mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-09 09:02:31 -06:00
WebUI: enforce string quotes coding style
This commit is contained in:
@@ -9,51 +9,51 @@
|
||||
<script src="scripts/lib/MooTools-More-1.6.0-compat-compressed.js"></script>
|
||||
<script src="scripts/misc.js?locale=${LANG}&v=${CACHEID}"></script>
|
||||
<script>
|
||||
'use strict';
|
||||
"use strict";
|
||||
|
||||
new Keyboard({
|
||||
defaultEventType: 'keydown',
|
||||
defaultEventType: "keydown",
|
||||
events: {
|
||||
'Enter': (event) => {
|
||||
$('renameButton').click();
|
||||
"Enter": (event) => {
|
||||
$("renameButton").click();
|
||||
event.preventDefault();
|
||||
},
|
||||
'Escape': (event) => {
|
||||
"Escape": (event) => {
|
||||
window.parent.qBittorrent.Client.closeWindows();
|
||||
event.preventDefault();
|
||||
},
|
||||
'Esc': (event) => {
|
||||
"Esc": (event) => {
|
||||
window.parent.qBittorrent.Client.closeWindows();
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
}).activate();
|
||||
window.addEvent('domready', () => {
|
||||
const oldPath = new URI().getData('oldPath');
|
||||
window.addEvent("domready", () => {
|
||||
const oldPath = new URI().getData("oldPath");
|
||||
|
||||
$('rename').value = oldPath;
|
||||
$('rename').focus();
|
||||
$('rename').setSelectionRange(0, oldPath.length);
|
||||
$("rename").value = oldPath;
|
||||
$("rename").focus();
|
||||
$("rename").setSelectionRange(0, oldPath.length);
|
||||
|
||||
$('renameButton').addEvent('click', (e) => {
|
||||
$("renameButton").addEvent("click", (e) => {
|
||||
new Event(e).stop();
|
||||
// check field
|
||||
const newPath = $('rename').value.trim();
|
||||
if (newPath === '') {
|
||||
alert('QBT_TR(Name cannot be empty)QBT_TR[CONTEXT=HttpServer]');
|
||||
const newPath = $("rename").value.trim();
|
||||
if (newPath === "") {
|
||||
alert("QBT_TR(Name cannot be empty)QBT_TR[CONTEXT=HttpServer]");
|
||||
return;
|
||||
}
|
||||
|
||||
if (newPath === oldPath) {
|
||||
alert('QBT_TR(Name is unchanged)QBT_TR[CONTEXT=HttpServer]');
|
||||
alert("QBT_TR(Name is unchanged)QBT_TR[CONTEXT=HttpServer]");
|
||||
return;
|
||||
}
|
||||
|
||||
$('renameButton').disabled = true;
|
||||
$("renameButton").disabled = true;
|
||||
|
||||
new Request({
|
||||
url: 'api/v2/rss/moveItem',
|
||||
method: 'post',
|
||||
url: "api/v2/rss/moveItem",
|
||||
method: "post",
|
||||
data: {
|
||||
itemPath: oldPath,
|
||||
destPath: newPath
|
||||
@@ -66,7 +66,7 @@
|
||||
if (response.status === 409) {
|
||||
alert(response.responseText);
|
||||
}
|
||||
$('renameButton').disabled = false;
|
||||
$("renameButton").disabled = false;
|
||||
}
|
||||
}).send();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user