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

Deminify part 2 (#509)

This de-minifies and de-uglifies `controllers` subdirectory
This commit is contained in:
grafixeyehero 2019-11-06 13:43:39 +03:00 committed by Vasily
parent f98a43f06f
commit 23677db990
66 changed files with 8296 additions and 4227 deletions

View file

@ -1,26 +1,48 @@
define(["homescreenSettings", "userSettingsBuilder", "dom", "globalize", "loading", "userSettings", "listViewStyle"], function(HomescreenSettings, userSettingsBuilder, dom, globalize, loading, currentUserSettings) {
define(["homescreenSettings", "userSettingsBuilder", "dom", "globalize", "loading", "userSettings", "listViewStyle"], function (HomescreenSettings, userSettingsBuilder, dom, globalize, loading, currentUserSettings) {
"use strict";
return function(view, params) {
return function (view, params) {
function onBeforeUnload(e) {
hasChanges && (e.returnValue = "You currently have unsaved changes. Are you sure you wish to leave?")
if (hasChanges) {
e.returnValue = "You currently have unsaved changes. Are you sure you wish to leave?";
}
}
var homescreenSettingsInstance, hasChanges, userId = params.userId || ApiClient.getCurrentUserId(),
userSettings = userId === ApiClient.getCurrentUserId() ? currentUserSettings : new userSettingsBuilder;
view.addEventListener("viewshow", function() {
window.addEventListener("beforeunload", onBeforeUnload), homescreenSettingsInstance ? homescreenSettingsInstance.loadData() : homescreenSettingsInstance = new HomescreenSettings({
serverId: ApiClient.serverId(),
userId: userId,
element: view.querySelector(".homeScreenSettingsContainer"),
userSettings: userSettings,
enableSaveButton: !1,
enableSaveConfirmation: !1
})
}), view.addEventListener("change", function() {
hasChanges = !0
}), view.addEventListener("viewbeforehide", function() {
hasChanges = !1, homescreenSettingsInstance && homescreenSettingsInstance.submit()
}), view.addEventListener("viewdestroy", function() {
homescreenSettingsInstance && (homescreenSettingsInstance.destroy(), homescreenSettingsInstance = null)
})
}
});
var homescreenSettingsInstance;
var hasChanges;
var userId = params.userId || ApiClient.getCurrentUserId();
var userSettings = userId === ApiClient.getCurrentUserId() ? currentUserSettings : new userSettingsBuilder();
view.addEventListener("viewshow", function () {
window.addEventListener("beforeunload", onBeforeUnload);
if (homescreenSettingsInstance) {
homescreenSettingsInstance.loadData();
} else {
homescreenSettingsInstance = new HomescreenSettings({
serverId: ApiClient.serverId(),
userId: userId,
element: view.querySelector(".homeScreenSettingsContainer"),
userSettings: userSettings,
enableSaveButton: false,
enableSaveConfirmation: false
});
}
});
view.addEventListener("change", function () {
hasChanges = true;
});
view.addEventListener("viewbeforehide", function () {
hasChanges = false;
if (homescreenSettingsInstance) {
homescreenSettingsInstance.submit();
}
});
view.addEventListener("viewdestroy", function () {
if (homescreenSettingsInstance) {
homescreenSettingsInstance.destroy();
homescreenSettingsInstance = null;
}
});
};
});