Force the use of single quotes
This commit is contained in:
parent
8b6dc05d64
commit
9e3ca706c4
217 changed files with 8541 additions and 8540 deletions
|
@ -1,31 +1,31 @@
|
|||
define(["jQuery", "loading", "globalize", "emby-checkbox", "listViewStyle", "emby-input", "emby-select", "emby-button", "flexStyles"], function ($, loading, globalize) {
|
||||
"use strict";
|
||||
define(['jQuery', 'loading', 'globalize', 'emby-checkbox', 'listViewStyle', 'emby-input', 'emby-select', 'emby-button', 'flexStyles'], function ($, loading, globalize) {
|
||||
'use strict';
|
||||
|
||||
return function (page, providerId, options) {
|
||||
function reload() {
|
||||
loading.show();
|
||||
ApiClient.getNamedConfiguration("livetv").then(function (config) {
|
||||
ApiClient.getNamedConfiguration('livetv').then(function (config) {
|
||||
var info = config.ListingProviders.filter(function (i) {
|
||||
return i.Id === providerId;
|
||||
})[0] || {};
|
||||
listingsId = info.ListingsId;
|
||||
$("#selectListing", page).val(info.ListingsId || "");
|
||||
page.querySelector(".txtUser").value = info.Username || "";
|
||||
page.querySelector(".txtPass").value = "";
|
||||
page.querySelector(".txtZipCode").value = info.ZipCode || "";
|
||||
$('#selectListing', page).val(info.ListingsId || '');
|
||||
page.querySelector('.txtUser').value = info.Username || '';
|
||||
page.querySelector('.txtPass').value = '';
|
||||
page.querySelector('.txtZipCode').value = info.ZipCode || '';
|
||||
|
||||
if (info.Username && info.Password) {
|
||||
page.querySelector(".listingsSection").classList.remove("hide");
|
||||
page.querySelector('.listingsSection').classList.remove('hide');
|
||||
} else {
|
||||
page.querySelector(".listingsSection").classList.add("hide");
|
||||
page.querySelector('.listingsSection').classList.add('hide');
|
||||
}
|
||||
|
||||
page.querySelector(".chkAllTuners").checked = info.EnableAllTuners;
|
||||
page.querySelector('.chkAllTuners').checked = info.EnableAllTuners;
|
||||
|
||||
if (info.EnableAllTuners) {
|
||||
page.querySelector(".selectTunersSection").classList.add("hide");
|
||||
page.querySelector('.selectTunersSection').classList.add('hide');
|
||||
} else {
|
||||
page.querySelector(".selectTunersSection").classList.remove("hide");
|
||||
page.querySelector('.selectTunersSection').classList.remove('hide');
|
||||
}
|
||||
|
||||
setCountry(info);
|
||||
|
@ -34,7 +34,7 @@ define(["jQuery", "loading", "globalize", "emby-checkbox", "listViewStyle", "emb
|
|||
}
|
||||
|
||||
function setCountry(info) {
|
||||
ApiClient.getJSON(ApiClient.getUrl("LiveTv/ListingProviders/SchedulesDirect/Countries")).then(function (result) {
|
||||
ApiClient.getJSON(ApiClient.getUrl('LiveTv/ListingProviders/SchedulesDirect/Countries')).then(function (result) {
|
||||
var i;
|
||||
var length;
|
||||
var countryList = [];
|
||||
|
@ -42,7 +42,7 @@ define(["jQuery", "loading", "globalize", "emby-checkbox", "listViewStyle", "emb
|
|||
for (var region in result) {
|
||||
var countries = result[region];
|
||||
|
||||
if (countries.length && "ZZZ" !== region) {
|
||||
if (countries.length && 'ZZZ' !== region) {
|
||||
for (i = 0, length = countries.length; i < length; i++) {
|
||||
countryList.push({
|
||||
name: countries[i].fullName,
|
||||
|
@ -63,13 +63,13 @@ define(["jQuery", "loading", "globalize", "emby-checkbox", "listViewStyle", "emb
|
|||
|
||||
return 0;
|
||||
});
|
||||
$("#selectCountry", page).html(countryList.map(function (c) {
|
||||
return '<option value="' + c.value + '">' + c.name + "</option>";
|
||||
}).join("")).val(info.Country || "");
|
||||
$(page.querySelector(".txtZipCode")).trigger("change");
|
||||
$('#selectCountry', page).html(countryList.map(function (c) {
|
||||
return '<option value="' + c.value + '">' + c.name + '</option>';
|
||||
}).join('')).val(info.Country || '');
|
||||
$(page.querySelector('.txtZipCode')).trigger('change');
|
||||
}, function () { // ApiClient.getJSON() error handler
|
||||
Dashboard.alert({
|
||||
message: globalize.translate("ErrorGettingTvLineups")
|
||||
message: globalize.translate('ErrorGettingTvLineups')
|
||||
});
|
||||
});
|
||||
loading.hide();
|
||||
|
@ -77,11 +77,11 @@ define(["jQuery", "loading", "globalize", "emby-checkbox", "listViewStyle", "emb
|
|||
|
||||
function sha256(str) {
|
||||
if (!self.TextEncoder) {
|
||||
return Promise.resolve("");
|
||||
return Promise.resolve('');
|
||||
}
|
||||
|
||||
var buffer = new TextEncoder("utf-8").encode(str);
|
||||
return crypto.subtle.digest("SHA-256", buffer).then(function (hash) {
|
||||
var buffer = new TextEncoder('utf-8').encode(str);
|
||||
return crypto.subtle.digest('SHA-256', buffer).then(function (hash) {
|
||||
return hex(hash);
|
||||
});
|
||||
}
|
||||
|
@ -93,22 +93,22 @@ define(["jQuery", "loading", "globalize", "emby-checkbox", "listViewStyle", "emb
|
|||
for (var i = 0; i < view.byteLength; i += 4) {
|
||||
var value = view.getUint32(i);
|
||||
var stringValue = value.toString(16);
|
||||
var paddedValue = ("00000000" + stringValue).slice(-"00000000".length);
|
||||
var paddedValue = ('00000000' + stringValue).slice(-'00000000'.length);
|
||||
hexCodes.push(paddedValue);
|
||||
}
|
||||
|
||||
return hexCodes.join("");
|
||||
return hexCodes.join('');
|
||||
}
|
||||
|
||||
function submitLoginForm() {
|
||||
loading.show();
|
||||
sha256(page.querySelector(".txtPass").value).then(function (passwordHash) {
|
||||
sha256(page.querySelector('.txtPass').value).then(function (passwordHash) {
|
||||
var info = {
|
||||
Type: "SchedulesDirect",
|
||||
Username: page.querySelector(".txtUser").value,
|
||||
Type: 'SchedulesDirect',
|
||||
Username: page.querySelector('.txtUser').value,
|
||||
EnableAllTuners: true,
|
||||
Password: passwordHash,
|
||||
Pw: page.querySelector(".txtPass").value
|
||||
Pw: page.querySelector('.txtPass').value
|
||||
};
|
||||
var id = providerId;
|
||||
|
||||
|
@ -117,56 +117,56 @@ define(["jQuery", "loading", "globalize", "emby-checkbox", "listViewStyle", "emb
|
|||
}
|
||||
|
||||
ApiClient.ajax({
|
||||
type: "POST",
|
||||
url: ApiClient.getUrl("LiveTv/ListingProviders", {
|
||||
type: 'POST',
|
||||
url: ApiClient.getUrl('LiveTv/ListingProviders', {
|
||||
ValidateLogin: true
|
||||
}),
|
||||
data: JSON.stringify(info),
|
||||
contentType: "application/json",
|
||||
dataType: "json"
|
||||
contentType: 'application/json',
|
||||
dataType: 'json'
|
||||
}).then(function (result) {
|
||||
Dashboard.processServerConfigurationUpdateResult();
|
||||
providerId = result.Id;
|
||||
reload();
|
||||
}, function () {
|
||||
Dashboard.alert({ // ApiClient.ajax() error handler
|
||||
message: globalize.translate("ErrorSavingTvProvider")
|
||||
message: globalize.translate('ErrorSavingTvProvider')
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function submitListingsForm() {
|
||||
var selectedListingsId = $("#selectListing", page).val();
|
||||
var selectedListingsId = $('#selectListing', page).val();
|
||||
|
||||
if (!selectedListingsId) {
|
||||
return void Dashboard.alert({
|
||||
message: globalize.translate("ErrorPleaseSelectLineup")
|
||||
message: globalize.translate('ErrorPleaseSelectLineup')
|
||||
});
|
||||
}
|
||||
|
||||
loading.show();
|
||||
var id = providerId;
|
||||
ApiClient.getNamedConfiguration("livetv").then(function (config) {
|
||||
ApiClient.getNamedConfiguration('livetv').then(function (config) {
|
||||
var info = config.ListingProviders.filter(function (i) {
|
||||
return i.Id === id;
|
||||
})[0];
|
||||
info.ZipCode = page.querySelector(".txtZipCode").value;
|
||||
info.Country = $("#selectCountry", page).val();
|
||||
info.ZipCode = page.querySelector('.txtZipCode').value;
|
||||
info.Country = $('#selectCountry', page).val();
|
||||
info.ListingsId = selectedListingsId;
|
||||
info.EnableAllTuners = page.querySelector(".chkAllTuners").checked;
|
||||
info.EnabledTuners = info.EnableAllTuners ? [] : $(".chkTuner", page).get().filter(function (i) {
|
||||
info.EnableAllTuners = page.querySelector('.chkAllTuners').checked;
|
||||
info.EnabledTuners = info.EnableAllTuners ? [] : $('.chkTuner', page).get().filter(function (i) {
|
||||
return i.checked;
|
||||
}).map(function (i) {
|
||||
return i.getAttribute("data-id");
|
||||
return i.getAttribute('data-id');
|
||||
});
|
||||
ApiClient.ajax({
|
||||
type: "POST",
|
||||
url: ApiClient.getUrl("LiveTv/ListingProviders", {
|
||||
type: 'POST',
|
||||
url: ApiClient.getUrl('LiveTv/ListingProviders', {
|
||||
ValidateListings: true
|
||||
}),
|
||||
data: JSON.stringify(info),
|
||||
contentType: "application/json"
|
||||
contentType: 'application/json'
|
||||
}).then(function (result) {
|
||||
loading.hide();
|
||||
|
||||
|
@ -174,11 +174,11 @@ define(["jQuery", "loading", "globalize", "emby-checkbox", "listViewStyle", "emb
|
|||
Dashboard.processServerConfigurationUpdateResult();
|
||||
}
|
||||
|
||||
Events.trigger(self, "submitted");
|
||||
Events.trigger(self, 'submitted');
|
||||
}, function () {
|
||||
loading.hide();
|
||||
Dashboard.alert({
|
||||
message: globalize.translate("ErrorAddingListingsToSchedulesDirect")
|
||||
message: globalize.translate('ErrorAddingListingsToSchedulesDirect')
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -186,79 +186,79 @@ define(["jQuery", "loading", "globalize", "emby-checkbox", "listViewStyle", "emb
|
|||
|
||||
function refreshListings(value) {
|
||||
if (!value) {
|
||||
return void $("#selectListing", page).html("");
|
||||
return void $('#selectListing', page).html('');
|
||||
}
|
||||
|
||||
loading.show();
|
||||
ApiClient.ajax({
|
||||
type: "GET",
|
||||
url: ApiClient.getUrl("LiveTv/ListingProviders/Lineups", {
|
||||
type: 'GET',
|
||||
url: ApiClient.getUrl('LiveTv/ListingProviders/Lineups', {
|
||||
Id: providerId,
|
||||
Location: value,
|
||||
Country: $("#selectCountry", page).val()
|
||||
Country: $('#selectCountry', page).val()
|
||||
}),
|
||||
dataType: "json"
|
||||
dataType: 'json'
|
||||
}).then(function (result) {
|
||||
$("#selectListing", page).html(result.map(function (o) {
|
||||
return '<option value="' + o.Id + '">' + o.Name + "</option>";
|
||||
$('#selectListing', page).html(result.map(function (o) {
|
||||
return '<option value="' + o.Id + '">' + o.Name + '</option>';
|
||||
}));
|
||||
|
||||
if (listingsId) {
|
||||
$("#selectListing", page).val(listingsId);
|
||||
$('#selectListing', page).val(listingsId);
|
||||
}
|
||||
|
||||
loading.hide();
|
||||
}, function (result) {
|
||||
Dashboard.alert({
|
||||
message: globalize.translate("ErrorGettingTvLineups")
|
||||
message: globalize.translate('ErrorGettingTvLineups')
|
||||
});
|
||||
refreshListings("");
|
||||
refreshListings('');
|
||||
loading.hide();
|
||||
});
|
||||
}
|
||||
|
||||
function getTunerName(providerId) {
|
||||
switch (providerId = providerId.toLowerCase()) {
|
||||
case "m3u":
|
||||
return "M3U Playlist";
|
||||
case "hdhomerun":
|
||||
return "HDHomerun";
|
||||
case "satip":
|
||||
return "DVB";
|
||||
case 'm3u':
|
||||
return 'M3U Playlist';
|
||||
case 'hdhomerun':
|
||||
return 'HDHomerun';
|
||||
case 'satip':
|
||||
return 'DVB';
|
||||
default:
|
||||
return "Unknown";
|
||||
return 'Unknown';
|
||||
}
|
||||
}
|
||||
|
||||
function refreshTunerDevices(page, providerInfo, devices) {
|
||||
var html = "";
|
||||
var html = '';
|
||||
|
||||
for (var i = 0, length = devices.length; i < length; i++) {
|
||||
var device = devices[i];
|
||||
html += '<div class="listItem">';
|
||||
var enabledTuners = providerInfo.EnabledTuners || [];
|
||||
var isChecked = providerInfo.EnableAllTuners || -1 !== enabledTuners.indexOf(device.Id);
|
||||
var checkedAttribute = isChecked ? " checked" : "";
|
||||
html += '<label class="checkboxContainer listItemCheckboxContainer"><input type="checkbox" is="emby-checkbox" data-id="' + device.Id + '" class="chkTuner" ' + checkedAttribute + "/><span></span></label>";
|
||||
var checkedAttribute = isChecked ? ' checked' : '';
|
||||
html += '<label class="checkboxContainer listItemCheckboxContainer"><input type="checkbox" is="emby-checkbox" data-id="' + device.Id + '" class="chkTuner" ' + checkedAttribute + '/><span></span></label>';
|
||||
html += '<div class="listItemBody two-line">';
|
||||
html += '<div class="listItemBodyText">';
|
||||
html += device.FriendlyName || getTunerName(device.Type);
|
||||
html += "</div>";
|
||||
html += '</div>';
|
||||
html += '<div class="listItemBodyText secondary">';
|
||||
html += device.Url;
|
||||
html += "</div>";
|
||||
html += "</div>";
|
||||
html += "</div>";
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
page.querySelector(".tunerList").innerHTML = html;
|
||||
page.querySelector('.tunerList').innerHTML = html;
|
||||
}
|
||||
|
||||
var listingsId;
|
||||
var self = this;
|
||||
|
||||
self.submit = function () {
|
||||
page.querySelector(".btnSubmitListingsContainer").click();
|
||||
page.querySelector('.btnSubmitListingsContainer').click();
|
||||
};
|
||||
|
||||
self.init = function () {
|
||||
|
@ -267,30 +267,30 @@ define(["jQuery", "loading", "globalize", "emby-checkbox", "listViewStyle", "emb
|
|||
// Only hide the buttons if explicitly set to false; default to showing if undefined or null
|
||||
// FIXME: rename this option to clarify logic
|
||||
var hideCancelButton = options.showCancelButton === false;
|
||||
page.querySelector(".btnCancel").classList.toggle("hide", hideCancelButton);
|
||||
page.querySelector('.btnCancel').classList.toggle('hide', hideCancelButton);
|
||||
|
||||
var hideSubmitButton = options.showSubmitButton === false;
|
||||
page.querySelector(".btnSubmitListings").classList.toggle("hide", hideSubmitButton);
|
||||
page.querySelector('.btnSubmitListings').classList.toggle('hide', hideSubmitButton);
|
||||
|
||||
$(".formLogin", page).on("submit", function () {
|
||||
$('.formLogin', page).on('submit', function () {
|
||||
submitLoginForm();
|
||||
return false;
|
||||
});
|
||||
$(".formListings", page).on("submit", function () {
|
||||
$('.formListings', page).on('submit', function () {
|
||||
submitListingsForm();
|
||||
return false;
|
||||
});
|
||||
$(".txtZipCode", page).on("change", function () {
|
||||
$('.txtZipCode', page).on('change', function () {
|
||||
refreshListings(this.value);
|
||||
});
|
||||
page.querySelector(".chkAllTuners").addEventListener("change", function (e) {
|
||||
page.querySelector('.chkAllTuners').addEventListener('change', function (e) {
|
||||
if (e.target.checked) {
|
||||
page.querySelector(".selectTunersSection").classList.add("hide");
|
||||
page.querySelector('.selectTunersSection').classList.add('hide');
|
||||
} else {
|
||||
page.querySelector(".selectTunersSection").classList.remove("hide");
|
||||
page.querySelector('.selectTunersSection').classList.remove('hide');
|
||||
}
|
||||
});
|
||||
$(".createAccountHelp", page).html(globalize.translate("MessageCreateAccountAt", '<a is="emby-linkbutton" class="button-link" href="http://www.schedulesdirect.org" target="_blank">http://www.schedulesdirect.org</a>'));
|
||||
$('.createAccountHelp', page).html(globalize.translate('MessageCreateAccountAt', '<a is="emby-linkbutton" class="button-link" href="http://www.schedulesdirect.org" target="_blank">http://www.schedulesdirect.org</a>'));
|
||||
reload();
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
define(["jQuery", "loading", "globalize", "emby-checkbox", "emby-input", "listViewStyle", "paper-icon-button-light"], function ($, loading, globalize) {
|
||||
"use strict";
|
||||
define(['jQuery', 'loading', 'globalize', 'emby-checkbox', 'emby-input', 'listViewStyle', 'paper-icon-button-light'], function ($, loading, globalize) {
|
||||
'use strict';
|
||||
|
||||
return function (page, providerId, options) {
|
||||
function getListingProvider(config, id) {
|
||||
|
@ -15,26 +15,26 @@ define(["jQuery", "loading", "globalize", "emby-checkbox", "emby-input", "listVi
|
|||
return getListingProvider();
|
||||
}
|
||||
|
||||
return ApiClient.getJSON(ApiClient.getUrl("LiveTv/ListingProviders/Default"));
|
||||
return ApiClient.getJSON(ApiClient.getUrl('LiveTv/ListingProviders/Default'));
|
||||
}
|
||||
|
||||
function reload() {
|
||||
loading.show();
|
||||
ApiClient.getNamedConfiguration("livetv").then(function (config) {
|
||||
ApiClient.getNamedConfiguration('livetv').then(function (config) {
|
||||
getListingProvider(config, providerId).then(function (info) {
|
||||
page.querySelector(".txtPath").value = info.Path || "";
|
||||
page.querySelector(".txtKids").value = (info.KidsCategories || []).join("|");
|
||||
page.querySelector(".txtNews").value = (info.NewsCategories || []).join("|");
|
||||
page.querySelector(".txtSports").value = (info.SportsCategories || []).join("|");
|
||||
page.querySelector(".txtMovies").value = (info.MovieCategories || []).join("|");
|
||||
page.querySelector(".txtMoviePrefix").value = info.MoviePrefix || "";
|
||||
page.querySelector(".txtUserAgent").value = info.UserAgent || "";
|
||||
page.querySelector(".chkAllTuners").checked = info.EnableAllTuners;
|
||||
page.querySelector('.txtPath').value = info.Path || '';
|
||||
page.querySelector('.txtKids').value = (info.KidsCategories || []).join('|');
|
||||
page.querySelector('.txtNews').value = (info.NewsCategories || []).join('|');
|
||||
page.querySelector('.txtSports').value = (info.SportsCategories || []).join('|');
|
||||
page.querySelector('.txtMovies').value = (info.MovieCategories || []).join('|');
|
||||
page.querySelector('.txtMoviePrefix').value = info.MoviePrefix || '';
|
||||
page.querySelector('.txtUserAgent').value = info.UserAgent || '';
|
||||
page.querySelector('.chkAllTuners').checked = info.EnableAllTuners;
|
||||
|
||||
if (page.querySelector(".chkAllTuners").checked) {
|
||||
page.querySelector(".selectTunersSection").classList.add("hide");
|
||||
if (page.querySelector('.chkAllTuners').checked) {
|
||||
page.querySelector('.selectTunersSection').classList.add('hide');
|
||||
} else {
|
||||
page.querySelector(".selectTunersSection").classList.remove("hide");
|
||||
page.querySelector('.selectTunersSection').classList.remove('hide');
|
||||
}
|
||||
|
||||
refreshTunerDevices(page, info, config.TunerHosts);
|
||||
|
@ -47,7 +47,7 @@ define(["jQuery", "loading", "globalize", "emby-checkbox", "emby-input", "listVi
|
|||
var value = txtInput.value;
|
||||
|
||||
if (value) {
|
||||
return value.split("|");
|
||||
return value.split('|');
|
||||
}
|
||||
|
||||
return [];
|
||||
|
@ -56,31 +56,31 @@ define(["jQuery", "loading", "globalize", "emby-checkbox", "emby-input", "listVi
|
|||
function submitListingsForm() {
|
||||
loading.show();
|
||||
var id = providerId;
|
||||
ApiClient.getNamedConfiguration("livetv").then(function (config) {
|
||||
ApiClient.getNamedConfiguration('livetv').then(function (config) {
|
||||
var info = config.ListingProviders.filter(function (provider) {
|
||||
return provider.Id === id;
|
||||
})[0] || {};
|
||||
info.Type = "xmltv";
|
||||
info.Path = page.querySelector(".txtPath").value;
|
||||
info.MoviePrefix = page.querySelector(".txtMoviePrefix").value || null;
|
||||
info.UserAgent = page.querySelector(".txtUserAgent").value || null;
|
||||
info.MovieCategories = getCategories(page.querySelector(".txtMovies"));
|
||||
info.KidsCategories = getCategories(page.querySelector(".txtKids"));
|
||||
info.NewsCategories = getCategories(page.querySelector(".txtNews"));
|
||||
info.SportsCategories = getCategories(page.querySelector(".txtSports"));
|
||||
info.EnableAllTuners = page.querySelector(".chkAllTuners").checked;
|
||||
info.EnabledTuners = info.EnableAllTuners ? [] : $(".chkTuner", page).get().filter(function (tuner) {
|
||||
info.Type = 'xmltv';
|
||||
info.Path = page.querySelector('.txtPath').value;
|
||||
info.MoviePrefix = page.querySelector('.txtMoviePrefix').value || null;
|
||||
info.UserAgent = page.querySelector('.txtUserAgent').value || null;
|
||||
info.MovieCategories = getCategories(page.querySelector('.txtMovies'));
|
||||
info.KidsCategories = getCategories(page.querySelector('.txtKids'));
|
||||
info.NewsCategories = getCategories(page.querySelector('.txtNews'));
|
||||
info.SportsCategories = getCategories(page.querySelector('.txtSports'));
|
||||
info.EnableAllTuners = page.querySelector('.chkAllTuners').checked;
|
||||
info.EnabledTuners = info.EnableAllTuners ? [] : $('.chkTuner', page).get().filter(function (tuner) {
|
||||
return tuner.checked;
|
||||
}).map(function (tuner) {
|
||||
return tuner.getAttribute("data-id");
|
||||
return tuner.getAttribute('data-id');
|
||||
});
|
||||
ApiClient.ajax({
|
||||
type: "POST",
|
||||
url: ApiClient.getUrl("LiveTv/ListingProviders", {
|
||||
type: 'POST',
|
||||
url: ApiClient.getUrl('LiveTv/ListingProviders', {
|
||||
ValidateListings: true
|
||||
}),
|
||||
data: JSON.stringify(info),
|
||||
contentType: "application/json"
|
||||
contentType: 'application/json'
|
||||
}).then(function (result) {
|
||||
loading.hide();
|
||||
|
||||
|
@ -88,11 +88,11 @@ define(["jQuery", "loading", "globalize", "emby-checkbox", "emby-input", "listVi
|
|||
Dashboard.processServerConfigurationUpdateResult();
|
||||
}
|
||||
|
||||
Events.trigger(self, "submitted");
|
||||
Events.trigger(self, 'submitted');
|
||||
}, function () {
|
||||
loading.hide();
|
||||
Dashboard.alert({
|
||||
message: globalize.translate("ErrorAddingXmlTvFile")
|
||||
message: globalize.translate('ErrorAddingXmlTvFile')
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -100,51 +100,51 @@ define(["jQuery", "loading", "globalize", "emby-checkbox", "emby-input", "listVi
|
|||
|
||||
function getTunerName(providerId) {
|
||||
switch (providerId = providerId.toLowerCase()) {
|
||||
case "m3u":
|
||||
return "M3U Playlist";
|
||||
case "hdhomerun":
|
||||
return "HDHomerun";
|
||||
case "satip":
|
||||
return "DVB";
|
||||
case 'm3u':
|
||||
return 'M3U Playlist';
|
||||
case 'hdhomerun':
|
||||
return 'HDHomerun';
|
||||
case 'satip':
|
||||
return 'DVB';
|
||||
default:
|
||||
return "Unknown";
|
||||
return 'Unknown';
|
||||
}
|
||||
}
|
||||
|
||||
function refreshTunerDevices(page, providerInfo, devices) {
|
||||
var html = "";
|
||||
var html = '';
|
||||
|
||||
for (var i = 0, length = devices.length; i < length; i++) {
|
||||
var device = devices[i];
|
||||
html += '<div class="listItem">';
|
||||
var enabledTuners = providerInfo.EnabledTuners || [];
|
||||
var isChecked = providerInfo.EnableAllTuners || -1 !== enabledTuners.indexOf(device.Id);
|
||||
var checkedAttribute = isChecked ? " checked" : "";
|
||||
html += '<label class="listItemCheckboxContainer"><input type="checkbox" is="emby-checkbox" class="chkTuner" data-id="' + device.Id + '" ' + checkedAttribute + "><span></span></label>";
|
||||
var checkedAttribute = isChecked ? ' checked' : '';
|
||||
html += '<label class="listItemCheckboxContainer"><input type="checkbox" is="emby-checkbox" class="chkTuner" data-id="' + device.Id + '" ' + checkedAttribute + '><span></span></label>';
|
||||
html += '<div class="listItemBody two-line">';
|
||||
html += '<div class="listItemBodyText">';
|
||||
html += device.FriendlyName || getTunerName(device.Type);
|
||||
html += "</div>";
|
||||
html += '</div>';
|
||||
html += '<div class="listItemBodyText secondary">';
|
||||
html += device.Url;
|
||||
html += "</div>";
|
||||
html += "</div>";
|
||||
html += "</div>";
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
page.querySelector(".tunerList").innerHTML = html;
|
||||
page.querySelector('.tunerList').innerHTML = html;
|
||||
}
|
||||
|
||||
function onSelectPathClick(e) {
|
||||
var page = $(e.target).parents(".xmltvForm")[0];
|
||||
var page = $(e.target).parents('.xmltvForm')[0];
|
||||
|
||||
require(["directorybrowser"], function (directoryBrowser) {
|
||||
require(['directorybrowser'], function (directoryBrowser) {
|
||||
var picker = new directoryBrowser();
|
||||
picker.show({
|
||||
includeFiles: true,
|
||||
callback: function (path) {
|
||||
if (path) {
|
||||
var txtPath = page.querySelector(".txtPath");
|
||||
var txtPath = page.querySelector('.txtPath');
|
||||
txtPath.value = path;
|
||||
txtPath.focus();
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ define(["jQuery", "loading", "globalize", "emby-checkbox", "emby-input", "listVi
|
|||
var self = this;
|
||||
|
||||
self.submit = function () {
|
||||
page.querySelector(".btnSubmitListings").click();
|
||||
page.querySelector('.btnSubmitListings').click();
|
||||
};
|
||||
|
||||
self.init = function () {
|
||||
|
@ -166,21 +166,21 @@ define(["jQuery", "loading", "globalize", "emby-checkbox", "emby-input", "listVi
|
|||
// Only hide the buttons if explicitly set to false; default to showing if undefined or null
|
||||
// FIXME: rename this option to clarify logic
|
||||
var hideCancelButton = options.showCancelButton === false;
|
||||
page.querySelector(".btnCancel").classList.toggle("hide", hideCancelButton);
|
||||
page.querySelector('.btnCancel').classList.toggle('hide', hideCancelButton);
|
||||
|
||||
var hideSubmitButton = options.showSubmitButton === false;
|
||||
page.querySelector(".btnSubmitListings").classList.toggle("hide", hideSubmitButton);
|
||||
page.querySelector('.btnSubmitListings').classList.toggle('hide', hideSubmitButton);
|
||||
|
||||
$("form", page).on("submit", function () {
|
||||
$('form', page).on('submit', function () {
|
||||
submitListingsForm();
|
||||
return false;
|
||||
});
|
||||
page.querySelector("#btnSelectPath").addEventListener("click", onSelectPathClick);
|
||||
page.querySelector(".chkAllTuners").addEventListener("change", function (evt) {
|
||||
page.querySelector('#btnSelectPath').addEventListener('click', onSelectPathClick);
|
||||
page.querySelector('.chkAllTuners').addEventListener('change', function (evt) {
|
||||
if (evt.target.checked) {
|
||||
page.querySelector(".selectTunersSection").classList.add("hide");
|
||||
page.querySelector('.selectTunersSection').classList.add('hide');
|
||||
} else {
|
||||
page.querySelector(".selectTunersSection").classList.remove("hide");
|
||||
page.querySelector('.selectTunersSection').classList.remove('hide');
|
||||
}
|
||||
});
|
||||
reload();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue