step2.htm revision 45481c31e00d6fc1792f7a8beae92607b4557749
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering var serverURLValid = true;
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers var platformLocaleValid = true;
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers var configDirectoryValid = true;
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering var encryptionKeyValid = true;
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering var cookieDomainValid = true;
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering function serverFieldsValid() {
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering $('nextTabButton').disabled =
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering !(serverURLValid &&
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering platformLocaleValid &&
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering configDirectoryValid &&
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering encryptionKeyValid &&
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering cookieDomainValid);
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering function validateInput(field, handler) {
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering var callUrl = "$context$path?actionLink=validateInput";
4e949c11a1df4547d5f102e4131e07b026369cd7Javier Jardón var key = "&key=" + field;
4e949c11a1df4547d5f102e4131e07b026369cd7Javier Jardón var value = "&value=" + $(field).value;
f9b557200b6d59a3dce1623d0873a259ee2fe421Lennart Poettering callUrl = callUrl + "&ie7fix=" + ie7fix;
4e949c11a1df4547d5f102e4131e07b026369cd7Javier Jardón if (handler != null) {
4e949c11a1df4547d5f102e4131e07b026369cd7Javier Jardón AjaxUtils.call(callUrl+key+value, handler);
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering AjaxUtils.call(callUrl+key+value, serverFieldValidated);
a80db8bd5f7f15859e8891aab9fc3694ce4cd0bdJavier Jardón function serverURLFieldValidated(response) {
a80db8bd5f7f15859e8891aab9fc3694ce4cd0bdJavier Jardón validated(response, "serverURL");
eb7bbee6cd182d5c4eb1e1180631c35158f59379Kay Sievers function serverFieldValidated(response) {
bbd9b8c2139a70005e4e83d198575e2a10fe1db2Lennart Poettering validated(response, field);
22be093ffb403a1c474037939ca9b88b1ee39f77Lennart Poettering function validated(response, field) {
d59d0a2b4b41a75eaf618b26b8f8bd1e17de7e2bcee if (response.responseText == "true") {
d59d0a2b4b41a75eaf618b26b8f8bd1e17de7e2bcee eval(field + "Valid = true;" );
d59d0a2b4b41a75eaf618b26b8f8bd1e17de7e2bcee $(field + 'Status').innerHTML = okString;
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering } else if (response.responseText.search("warning") == 0) {
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers eval(field + "Valid = true;" );
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers $(field + 'Status').innerHTML = warningImage +
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering '<small>' + response.responseText.substring(7) + '</small>';
1c7dde3e475978c569a982d65fd86d4b4e3caad8Bastien Nocera eval(field + "Valid = false;" );
1c7dde3e475978c569a982d65fd86d4b4e3caad8Bastien Nocera $(field + 'Status').innerHTML = errorImage +
1c7dde3e475978c569a982d65fd86d4b4e3caad8Bastien Nocera '<small>' + response.responseText + '</small>';
e9da3678fcfc774b325dc1eaa054d0e00028a1fcLennart Poettering serverFieldsValid();
f975e971accc4d50c73ae53167db3df7a7099cf2Lennart Poettering function validateServerURL() {
e9da3678fcfc774b325dc1eaa054d0e00028a1fcLennart Poettering validateInput("serverURL", serverURLFieldValidated);
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering validateCookieDomain();
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering function validateLocale() {
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering field = "platformLocale";
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers validateInput(field, null);
86b2e20a5e5abf222fb81edcb5d58d012e35cbaaLennart Poettering function validateConfigDir() {
86b2e20a5e5abf222fb81edcb5d58d012e35cbaaLennart Poettering field = "configDirectory";
b51fc639f01ee6194af3e7e944a79accce474fe1Dave Reisner var callUrl = "$context$path?actionLink=validateConfigDir&dir=" +
86b2e20a5e5abf222fb81edcb5d58d012e35cbaaLennart Poettering encodeURIComponent($(field).value);
c1c02e07ed87e027a6364c4f4aa2468796ca1c56Dave Reisner callUrl = callUrl + "&ie7fix=" + ie7fix;
96ede2601f27cd5fe52eed96b873bef55cd0ce23Lennart Poettering AjaxUtils.call(callUrl, serverFieldValidated);
9e45e7d8f0d8d3f31d790f85694585d0d4b368b8Javier Jardón function validateCookieDomain() {
6e92b23f0d6dd398848376bbaf47e54a90ed3389Kay Sievers field = "cookieDomain";
92ec4495f76a7a2a6c31f5bb2a5240f78dcfe1d2Javier Jardón var callUrl = "$context$path?actionLink=validateCookieDomain&domain=" +
fe1fed02c7637a2c18cd575f78be7fda27972148Zbigniew Jędrzejewski-Szmek encodeURIComponent($(field).value) + "&serverurl=" + encodeURIComponent($("serverURL").value);
fe1fed02c7637a2c18cd575f78be7fda27972148Zbigniew Jędrzejewski-Szmek callUrl = callUrl + "&ie7fix=" + ie7fix;
fe1fed02c7637a2c18cd575f78be7fda27972148Zbigniew Jędrzejewski-Szmek AjaxUtils.call(callUrl, serverFieldValidated);
8d7e170a5230753d8406276f8b5598e5bb6766e6Lennart Poettering<h1>$page.getLocalizedString("step2.title")<img class="pointer" src="$context/assets/images/message.gif"/></h1>
8d7e170a5230753d8406276f8b5598e5bb6766e6Lennart Poettering<p>$page.getLocalizedString("step2.description")</p>
b62cfcea00862ccbf0e5e297f8a339f70987edefMichael Biebl<div id="serverSettingsDiv" style="width:610px;">
b62cfcea00862ccbf0e5e297f8a339f70987edefMichael Biebl <p id="allfields"><em>*</em> $page.getLocalizedString("required.field.label")</p>
9a60da2834074d970ca063c210fe9d2f05c70532Thierry Reding <b class="xtop"><b class="xt1"></b><b class="xt2"></b><b class="xt3"></b><b class="xt4"></b></b>
8d7e170a5230753d8406276f8b5598e5bb6766e6Lennart Poettering <div class="headerBox" >$page.getLocalizedString("step2.server.settings")</div>
8d7e170a5230753d8406276f8b5598e5bb6766e6Lennart Poettering <div class="bodyBox" style="height:220px;">
78fbaacac004f912ec84b6f57d0bc656c3c95439Wulf C. Krueger <td><label for="serverURL"><em>* </em>$page.getLocalizedString("step2.server.url")</label></td>
78fbaacac004f912ec84b6f57d0bc656c3c95439Wulf C. Krueger <input id="serverURL" name="serverURL" type="text"
78fbaacac004f912ec84b6f57d0bc656c3c95439Wulf C. Krueger value="$serverURL"
78fbaacac004f912ec84b6f57d0bc656c3c95439Wulf C. Krueger onkeyup="APP.callDelayed(this, validateServerURL)"
78fbaacac004f912ec84b6f57d0bc656c3c95439Wulf C. Krueger onchange="APP.callDelayed(this, validateServerURL)"/>
78fbaacac004f912ec84b6f57d0bc656c3c95439Wulf C. Krueger <td><label for="cookieDomain">$page.getLocalizedString("step2.cookie.domain")</label></td>
78fbaacac004f912ec84b6f57d0bc656c3c95439Wulf C. Krueger <input id="cookieDomain" name="cookieDomain" type="text"
8d7e170a5230753d8406276f8b5598e5bb6766e6Lennart Poettering value="$cookieDomain"
78fbaacac004f912ec84b6f57d0bc656c3c95439Wulf C. Krueger onkeyup="APP.callDelayed(this, validateCookieDomain)"
78fbaacac004f912ec84b6f57d0bc656c3c95439Wulf C. Krueger onchange="APP.callDelayed(this, validateCookieDomain)"/>
8d7e170a5230753d8406276f8b5598e5bb6766e6Lennart Poettering <span data-tooltip="$page.getLocalizedString("step2.cookie.domain.help")">
8d7e170a5230753d8406276f8b5598e5bb6766e6Lennart Poettering <img class="pointer" alt="help" src="$context/com_sun_web_ui/images/alerts/info_small.gif" width="11" height="11" />
27765dfc7a32d790badb29e6498b34edb0b60c33Lennart Poettering <td><label for="platformLocale"><em>* </em>$page.getLocalizedString("step2.platform.locale")</label></td>
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering <input id="platformLocale" name="platformLocale" type="text" class="text" style="width:150px" value="$platformLocale" onchange="APP.callDelayed(this, validateLocale)"/>
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering <td><label for="configDirectory"><em>* </em>$page.getLocalizedString("step2.config.directory")</label></td>
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering <input id="configDirectory" name="configDirectory"
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering value="$configDirectory" onkeyup="APP.callDelayed(this, validateConfigDir)" />
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering <span id="configDirectoryStatus">$initialCheck</span>