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

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

View file

@ -1,51 +1,51 @@
define(["jQuery", "loading", "globalize", "fnchecked", "emby-checkbox"], function ($, loading, globalize) {
"use strict";
define(['jQuery', 'loading', 'globalize', 'fnchecked', 'emby-checkbox'], function ($, loading, globalize) {
'use strict';
function loadMediaFolders(page, mediaFolders) {
var html = "";
html += '<h3 class="checkboxListLabel">' + globalize.translate("HeaderLibraries") + "</h3>";
var html = '';
html += '<h3 class="checkboxListLabel">' + globalize.translate('HeaderLibraries') + '</h3>';
html += '<div class="checkboxList paperList" style="padding:.5em 1em;">';
for (var i = 0; i < mediaFolders.length; i++) {
var folder = mediaFolders[i];
html += '<label><input type="checkbox" is="emby-checkbox" class="chkFolder" data-id="' + folder.Id + '" checked="checked"/><span>' + folder.Name + "</span></label>";
html += '<label><input type="checkbox" is="emby-checkbox" class="chkFolder" data-id="' + folder.Id + '" checked="checked"/><span>' + folder.Name + '</span></label>';
}
html += "</div>";
$(".folderAccess", page).html(html).trigger("create");
$("#chkEnableAllFolders", page).checked(true).trigger("change");
html += '</div>';
$('.folderAccess', page).html(html).trigger('create');
$('#chkEnableAllFolders', page).checked(true).trigger('change');
}
function loadChannels(page, channels) {
var html = "";
html += '<h3 class="checkboxListLabel">' + globalize.translate("HeaderChannels") + "</h3>";
var html = '';
html += '<h3 class="checkboxListLabel">' + globalize.translate('HeaderChannels') + '</h3>';
html += '<div class="checkboxList paperList" style="padding:.5em 1em;">';
for (var i = 0; i < channels.length; i++) {
var folder = channels[i];
html += '<label><input type="checkbox" is="emby-checkbox" class="chkChannel" data-id="' + folder.Id + '" checked="checked"/><span>' + folder.Name + "</span></label>";
html += '<label><input type="checkbox" is="emby-checkbox" class="chkChannel" data-id="' + folder.Id + '" checked="checked"/><span>' + folder.Name + '</span></label>';
}
html += "</div>";
$(".channelAccess", page).show().html(html).trigger("create");
html += '</div>';
$('.channelAccess', page).show().html(html).trigger('create');
if (channels.length) {
$(".channelAccessContainer", page).show();
$('.channelAccessContainer', page).show();
} else {
$(".channelAccessContainer", page).hide();
$('.channelAccessContainer', page).hide();
}
$("#chkEnableAllChannels", page).checked(true).trigger("change");
$('#chkEnableAllChannels', page).checked(true).trigger('change');
}
function loadUser(page) {
$("#txtUsername", page).val("");
$("#txtPassword", page).val("");
$('#txtUsername', page).val('');
$('#txtPassword', page).val('');
loading.show();
var promiseFolders = ApiClient.getJSON(ApiClient.getUrl("Library/MediaFolders", {
var promiseFolders = ApiClient.getJSON(ApiClient.getUrl('Library/MediaFolders', {
IsHidden: false
}));
var promiseChannels = ApiClient.getJSON(ApiClient.getUrl("Channels"));
var promiseChannels = ApiClient.getJSON(ApiClient.getUrl('Channels'));
Promise.all([promiseFolders, promiseChannels]).then(function (responses) {
loadMediaFolders(page, responses[0].Items);
loadChannels(page, responses[1].Items);
@ -55,37 +55,37 @@ define(["jQuery", "loading", "globalize", "fnchecked", "emby-checkbox"], functio
function saveUser(page) {
var user = {};
user.Name = $("#txtUsername", page).val();
user.Password = $("#txtPassword", page).val();
user.Name = $('#txtUsername', page).val();
user.Password = $('#txtPassword', page).val();
ApiClient.createUser(user).then(function (user) {
user.Policy.EnableAllFolders = $("#chkEnableAllFolders", page).checked();
user.Policy.EnableAllFolders = $('#chkEnableAllFolders', page).checked();
user.Policy.EnabledFolders = [];
if (!user.Policy.EnableAllFolders) {
user.Policy.EnabledFolders = $(".chkFolder", page).get().filter(function (i) {
user.Policy.EnabledFolders = $('.chkFolder', page).get().filter(function (i) {
return i.checked;
}).map(function (i) {
return i.getAttribute("data-id");
return i.getAttribute('data-id');
});
}
user.Policy.EnableAllChannels = $("#chkEnableAllChannels", page).checked();
user.Policy.EnableAllChannels = $('#chkEnableAllChannels', page).checked();
user.Policy.EnabledChannels = [];
if (!user.Policy.EnableAllChannels) {
user.Policy.EnabledChannels = $(".chkChannel", page).get().filter(function (i) {
user.Policy.EnabledChannels = $('.chkChannel', page).get().filter(function (i) {
return i.checked;
}).map(function (i) {
return i.getAttribute("data-id");
return i.getAttribute('data-id');
});
}
ApiClient.updateUserPolicy(user.Id, user.Policy).then(function () {
Dashboard.navigate("useredit.html?userId=" + user.Id);
Dashboard.navigate('useredit.html?userId=' + user.Id);
});
}, function (response) {
require(["toast"], function (toast) {
toast(globalize.translate("DefaultErrorMessage"));
require(['toast'], function (toast) {
toast(globalize.translate('DefaultErrorMessage'));
});
loading.hide();
@ -93,7 +93,7 @@ define(["jQuery", "loading", "globalize", "fnchecked", "emby-checkbox"], functio
}
function onSubmit() {
var page = $(this).parents(".page")[0];
var page = $(this).parents('.page')[0];
loading.show();
saveUser(page);
return false;
@ -103,24 +103,24 @@ define(["jQuery", "loading", "globalize", "fnchecked", "emby-checkbox"], functio
loadUser(page);
}
$(document).on("pageinit", "#newUserPage", function () {
$(document).on('pageinit', '#newUserPage', function () {
var page = this;
$("#chkEnableAllChannels", page).on("change", function () {
$('#chkEnableAllChannels', page).on('change', function () {
if (this.checked) {
$(".channelAccessListContainer", page).hide();
$('.channelAccessListContainer', page).hide();
} else {
$(".channelAccessListContainer", page).show();
$('.channelAccessListContainer', page).show();
}
});
$("#chkEnableAllFolders", page).on("change", function () {
$('#chkEnableAllFolders', page).on('change', function () {
if (this.checked) {
$(".folderAccessListContainer", page).hide();
$('.folderAccessListContainer', page).hide();
} else {
$(".folderAccessListContainer", page).show();
$('.folderAccessListContainer', page).show();
}
});
$(".newUserProfileForm").off("submit", onSubmit).on("submit", onSubmit);
}).on("pageshow", "#newUserPage", function () {
$('.newUserProfileForm').off('submit', onSubmit).on('submit', onSubmit);
}).on('pageshow', '#newUserPage', function () {
loadData(this);
});
});