2018-10-23 01:05:09 +03:00
|
|
|
define(["jQuery", "loading", "libraryMenu"], function($, loading, libraryMenu) {
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
function loadPage(page, config) {
|
|
|
|
$("#txtMinResumePct", page).val(config.MinResumePct), $("#txtMaxResumePct", page).val(config.MaxResumePct), $("#txtMinResumeDuration", page).val(config.MinResumeDurationSeconds), loading.hide()
|
|
|
|
}
|
|
|
|
|
|
|
|
function onSubmit() {
|
|
|
|
loading.show();
|
|
|
|
var form = this;
|
|
|
|
return ApiClient.getServerConfiguration().then(function(config) {
|
|
|
|
config.MinResumePct = $("#txtMinResumePct", form).val(), config.MaxResumePct = $("#txtMaxResumePct", form).val(), config.MinResumeDurationSeconds = $("#txtMinResumeDuration", form).val(), ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult)
|
|
|
|
}), !1
|
|
|
|
}
|
|
|
|
|
|
|
|
function getTabs() {
|
|
|
|
return [{
|
2019-08-16 00:25:31 -07:00
|
|
|
href: "encodingsettings.html",
|
|
|
|
name: Globalize.translate("Transcoding")
|
|
|
|
}, {
|
2018-10-23 01:05:09 +03:00
|
|
|
href: "playbackconfiguration.html",
|
|
|
|
name: Globalize.translate("TabResumeSettings")
|
|
|
|
}, {
|
|
|
|
href: "streamingsettings.html",
|
|
|
|
name: Globalize.translate("TabStreaming")
|
|
|
|
}]
|
|
|
|
}
|
2019-08-16 00:25:31 -07:00
|
|
|
|
2018-10-23 01:05:09 +03:00
|
|
|
$(document).on("pageinit", "#playbackConfigurationPage", function() {
|
|
|
|
$(".playbackConfigurationForm").off("submit", onSubmit).on("submit", onSubmit)
|
|
|
|
}).on("pageshow", "#playbackConfigurationPage", function() {
|
2019-08-16 00:25:31 -07:00
|
|
|
loading.show();
|
|
|
|
libraryMenu.setTabs("playback", 1, getTabs);
|
2018-10-23 01:05:09 +03:00
|
|
|
var page = this;
|
|
|
|
ApiClient.getServerConfiguration().then(function(config) {
|
|
|
|
loadPage(page, config)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
});
|