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>';
|
|
|
|
|
|
2015-09-03 10:01:51 -07:00
|
|
|
|
})).val(config.UICulture);
|
2014-04-26 21:35:04 -07:00
|
|
|
|
|
|
|
|
|
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({
|
2015-06-07 20:16:42 -07:00
|
|
|
|
|
2014-11-14 19:31:03 -07:00
|
|
|
|
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
|
|
|
|
|
2015-06-07 20:16:42 -07:00
|
|
|
|
function onSubmit() {
|
|
|
|
|
save($(this).parents('.page'));
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2015-09-01 07:01:59 -07:00
|
|
|
|
$(document).on('pageinit', "#wizardStartPage", function () {
|
2015-06-07 20:16:42 -07:00
|
|
|
|
|
|
|
|
|
$('.wizardStartForm').off('submit', onSubmit).on('submit', onSubmit);
|
|
|
|
|
|
|
|
|
|
}).on('pageshowready', "#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, jQuery);
|