step2.htm revision 45481c31e00d6fc1792f7a8beae92607b4557749
fb0951b02ebf51a93acf12721d8857d31ce57ba3Lennart Poettering<script type="text/javascript">
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering
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
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 }
5430f7f2bc7330f3088b894166bf3524a067e3d8Lennart Poettering
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;
4e949c11a1df4547d5f102e4131e07b026369cd7Javier Jardón ie7fix++;
f9b557200b6d59a3dce1623d0873a259ee2fe421Lennart Poettering callUrl = callUrl + "&ie7fix=" + ie7fix;
4e949c11a1df4547d5f102e4131e07b026369cd7Javier Jardón if (handler != null) {
4e949c11a1df4547d5f102e4131e07b026369cd7Javier Jardón AjaxUtils.call(callUrl+key+value, handler);
4e949c11a1df4547d5f102e4131e07b026369cd7Javier Jardón } else {
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering AjaxUtils.call(callUrl+key+value, serverFieldValidated);
78a825f216d39ee0295b00647b059d45467e1d02Kay Sievers }
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering }
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering
a80db8bd5f7f15859e8891aab9fc3694ce4cd0bdJavier Jardón function serverURLFieldValidated(response) {
a80db8bd5f7f15859e8891aab9fc3694ce4cd0bdJavier Jardón validated(response, "serverURL");
4db6d587c37c0357d20c79bf1a7c9afd4c7ced61Kay Sievers }
907dd1953b7517534d646f5b2777780020c896e2Kay Sievers
eb7bbee6cd182d5c4eb1e1180631c35158f59379Kay Sievers function serverFieldValidated(response) {
bbd9b8c2139a70005e4e83d198575e2a10fe1db2Lennart Poettering validated(response, field);
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers }
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering
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
1c7dde3e475978c569a982d65fd86d4b4e3caad8Bastien Nocera } else {
1c7dde3e475978c569a982d65fd86d4b4e3caad8Bastien Nocera eval(field + "Valid = false;" );
1c7dde3e475978c569a982d65fd86d4b4e3caad8Bastien Nocera $(field + 'Status').innerHTML = errorImage +
1c7dde3e475978c569a982d65fd86d4b4e3caad8Bastien Nocera '<small>' + response.responseText + '</small>';
1c7dde3e475978c569a982d65fd86d4b4e3caad8Bastien Nocera }
e9da3678fcfc774b325dc1eaa054d0e00028a1fcLennart Poettering serverFieldsValid();
e9da3678fcfc774b325dc1eaa054d0e00028a1fcLennart Poettering field = "";
e9da3678fcfc774b325dc1eaa054d0e00028a1fcLennart Poettering }
3ce4fad8f548db9edb19869ea540e3192d2123f4Kay Sievers
f975e971accc4d50c73ae53167db3df7a7099cf2Lennart Poettering function validateServerURL() {
e9da3678fcfc774b325dc1eaa054d0e00028a1fcLennart Poettering validateInput("serverURL", serverURLFieldValidated);
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering validateCookieDomain();
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering }
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering function validateLocale() {
47be870bd83fb3719dffc3ee9348a409ab762a14Lennart Poettering field = "platformLocale";
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers validateInput(field, null);
fe1fed02c7637a2c18cd575f78be7fda27972148Zbigniew Jędrzejewski-Szmek }
92ec4495f76a7a2a6c31f5bb2a5240f78dcfe1d2Javier Jardón
86b2e20a5e5abf222fb81edcb5d58d012e35cbaaLennart Poettering function validateConfigDir() {
86b2e20a5e5abf222fb81edcb5d58d012e35cbaaLennart Poettering field = "configDirectory";
b51fc639f01ee6194af3e7e944a79accce474fe1Dave Reisner var callUrl = "$context$path?actionLink=validateConfigDir&dir=" +
86b2e20a5e5abf222fb81edcb5d58d012e35cbaaLennart Poettering encodeURIComponent($(field).value);
86b2e20a5e5abf222fb81edcb5d58d012e35cbaaLennart Poettering ie7fix++;
c1c02e07ed87e027a6364c4f4aa2468796ca1c56Dave Reisner callUrl = callUrl + "&ie7fix=" + ie7fix;
96ede2601f27cd5fe52eed96b873bef55cd0ce23Lennart Poettering AjaxUtils.call(callUrl, serverFieldValidated);
80a5cbace45a6adbf2f9119edc5a4b10db493064Kay Sievers }
92ec4495f76a7a2a6c31f5bb2a5240f78dcfe1d2Javier Jardón
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 ie7fix++;
fe1fed02c7637a2c18cd575f78be7fda27972148Zbigniew Jędrzejewski-Szmek callUrl = callUrl + "&ie7fix=" + ie7fix;
fe1fed02c7637a2c18cd575f78be7fda27972148Zbigniew Jędrzejewski-Szmek AjaxUtils.call(callUrl, serverFieldValidated);
6e92b23f0d6dd398848376bbaf47e54a90ed3389Kay Sievers }
0eaeca1f2373a323b98c86b47561d98e59c67b25Kay Sievers
6e92b23f0d6dd398848376bbaf47e54a90ed3389Kay Sievers</script>
3e2147858f21943d5f4a781c60f33ac22c6096edKay Sievers
8d7e170a5230753d8406276f8b5598e5bb6766e6Lennart Poettering<div style="margin-left:10px;">
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
b62cfcea00862ccbf0e5e297f8a339f70987edefMichael Biebl<div id="serverSettingsDiv" style="width:610px;">
b62cfcea00862ccbf0e5e297f8a339f70987edefMichael Biebl <p id="allfields"><em>*</em>&nbsp;$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;">
8d7e170a5230753d8406276f8b5598e5bb6766e6Lennart Poettering <span>
78fbaacac004f912ec84b6f57d0bc656c3c95439Wulf C. Krueger <table class="temp">
78fbaacac004f912ec84b6f57d0bc656c3c95439Wulf C. Krueger <tr>
78fbaacac004f912ec84b6f57d0bc656c3c95439Wulf C. Krueger <td><label for="serverURL"><em>*&nbsp;</em>$page.getLocalizedString("step2.server.url")</label></td>
78fbaacac004f912ec84b6f57d0bc656c3c95439Wulf C. Krueger <td>
78fbaacac004f912ec84b6f57d0bc656c3c95439Wulf C. Krueger <input id="serverURL" name="serverURL" type="text"
78fbaacac004f912ec84b6f57d0bc656c3c95439Wulf C. Krueger class="text" size="40"
78fbaacac004f912ec84b6f57d0bc656c3c95439Wulf C. Krueger value="$serverURL"
78fbaacac004f912ec84b6f57d0bc656c3c95439Wulf C. Krueger onkeyup="APP.callDelayed(this, validateServerURL)"
78fbaacac004f912ec84b6f57d0bc656c3c95439Wulf C. Krueger onchange="APP.callDelayed(this, validateServerURL)"/>
78fbaacac004f912ec84b6f57d0bc656c3c95439Wulf C. Krueger <span id="serverURLStatus"></span>
78fbaacac004f912ec84b6f57d0bc656c3c95439Wulf C. Krueger </td>
78fbaacac004f912ec84b6f57d0bc656c3c95439Wulf C. Krueger </tr>
78fbaacac004f912ec84b6f57d0bc656c3c95439Wulf C. Krueger <tr>
78fbaacac004f912ec84b6f57d0bc656c3c95439Wulf C. Krueger <td><label for="cookieDomain">$page.getLocalizedString("step2.cookie.domain")</label></td>
78fbaacac004f912ec84b6f57d0bc656c3c95439Wulf C. Krueger <td>
78fbaacac004f912ec84b6f57d0bc656c3c95439Wulf C. Krueger <input id="cookieDomain" name="cookieDomain" type="text"
78fbaacac004f912ec84b6f57d0bc656c3c95439Wulf C. Krueger class="text" style="width:150px"
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" />
9c4fa6ed1069e98db5f01a5d1056b443a04cc7d9Lennart Poettering </span>
eb2e280f9c59b66965c9316eadc4c113a13ca744Lucas De Marchi <span id="cookieDomainStatus"></span>
be1a67d9d63bfdd4a5f8ba9cfc804030f10f5833Lennart Poettering </td>
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering </tr>
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering <tr>
27765dfc7a32d790badb29e6498b34edb0b60c33Lennart Poettering <td><label for="platformLocale"><em>*&nbsp;</em>$page.getLocalizedString("step2.platform.locale")</label></td>
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering <td>
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering <input id="platformLocale" name="platformLocale" type="text" class="text" style="width:150px" value="$platformLocale" onchange="APP.callDelayed(this, validateLocale)"/>
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering <span id="platformLocaleStatus"></span>
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering </td>
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering </tr>
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering <tr>
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering <td><label for="configDirectory"><em>*&nbsp;</em>$page.getLocalizedString("step2.config.directory")</label></td>
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering <td>
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering <input id="configDirectory" name="configDirectory"
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering type="text" class="text" size="40"
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering value="$configDirectory" onkeyup="APP.callDelayed(this, validateConfigDir)" />
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering <span id="configDirectoryStatus">$initialCheck</span>
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering </td>
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering </tr>
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering </table>
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering </span>
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering </div>
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering <div>
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering <b class="xbottom">
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering <b class="xbGray1"></b>
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering <b class="xbGray2"></b>
be1a67d9d63bfdd4a5f8ba9cfc804030f10f5833Lennart Poettering <b class="xbGray3"></b>
be1a67d9d63bfdd4a5f8ba9cfc804030f10f5833Lennart Poettering <b class="xbGray4"></b>
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering </b>
be1a67d9d63bfdd4a5f8ba9cfc804030f10f5833Lennart Poettering </div>
8745297f9853c4a17bac69e1b7e652fe81bc1940Lennart Poettering</div>
d200735e13c52dcfe36c0e066f9f6c2fbfb85a9cMichal Schmidt</div> <!-- indent div -->
be1a67d9d63bfdd4a5f8ba9cfc804030f10f5833Lennart Poettering
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering
d1ab0ca07372649dad70a0348d75e394f254e1b6Lennart Poettering