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:
parent
8b6dc05d64
commit
9e3ca706c4
217 changed files with 8541 additions and 8540 deletions
|
@ -1,23 +1,23 @@
|
|||
define(["jQuery", "loading", "globalize", "dom", "libraryMenu"], function ($, loading, globalize, dom, libraryMenu) {
|
||||
"use strict";
|
||||
define(['jQuery', 'loading', 'globalize', 'dom', 'libraryMenu'], function ($, loading, globalize, dom, libraryMenu) {
|
||||
'use strict';
|
||||
|
||||
function loadPage(page, config, systemInfo) {
|
||||
Array.prototype.forEach.call(page.querySelectorAll(".chkDecodeCodec"), function (c) {
|
||||
c.checked = -1 !== (config.HardwareDecodingCodecs || []).indexOf(c.getAttribute("data-codec"));
|
||||
Array.prototype.forEach.call(page.querySelectorAll('.chkDecodeCodec'), function (c) {
|
||||
c.checked = -1 !== (config.HardwareDecodingCodecs || []).indexOf(c.getAttribute('data-codec'));
|
||||
});
|
||||
page.querySelector("#chkHardwareEncoding").checked = config.EnableHardwareEncoding;
|
||||
$("#selectVideoDecoder", page).val(config.HardwareAccelerationType);
|
||||
$("#selectThreadCount", page).val(config.EncodingThreadCount);
|
||||
$("#txtDownMixAudioBoost", page).val(config.DownMixAudioBoost);
|
||||
page.querySelector(".txtEncoderPath").value = config.EncoderAppPathDisplay || "";
|
||||
$("#txtTranscodingTempPath", page).val(systemInfo.TranscodingTempPath || "");
|
||||
$("#txtVaapiDevice", page).val(config.VaapiDevice || "");
|
||||
page.querySelector("#selectEncoderPreset").value = config.EncoderPreset || "";
|
||||
page.querySelector("#txtH264Crf").value = config.H264Crf || "";
|
||||
page.querySelector("#selectDeinterlaceMethod").value = config.DeinterlaceMethod || "";
|
||||
page.querySelector("#chkEnableSubtitleExtraction").checked = config.EnableSubtitleExtraction || false;
|
||||
page.querySelector("#chkEnableThrottling").checked = config.EnableThrottling || false;
|
||||
page.querySelector("#selectVideoDecoder").dispatchEvent(new CustomEvent("change", {
|
||||
page.querySelector('#chkHardwareEncoding').checked = config.EnableHardwareEncoding;
|
||||
$('#selectVideoDecoder', page).val(config.HardwareAccelerationType);
|
||||
$('#selectThreadCount', page).val(config.EncodingThreadCount);
|
||||
$('#txtDownMixAudioBoost', page).val(config.DownMixAudioBoost);
|
||||
page.querySelector('.txtEncoderPath').value = config.EncoderAppPathDisplay || '';
|
||||
$('#txtTranscodingTempPath', page).val(systemInfo.TranscodingTempPath || '');
|
||||
$('#txtVaapiDevice', page).val(config.VaapiDevice || '');
|
||||
page.querySelector('#selectEncoderPreset').value = config.EncoderPreset || '';
|
||||
page.querySelector('#txtH264Crf').value = config.H264Crf || '';
|
||||
page.querySelector('#selectDeinterlaceMethod').value = config.DeinterlaceMethod || '';
|
||||
page.querySelector('#chkEnableSubtitleExtraction').checked = config.EnableSubtitleExtraction || false;
|
||||
page.querySelector('#chkEnableThrottling').checked = config.EnableThrottling || false;
|
||||
page.querySelector('#selectVideoDecoder').dispatchEvent(new CustomEvent('change', {
|
||||
bubbles: true
|
||||
}));
|
||||
loading.hide();
|
||||
|
@ -25,10 +25,10 @@ define(["jQuery", "loading", "globalize", "dom", "libraryMenu"], function ($, lo
|
|||
|
||||
function onSaveEncodingPathFailure(response) {
|
||||
loading.hide();
|
||||
var msg = "";
|
||||
msg = globalize.translate("FFmpegSavePathNotFound");
|
||||
var msg = '';
|
||||
msg = globalize.translate('FFmpegSavePathNotFound');
|
||||
|
||||
require(["alert"], function (alert) {
|
||||
require(['alert'], function (alert) {
|
||||
alert(msg);
|
||||
});
|
||||
}
|
||||
|
@ -36,11 +36,11 @@ define(["jQuery", "loading", "globalize", "dom", "libraryMenu"], function ($, lo
|
|||
function updateEncoder(form) {
|
||||
return ApiClient.getSystemInfo().then(function (systemInfo) {
|
||||
return ApiClient.ajax({
|
||||
url: ApiClient.getUrl("System/MediaEncoder/Path"),
|
||||
type: "POST",
|
||||
url: ApiClient.getUrl('System/MediaEncoder/Path'),
|
||||
type: 'POST',
|
||||
data: {
|
||||
Path: form.querySelector(".txtEncoderPath").value,
|
||||
PathType: "Custom"
|
||||
Path: form.querySelector('.txtEncoderPath').value,
|
||||
PathType: 'Custom'
|
||||
}
|
||||
}).then(Dashboard.processServerConfigurationUpdateResult, onSaveEncodingPathFailure);
|
||||
});
|
||||
|
@ -51,28 +51,28 @@ define(["jQuery", "loading", "globalize", "dom", "libraryMenu"], function ($, lo
|
|||
|
||||
var onDecoderConfirmed = function () {
|
||||
loading.show();
|
||||
ApiClient.getNamedConfiguration("encoding").then(function (config) {
|
||||
config.DownMixAudioBoost = $("#txtDownMixAudioBoost", form).val();
|
||||
config.TranscodingTempPath = $("#txtTranscodingTempPath", form).val();
|
||||
config.EncodingThreadCount = $("#selectThreadCount", form).val();
|
||||
config.HardwareAccelerationType = $("#selectVideoDecoder", form).val();
|
||||
config.VaapiDevice = $("#txtVaapiDevice", form).val();
|
||||
config.EncoderPreset = form.querySelector("#selectEncoderPreset").value;
|
||||
config.H264Crf = parseInt(form.querySelector("#txtH264Crf").value || "0");
|
||||
config.DeinterlaceMethod = form.querySelector("#selectDeinterlaceMethod").value;
|
||||
config.EnableSubtitleExtraction = form.querySelector("#chkEnableSubtitleExtraction").checked;
|
||||
config.EnableThrottling = form.querySelector("#chkEnableThrottling").checked;
|
||||
config.HardwareDecodingCodecs = Array.prototype.map.call(Array.prototype.filter.call(form.querySelectorAll(".chkDecodeCodec"), function (c) {
|
||||
ApiClient.getNamedConfiguration('encoding').then(function (config) {
|
||||
config.DownMixAudioBoost = $('#txtDownMixAudioBoost', form).val();
|
||||
config.TranscodingTempPath = $('#txtTranscodingTempPath', form).val();
|
||||
config.EncodingThreadCount = $('#selectThreadCount', form).val();
|
||||
config.HardwareAccelerationType = $('#selectVideoDecoder', form).val();
|
||||
config.VaapiDevice = $('#txtVaapiDevice', form).val();
|
||||
config.EncoderPreset = form.querySelector('#selectEncoderPreset').value;
|
||||
config.H264Crf = parseInt(form.querySelector('#txtH264Crf').value || '0');
|
||||
config.DeinterlaceMethod = form.querySelector('#selectDeinterlaceMethod').value;
|
||||
config.EnableSubtitleExtraction = form.querySelector('#chkEnableSubtitleExtraction').checked;
|
||||
config.EnableThrottling = form.querySelector('#chkEnableThrottling').checked;
|
||||
config.HardwareDecodingCodecs = Array.prototype.map.call(Array.prototype.filter.call(form.querySelectorAll('.chkDecodeCodec'), function (c) {
|
||||
return c.checked;
|
||||
}), function (c) {
|
||||
return c.getAttribute("data-codec");
|
||||
return c.getAttribute('data-codec');
|
||||
});
|
||||
config.EnableHardwareEncoding = form.querySelector("#chkHardwareEncoding").checked;
|
||||
ApiClient.updateNamedConfiguration("encoding", config).then(function () {
|
||||
config.EnableHardwareEncoding = form.querySelector('#chkHardwareEncoding').checked;
|
||||
ApiClient.updateNamedConfiguration('encoding', config).then(function () {
|
||||
updateEncoder(form);
|
||||
}, function () {
|
||||
require(["alert"], function (alert) {
|
||||
alert(globalize.translate("DefaultErrorMessage"));
|
||||
require(['alert'], function (alert) {
|
||||
alert(globalize.translate('DefaultErrorMessage'));
|
||||
});
|
||||
|
||||
Dashboard.processServerConfigurationUpdateResult();
|
||||
|
@ -80,11 +80,11 @@ define(["jQuery", "loading", "globalize", "dom", "libraryMenu"], function ($, lo
|
|||
});
|
||||
};
|
||||
|
||||
if ($("#selectVideoDecoder", form).val()) {
|
||||
require(["alert"], function (alert) {
|
||||
if ($('#selectVideoDecoder', form).val()) {
|
||||
require(['alert'], function (alert) {
|
||||
alert({
|
||||
title: globalize.translate("TitleHardwareAcceleration"),
|
||||
text: globalize.translate("HardwareAccelerationWarning")
|
||||
title: globalize.translate('TitleHardwareAcceleration'),
|
||||
text: globalize.translate('HardwareAccelerationWarning')
|
||||
}).then(onDecoderConfirmed);
|
||||
});
|
||||
} else {
|
||||
|
@ -95,64 +95,64 @@ define(["jQuery", "loading", "globalize", "dom", "libraryMenu"], function ($, lo
|
|||
}
|
||||
|
||||
function setDecodingCodecsVisible(context, value) {
|
||||
value = value || "";
|
||||
value = value || '';
|
||||
var any;
|
||||
Array.prototype.forEach.call(context.querySelectorAll(".chkDecodeCodec"), function (c) {
|
||||
if (-1 === c.getAttribute("data-types").split(",").indexOf(value)) {
|
||||
dom.parentWithTag(c, "LABEL").classList.add("hide");
|
||||
Array.prototype.forEach.call(context.querySelectorAll('.chkDecodeCodec'), function (c) {
|
||||
if (-1 === c.getAttribute('data-types').split(',').indexOf(value)) {
|
||||
dom.parentWithTag(c, 'LABEL').classList.add('hide');
|
||||
} else {
|
||||
dom.parentWithTag(c, "LABEL").classList.remove("hide");
|
||||
dom.parentWithTag(c, 'LABEL').classList.remove('hide');
|
||||
any = true;
|
||||
}
|
||||
});
|
||||
|
||||
if (any) {
|
||||
context.querySelector(".decodingCodecsList").classList.remove("hide");
|
||||
context.querySelector('.decodingCodecsList').classList.remove('hide');
|
||||
} else {
|
||||
context.querySelector(".decodingCodecsList").classList.add("hide");
|
||||
context.querySelector('.decodingCodecsList').classList.add('hide');
|
||||
}
|
||||
}
|
||||
|
||||
function getTabs() {
|
||||
return [{
|
||||
href: "encodingsettings.html",
|
||||
name: globalize.translate("Transcoding")
|
||||
href: 'encodingsettings.html',
|
||||
name: globalize.translate('Transcoding')
|
||||
}, {
|
||||
href: "playbackconfiguration.html",
|
||||
name: globalize.translate("TabResumeSettings")
|
||||
href: 'playbackconfiguration.html',
|
||||
name: globalize.translate('TabResumeSettings')
|
||||
}, {
|
||||
href: "streamingsettings.html",
|
||||
name: globalize.translate("TabStreaming")
|
||||
href: 'streamingsettings.html',
|
||||
name: globalize.translate('TabStreaming')
|
||||
}];
|
||||
}
|
||||
|
||||
$(document).on("pageinit", "#encodingSettingsPage", function () {
|
||||
$(document).on('pageinit', '#encodingSettingsPage', function () {
|
||||
var page = this;
|
||||
page.querySelector("#selectVideoDecoder").addEventListener("change", function () {
|
||||
if ("vaapi" == this.value) {
|
||||
page.querySelector(".fldVaapiDevice").classList.remove("hide");
|
||||
page.querySelector("#txtVaapiDevice").setAttribute("required", "required");
|
||||
page.querySelector('#selectVideoDecoder').addEventListener('change', function () {
|
||||
if ('vaapi' == this.value) {
|
||||
page.querySelector('.fldVaapiDevice').classList.remove('hide');
|
||||
page.querySelector('#txtVaapiDevice').setAttribute('required', 'required');
|
||||
} else {
|
||||
page.querySelector(".fldVaapiDevice").classList.add("hide");
|
||||
page.querySelector("#txtVaapiDevice").removeAttribute("required");
|
||||
page.querySelector('.fldVaapiDevice').classList.add('hide');
|
||||
page.querySelector('#txtVaapiDevice').removeAttribute('required');
|
||||
}
|
||||
|
||||
if (this.value) {
|
||||
page.querySelector(".hardwareAccelerationOptions").classList.remove("hide");
|
||||
page.querySelector('.hardwareAccelerationOptions').classList.remove('hide');
|
||||
} else {
|
||||
page.querySelector(".hardwareAccelerationOptions").classList.add("hide");
|
||||
page.querySelector('.hardwareAccelerationOptions').classList.add('hide');
|
||||
}
|
||||
|
||||
setDecodingCodecsVisible(page, this.value);
|
||||
});
|
||||
$("#btnSelectEncoderPath", page).on("click.selectDirectory", function () {
|
||||
require(["directorybrowser"], function (directoryBrowser) {
|
||||
$('#btnSelectEncoderPath', page).on('click.selectDirectory', function () {
|
||||
require(['directorybrowser'], function (directoryBrowser) {
|
||||
var picker = new directoryBrowser();
|
||||
picker.show({
|
||||
includeFiles: true,
|
||||
callback: function (path) {
|
||||
if (path) {
|
||||
$(".txtEncoderPath", page).val(path);
|
||||
$('.txtEncoderPath', page).val(path);
|
||||
}
|
||||
|
||||
picker.close();
|
||||
|
@ -160,29 +160,29 @@ define(["jQuery", "loading", "globalize", "dom", "libraryMenu"], function ($, lo
|
|||
});
|
||||
});
|
||||
});
|
||||
$("#btnSelectTranscodingTempPath", page).on("click.selectDirectory", function () {
|
||||
require(["directorybrowser"], function (directoryBrowser) {
|
||||
$('#btnSelectTranscodingTempPath', page).on('click.selectDirectory', function () {
|
||||
require(['directorybrowser'], function (directoryBrowser) {
|
||||
var picker = new directoryBrowser();
|
||||
picker.show({
|
||||
callback: function (path) {
|
||||
if (path) {
|
||||
$("#txtTranscodingTempPath", page).val(path);
|
||||
$('#txtTranscodingTempPath', page).val(path);
|
||||
}
|
||||
|
||||
picker.close();
|
||||
},
|
||||
validateWriteable: true,
|
||||
header: globalize.translate("HeaderSelectTranscodingPath"),
|
||||
instruction: globalize.translate("HeaderSelectTranscodingPathHelp")
|
||||
header: globalize.translate('HeaderSelectTranscodingPath'),
|
||||
instruction: globalize.translate('HeaderSelectTranscodingPathHelp')
|
||||
});
|
||||
});
|
||||
});
|
||||
$(".encodingSettingsForm").off("submit", onSubmit).on("submit", onSubmit);
|
||||
}).on("pageshow", "#encodingSettingsPage", function () {
|
||||
$('.encodingSettingsForm').off('submit', onSubmit).on('submit', onSubmit);
|
||||
}).on('pageshow', '#encodingSettingsPage', function () {
|
||||
loading.show();
|
||||
libraryMenu.setTabs("playback", 0, getTabs);
|
||||
libraryMenu.setTabs('playback', 0, getTabs);
|
||||
var page = this;
|
||||
ApiClient.getNamedConfiguration("encoding").then(function (config) {
|
||||
ApiClient.getNamedConfiguration('encoding').then(function (config) {
|
||||
ApiClient.getSystemInfo().then(function (systemInfo) {
|
||||
loadPage(page, config, systemInfo);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue