1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
jellyfin-web/dashboard-ui/scripts/appsweather.js

41 lines
1.1 KiB
JavaScript
Raw Normal View History

2013-04-17 00:58:32 -04:00
(function ($, document, window) {
2013-12-25 22:44:26 -05:00
$(document).on('pageshow', "#appsWeatherPage", function () {
2013-04-17 00:58:32 -04:00
Dashboard.showLoadingMsg();
var page = this;
ApiClient.getServerConfiguration().done(function (config) {
2013-06-24 10:06:25 -04:00
$('#txtWeatherLocation', page).val(config.WeatherLocation);
$('#selectWeatherUnit', page).val(config.WeatherUnit).selectmenu("refresh");
2013-04-17 00:58:32 -04:00
$('input:first', page).focus();
Dashboard.hideLoadingMsg();
});
});
2013-12-25 22:44:26 -05:00
window.AppsWeatherPage = {
2013-04-17 00:58:32 -04:00
2013-12-25 22:44:26 -05:00
onSubmit: function () {
2013-04-17 00:58:32 -04:00
var form = this;
Dashboard.showLoadingMsg();
ApiClient.getServerConfiguration().done(function (config) {
2013-06-24 10:06:25 -04:00
config.WeatherLocation = $('#txtWeatherLocation', form).val();
config.WeatherUnit = $('#selectWeatherUnit', form).val();
2013-04-17 00:58:32 -04:00
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
});
// Disable default form submission
return false;
2013-12-25 22:44:26 -05:00
}
2013-04-17 00:58:32 -04:00
2013-12-25 22:44:26 -05:00
};
2013-04-17 00:58:32 -04:00
2013-06-24 10:06:25 -04:00
})($, document, window);