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,20 +1,20 @@
define(["events", "globalize", "dom", "date-fns", "dfnshelper", "userSettings", "serverNotifications", "connectionManager", "emby-button", "listViewStyle"], function (events, globalize, dom, datefns, dfnshelper, userSettings, serverNotifications, connectionManager) {
"use strict";
define(['events', 'globalize', 'dom', 'date-fns', 'dfnshelper', 'userSettings', 'serverNotifications', 'connectionManager', 'emby-button', 'listViewStyle'], function (events, globalize, dom, datefns, dfnshelper, userSettings, serverNotifications, connectionManager) {
'use strict';
function getEntryHtml(entry, apiClient) {
var html = "";
var html = '';
html += '<div class="listItem listItem-border">';
var color = "#00a4dc";
var icon = "notifications";
var color = '#00a4dc';
var icon = 'notifications';
if ("Error" == entry.Severity || "Fatal" == entry.Severity || "Warn" == entry.Severity) {
color = "#cc0000";
icon = "notification_important";
if ('Error' == entry.Severity || 'Fatal' == entry.Severity || 'Warn' == entry.Severity) {
color = '#cc0000';
icon = 'notification_important';
}
if (entry.UserId && entry.UserPrimaryImageTag) {
html += '<span class="listItemIcon material-icons dvr" style="width:2em!important;height:2em!important;padding:0;color:transparent;background-color:' + color + ";background-image:url('" + apiClient.getUserImageUrl(entry.UserId, {
type: "Primary",
type: 'Primary',
tag: entry.UserPrimaryImageTag
}) + "');background-repeat:no-repeat;background-position:center center;background-size: cover;\"></span>";
} else {
@ -24,36 +24,36 @@ define(["events", "globalize", "dom", "date-fns", "dfnshelper", "userSettings",
html += '<div class="listItemBody three-line">';
html += '<div class="listItemBodyText">';
html += entry.Name;
html += "</div>";
html += '</div>';
html += '<div class="listItemBodyText secondary">';
html += datefns.formatRelative(Date.parse(entry.Date), Date.parse(new Date()), { locale: dfnshelper.getLocale() });
html += "</div>";
html += '</div>';
html += '<div class="listItemBodyText secondary listItemBodyText-nowrap">';
html += entry.ShortOverview || "";
html += "</div>";
html += "</div>";
html += entry.ShortOverview || '';
html += '</div>';
html += '</div>';
if (entry.Overview) {
html += '<button type="button" is="paper-icon-button-light" class="btnEntryInfo" data-id="' + entry.Id + '" title="' + globalize.translate("Info") + '"><span class="material-icons info"></span></button>';
html += '<button type="button" is="paper-icon-button-light" class="btnEntryInfo" data-id="' + entry.Id + '" title="' + globalize.translate('Info') + '"><span class="material-icons info"></span></button>';
}
return html += "</div>";
return html += '</div>';
}
function renderList(elem, apiClient, result, startIndex, limit) {
elem.innerHTML = result.Items.map(function (i) {
return getEntryHtml(i, apiClient);
}).join("");
}).join('');
}
function reloadData(instance, elem, apiClient, startIndex, limit) {
if (null == startIndex) {
startIndex = parseInt(elem.getAttribute("data-activitystartindex") || "0");
startIndex = parseInt(elem.getAttribute('data-activitystartindex') || '0');
}
limit = limit || parseInt(elem.getAttribute("data-activitylimit") || "7");
limit = limit || parseInt(elem.getAttribute('data-activitylimit') || '7');
var minDate = new Date();
var hasUserId = "false" !== elem.getAttribute("data-useractivity");
var hasUserId = 'false' !== elem.getAttribute('data-useractivity');
if (hasUserId) {
minDate.setTime(minDate.getTime() - 24 * 60 * 60 * 1000); // one day back
@ -61,22 +61,22 @@ define(["events", "globalize", "dom", "date-fns", "dfnshelper", "userSettings",
minDate.setTime(minDate.getTime() - 7 * 24 * 60 * 60 * 1000); // one week back
}
ApiClient.getJSON(ApiClient.getUrl("System/ActivityLog/Entries", {
ApiClient.getJSON(ApiClient.getUrl('System/ActivityLog/Entries', {
startIndex: startIndex,
limit: limit,
minDate: minDate.toISOString(),
hasUserId: hasUserId
})).then(function (result) {
elem.setAttribute("data-activitystartindex", startIndex);
elem.setAttribute("data-activitylimit", limit);
elem.setAttribute('data-activitystartindex', startIndex);
elem.setAttribute('data-activitylimit', limit);
if (!startIndex) {
var activityContainer = dom.parentWithClass(elem, "activityContainer");
var activityContainer = dom.parentWithClass(elem, 'activityContainer');
if (activityContainer) {
if (result.Items.length) {
activityContainer.classList.remove("hide");
activityContainer.classList.remove('hide');
} else {
activityContainer.classList.add("hide");
activityContainer.classList.add('hide');
}
}
}
@ -95,10 +95,10 @@ define(["events", "globalize", "dom", "date-fns", "dfnshelper", "userSettings",
}
function onListClick(e) {
var btnEntryInfo = dom.parentWithClass(e.target, "btnEntryInfo");
var btnEntryInfo = dom.parentWithClass(e.target, 'btnEntryInfo');
if (btnEntryInfo) {
var id = btnEntryInfo.getAttribute("data-id");
var id = btnEntryInfo.getAttribute('data-id');
var items = this.items;
if (items) {
@ -114,7 +114,7 @@ define(["events", "globalize", "dom", "date-fns", "dfnshelper", "userSettings",
}
function showItemOverview(item) {
require(["alert"], function (alert) {
require(['alert'], function (alert) {
alert({
text: item.Overview
});
@ -124,28 +124,28 @@ define(["events", "globalize", "dom", "date-fns", "dfnshelper", "userSettings",
function ActivityLog(options) {
this.options = options;
var element = options.element;
element.classList.add("activityLogListWidget");
element.addEventListener("click", onListClick.bind(this));
element.classList.add('activityLogListWidget');
element.addEventListener('click', onListClick.bind(this));
var apiClient = connectionManager.getApiClient(options.serverId);
reloadData(this, element, apiClient);
var onUpdate = onActivityLogUpdate.bind(this);
this.updateFn = onUpdate;
events.on(serverNotifications, "ActivityLogEntry", onUpdate);
apiClient.sendMessage("ActivityLogEntryStart", "0,1500");
events.on(serverNotifications, 'ActivityLogEntry', onUpdate);
apiClient.sendMessage('ActivityLogEntryStart', '0,1500');
}
ActivityLog.prototype.destroy = function () {
var options = this.options;
if (options) {
options.element.classList.remove("activityLogListWidget");
connectionManager.getApiClient(options.serverId).sendMessage("ActivityLogEntryStop", "0,1500");
options.element.classList.remove('activityLogListWidget');
connectionManager.getApiClient(options.serverId).sendMessage('ActivityLogEntryStop', '0,1500');
}
var onUpdate = this.updateFn;
if (onUpdate) {
events.off(serverNotifications, "ActivityLogEntry", onUpdate);
events.off(serverNotifications, 'ActivityLogEntry', onUpdate);
}
this.items = null;