2014-04-26 21:35:04 -07:00
|
|
|
|
(function (window, $) {
|
|
|
|
|
|
|
|
|
|
function loadPage(page, config, languageOptions) {
|
|
|
|
|
|
|
|
|
|
$('#selectLocalizationLanguage', page).html(languageOptions.map(function (l) {
|
|
|
|
|
|
|
|
|
|
return '<option value="' + l.Value + '">' + l.Name + '</option>';
|
|
|
|
|
|
|
|
|
|
})).val(config.UICulture).selectmenu('refresh');
|
|
|
|
|
|
|
|
|
|
Dashboard.hideLoadingMsg();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function save(page) {
|
|
|
|
|
|
|
|
|
|
Dashboard.showLoadingMsg();
|
|
|
|
|
|
2014-11-02 20:38:43 -07:00
|
|
|
|
var apiClient = ApiClient;
|
|
|
|
|
|
2014-11-14 19:31:03 -07:00
|
|
|
|
apiClient.getJSON(apiClient.getUrl('Startup/Configuration')).done(function (config) {
|
2014-04-26 21:35:04 -07:00
|
|
|
|
|
|
|
|
|
config.UICulture = $('#selectLocalizationLanguage', page).val();
|
|
|
|
|
|
2014-11-14 19:31:03 -07:00
|
|
|
|
apiClient.ajax({
|
|
|
|
|
|
|
|
|
|
type: 'POST',
|
|
|
|
|
data: config,
|
|
|
|
|
url: apiClient.getUrl('Startup/Configuration')
|
|
|
|
|
|
|
|
|
|
}).done(function () {
|
2014-04-26 21:35:04 -07:00
|
|
|
|
|
|
|
|
|
Dashboard.navigate('wizarduser.html');
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
});
|
2013-02-20 18:33:05 -07:00
|
|
|
|
|
|
|
|
|
}
|
2014-04-26 21:35:04 -07:00
|
|
|
|
|
2014-11-02 20:38:43 -07:00
|
|
|
|
$(document).on('pageshow', "#wizardStartPage", function () {
|
2014-04-26 21:35:04 -07:00
|
|
|
|
|
|
|
|
|
Dashboard.showLoadingMsg();
|
|
|
|
|
var page = this;
|
|
|
|
|
|
2014-11-02 20:38:43 -07:00
|
|
|
|
var apiClient = ApiClient;
|
|
|
|
|
|
2014-11-14 19:31:03 -07:00
|
|
|
|
var promise1 = apiClient.getJSON(apiClient.getUrl('Startup/Configuration'));
|
2014-07-09 20:48:08 -07:00
|
|
|
|
|
2014-11-14 19:31:03 -07:00
|
|
|
|
var promise2 = apiClient.getJSON(apiClient.getUrl("Localization/Options"));
|
2014-07-09 20:48:08 -07:00
|
|
|
|
|
2014-11-14 19:31:03 -07:00
|
|
|
|
$.when(promise1, promise2).done(function (response1, response2) {
|
2014-07-09 20:48:08 -07:00
|
|
|
|
|
2014-11-14 19:31:03 -07:00
|
|
|
|
loadPage(page, response1[0], response2[0]);
|
2014-07-09 20:48:08 -07:00
|
|
|
|
|
|
|
|
|
});
|
2014-04-26 21:35:04 -07:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
window.WizardStartPage = {
|
|
|
|
|
|
|
|
|
|
onSubmit: function () {
|
|
|
|
|
|
|
|
|
|
save($(this).parents('.page'));
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
})(window, jQuery);
|