mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update var declerations
This commit is contained in:
parent
8ad12fa0bb
commit
39c1b6fa65
2 changed files with 15 additions and 15 deletions
|
@ -12,13 +12,13 @@ import 'emby-button';
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadData() {
|
function loadData() {
|
||||||
var page = this;
|
const page = this;
|
||||||
loading.show();
|
loading.show();
|
||||||
var id = getParameterByName('id');
|
const id = getParameterByName('id');
|
||||||
var promise1 = ApiClient.getJSON(ApiClient.getUrl('Devices/Info', {
|
const promise1 = ApiClient.getJSON(ApiClient.getUrl('Devices/Info', {
|
||||||
Id: id
|
Id: id
|
||||||
}));
|
}));
|
||||||
var promise2 = ApiClient.getJSON(ApiClient.getUrl('Devices/Options', {
|
const promise2 = ApiClient.getJSON(ApiClient.getUrl('Devices/Options', {
|
||||||
Id: id
|
Id: id
|
||||||
}));
|
}));
|
||||||
Promise.all([promise1, promise2]).then(function (responses) {
|
Promise.all([promise1, promise2]).then(function (responses) {
|
||||||
|
@ -28,7 +28,7 @@ import 'emby-button';
|
||||||
}
|
}
|
||||||
|
|
||||||
function save(page) {
|
function save(page) {
|
||||||
var id = getParameterByName('id');
|
const id = getParameterByName('id');
|
||||||
ApiClient.ajax({
|
ApiClient.ajax({
|
||||||
url: ApiClient.getUrl('Devices/Options', {
|
url: ApiClient.getUrl('Devices/Options', {
|
||||||
Id: id
|
Id: id
|
||||||
|
@ -42,7 +42,7 @@ import 'emby-button';
|
||||||
}
|
}
|
||||||
|
|
||||||
function onSubmit(e) {
|
function onSubmit(e) {
|
||||||
var form = this;
|
const form = this;
|
||||||
save(dom.parentWithClass(form, 'page'));
|
save(dom.parentWithClass(form, 'page'));
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
return false;
|
return false;
|
||||||
|
@ -51,6 +51,6 @@ import 'emby-button';
|
||||||
export default function (view, params) {
|
export default function (view, params) {
|
||||||
view.querySelector('form').addEventListener('submit', onSubmit);
|
view.querySelector('form').addEventListener('submit', onSubmit);
|
||||||
view.addEventListener('viewshow', loadData);
|
view.addEventListener('viewshow', loadData);
|
||||||
};
|
}
|
||||||
|
|
||||||
/* eslint-enable indent */
|
/* eslint-enable indent */
|
||||||
|
|
|
@ -16,7 +16,7 @@ import 'cardStyle';
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteDevice(page, id) {
|
function deleteDevice(page, id) {
|
||||||
var msg = globalize.translate('DeleteDeviceConfirmation');
|
const msg = globalize.translate('DeleteDeviceConfirmation');
|
||||||
|
|
||||||
import('confirm').then(({default: confirm}) => {
|
import('confirm').then(({default: confirm}) => {
|
||||||
confirm({
|
confirm({
|
||||||
|
@ -39,7 +39,7 @@ import 'cardStyle';
|
||||||
}
|
}
|
||||||
|
|
||||||
function showDeviceMenu(view, btn, deviceId) {
|
function showDeviceMenu(view, btn, deviceId) {
|
||||||
var menuItems = [];
|
let menuItems = [];
|
||||||
|
|
||||||
if (canEdit) {
|
if (canEdit) {
|
||||||
menuItems.push({
|
menuItems.push({
|
||||||
|
@ -76,15 +76,15 @@ import 'cardStyle';
|
||||||
}
|
}
|
||||||
|
|
||||||
function load(page, devices) {
|
function load(page, devices) {
|
||||||
var html = '';
|
let html = '';
|
||||||
html += devices.map(function (device) {
|
html += devices.map(function (device) {
|
||||||
var deviceHtml = '';
|
let deviceHtml = '';
|
||||||
deviceHtml += "<div data-id='" + device.Id + "' class='card backdropCard'>";
|
deviceHtml += "<div data-id='" + device.Id + "' class='card backdropCard'>";
|
||||||
deviceHtml += '<div class="cardBox visualCardBox">';
|
deviceHtml += '<div class="cardBox visualCardBox">';
|
||||||
deviceHtml += '<div class="cardScalable">';
|
deviceHtml += '<div class="cardScalable">';
|
||||||
deviceHtml += '<div class="cardPadder cardPadder-backdrop"></div>';
|
deviceHtml += '<div class="cardPadder cardPadder-backdrop"></div>';
|
||||||
deviceHtml += '<a is="emby-linkbutton" href="' + (canEdit ? 'device.html?id=' + device.Id : '#') + '" class="cardContent cardImageContainer">';
|
deviceHtml += '<a is="emby-linkbutton" href="' + (canEdit ? 'device.html?id=' + device.Id : '#') + '" class="cardContent cardImageContainer">';
|
||||||
var iconUrl = imageHelper.getDeviceIcon(device);
|
const iconUrl = imageHelper.getDeviceIcon(device);
|
||||||
|
|
||||||
if (iconUrl) {
|
if (iconUrl) {
|
||||||
deviceHtml += '<div class="cardImage" style="background-image:url(\'' + iconUrl + "');background-size: auto 64%;background-position:center center;\">";
|
deviceHtml += '<div class="cardImage" style="background-image:url(\'' + iconUrl + "');background-size: auto 64%;background-position:center center;\">";
|
||||||
|
@ -134,10 +134,10 @@ import 'cardStyle';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var canEdit = ApiClient.isMinServerVersion('3.4.1.31');
|
const canEdit = ApiClient.isMinServerVersion('3.4.1.31');
|
||||||
export default function (view, params) {
|
export default function (view, params) {
|
||||||
view.querySelector('.devicesList').addEventListener('click', function (e) {
|
view.querySelector('.devicesList').addEventListener('click', function (e) {
|
||||||
var btnDeviceMenu = dom.parentWithClass(e.target, 'btnDeviceMenu');
|
const btnDeviceMenu = dom.parentWithClass(e.target, 'btnDeviceMenu');
|
||||||
|
|
||||||
if (btnDeviceMenu) {
|
if (btnDeviceMenu) {
|
||||||
showDeviceMenu(view, btnDeviceMenu, btnDeviceMenu.getAttribute('data-id'));
|
showDeviceMenu(view, btnDeviceMenu, btnDeviceMenu.getAttribute('data-id'));
|
||||||
|
@ -146,6 +146,6 @@ import 'cardStyle';
|
||||||
view.addEventListener('viewshow', function () {
|
view.addEventListener('viewshow', function () {
|
||||||
loadData(this);
|
loadData(this);
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
/* eslint-enable indent */
|
/* eslint-enable indent */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue