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

Beautified all js in web dashboard

This commit is contained in:
Vasily 2018-10-23 01:05:09 +03:00
parent 5895f209e7
commit 6bfd795635
346 changed files with 72978 additions and 375 deletions

File diff suppressed because one or more lines are too long

View file

@ -1 +1,52 @@
define(["tabbedView","globalize","require","emby-tabs","emby-button","emby-scroller"],function(TabbedView,globalize,require){"use strict";function getTabs(){return[{name:globalize.translate("sharedcomponents#Home")},{name:globalize.translate("sharedcomponents#Favorites")}]}function getDefaultTabIndex(){return 0}function getRequirePromise(deps){return new Promise(function(resolve,reject){require(deps,resolve)})}function getTabController(index){if(null==index)throw new Error("index cannot be null");var depends=[];switch(index){case 0:depends.push("./hometab");break;case 1:depends.push("./favorites")}var instance=this;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}return controller})}function HomeView(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});
define(["tabbedView", "globalize", "require", "emby-tabs", "emby-button", "emby-scroller"], function(TabbedView, globalize, require) {
"use strict";
function getTabs() {
return [{
name: globalize.translate("sharedcomponents#Home")
}, {
name: globalize.translate("sharedcomponents#Favorites")
}]
}
function getDefaultTabIndex() {
return 0
}
function getRequirePromise(deps) {
return new Promise(function(resolve, reject) {
require(deps, resolve)
})
}
function getTabController(index) {
if (null == index) throw new Error("index cannot be null");
var depends = [];
switch (index) {
case 0:
depends.push("./hometab");
break;
case 1:
depends.push("./favorites")
}
var instance = this;
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
}
return controller
})
}
function HomeView(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
});

View file

@ -1 +1,35 @@
define(["userSettings","loading","connectionManager","apphost","layoutManager","focusManager","homeSections","emby-itemscontainer"],function(userSettings,loading,connectionManager,appHost,layoutManager,focusManager,homeSections){"use strict";function HomeTab(view,params){this.view=view,this.params=params,this.apiClient=connectionManager.currentApiClient(),this.sectionsContainer=view.querySelector(".sections"),view.querySelector(".sections").addEventListener("settingschange",onHomeScreenSettingsChanged.bind(this))}function onHomeScreenSettingsChanged(){this.sectionsRendered=!1,this.paused||this.onResume({refresh:!0})}return HomeTab.prototype.onResume=function(options){if(this.sectionsRendered){var sectionsContainer=this.sectionsContainer;return sectionsContainer?homeSections.resume(sectionsContainer,options):Promise.resolve()}loading.show();var view=this.view,apiClient=this.apiClient;return this.destroyHomeSections(),this.sectionsRendered=!0,apiClient.getCurrentUser().then(function(user){return homeSections.loadSections(view.querySelector(".sections"),apiClient,user,userSettings).then(function(){options.autoFocus&&focusManager.autoFocus(view),loading.hide()})})},HomeTab.prototype.onPause=function(){var sectionsContainer=this.sectionsContainer;sectionsContainer&&homeSections.pause(sectionsContainer)},HomeTab.prototype.destroy=function(){this.view=null,this.params=null,this.apiClient=null,this.destroyHomeSections(),this.sectionsContainer=null},HomeTab.prototype.destroyHomeSections=function(){var sectionsContainer=this.sectionsContainer;sectionsContainer&&homeSections.destroySections(sectionsContainer)},HomeTab});
define(["userSettings", "loading", "connectionManager", "apphost", "layoutManager", "focusManager", "homeSections", "emby-itemscontainer"], function(userSettings, loading, connectionManager, appHost, layoutManager, focusManager, homeSections) {
"use strict";
function HomeTab(view, params) {
this.view = view, this.params = params, this.apiClient = connectionManager.currentApiClient(), this.sectionsContainer = view.querySelector(".sections"), view.querySelector(".sections").addEventListener("settingschange", onHomeScreenSettingsChanged.bind(this))
}
function onHomeScreenSettingsChanged() {
this.sectionsRendered = !1, this.paused || this.onResume({
refresh: !0
})
}
return HomeTab.prototype.onResume = function(options) {
if (this.sectionsRendered) {
var sectionsContainer = this.sectionsContainer;
return sectionsContainer ? homeSections.resume(sectionsContainer, options) : Promise.resolve()
}
loading.show();
var view = this.view,
apiClient = this.apiClient;
return this.destroyHomeSections(), this.sectionsRendered = !0, apiClient.getCurrentUser().then(function(user) {
return homeSections.loadSections(view.querySelector(".sections"), apiClient, user, userSettings).then(function() {
options.autoFocus && focusManager.autoFocus(view), loading.hide()
})
})
}, HomeTab.prototype.onPause = function() {
var sectionsContainer = this.sectionsContainer;
sectionsContainer && homeSections.pause(sectionsContainer)
}, HomeTab.prototype.destroy = function() {
this.view = null, this.params = null, this.apiClient = null, this.destroyHomeSections(), this.sectionsContainer = null
}, HomeTab.prototype.destroyHomeSections = function() {
var sectionsContainer = this.sectionsContainer;
sectionsContainer && homeSections.destroySections(sectionsContainer)
}, HomeTab
});