mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
run eslint to fix most var instances
This commit is contained in:
parent
24699c0aca
commit
39eddeb205
55 changed files with 614 additions and 614 deletions
|
@ -32,7 +32,7 @@ function onOpen() {
|
|||
const playerId = localStorage.getItem('autocastPlayerId');
|
||||
|
||||
playbackManager.getTargets().then(function (targets) {
|
||||
for (var i = 0; i < targets.length; i++) {
|
||||
for (let i = 0; i < targets.length; i++) {
|
||||
if (targets[i].id == playerId) {
|
||||
playbackManager.trySetActivePlayer(targets[i].playerName, targets[i]);
|
||||
break;
|
||||
|
|
|
@ -23,7 +23,7 @@ define(['browser'], function (browser) {
|
|||
videoTestElement.canPlayType('video/mp4; codecs="hev1.1.0.L120"').replace(/no/, ''));
|
||||
}
|
||||
|
||||
var _supportsTextTracks;
|
||||
let _supportsTextTracks;
|
||||
function supportsTextTracks() {
|
||||
if (browser.tizen) {
|
||||
return true;
|
||||
|
@ -37,7 +37,7 @@ define(['browser'], function (browser) {
|
|||
return _supportsTextTracks;
|
||||
}
|
||||
|
||||
var _canPlayHls;
|
||||
let _canPlayHls;
|
||||
function canPlayHls() {
|
||||
if (_canPlayHls == null) {
|
||||
_canPlayHls = canPlayNativeHls() || canPlayHlsWithMSE();
|
||||
|
@ -51,7 +51,7 @@ define(['browser'], function (browser) {
|
|||
return true;
|
||||
}
|
||||
|
||||
var media = document.createElement('video');
|
||||
const media = document.createElement('video');
|
||||
if (media.canPlayType('application/x-mpegURL').replace(/no/, '') ||
|
||||
media.canPlayType('application/vnd.apple.mpegURL').replace(/no/, '')) {
|
||||
return true;
|
||||
|
@ -107,7 +107,7 @@ define(['browser'], function (browser) {
|
|||
}
|
||||
|
||||
function canPlayAudioFormat(format) {
|
||||
var typeString;
|
||||
let typeString;
|
||||
|
||||
if (format === 'flac') {
|
||||
if (browser.tizen || browser.web0s || browser.edgeUwp) {
|
||||
|
@ -192,9 +192,9 @@ define(['browser'], function (browser) {
|
|||
}
|
||||
|
||||
function getDirectPlayProfileForVideoContainer(container, videoAudioCodecs, videoTestElement, options) {
|
||||
var supported = false;
|
||||
var profileContainer = container;
|
||||
var videoCodecs = [];
|
||||
let supported = false;
|
||||
let profileContainer = container;
|
||||
const videoCodecs = [];
|
||||
|
||||
switch (container) {
|
||||
case 'asf':
|
||||
|
@ -277,10 +277,10 @@ define(['browser'], function (browser) {
|
|||
}
|
||||
|
||||
function getGlobalMaxVideoBitrate() {
|
||||
var isTizenFhd = false;
|
||||
let isTizenFhd = false;
|
||||
if (browser.tizen) {
|
||||
try {
|
||||
var isTizenUhd = webapis.productinfo.isUdPanelSupported();
|
||||
const isTizenUhd = webapis.productinfo.isUdPanelSupported();
|
||||
isTizenFhd = !isTizenUhd;
|
||||
console.debug('isTizenFhd = ' + isTizenFhd);
|
||||
} catch (error) {
|
||||
|
@ -297,19 +297,19 @@ define(['browser'], function (browser) {
|
|||
return function (options) {
|
||||
options = options || {};
|
||||
|
||||
var physicalAudioChannels = options.audioChannels || (browser.tv || browser.ps4 || browser.xboxOne ? 6 : 2);
|
||||
const physicalAudioChannels = options.audioChannels || (browser.tv || browser.ps4 || browser.xboxOne ? 6 : 2);
|
||||
|
||||
var bitrateSetting = getMaxBitrate();
|
||||
const bitrateSetting = getMaxBitrate();
|
||||
|
||||
var videoTestElement = document.createElement('video');
|
||||
const videoTestElement = document.createElement('video');
|
||||
|
||||
var canPlayVp8 = videoTestElement.canPlayType('video/webm; codecs="vp8"').replace(/no/, '');
|
||||
var canPlayVp9 = videoTestElement.canPlayType('video/webm; codecs="vp9"').replace(/no/, '');
|
||||
var webmAudioCodecs = ['vorbis'];
|
||||
const canPlayVp8 = videoTestElement.canPlayType('video/webm; codecs="vp8"').replace(/no/, '');
|
||||
const canPlayVp9 = videoTestElement.canPlayType('video/webm; codecs="vp9"').replace(/no/, '');
|
||||
const webmAudioCodecs = ['vorbis'];
|
||||
|
||||
var canPlayMkv = testCanPlayMkv(videoTestElement);
|
||||
const canPlayMkv = testCanPlayMkv(videoTestElement);
|
||||
|
||||
var profile = {};
|
||||
const profile = {};
|
||||
|
||||
profile.MaxStreamingBitrate = bitrateSetting;
|
||||
profile.MaxStaticBitrate = 100000000;
|
||||
|
@ -317,18 +317,18 @@ define(['browser'], function (browser) {
|
|||
|
||||
profile.DirectPlayProfiles = [];
|
||||
|
||||
var videoAudioCodecs = [];
|
||||
var hlsVideoAudioCodecs = [];
|
||||
let videoAudioCodecs = [];
|
||||
let hlsVideoAudioCodecs = [];
|
||||
|
||||
var supportsMp3VideoAudio = videoTestElement.canPlayType('video/mp4; codecs="avc1.640029, mp4a.69"').replace(/no/, '')
|
||||
const supportsMp3VideoAudio = videoTestElement.canPlayType('video/mp4; codecs="avc1.640029, mp4a.69"').replace(/no/, '')
|
||||
|| videoTestElement.canPlayType('video/mp4; codecs="avc1.640029, mp4a.6B"').replace(/no/, '')
|
||||
|| videoTestElement.canPlayType('video/mp4; codecs="avc1.640029, mp3"').replace(/no/, '');
|
||||
|
||||
// Not sure how to test for this
|
||||
var supportsMp2VideoAudio = browser.edgeUwp || browser.tizen || browser.web0s;
|
||||
const supportsMp2VideoAudio = browser.edgeUwp || browser.tizen || browser.web0s;
|
||||
|
||||
/* eslint-disable compat/compat */
|
||||
var maxVideoWidth = browser.xboxOne ?
|
||||
let maxVideoWidth = browser.xboxOne ?
|
||||
(window.screen ? window.screen.width : null) :
|
||||
null;
|
||||
|
||||
|
@ -337,7 +337,7 @@ define(['browser'], function (browser) {
|
|||
maxVideoWidth = options.maxVideoWidth;
|
||||
}
|
||||
|
||||
var canPlayAacVideoAudio = videoTestElement.canPlayType('video/mp4; codecs="avc1.640029, mp4a.40.2"').replace(/no/, '');
|
||||
const canPlayAacVideoAudio = videoTestElement.canPlayType('video/mp4; codecs="avc1.640029, mp4a.40.2"').replace(/no/, '');
|
||||
|
||||
// Only put mp3 first if mkv support is there
|
||||
// Otherwise with HLS and mp3 audio we're seeing some browsers
|
||||
|
@ -345,7 +345,7 @@ define(['browser'], function (browser) {
|
|||
if (supportsAc3(videoTestElement)) {
|
||||
videoAudioCodecs.push('ac3');
|
||||
|
||||
var eAc3 = supportsEac3(videoTestElement);
|
||||
const eAc3 = supportsEac3(videoTestElement);
|
||||
if (eAc3) {
|
||||
videoAudioCodecs.push('eac3');
|
||||
}
|
||||
|
@ -394,7 +394,7 @@ define(['browser'], function (browser) {
|
|||
videoAudioCodecs.push('mp2');
|
||||
}
|
||||
|
||||
var supportsDts = browser.tizen || browser.web0s || options.supportsDts || videoTestElement.canPlayType('video/mp4; codecs="dts-"').replace(/no/, '') || videoTestElement.canPlayType('video/mp4; codecs="dts+"').replace(/no/, '');
|
||||
let supportsDts = browser.tizen || browser.web0s || options.supportsDts || videoTestElement.canPlayType('video/mp4; codecs="dts-"').replace(/no/, '') || videoTestElement.canPlayType('video/mp4; codecs="dts+"').replace(/no/, '');
|
||||
|
||||
// DTS audio not supported in 2018 models (Tizen 4.0)
|
||||
if (browser.tizenVersion >= 4) {
|
||||
|
@ -437,9 +437,9 @@ define(['browser'], function (browser) {
|
|||
return (options.disableHlsVideoAudioCodecs || []).indexOf(c) === -1;
|
||||
});
|
||||
|
||||
var mp4VideoCodecs = [];
|
||||
var webmVideoCodecs = [];
|
||||
var hlsVideoCodecs = [];
|
||||
const mp4VideoCodecs = [];
|
||||
const webmVideoCodecs = [];
|
||||
const hlsVideoCodecs = [];
|
||||
|
||||
if (canPlayH264(videoTestElement)) {
|
||||
mp4VideoCodecs.push('h264');
|
||||
|
@ -555,7 +555,7 @@ define(['browser'], function (browser) {
|
|||
|
||||
profile.TranscodingProfiles = [];
|
||||
|
||||
var hlsBreakOnNonKeyFrames = browser.iOS || browser.osx || browser.edge || !canPlayNativeHls() ? true : false;
|
||||
const hlsBreakOnNonKeyFrames = browser.iOS || browser.osx || browser.edge || !canPlayNativeHls() ? true : false;
|
||||
|
||||
if (canPlayHls() && browser.enableHlsAudio !== false) {
|
||||
profile.TranscodingProfiles.push({
|
||||
|
@ -661,9 +661,9 @@ define(['browser'], function (browser) {
|
|||
|
||||
profile.CodecProfiles = [];
|
||||
|
||||
var supportsSecondaryAudio = browser.tizen || videoTestElement.audioTracks;
|
||||
const supportsSecondaryAudio = browser.tizen || videoTestElement.audioTracks;
|
||||
|
||||
var aacCodecProfileConditions = [];
|
||||
const aacCodecProfileConditions = [];
|
||||
|
||||
// Handle he-aac not supported
|
||||
if (!videoTestElement.canPlayType('video/mp4; codecs="avc1.640029, mp4a.40.5"').replace(/no/, '')) {
|
||||
|
@ -706,8 +706,8 @@ define(['browser'], function (browser) {
|
|||
});
|
||||
}
|
||||
|
||||
var maxH264Level = 42;
|
||||
var h264Profiles = 'high|main|baseline|constrained baseline';
|
||||
let maxH264Level = 42;
|
||||
let h264Profiles = 'high|main|baseline|constrained baseline';
|
||||
|
||||
if (browser.tizen || browser.web0s ||
|
||||
videoTestElement.canPlayType('video/mp4; codecs="avc1.640833"').replace(/no/, '')) {
|
||||
|
@ -766,9 +766,9 @@ define(['browser'], function (browser) {
|
|||
});
|
||||
}
|
||||
|
||||
var globalMaxVideoBitrate = (getGlobalMaxVideoBitrate() || '').toString();
|
||||
const globalMaxVideoBitrate = (getGlobalMaxVideoBitrate() || '').toString();
|
||||
|
||||
var h264MaxVideoBitrate = globalMaxVideoBitrate;
|
||||
const h264MaxVideoBitrate = globalMaxVideoBitrate;
|
||||
|
||||
if (h264MaxVideoBitrate) {
|
||||
h264CodecProfileConditions.push({
|
||||
|
@ -806,7 +806,7 @@ define(['browser'], function (browser) {
|
|||
Conditions: h264CodecProfileConditions
|
||||
});
|
||||
|
||||
var globalVideoConditions = [];
|
||||
const globalVideoConditions = [];
|
||||
|
||||
if (globalMaxVideoBitrate) {
|
||||
globalVideoConditions.push({
|
||||
|
|
|
@ -5,8 +5,8 @@ import 'material-icons';
|
|||
/* eslint-disable indent */
|
||||
|
||||
function getNode(item, folderState, selected) {
|
||||
var htmlName = getNodeInnerHtml(item);
|
||||
var node = {
|
||||
const htmlName = getNodeInnerHtml(item);
|
||||
const node = {
|
||||
id: item.Id,
|
||||
text: htmlName,
|
||||
state: {
|
||||
|
@ -37,14 +37,14 @@ import 'material-icons';
|
|||
}
|
||||
|
||||
function getNodeInnerHtml(item) {
|
||||
var name = item.Name;
|
||||
let name = item.Name;
|
||||
if (item.Number) {
|
||||
name = item.Number + ' - ' + name;
|
||||
}
|
||||
if (item.IndexNumber != null && item.Type != 'Season') {
|
||||
name = item.IndexNumber + ' - ' + name;
|
||||
}
|
||||
var htmlName = "<div class='editorNode'>";
|
||||
let htmlName = "<div class='editorNode'>";
|
||||
if (item.IsFolder) {
|
||||
htmlName += '<span class="material-icons metadataSidebarIcon folder"></span>';
|
||||
} else if (item.MediaType === 'Video') {
|
||||
|
@ -70,7 +70,7 @@ import 'material-icons';
|
|||
ApiClient.getLiveTvChannels({
|
||||
limit: 0
|
||||
}).then(function (result) {
|
||||
var nodes = [];
|
||||
const nodes = [];
|
||||
nodes.push({
|
||||
id: 'MediaFolders',
|
||||
text: globalize.translate('HeaderMediaFolders'),
|
||||
|
@ -110,8 +110,8 @@ import 'material-icons';
|
|||
ServiceName: service,
|
||||
AddCurrentProgram: false
|
||||
}).then(function (result) {
|
||||
var nodes = result.Items.map(function (i) {
|
||||
var state = openItems.indexOf(i.Id) == -1 ? 'closed' : 'open';
|
||||
const nodes = result.Items.map(function (i) {
|
||||
const state = openItems.indexOf(i.Id) == -1 ? 'closed' : 'open';
|
||||
return getNode(i, state, false);
|
||||
});
|
||||
callback(nodes);
|
||||
|
@ -120,12 +120,12 @@ import 'material-icons';
|
|||
|
||||
function loadMediaFolders(page, scope, openItems, callback) {
|
||||
ApiClient.getJSON(ApiClient.getUrl('Library/MediaFolders')).then(function (result) {
|
||||
var nodes = result.Items.map(function (n) {
|
||||
var state = openItems.indexOf(n.Id) == -1 ? 'closed' : 'open';
|
||||
const nodes = result.Items.map(function (n) {
|
||||
const state = openItems.indexOf(n.Id) == -1 ? 'closed' : 'open';
|
||||
return getNode(n, state, false);
|
||||
});
|
||||
callback.call(scope, nodes);
|
||||
for (var i = 0, length = nodes.length; i < length; i++) {
|
||||
for (let i = 0, length = nodes.length; i < length; i++) {
|
||||
if (nodes[i].state.opened) {
|
||||
nodesToLoad.push(nodes[i].id);
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ import 'material-icons';
|
|||
}
|
||||
|
||||
function loadNode(page, scope, node, openItems, selectedId, currentUser, callback) {
|
||||
var id = node.id;
|
||||
const id = node.id;
|
||||
if (id == '#') {
|
||||
loadChildrenOfRootNode(page, scope, callback);
|
||||
return;
|
||||
|
@ -147,7 +147,7 @@ import 'material-icons';
|
|||
loadMediaFolders(page, scope, openItems, callback);
|
||||
return;
|
||||
}
|
||||
var query = {
|
||||
const query = {
|
||||
ParentId: id,
|
||||
Fields: 'Settings',
|
||||
IsVirtualUnaired: false,
|
||||
|
@ -156,17 +156,17 @@ import 'material-icons';
|
|||
EnableImages: false,
|
||||
EnableUserData: false
|
||||
};
|
||||
var itemtype = node.li_attr.itemtype;
|
||||
const itemtype = node.li_attr.itemtype;
|
||||
if (itemtype != 'Season' && itemtype != 'Series') {
|
||||
query.SortBy = 'SortName';
|
||||
}
|
||||
ApiClient.getItems(Dashboard.getCurrentUserId(), query).then(function (result) {
|
||||
var nodes = result.Items.map(function (n) {
|
||||
var state = openItems.indexOf(n.Id) == -1 ? 'closed' : 'open';
|
||||
const nodes = result.Items.map(function (n) {
|
||||
const state = openItems.indexOf(n.Id) == -1 ? 'closed' : 'open';
|
||||
return getNode(n, state, n.Id == selectedId);
|
||||
});
|
||||
callback.call(scope, nodes);
|
||||
for (var i = 0, length = nodes.length; i < length; i++) {
|
||||
for (let i = 0, length = nodes.length; i < length; i++) {
|
||||
if (nodes[i].state.opened) {
|
||||
nodesToLoad.push(nodes[i].id);
|
||||
}
|
||||
|
@ -175,7 +175,7 @@ import 'material-icons';
|
|||
}
|
||||
|
||||
function scrollToNode(id) {
|
||||
var elem = $('#' + id)[0];
|
||||
const elem = $('#' + id)[0];
|
||||
if (elem) {
|
||||
elem.scrollIntoView();
|
||||
}
|
||||
|
@ -188,8 +188,8 @@ import 'material-icons';
|
|||
}
|
||||
|
||||
function onNodeSelect(event, data) {
|
||||
var node = data.node;
|
||||
var eventData = {
|
||||
const node = data.node;
|
||||
const eventData = {
|
||||
id: node.id,
|
||||
itemType: node.li_attr.itemtype,
|
||||
serverItemType: node.li_attr.serveritemtype,
|
||||
|
@ -210,8 +210,8 @@ import 'material-icons';
|
|||
}
|
||||
|
||||
function onNodeOpen(event, data) {
|
||||
var page = $(this).parents('.page')[0];
|
||||
var node = data.node;
|
||||
const page = $(this).parents('.page')[0];
|
||||
const node = data.node;
|
||||
if (node.children) {
|
||||
loadNodesToLoad(page, node);
|
||||
}
|
||||
|
@ -222,8 +222,8 @@ import 'material-icons';
|
|||
}
|
||||
|
||||
function onNodeLoad(event, data) {
|
||||
var page = $(this).parents('.page')[0];
|
||||
var node = data.node;
|
||||
const page = $(this).parents('.page')[0];
|
||||
const node = data.node;
|
||||
if (node.children) {
|
||||
loadNodesToLoad(page, node);
|
||||
}
|
||||
|
@ -252,8 +252,8 @@ import 'material-icons';
|
|||
}
|
||||
|
||||
function loadNodesToLoad(page, node) {
|
||||
var children = node.children;
|
||||
for (var i = 0, length = children.length; i < length; i++) {
|
||||
const children = node.children;
|
||||
for (let i = 0, length = children.length; i < length; i++) {
|
||||
var child = children[i];
|
||||
if (nodesToLoad.indexOf(child) != -1) {
|
||||
nodesToLoad = nodesToLoad.filter(function (n) {
|
||||
|
@ -273,15 +273,15 @@ import 'material-icons';
|
|||
}
|
||||
|
||||
function updateEditorNode(page, item) {
|
||||
var elem = $('#' + item.Id + '>a', page)[0];
|
||||
const elem = $('#' + item.Id + '>a', page)[0];
|
||||
if (elem == null) {
|
||||
return;
|
||||
}
|
||||
$('.editorNode', elem).remove();
|
||||
$(elem).append(getNodeInnerHtml(item));
|
||||
if (item.IsFolder) {
|
||||
var tree = jQuery.jstree._reference('.libraryTree');
|
||||
var currentNode = tree._get_node(null, false);
|
||||
const tree = jQuery.jstree._reference('.libraryTree');
|
||||
const currentNode = tree._get_node(null, false);
|
||||
tree.refresh(currentNode);
|
||||
}
|
||||
}
|
||||
|
@ -294,23 +294,23 @@ import 'material-icons';
|
|||
if (itemId) {
|
||||
return itemId;
|
||||
}
|
||||
var url = window.location.hash || window.location.href;
|
||||
const url = window.location.hash || window.location.href;
|
||||
return getParameterByName('id', url);
|
||||
}
|
||||
var nodesToLoad = [];
|
||||
var selectedNodeId;
|
||||
let selectedNodeId;
|
||||
$(document).on('itemsaved', '.metadataEditorPage', function (e, item) {
|
||||
updateEditorNode(this, item);
|
||||
}).on('pagebeforeshow', '.metadataEditorPage', function () {
|
||||
/* eslint-disable-next-line @babel/no-unused-expressions */
|
||||
import('css!assets/css/metadataeditor.css');
|
||||
}).on('pagebeforeshow', '.metadataEditorPage', function () {
|
||||
var page = this;
|
||||
const page = this;
|
||||
Dashboard.getCurrentUser().then(function (user) {
|
||||
var id = getCurrentItemId();
|
||||
const id = getCurrentItemId();
|
||||
if (id) {
|
||||
ApiClient.getAncestorItems(id, user.Id).then(function (ancestors) {
|
||||
var ids = ancestors.map(function (i) {
|
||||
const ids = ancestors.map(function (i) {
|
||||
return i.Id;
|
||||
});
|
||||
initializeTree(page, user, ids, id);
|
||||
|
@ -320,13 +320,13 @@ import 'material-icons';
|
|||
}
|
||||
});
|
||||
}).on('pagebeforehide', '.metadataEditorPage', function () {
|
||||
var page = this;
|
||||
const page = this;
|
||||
$('.libraryTree', page).off('select_node.jstree', onNodeSelect).off('open_node.jstree', onNodeOpen).off('load_node.jstree', onNodeLoad);
|
||||
});
|
||||
var itemId;
|
||||
let itemId;
|
||||
window.MetadataEditor = {
|
||||
getItemPromise: function () {
|
||||
var currentItemId = getCurrentItemId();
|
||||
const currentItemId = getCurrentItemId();
|
||||
if (currentItemId) {
|
||||
return ApiClient.getItem(Dashboard.getCurrentUserId(), currentItemId);
|
||||
}
|
||||
|
|
|
@ -22,47 +22,47 @@
|
|||
|
||||
import appHost from 'apphost';
|
||||
|
||||
var _GAMEPAD_A_BUTTON_INDEX = 0;
|
||||
var _GAMEPAD_B_BUTTON_INDEX = 1;
|
||||
var _GAMEPAD_DPAD_UP_BUTTON_INDEX = 12;
|
||||
var _GAMEPAD_DPAD_DOWN_BUTTON_INDEX = 13;
|
||||
var _GAMEPAD_DPAD_LEFT_BUTTON_INDEX = 14;
|
||||
var _GAMEPAD_DPAD_RIGHT_BUTTON_INDEX = 15;
|
||||
var _GAMEPAD_A_KEY = 'GamepadA';
|
||||
var _GAMEPAD_B_KEY = 'GamepadB';
|
||||
var _GAMEPAD_DPAD_UP_KEY = 'GamepadDPadUp';
|
||||
var _GAMEPAD_DPAD_DOWN_KEY = 'GamepadDPadDown';
|
||||
var _GAMEPAD_DPAD_LEFT_KEY = 'GamepadDPadLeft';
|
||||
var _GAMEPAD_DPAD_RIGHT_KEY = 'GamepadDPadRight';
|
||||
var _GAMEPAD_LEFT_THUMBSTICK_UP_KEY = 'GamepadLeftThumbStickUp';
|
||||
var _GAMEPAD_LEFT_THUMBSTICK_DOWN_KEY = 'GamepadLeftThumbStickDown';
|
||||
var _GAMEPAD_LEFT_THUMBSTICK_LEFT_KEY = 'GamepadLeftThumbStickLeft';
|
||||
var _GAMEPAD_LEFT_THUMBSTICK_RIGHT_KEY = 'GamepadLeftThumbStickRight';
|
||||
var _GAMEPAD_A_KEYCODE = 0;
|
||||
var _GAMEPAD_B_KEYCODE = 27;
|
||||
var _GAMEPAD_DPAD_UP_KEYCODE = 38;
|
||||
var _GAMEPAD_DPAD_DOWN_KEYCODE = 40;
|
||||
var _GAMEPAD_DPAD_LEFT_KEYCODE = 37;
|
||||
var _GAMEPAD_DPAD_RIGHT_KEYCODE = 39;
|
||||
var _GAMEPAD_LEFT_THUMBSTICK_UP_KEYCODE = 38;
|
||||
var _GAMEPAD_LEFT_THUMBSTICK_DOWN_KEYCODE = 40;
|
||||
var _GAMEPAD_LEFT_THUMBSTICK_LEFT_KEYCODE = 37;
|
||||
var _GAMEPAD_LEFT_THUMBSTICK_RIGHT_KEYCODE = 39;
|
||||
var _THUMB_STICK_THRESHOLD = 0.75;
|
||||
const _GAMEPAD_A_BUTTON_INDEX = 0;
|
||||
const _GAMEPAD_B_BUTTON_INDEX = 1;
|
||||
const _GAMEPAD_DPAD_UP_BUTTON_INDEX = 12;
|
||||
const _GAMEPAD_DPAD_DOWN_BUTTON_INDEX = 13;
|
||||
const _GAMEPAD_DPAD_LEFT_BUTTON_INDEX = 14;
|
||||
const _GAMEPAD_DPAD_RIGHT_BUTTON_INDEX = 15;
|
||||
const _GAMEPAD_A_KEY = 'GamepadA';
|
||||
const _GAMEPAD_B_KEY = 'GamepadB';
|
||||
const _GAMEPAD_DPAD_UP_KEY = 'GamepadDPadUp';
|
||||
const _GAMEPAD_DPAD_DOWN_KEY = 'GamepadDPadDown';
|
||||
const _GAMEPAD_DPAD_LEFT_KEY = 'GamepadDPadLeft';
|
||||
const _GAMEPAD_DPAD_RIGHT_KEY = 'GamepadDPadRight';
|
||||
const _GAMEPAD_LEFT_THUMBSTICK_UP_KEY = 'GamepadLeftThumbStickUp';
|
||||
const _GAMEPAD_LEFT_THUMBSTICK_DOWN_KEY = 'GamepadLeftThumbStickDown';
|
||||
const _GAMEPAD_LEFT_THUMBSTICK_LEFT_KEY = 'GamepadLeftThumbStickLeft';
|
||||
const _GAMEPAD_LEFT_THUMBSTICK_RIGHT_KEY = 'GamepadLeftThumbStickRight';
|
||||
const _GAMEPAD_A_KEYCODE = 0;
|
||||
const _GAMEPAD_B_KEYCODE = 27;
|
||||
const _GAMEPAD_DPAD_UP_KEYCODE = 38;
|
||||
const _GAMEPAD_DPAD_DOWN_KEYCODE = 40;
|
||||
const _GAMEPAD_DPAD_LEFT_KEYCODE = 37;
|
||||
const _GAMEPAD_DPAD_RIGHT_KEYCODE = 39;
|
||||
const _GAMEPAD_LEFT_THUMBSTICK_UP_KEYCODE = 38;
|
||||
const _GAMEPAD_LEFT_THUMBSTICK_DOWN_KEYCODE = 40;
|
||||
const _GAMEPAD_LEFT_THUMBSTICK_LEFT_KEYCODE = 37;
|
||||
const _GAMEPAD_LEFT_THUMBSTICK_RIGHT_KEYCODE = 39;
|
||||
const _THUMB_STICK_THRESHOLD = 0.75;
|
||||
|
||||
var _leftThumbstickUpPressed = false;
|
||||
var _leftThumbstickDownPressed = false;
|
||||
var _leftThumbstickLeftPressed = false;
|
||||
var _leftThumbstickRightPressed = false;
|
||||
var _dPadUpPressed = false;
|
||||
var _dPadDownPressed = false;
|
||||
var _dPadLeftPressed = false;
|
||||
var _dPadRightPressed = false;
|
||||
var _gamepadAPressed = false;
|
||||
var _gamepadBPressed = false;
|
||||
let _leftThumbstickUpPressed = false;
|
||||
let _leftThumbstickDownPressed = false;
|
||||
let _leftThumbstickLeftPressed = false;
|
||||
let _leftThumbstickRightPressed = false;
|
||||
let _dPadUpPressed = false;
|
||||
let _dPadDownPressed = false;
|
||||
let _dPadLeftPressed = false;
|
||||
let _dPadRightPressed = false;
|
||||
let _gamepadAPressed = false;
|
||||
let _gamepadBPressed = false;
|
||||
|
||||
// The set of buttons on the gamepad we listen for.
|
||||
var ProcessedButtons = [
|
||||
const ProcessedButtons = [
|
||||
_GAMEPAD_DPAD_UP_BUTTON_INDEX,
|
||||
_GAMEPAD_DPAD_DOWN_BUTTON_INDEX,
|
||||
_GAMEPAD_DPAD_LEFT_BUTTON_INDEX,
|
||||
|
@ -71,7 +71,7 @@ var ProcessedButtons = [
|
|||
_GAMEPAD_B_BUTTON_INDEX
|
||||
];
|
||||
|
||||
var _ButtonPressedState = {};
|
||||
const _ButtonPressedState = {};
|
||||
_ButtonPressedState.getgamepadA = function () {
|
||||
return _gamepadAPressed;
|
||||
};
|
||||
|
@ -162,11 +162,11 @@ _ButtonPressedState.setdPadRight = function (newPressedState) {
|
|||
_dPadRightPressed = newPressedState;
|
||||
};
|
||||
|
||||
var times = {};
|
||||
const times = {};
|
||||
|
||||
function throttle(key) {
|
||||
var time = times[key] || 0;
|
||||
var now = new Date().getTime();
|
||||
const time = times[key] || 0;
|
||||
const now = new Date().getTime();
|
||||
|
||||
if ((now - time) >= 200) {
|
||||
//times[key] = now;
|
||||
|
@ -180,7 +180,7 @@ function resetThrottle(key) {
|
|||
times[key] = new Date().getTime();
|
||||
}
|
||||
|
||||
var isElectron = navigator.userAgent.toLowerCase().indexOf('electron') !== -1;
|
||||
const isElectron = navigator.userAgent.toLowerCase().indexOf('electron') !== -1;
|
||||
function allowInput() {
|
||||
// This would be nice but always seems to return true with electron
|
||||
if (!isElectron && document.hidden) { /* eslint-disable-line compat/compat */
|
||||
|
@ -199,7 +199,7 @@ function raiseEvent(name, key, keyCode) {
|
|||
return;
|
||||
}
|
||||
|
||||
var event = document.createEvent('Event');
|
||||
const event = document.createEvent('Event');
|
||||
event.initEvent(name, true, true);
|
||||
event.key = key;
|
||||
event.keyCode = keyCode;
|
||||
|
@ -218,7 +218,7 @@ function raiseKeyEvent(oldPressedState, newPressedState, key, keyCode, enableRep
|
|||
// No-op if oldPressedState === newPressedState
|
||||
if (newPressedState === true) {
|
||||
// button down
|
||||
var fire = false;
|
||||
let fire = false;
|
||||
|
||||
// always fire if this is the initial down press
|
||||
if (oldPressedState === false) {
|
||||
|
@ -244,19 +244,19 @@ function raiseKeyEvent(oldPressedState, newPressedState, key, keyCode, enableRep
|
|||
}
|
||||
}
|
||||
|
||||
var inputLoopTimer;
|
||||
let inputLoopTimer;
|
||||
function runInputLoop() {
|
||||
// Get the latest gamepad state.
|
||||
var gamepads = navigator.getGamepads(); /* eslint-disable-line compat/compat */
|
||||
const gamepads = navigator.getGamepads(); /* eslint-disable-line compat/compat */
|
||||
for (var i = 0, len = gamepads.length; i < len; i++) {
|
||||
var gamepad = gamepads[i];
|
||||
const gamepad = gamepads[i];
|
||||
if (!gamepad) {
|
||||
continue;
|
||||
}
|
||||
// Iterate through the axes
|
||||
var axes = gamepad.axes;
|
||||
var leftStickX = axes[0];
|
||||
var leftStickY = axes[1];
|
||||
const axes = gamepad.axes;
|
||||
const leftStickX = axes[0];
|
||||
const leftStickY = axes[1];
|
||||
if (leftStickX > _THUMB_STICK_THRESHOLD) { // Right
|
||||
_ButtonPressedState.setleftThumbstickRight(true);
|
||||
} else if (leftStickX < -_THUMB_STICK_THRESHOLD) { // Left
|
||||
|
@ -272,7 +272,7 @@ function runInputLoop() {
|
|||
_ButtonPressedState.setleftThumbstickDown(false);
|
||||
}
|
||||
// Iterate through the buttons to see if Left thumbstick, DPad, A and B are pressed.
|
||||
var buttons = gamepad.buttons;
|
||||
const buttons = gamepad.buttons;
|
||||
for (var j = 0, len = buttons.length; j < len; j++) {
|
||||
if (ProcessedButtons.indexOf(j) !== -1) {
|
||||
if (buttons[j].pressed) {
|
||||
|
@ -355,9 +355,9 @@ function stopInputLoop() {
|
|||
}
|
||||
|
||||
function isGamepadConnected() {
|
||||
var gamepads = navigator.getGamepads(); /* eslint-disable-line compat/compat */
|
||||
for (var i = 0, len = gamepads.length; i < len; i++) {
|
||||
var gamepad = gamepads[i];
|
||||
const gamepads = navigator.getGamepads(); /* eslint-disable-line compat/compat */
|
||||
for (let i = 0, len = gamepads.length; i < len; i++) {
|
||||
const gamepad = gamepads[i];
|
||||
if (gamepad && gamepad.connected) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
/* eslint-disable indent */
|
||||
|
||||
export function getDeviceIcon(device) {
|
||||
var baseUrl = 'assets/img/devices/';
|
||||
const baseUrl = 'assets/img/devices/';
|
||||
switch (device.AppName || device.Client) {
|
||||
case 'Samsung Smart TV':
|
||||
return baseUrl + 'samsung.svg';
|
||||
|
|
|
@ -6,7 +6,7 @@ export function getSavedQueryKey(modifier) {
|
|||
}
|
||||
|
||||
export function loadSavedQueryValues(key, query) {
|
||||
var values = userSettings.get(key);
|
||||
let values = userSettings.get(key);
|
||||
|
||||
if (values) {
|
||||
values = JSON.parse(values);
|
||||
|
@ -17,7 +17,7 @@ export function loadSavedQueryValues(key, query) {
|
|||
}
|
||||
|
||||
export function saveQueryValues(key, query) {
|
||||
var values = {};
|
||||
const values = {};
|
||||
|
||||
if (query.SortBy) {
|
||||
values.SortBy = query.SortBy;
|
||||
|
@ -39,7 +39,7 @@ export function getSavedView (key) {
|
|||
}
|
||||
|
||||
export function showLayoutMenu (button, currentLayout, views) {
|
||||
var dispatchEvent = true;
|
||||
let dispatchEvent = true;
|
||||
|
||||
if (!views) {
|
||||
dispatchEvent = false;
|
||||
|
@ -47,7 +47,7 @@ export function showLayoutMenu (button, currentLayout, views) {
|
|||
views = views ? views.split(',') : ['List', 'Poster', 'PosterCard', 'Thumb', 'ThumbCard'];
|
||||
}
|
||||
|
||||
var menuItems = views.map(function (v) {
|
||||
const menuItems = views.map(function (v) {
|
||||
return {
|
||||
name: globalize.translate(v),
|
||||
id: v,
|
||||
|
@ -79,12 +79,12 @@ export function showLayoutMenu (button, currentLayout, views) {
|
|||
}
|
||||
|
||||
export function getQueryPagingHtml (options) {
|
||||
var startIndex = options.startIndex;
|
||||
var limit = options.limit;
|
||||
var totalRecordCount = options.totalRecordCount;
|
||||
var html = '';
|
||||
var recordsEnd = Math.min(startIndex + limit, totalRecordCount);
|
||||
var showControls = limit < totalRecordCount;
|
||||
const startIndex = options.startIndex;
|
||||
const limit = options.limit;
|
||||
const totalRecordCount = options.totalRecordCount;
|
||||
let html = '';
|
||||
const recordsEnd = Math.min(startIndex + limit, totalRecordCount);
|
||||
const showControls = limit < totalRecordCount;
|
||||
|
||||
if (html += '<div class="listPaging">', showControls) {
|
||||
html += '<span style="vertical-align:middle;">';
|
||||
|
@ -124,10 +124,10 @@ export function showSortMenu (options) {
|
|||
import('emby-radio')
|
||||
]).then(([{default: dialogHelper}]) => {
|
||||
function onSortByChange() {
|
||||
var newValue = this.value;
|
||||
const newValue = this.value;
|
||||
|
||||
if (this.checked) {
|
||||
var changed = options.query.SortBy != newValue;
|
||||
const changed = options.query.SortBy != newValue;
|
||||
options.query.SortBy = newValue.replace('_', ',');
|
||||
options.query.StartIndex = 0;
|
||||
|
||||
|
@ -138,10 +138,10 @@ export function showSortMenu (options) {
|
|||
}
|
||||
|
||||
function onSortOrderChange() {
|
||||
var newValue = this.value;
|
||||
const newValue = this.value;
|
||||
|
||||
if (this.checked) {
|
||||
var changed = options.query.SortOrder != newValue;
|
||||
const changed = options.query.SortOrder != newValue;
|
||||
options.query.SortOrder = newValue;
|
||||
options.query.StartIndex = 0;
|
||||
|
||||
|
@ -151,7 +151,7 @@ export function showSortMenu (options) {
|
|||
}
|
||||
}
|
||||
|
||||
var dlg = dialogHelper.createDialog({
|
||||
const dlg = dialogHelper.createDialog({
|
||||
removeOnClose: true,
|
||||
modal: false,
|
||||
entryAnimationDuration: 160,
|
||||
|
@ -160,18 +160,18 @@ export function showSortMenu (options) {
|
|||
dlg.classList.add('ui-body-a');
|
||||
dlg.classList.add('background-theme-a');
|
||||
dlg.classList.add('formDialog');
|
||||
var html = '';
|
||||
let html = '';
|
||||
html += '<div style="margin:0;padding:1.25em 1.5em 1.5em;">';
|
||||
html += '<h2 style="margin:0 0 .5em;">';
|
||||
html += globalize.translate('HeaderSortBy');
|
||||
html += '</h2>';
|
||||
var i;
|
||||
var length;
|
||||
var isChecked;
|
||||
let i;
|
||||
let length;
|
||||
let isChecked;
|
||||
html += '<div>';
|
||||
for (i = 0, length = options.items.length; i < length; i++) {
|
||||
var option = options.items[i];
|
||||
var radioValue = option.id.replace(',', '_');
|
||||
const option = options.items[i];
|
||||
const radioValue = option.id.replace(',', '_');
|
||||
isChecked = (options.query.SortBy || '').replace(',', '_') == radioValue ? ' checked' : '';
|
||||
html += '<label class="radio-label-block"><input type="radio" is="emby-radio" name="SortBy" data-id="' + option.id + '" value="' + radioValue + '" class="menuSortBy" ' + isChecked + ' /><span>' + option.name + '</span></label>';
|
||||
}
|
||||
|
@ -189,13 +189,13 @@ export function showSortMenu (options) {
|
|||
html += '</div>';
|
||||
dlg.innerHTML = html;
|
||||
dialogHelper.open(dlg);
|
||||
var sortBys = dlg.querySelectorAll('.menuSortBy');
|
||||
const sortBys = dlg.querySelectorAll('.menuSortBy');
|
||||
|
||||
for (i = 0, length = sortBys.length; i < length; i++) {
|
||||
sortBys[i].addEventListener('change', onSortByChange);
|
||||
}
|
||||
|
||||
var sortOrders = dlg.querySelectorAll('.menuSortOrder');
|
||||
const sortOrders = dlg.querySelectorAll('.menuSortOrder');
|
||||
|
||||
for (i = 0, length = sortOrders.length; i < length; i++) {
|
||||
sortOrders[i].addEventListener('change', onSortOrderChange);
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import browser from 'browser';
|
||||
|
||||
function fallback(urls) {
|
||||
var i = 0;
|
||||
let i = 0;
|
||||
|
||||
(function createIframe() {
|
||||
var frame = document.createElement('iframe');
|
||||
const frame = document.createElement('iframe');
|
||||
frame.style.display = 'none';
|
||||
frame.src = urls[i++];
|
||||
document.documentElement.appendChild(frame);
|
||||
|
@ -28,14 +28,14 @@ function fallback(urls) {
|
|||
}
|
||||
|
||||
function sameDomain(url) {
|
||||
var a = document.createElement('a');
|
||||
const a = document.createElement('a');
|
||||
a.href = url;
|
||||
|
||||
return window.location.hostname === a.hostname && window.location.protocol === a.protocol;
|
||||
}
|
||||
|
||||
function download(url) {
|
||||
var a = document.createElement('a');
|
||||
const a = document.createElement('a');
|
||||
a.download = '';
|
||||
a.href = url;
|
||||
// firefox doesn't support `a.click()`...
|
||||
|
@ -51,7 +51,7 @@ export default function (urls) {
|
|||
return fallback(urls);
|
||||
}
|
||||
|
||||
var delay = 0;
|
||||
let delay = 0;
|
||||
|
||||
urls.forEach(function (url) {
|
||||
// the download init has to be sequential for firefox if the urls are not on the same domain
|
||||
|
|
|
@ -3,7 +3,7 @@ define(['listView'], function (listView) {
|
|||
|
||||
function getFetchPlaylistItemsFn(itemId) {
|
||||
return function () {
|
||||
var query = {
|
||||
const query = {
|
||||
Fields: 'PrimaryImageAspectRatio,UserData',
|
||||
EnableImageTypes: 'Primary,Backdrop,Banner,Thumb',
|
||||
UserId: ApiClient.getCurrentUserId()
|
||||
|
@ -28,7 +28,7 @@ define(['listView'], function (listView) {
|
|||
}
|
||||
|
||||
function init(page, item) {
|
||||
var elem = page.querySelector('#childrenContent .itemsContainer');
|
||||
const elem = page.querySelector('#childrenContent .itemsContainer');
|
||||
elem.classList.add('vertical-list');
|
||||
elem.classList.remove('vertical-wrap');
|
||||
elem.enableDragReordering(true);
|
||||
|
|
|
@ -17,7 +17,7 @@ import 'detailtablecss';
|
|||
console.groupCollapsed('defining core routes');
|
||||
|
||||
function defineRoute(newRoute) {
|
||||
var path = newRoute.alias ? newRoute.alias : newRoute.path;
|
||||
const path = newRoute.alias ? newRoute.alias : newRoute.path;
|
||||
console.debug('defining route: ' + path);
|
||||
newRoute.dictionary = 'core';
|
||||
Emby.Page.addRoute(path, newRoute);
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
window.getWindowLocationSearch = function(win) {
|
||||
'use strict';
|
||||
|
||||
var search = (win || window).location.search;
|
||||
let search = (win || window).location.search;
|
||||
|
||||
if (!search) {
|
||||
var index = window.location.href.indexOf('?');
|
||||
const index = window.location.href.indexOf('?');
|
||||
|
||||
if (index != -1) {
|
||||
search = window.location.href.substring(index);
|
||||
|
@ -18,9 +18,9 @@ window.getParameterByName = function(name, url) {
|
|||
'use strict';
|
||||
|
||||
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
|
||||
var regexS = '[\\?&]' + name + '=([^&#]*)';
|
||||
var regex = new RegExp(regexS, 'i');
|
||||
var results = regex.exec(url || getWindowLocationSearch());
|
||||
const regexS = '[\\?&]' + name + '=([^&#]*)';
|
||||
const regex = new RegExp(regexS, 'i');
|
||||
const results = regex.exec(url || getWindowLocationSearch());
|
||||
|
||||
if (results == null) {
|
||||
return '';
|
||||
|
@ -33,7 +33,7 @@ window.pageClassOn = function(eventName, className, fn) {
|
|||
'use strict';
|
||||
|
||||
document.addEventListener(eventName, function (event) {
|
||||
var target = event.target;
|
||||
const target = event.target;
|
||||
|
||||
if (target.classList.contains(className)) {
|
||||
fn.call(target, event);
|
||||
|
@ -45,7 +45,7 @@ window.pageIdOn = function(eventName, id, fn) {
|
|||
'use strict';
|
||||
|
||||
document.addEventListener(eventName, function (event) {
|
||||
var target = event.target;
|
||||
const target = event.target;
|
||||
|
||||
if (target.id === id) {
|
||||
fn.call(target, event);
|
||||
|
@ -53,7 +53,7 @@ window.pageIdOn = function(eventName, id, fn) {
|
|||
});
|
||||
};
|
||||
|
||||
var AppInfo = {};
|
||||
const AppInfo = {};
|
||||
|
||||
function initClient() {
|
||||
function bindConnectionManagerEvents(connectionManager, events, userSettings) {
|
||||
|
@ -61,7 +61,7 @@ function initClient() {
|
|||
|
||||
window.connectionManager.currentApiClient = function () {
|
||||
if (!localApiClient) {
|
||||
var server = window.connectionManager.getLastUsedServer();
|
||||
const server = window.connectionManager.getLastUsedServer();
|
||||
|
||||
if (server) {
|
||||
localApiClient = window.connectionManager.getApiClient(server.Id);
|
||||
|
@ -86,11 +86,11 @@ function initClient() {
|
|||
return require(['connectionManagerFactory', 'apphost', 'credentialprovider', 'events', 'userSettings'], function (ConnectionManager, appHost, credentialProvider, events, userSettings) {
|
||||
appHost = appHost.default || appHost;
|
||||
|
||||
var credentialProviderInstance = new credentialProvider();
|
||||
var promises = [appHost.init()];
|
||||
const credentialProviderInstance = new credentialProvider();
|
||||
const promises = [appHost.init()];
|
||||
|
||||
return Promise.all(promises).then(function (responses) {
|
||||
var capabilities = Dashboard.capabilities(appHost);
|
||||
const capabilities = Dashboard.capabilities(appHost);
|
||||
|
||||
window.connectionManager = new ConnectionManager(credentialProviderInstance, appHost.appName(), appHost.appVersion(), appHost.deviceName(), appHost.deviceId(), capabilities);
|
||||
|
||||
|
@ -102,7 +102,7 @@ function initClient() {
|
|||
return require(['apiclient', 'clientUtils'], function (apiClientFactory, clientUtils) {
|
||||
console.debug('creating ApiClient singleton');
|
||||
|
||||
var apiClient = new apiClientFactory(Dashboard.serverAddress(), appHost.appName(), appHost.appVersion(), appHost.deviceName(), appHost.deviceId());
|
||||
const apiClient = new apiClientFactory(Dashboard.serverAddress(), appHost.appName(), appHost.appVersion(), appHost.deviceName(), appHost.deviceId());
|
||||
|
||||
apiClient.enableAutomaticNetworking = false;
|
||||
apiClient.manualAddressOnly = true;
|
||||
|
@ -194,7 +194,7 @@ function initClient() {
|
|||
|
||||
require(['clientUtils']);
|
||||
|
||||
var promises = [];
|
||||
const promises = [];
|
||||
if (!window.fetch) {
|
||||
promises.push(require(['fetch']));
|
||||
}
|
||||
|
@ -226,8 +226,8 @@ function initClient() {
|
|||
}
|
||||
|
||||
function loadCoreDictionary(globalize) {
|
||||
var languages = ['ar', 'be-by', 'bg-bg', 'ca', 'cs', 'da', 'de', 'el', 'en-gb', 'en-us', 'es', 'es-ar', 'es-mx', 'fa', 'fi', 'fr', 'fr-ca', 'gsw', 'he', 'hi-in', 'hr', 'hu', 'id', 'it', 'kk', 'ko', 'lt-lt', 'ms', 'nb', 'nl', 'pl', 'pt-br', 'pt-pt', 'ro', 'ru', 'sk', 'sl-si', 'sv', 'tr', 'uk', 'vi', 'zh-cn', 'zh-hk', 'zh-tw'];
|
||||
var translations = languages.map(function (language) {
|
||||
const languages = ['ar', 'be-by', 'bg-bg', 'ca', 'cs', 'da', 'de', 'el', 'en-gb', 'en-us', 'es', 'es-ar', 'es-mx', 'fa', 'fi', 'fr', 'fr-ca', 'gsw', 'he', 'hi-in', 'hr', 'hu', 'id', 'it', 'kk', 'ko', 'lt-lt', 'ms', 'nb', 'nl', 'pl', 'pt-br', 'pt-pt', 'ro', 'ru', 'sk', 'sl-si', 'sv', 'tr', 'uk', 'vi', 'zh-cn', 'zh-hk', 'zh-tw'];
|
||||
const translations = languages.map(function (language) {
|
||||
return {
|
||||
lang: language,
|
||||
path: 'strings/' + language + '.json'
|
||||
|
@ -367,7 +367,7 @@ function initClient() {
|
|||
|
||||
require(['playerSelectionMenu']);
|
||||
|
||||
var apiClient = window.connectionManager && window.connectionManager.currentApiClient();
|
||||
const apiClient = window.connectionManager && window.connectionManager.currentApiClient();
|
||||
if (apiClient) {
|
||||
fetch(apiClient.getUrl('Branding/Css'))
|
||||
.then(function(response) {
|
||||
|
@ -410,8 +410,8 @@ function initClient() {
|
|||
}
|
||||
|
||||
function onWebComponentsReady() {
|
||||
var componentsPath = getComponentsPath();
|
||||
var scriptsPath = getScriptsPath();
|
||||
const componentsPath = getComponentsPath();
|
||||
const scriptsPath = getScriptsPath();
|
||||
|
||||
define('filesystem', [scriptsPath + '/filesystem'], returnFirstDependency);
|
||||
|
||||
|
@ -441,18 +441,18 @@ function initClient() {
|
|||
init();
|
||||
}
|
||||
|
||||
var promise;
|
||||
var localApiClient;
|
||||
let promise;
|
||||
let localApiClient;
|
||||
|
||||
function initRequireJs() {
|
||||
var urlArgs = 'v=' + (window.dashboardVersion || new Date().getDate());
|
||||
const urlArgs = 'v=' + (window.dashboardVersion || new Date().getDate());
|
||||
|
||||
var bowerPath = getBowerPath();
|
||||
var componentsPath = getComponentsPath();
|
||||
var elementsPath = getElementsPath();
|
||||
var scriptsPath = getScriptsPath();
|
||||
const bowerPath = getBowerPath();
|
||||
const componentsPath = getComponentsPath();
|
||||
const elementsPath = getElementsPath();
|
||||
const scriptsPath = getScriptsPath();
|
||||
|
||||
var paths = {
|
||||
const paths = {
|
||||
browserdeviceprofile: 'scripts/browserDeviceProfile',
|
||||
browser: 'scripts/browser',
|
||||
libraryBrowser: 'scripts/libraryBrowser',
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import * as webSettings from 'webSettings';
|
||||
|
||||
var themeStyleElement = document.querySelector('#cssTheme');
|
||||
var currentThemeId;
|
||||
let themeStyleElement = document.querySelector('#cssTheme');
|
||||
let currentThemeId;
|
||||
|
||||
function unloadTheme() {
|
||||
var elem = themeStyleElement;
|
||||
const elem = themeStyleElement;
|
||||
if (elem) {
|
||||
elem.removeAttribute('href');
|
||||
currentThemeId = null;
|
||||
|
@ -17,7 +17,7 @@ function getThemes() {
|
|||
|
||||
function getThemeStylesheetInfo(id) {
|
||||
return getThemes().then(themes => {
|
||||
var theme = themes.find(theme => {
|
||||
const theme = themes.find(theme => {
|
||||
return id ? theme.id === id : theme.default;
|
||||
});
|
||||
|
||||
|
@ -41,7 +41,7 @@ function setTheme(id) {
|
|||
return;
|
||||
}
|
||||
|
||||
var linkUrl = info.stylesheetPath;
|
||||
const linkUrl = info.stylesheetPath;
|
||||
unloadTheme();
|
||||
|
||||
let link = themeStyleElement;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue