Force the use of single quotes

This commit is contained in:
MrTimscampi 2020-05-04 12:44:12 +02:00
parent 8b6dc05d64
commit 9e3ca706c4
217 changed files with 8541 additions and 8540 deletions

File diff suppressed because it is too large Load diff

View file

@ -1,9 +1,9 @@
define(["jQuery", "globalize", "loading", "libraryMenu", "listViewStyle", "emby-button"], function ($, globalize, loading, libraryMenu) {
"use strict";
define(['jQuery', 'globalize', 'loading', 'libraryMenu', 'listViewStyle', 'emby-button'], function ($, globalize, loading, libraryMenu) {
'use strict';
function loadProfiles(page) {
loading.show();
ApiClient.getJSON(ApiClient.getUrl("Dlna/ProfileInfos")).then(function (result) {
ApiClient.getJSON(ApiClient.getUrl('Dlna/ProfileInfos')).then(function (result) {
renderUserProfiles(page, result);
renderSystemProfiles(page, result);
loading.hide();
@ -11,19 +11,19 @@ define(["jQuery", "globalize", "loading", "libraryMenu", "listViewStyle", "emby-
}
function renderUserProfiles(page, profiles) {
renderProfiles(page, page.querySelector(".customProfiles"), profiles.filter(function (p) {
return "User" == p.Type;
renderProfiles(page, page.querySelector('.customProfiles'), profiles.filter(function (p) {
return 'User' == p.Type;
}));
}
function renderSystemProfiles(page, profiles) {
renderProfiles(page, page.querySelector(".systemProfiles"), profiles.filter(function (p) {
return "System" == p.Type;
renderProfiles(page, page.querySelector('.systemProfiles'), profiles.filter(function (p) {
return 'System' == p.Type;
}));
}
function renderProfiles(page, element, profiles) {
var html = "";
var html = '';
if (profiles.length) {
html += '<div class="paperList">';
@ -35,35 +35,35 @@ define(["jQuery", "globalize", "loading", "libraryMenu", "listViewStyle", "emby-
html += '<span class="listItemIcon material-icons live_tv"></span>';
html += '<div class="listItemBody two-line">';
html += "<a is='emby-linkbutton' style='padding:0;margin:0;' data-ripple='false' class='clearLink' href='dlnaprofile.html?id=" + profile.Id + "'>";
html += "<div>" + profile.Name + "</div>";
html += "</a>";
html += "</div>";
html += '<div>' + profile.Name + '</div>';
html += '</a>';
html += '</div>';
if ("User" == profile.Type) {
html += '<button type="button" is="paper-icon-button-light" class="btnDeleteProfile" data-profileid="' + profile.Id + '" title="' + globalize.translate("ButtonDelete") + '"><span class="material-icons delete"></span></button>';
if ('User' == profile.Type) {
html += '<button type="button" is="paper-icon-button-light" class="btnDeleteProfile" data-profileid="' + profile.Id + '" title="' + globalize.translate('ButtonDelete') + '"><span class="material-icons delete"></span></button>';
}
html += "</div>";
html += '</div>';
}
if (profiles.length) {
html += "</div>";
html += '</div>';
}
element.innerHTML = html;
$(".btnDeleteProfile", element).on("click", function () {
var id = this.getAttribute("data-profileid");
$('.btnDeleteProfile', element).on('click', function () {
var id = this.getAttribute('data-profileid');
deleteProfile(page, id);
});
}
function deleteProfile(page, id) {
require(["confirm"], function (confirm) {
confirm(globalize.translate("MessageConfirmProfileDeletion"), globalize.translate("HeaderConfirmProfileDeletion")).then(function () {
require(['confirm'], function (confirm) {
confirm(globalize.translate('MessageConfirmProfileDeletion'), globalize.translate('HeaderConfirmProfileDeletion')).then(function () {
loading.show();
ApiClient.ajax({
type: "DELETE",
url: ApiClient.getUrl("Dlna/Profiles/" + id)
type: 'DELETE',
url: ApiClient.getUrl('Dlna/Profiles/' + id)
}).then(function () {
loading.hide();
loadProfiles(page);
@ -74,16 +74,16 @@ define(["jQuery", "globalize", "loading", "libraryMenu", "listViewStyle", "emby-
function getTabs() {
return [{
href: "dlnasettings.html",
name: globalize.translate("TabSettings")
href: 'dlnasettings.html',
name: globalize.translate('TabSettings')
}, {
href: "dlnaprofiles.html",
name: globalize.translate("TabProfiles")
href: 'dlnaprofiles.html',
name: globalize.translate('TabProfiles')
}];
}
$(document).on("pageshow", "#dlnaProfilesPage", function () {
libraryMenu.setTabs("dlna", 1, getTabs);
$(document).on('pageshow', '#dlnaProfilesPage', function () {
libraryMenu.setTabs('dlna', 1, getTabs);
loadProfiles(this);
});
});

View file

@ -1,53 +1,53 @@
define(["jQuery", "loading", "libraryMenu", "globalize", "fnchecked"], function ($, loading, libraryMenu, globalize) {
"use strict";
define(['jQuery', 'loading', 'libraryMenu', 'globalize', 'fnchecked'], function ($, loading, libraryMenu, globalize) {
'use strict';
function loadPage(page, config, users) {
page.querySelector("#chkEnablePlayTo").checked = config.EnablePlayTo;
page.querySelector("#chkEnableDlnaDebugLogging").checked = config.EnableDebugLog;
$("#txtClientDiscoveryInterval", page).val(config.ClientDiscoveryIntervalSeconds);
$("#chkEnableServer", page).checked(config.EnableServer);
$("#chkBlastAliveMessages", page).checked(config.BlastAliveMessages);
$("#txtBlastInterval", page).val(config.BlastAliveMessageIntervalSeconds);
page.querySelector('#chkEnablePlayTo').checked = config.EnablePlayTo;
page.querySelector('#chkEnableDlnaDebugLogging').checked = config.EnableDebugLog;
$('#txtClientDiscoveryInterval', page).val(config.ClientDiscoveryIntervalSeconds);
$('#chkEnableServer', page).checked(config.EnableServer);
$('#chkBlastAliveMessages', page).checked(config.BlastAliveMessages);
$('#txtBlastInterval', page).val(config.BlastAliveMessageIntervalSeconds);
var usersHtml = users.map(function (u) {
return '<option value="' + u.Id + '">' + u.Name + "</option>";
}).join("");
$("#selectUser", page).html(usersHtml).val(config.DefaultUserId || "");
return '<option value="' + u.Id + '">' + u.Name + '</option>';
}).join('');
$('#selectUser', page).html(usersHtml).val(config.DefaultUserId || '');
loading.hide();
}
function onSubmit() {
loading.show();
var form = this;
ApiClient.getNamedConfiguration("dlna").then(function (config) {
config.EnablePlayTo = form.querySelector("#chkEnablePlayTo").checked;
config.EnableDebugLog = form.querySelector("#chkEnableDlnaDebugLogging").checked;
config.ClientDiscoveryIntervalSeconds = $("#txtClientDiscoveryInterval", form).val();
config.EnableServer = $("#chkEnableServer", form).checked();
config.BlastAliveMessages = $("#chkBlastAliveMessages", form).checked();
config.BlastAliveMessageIntervalSeconds = $("#txtBlastInterval", form).val();
config.DefaultUserId = $("#selectUser", form).val();
ApiClient.updateNamedConfiguration("dlna", config).then(Dashboard.processServerConfigurationUpdateResult);
ApiClient.getNamedConfiguration('dlna').then(function (config) {
config.EnablePlayTo = form.querySelector('#chkEnablePlayTo').checked;
config.EnableDebugLog = form.querySelector('#chkEnableDlnaDebugLogging').checked;
config.ClientDiscoveryIntervalSeconds = $('#txtClientDiscoveryInterval', form).val();
config.EnableServer = $('#chkEnableServer', form).checked();
config.BlastAliveMessages = $('#chkBlastAliveMessages', form).checked();
config.BlastAliveMessageIntervalSeconds = $('#txtBlastInterval', form).val();
config.DefaultUserId = $('#selectUser', form).val();
ApiClient.updateNamedConfiguration('dlna', config).then(Dashboard.processServerConfigurationUpdateResult);
});
return false;
}
function getTabs() {
return [{
href: "dlnasettings.html",
name: globalize.translate("TabSettings")
href: 'dlnasettings.html',
name: globalize.translate('TabSettings')
}, {
href: "dlnaprofiles.html",
name: globalize.translate("TabProfiles")
href: 'dlnaprofiles.html',
name: globalize.translate('TabProfiles')
}];
}
$(document).on("pageinit", "#dlnaSettingsPage", function () {
$(".dlnaSettingsForm").off("submit", onSubmit).on("submit", onSubmit);
}).on("pageshow", "#dlnaSettingsPage", function () {
libraryMenu.setTabs("dlna", 0, getTabs);
$(document).on('pageinit', '#dlnaSettingsPage', function () {
$('.dlnaSettingsForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshow', '#dlnaSettingsPage', function () {
libraryMenu.setTabs('dlna', 0, getTabs);
loading.show();
var page = this;
var promise1 = ApiClient.getNamedConfiguration("dlna");
var promise1 = ApiClient.getNamedConfiguration('dlna');
var promise2 = ApiClient.getUsers();
Promise.all([promise1, promise2]).then(function (responses) {
loadPage(page, responses[0], responses[1]);