mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
minify resources
This commit is contained in:
parent
8a6884abef
commit
661eeac16e
201 changed files with 203 additions and 52376 deletions
|
@ -1,93 +1 @@
|
|||
define(['jQuery'], function ($) {
|
||||
'use strict';
|
||||
|
||||
var guideController;
|
||||
|
||||
function init(page, type) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var apiClient = ApiClient;
|
||||
|
||||
apiClient.getJSON(apiClient.getUrl('Startup/Configuration')).then(function (config) {
|
||||
|
||||
var providerId = null;
|
||||
|
||||
if ((config.LiveTvGuideProviderType || '').toLowerCase() == type.toLowerCase()) {
|
||||
if (config.LiveTvGuideProviderId) {
|
||||
providerId = config.LiveTvGuideProviderId;
|
||||
}
|
||||
}
|
||||
|
||||
var url = 'components/tvproviders/' + type.toLowerCase() + '.js';
|
||||
|
||||
require([url], function (factory) {
|
||||
|
||||
var instance = new factory(page, providerId, {
|
||||
showCancelButton: false,
|
||||
showSubmitButton: false,
|
||||
showConfirmation: false
|
||||
});
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
instance.init();
|
||||
guideController = instance;
|
||||
|
||||
Events.on(guideController, 'submitted', skip);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function loadTemplate(page, type) {
|
||||
|
||||
guideController = null;
|
||||
|
||||
ApiClient.ajax({
|
||||
|
||||
type: 'GET',
|
||||
url: 'components/tvproviders/' + type.toLowerCase() + '.template.html'
|
||||
|
||||
}).then(function (html) {
|
||||
|
||||
var elem = page.querySelector('.providerTemplate');
|
||||
elem.innerHTML = Globalize.translateDocument(html);
|
||||
|
||||
init(page, type);
|
||||
});
|
||||
}
|
||||
|
||||
function skip() {
|
||||
require(['scripts/wizardcontroller'], function (wizardcontroller) {
|
||||
wizardcontroller.navigateToComponents();
|
||||
});
|
||||
}
|
||||
|
||||
function next() {
|
||||
guideController.submit();
|
||||
}
|
||||
|
||||
function reload(page) {
|
||||
|
||||
$('#selectType', page).trigger('change');
|
||||
}
|
||||
|
||||
$(document).on('pageinit', "#wizardGuidePage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
$('#selectType', page).on('change', function () {
|
||||
|
||||
loadTemplate(page, this.value);
|
||||
});
|
||||
|
||||
$('.btnSkip', page).on('click', skip);
|
||||
$('.btnNext', page).on('click', next);
|
||||
|
||||
}).on('pageshow', "#wizardGuidePage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
reload(page);
|
||||
});
|
||||
|
||||
});
|
||||
define(["jQuery"],function($){"use strict";function init(page,type){Dashboard.showLoadingMsg();var apiClient=ApiClient;apiClient.getJSON(apiClient.getUrl("Startup/Configuration")).then(function(config){var providerId=null;(config.LiveTvGuideProviderType||"").toLowerCase()==type.toLowerCase()&&config.LiveTvGuideProviderId&&(providerId=config.LiveTvGuideProviderId);var url="components/tvproviders/"+type.toLowerCase()+".js";require([url],function(factory){var instance=new factory(page,providerId,{showCancelButton:!1,showSubmitButton:!1,showConfirmation:!1});Dashboard.hideLoadingMsg(),instance.init(),guideController=instance,Events.on(guideController,"submitted",skip)})})}function loadTemplate(page,type){guideController=null,ApiClient.ajax({type:"GET",url:"components/tvproviders/"+type.toLowerCase()+".template.html"}).then(function(html){var elem=page.querySelector(".providerTemplate");elem.innerHTML=Globalize.translateDocument(html),init(page,type)})}function skip(){require(["scripts/wizardcontroller"],function(wizardcontroller){wizardcontroller.navigateToComponents()})}function next(){guideController.submit()}function reload(page){$("#selectType",page).trigger("change")}var guideController;$(document).on("pageinit","#wizardGuidePage",function(){var page=this;$("#selectType",page).on("change",function(){loadTemplate(page,this.value)}),$(".btnSkip",page).on("click",skip),$(".btnNext",page).on("click",next)}).on("pageshow","#wizardGuidePage",function(){var page=this;reload(page)})});
|
Loading…
Add table
Add a link
Reference in a new issue