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:
parent
f98a43f06f
commit
23677db990
66 changed files with 8296 additions and 4227 deletions
|
@ -1,4 +1,4 @@
|
|||
define(["tabbedView", "globalize", "require", "emby-tabs", "emby-button", "emby-scroller"], function(TabbedView, globalize, require) {
|
||||
define(["tabbedView", "globalize", "require", "emby-tabs", "emby-button", "emby-scroller"], function (TabbedView, globalize, require) {
|
||||
"use strict";
|
||||
|
||||
function getTabs() {
|
||||
|
@ -6,47 +6,70 @@ define(["tabbedView", "globalize", "require", "emby-tabs", "emby-button", "emby-
|
|||
name: globalize.translate("Home")
|
||||
}, {
|
||||
name: globalize.translate("Favorites")
|
||||
}]
|
||||
}];
|
||||
}
|
||||
|
||||
function getDefaultTabIndex() {
|
||||
return 0
|
||||
return 0;
|
||||
}
|
||||
|
||||
function getRequirePromise(deps) {
|
||||
return new Promise(function(resolve, reject) {
|
||||
require(deps, resolve)
|
||||
})
|
||||
return new Promise(function (resolve, reject) {
|
||||
require(deps, resolve);
|
||||
});
|
||||
}
|
||||
|
||||
function getTabController(index) {
|
||||
if (null == index) throw new Error("index cannot be null");
|
||||
if (null == index) {
|
||||
throw new Error("index cannot be null");
|
||||
}
|
||||
|
||||
var depends = [];
|
||||
|
||||
switch (index) {
|
||||
case 0:
|
||||
depends.push("controllers/hometab");
|
||||
break;
|
||||
|
||||
case 1:
|
||||
depends.push("controllers/favorites")
|
||||
depends.push("controllers/favorites");
|
||||
}
|
||||
|
||||
var instance = this;
|
||||
return getRequirePromise(depends).then(function(controllerFactory) {
|
||||
return getRequirePromise(depends).then(function (controllerFactory) {
|
||||
var controller = instance.tabControllers[index];
|
||||
|
||||
if (!controller) {
|
||||
controller = new controllerFactory(instance.view.querySelector(".tabContent[data-index='" + index + "']"), instance.params), instance.tabControllers[index] = controller
|
||||
controller = new controllerFactory(instance.view.querySelector(".tabContent[data-index='" + index + "']"), instance.params);
|
||||
instance.tabControllers[index] = controller;
|
||||
}
|
||||
return controller
|
||||
})
|
||||
|
||||
return controller;
|
||||
});
|
||||
}
|
||||
|
||||
function HomeView(view, params) {
|
||||
TabbedView.call(this, view, params)
|
||||
TabbedView.call(this, view, params);
|
||||
}
|
||||
return Object.assign(HomeView.prototype, TabbedView.prototype), HomeView.prototype.getTabs = getTabs, HomeView.prototype.getDefaultTabIndex = getDefaultTabIndex, HomeView.prototype.getTabController = getTabController, HomeView.prototype.setTitle = function() {
|
||||
Emby.Page.setTitle(null)
|
||||
}, HomeView.prototype.onPause = function() {
|
||||
TabbedView.prototype.onPause.call(this), document.querySelector(".skinHeader").classList.remove("noHomeButtonHeader")
|
||||
}, HomeView.prototype.onResume = function(options) {
|
||||
TabbedView.prototype.onResume.call(this, options), document.querySelector(".skinHeader").classList.add("noHomeButtonHeader")
|
||||
}, HomeView
|
||||
});
|
||||
|
||||
Object.assign(HomeView.prototype, TabbedView.prototype);
|
||||
HomeView.prototype.getTabs = getTabs;
|
||||
HomeView.prototype.getDefaultTabIndex = getDefaultTabIndex;
|
||||
HomeView.prototype.getTabController = getTabController;
|
||||
|
||||
HomeView.prototype.setTitle = function () {
|
||||
Emby.Page.setTitle(null);
|
||||
};
|
||||
|
||||
HomeView.prototype.onPause = function () {
|
||||
TabbedView.prototype.onPause.call(this);
|
||||
document.querySelector(".skinHeader").classList.remove("noHomeButtonHeader");
|
||||
};
|
||||
|
||||
HomeView.prototype.onResume = function (options) {
|
||||
TabbedView.prototype.onResume.call(this, options);
|
||||
document.querySelector(".skinHeader").classList.add("noHomeButtonHeader");
|
||||
};
|
||||
|
||||
return HomeView;
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue