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,92 +1 @@
|
|||
define(['jQuery'], function ($) {
|
||||
'use strict';
|
||||
|
||||
function reload(page, providerId) {
|
||||
|
||||
page.querySelector('.txtDevicePath').value = '';
|
||||
|
||||
if (providerId) {
|
||||
ApiClient.getNamedConfiguration("livetv").then(function (config) {
|
||||
|
||||
var info = config.TunerHosts.filter(function (i) {
|
||||
return i.Id == providerId;
|
||||
})[0];
|
||||
|
||||
page.querySelector('.txtDevicePath').value = info.Url || '';
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function submitForm(page) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var info = {
|
||||
Type: 'm3u',
|
||||
Url: page.querySelector('.txtDevicePath').value,
|
||||
EnableTvgId: true
|
||||
};
|
||||
|
||||
var id = getParameterByName('id');
|
||||
|
||||
if (id) {
|
||||
info.Id = id;
|
||||
}
|
||||
|
||||
ApiClient.ajax({
|
||||
type: "POST",
|
||||
url: ApiClient.getUrl('LiveTv/TunerHosts'),
|
||||
data: JSON.stringify(info),
|
||||
contentType: "application/json"
|
||||
|
||||
}).then(function () {
|
||||
|
||||
Dashboard.processServerConfigurationUpdateResult();
|
||||
Dashboard.navigate('livetvstatus.html');
|
||||
|
||||
}, function () {
|
||||
Dashboard.hideLoadingMsg();
|
||||
Dashboard.alert({
|
||||
message: Globalize.translate('ErrorSavingTvProvider')
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$(document).on('pageinit', "#liveTvTunerProviderM3UPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
$('form', page).on('submit', function () {
|
||||
submitForm(page);
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#btnSelectPath', page).on("click.selectDirectory", function () {
|
||||
|
||||
require(['directorybrowser'], function (directoryBrowser) {
|
||||
|
||||
var picker = new directoryBrowser();
|
||||
|
||||
picker.show({
|
||||
|
||||
includeFiles: true,
|
||||
callback: function (path) {
|
||||
if (path) {
|
||||
$('.txtDevicePath', page).val(path);
|
||||
}
|
||||
picker.close();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
}).on('pageshow', "#liveTvTunerProviderM3UPage", function () {
|
||||
|
||||
var providerId = getParameterByName('id');
|
||||
var page = this;
|
||||
reload(page, providerId);
|
||||
});
|
||||
|
||||
});
|
||||
define(["jQuery"],function($){"use strict";function reload(page,providerId){page.querySelector(".txtDevicePath").value="",providerId&&ApiClient.getNamedConfiguration("livetv").then(function(config){var info=config.TunerHosts.filter(function(i){return i.Id==providerId})[0];page.querySelector(".txtDevicePath").value=info.Url||""})}function submitForm(page){Dashboard.showLoadingMsg();var info={Type:"m3u",Url:page.querySelector(".txtDevicePath").value,EnableTvgId:!0},id=getParameterByName("id");id&&(info.Id=id),ApiClient.ajax({type:"POST",url:ApiClient.getUrl("LiveTv/TunerHosts"),data:JSON.stringify(info),contentType:"application/json"}).then(function(){Dashboard.processServerConfigurationUpdateResult(),Dashboard.navigate("livetvstatus.html")},function(){Dashboard.hideLoadingMsg(),Dashboard.alert({message:Globalize.translate("ErrorSavingTvProvider")})})}$(document).on("pageinit","#liveTvTunerProviderM3UPage",function(){var page=this;$("form",page).on("submit",function(){return submitForm(page),!1}),$("#btnSelectPath",page).on("click.selectDirectory",function(){require(["directorybrowser"],function(directoryBrowser){var picker=new directoryBrowser;picker.show({includeFiles:!0,callback:function(path){path&&$(".txtDevicePath",page).val(path),picker.close()}})})})}).on("pageshow","#liveTvTunerProviderM3UPage",function(){var providerId=getParameterByName("id"),page=this;reload(page,providerId)})});
|
Loading…
Add table
Add a link
Reference in a new issue