build: bump web client dev-dependencies (#5789)
This commit is contained in:
parent
32af004248
commit
1acfca9c3a
|
@ -462,8 +462,12 @@ $video-image: '../img/film.svg';
|
|||
&[data-icon-multifile='true'] {
|
||||
-webkit-mask-image: url($mime-icon), url($folder-image);
|
||||
mask-image: url($mime-icon), url($folder-image);
|
||||
-webkit-mask-position: top left, bottom right;
|
||||
mask-position: top left, bottom right;
|
||||
-webkit-mask-position:
|
||||
top left,
|
||||
bottom right;
|
||||
mask-position:
|
||||
top left,
|
||||
bottom right;
|
||||
-webkit-mask-repeat: no-repeat, no-repeat;
|
||||
mask-repeat: no-repeat, no-repeat;
|
||||
-webkit-mask-size: 16px, 16px;
|
||||
|
@ -486,7 +490,9 @@ $video-image: '../img/film.svg';
|
|||
.icon {
|
||||
// color the background svg fill
|
||||
background-color: var(--color-fg-primary);
|
||||
background-position: center, top left;
|
||||
background-position:
|
||||
center,
|
||||
top left;
|
||||
|
||||
&[data-icon-mime-type='audio'] {
|
||||
@include mime-icon($audio-image);
|
||||
|
@ -572,8 +578,12 @@ $video-image: '../img/film.svg';
|
|||
.icon {
|
||||
flex-shrink: 0;
|
||||
height: $icon-size;
|
||||
-webkit-mask-size: $icon-size, $icon-size-num * 0.5px;
|
||||
mask-size: $icon-size, $icon-size-num * 0.5px;
|
||||
-webkit-mask-size:
|
||||
$icon-size,
|
||||
$icon-size-num * 0.5px;
|
||||
mask-size:
|
||||
$icon-size,
|
||||
$icon-size-num * 0.5px;
|
||||
width: $icon-size;
|
||||
|
||||
&[data-icon-multifile='true'] {
|
||||
|
@ -601,7 +611,9 @@ $video-image: '../img/film.svg';
|
|||
padding: 6px 12px;
|
||||
|
||||
.icon {
|
||||
background-size: $icon-size, $icon-size-num * 0.5px;
|
||||
background-size:
|
||||
$icon-size,
|
||||
$icon-size-num * 0.5px;
|
||||
grid-area: icon;
|
||||
height: $icon-size;
|
||||
width: $icon-size;
|
||||
|
@ -796,7 +808,9 @@ $video-image: '../img/film.svg';
|
|||
$background-color: var(--color-inspector-background);
|
||||
background: $background-color;
|
||||
bottom: 0;
|
||||
box-shadow: 0 3px 6px -4px #0000001f, 0 6px 16px #00000014,
|
||||
box-shadow:
|
||||
0 3px 6px -4px #0000001f,
|
||||
0 6px 16px #00000014,
|
||||
0 9px 28px 8px #0000000d;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
|
@ -1344,7 +1358,9 @@ $video-image: '../img/film.svg';
|
|||
.overflow-menu {
|
||||
background: var(--color-bg-popup);
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 3px 6px -4px #0000001f, 0 6px 16px #00000014,
|
||||
box-shadow:
|
||||
0 3px 6px -4px #0000001f,
|
||||
0 6px 16px #00000014,
|
||||
0 9px 28px 8px #0000000d;
|
||||
color: var(--color-fg-on-popup);
|
||||
min-width: 220px;
|
||||
|
@ -1584,7 +1600,9 @@ dialog {
|
|||
}
|
||||
|
||||
.dialog-container {
|
||||
box-shadow: 0 3px 6px -4px #0000001f, 0 6px 16px #00000014,
|
||||
box-shadow:
|
||||
0 3px 6px -4px #0000001f,
|
||||
0 6px 16px #00000014,
|
||||
0 9px 28px 8px #0000000d;
|
||||
color: var(--color-fg-primary);
|
||||
display: block;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -12,37 +12,36 @@
|
|||
"lint:fix": "run-s lint:eslint:fix lint:stylelint:fix lint:prettier:fix",
|
||||
"lint:eslint": "eslint src/*.js",
|
||||
"lint:eslint:fix": "eslint --fix src/*.js",
|
||||
"lint:prettier": "prettier --loglevel warn --check package.json public_html/index.html assets/css/*scss src/*.js",
|
||||
"lint:prettier:fix": "prettier --loglevel warn -w package.json public_html/index.html assets/css/*scss src/*.js",
|
||||
"lint:prettier": "prettier --log-level warn --check package.json public_html/index.html assets/css/*scss src/*.js",
|
||||
"lint:prettier:fix": "prettier --log-level warn -w package.json public_html/index.html assets/css/*scss src/*.js",
|
||||
"lint:stylelint": "stylelint assets/css/*scss",
|
||||
"lint:stylelint:fix": "stylelint --fix assets/css/*scss"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.20.12",
|
||||
"@babel/eslint-parser": "^7.19.1",
|
||||
"@babel/core": "^7.22.9",
|
||||
"@babel/eslint-parser": "^7.22.9",
|
||||
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
||||
"@primer/stylelint-config": "^12.7.0",
|
||||
"css-loader": "^6.7.3",
|
||||
"css-minimizer-webpack-plugin": "^4.2.2",
|
||||
"eslint": "^8.32.0",
|
||||
"eslint-plugin-sonarjs": "^0.18.0",
|
||||
"eslint-plugin-unicorn": "^45.0.2",
|
||||
"@primer/stylelint-config": "^12.7.2",
|
||||
"css-loader": "^6.8.1",
|
||||
"css-minimizer-webpack-plugin": "^5.0.1",
|
||||
"eslint": "^8.45.0",
|
||||
"eslint-plugin-sonarjs": "^0.19.0",
|
||||
"eslint-plugin-unicorn": "^47.0.0",
|
||||
"file-loader": "^6.2.0",
|
||||
"mini-css-extract-plugin": "^2.7.2",
|
||||
"mini-css-extract-plugin": "^2.7.6",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "^2.8.3",
|
||||
"sass": "^1.57.1",
|
||||
"sass-loader": "^13.2.0",
|
||||
"style-loader": "^3.3.1",
|
||||
"stylelint": "^14.16.1",
|
||||
"stylelint-config-prettier": "^9.0.4",
|
||||
"stylelint-config-sass-guidelines": "^9.0.1",
|
||||
"stylelint-config-standard": "^29.0.0",
|
||||
"terser-webpack-plugin": "^5.3.6",
|
||||
"webpack": "^5.76.0",
|
||||
"webpack-bundle-analyzer": "^4.7.0",
|
||||
"webpack-cli": "^4.10.0",
|
||||
"webpack-dev-server": "^4.11.1"
|
||||
"prettier": "^3.0.0",
|
||||
"sass": "^1.63.6",
|
||||
"sass-loader": "^13.2.2",
|
||||
"style-loader": "^3.3.3",
|
||||
"stylelint": "^15.10.1",
|
||||
"stylelint-config-sass-guidelines": "^10.0.0",
|
||||
"stylelint-config-standard": "^34.0.0",
|
||||
"terser-webpack-plugin": "^5.3.9",
|
||||
"webpack": "^5.88.1",
|
||||
"webpack-bundle-analyzer": "^4.9.0",
|
||||
"webpack-cli": "^5.1.4",
|
||||
"webpack-dev-server": "^4.15.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"lodash.isequal": "^4.5.0"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en" xml:lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
|
|
@ -112,7 +112,7 @@ export class ActionManager extends EventTarget {
|
|||
return new Map(
|
||||
Object.entries(this.actions)
|
||||
.filter(([, properties]) => properties.shortcut)
|
||||
.map(([name, properties]) => [properties.shortcut, name])
|
||||
.map(([name, properties]) => [properties.shortcut, name]),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -146,7 +146,7 @@ export class ActionManager extends EventTarget {
|
|||
const selected_paused = selected.filter((tor) => tor.isStopped()).length;
|
||||
const selected_active = selected.length - selected_paused;
|
||||
const nonselected_paused = nonselected.filter((tor) =>
|
||||
tor.isStopped()
|
||||
tor.isStopped(),
|
||||
).length;
|
||||
const nonselected_active = nonselected.length - nonselected_paused;
|
||||
const paused = selected_paused + nonselected_paused;
|
||||
|
|
|
@ -33,7 +33,7 @@ export class FileRow extends EventTarget {
|
|||
const pct = 100 * (size ? have / size : 1);
|
||||
const fmt = Formatter;
|
||||
const c = `${fmt.size(have)} of ${fmt.size(size)} (${fmt.percentString(
|
||||
pct
|
||||
pct,
|
||||
)}%)`;
|
||||
setTextContent(this.elements.progress, c);
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ export class FileRow extends EventTarget {
|
|||
const root = document.createElement('li');
|
||||
root.classList.add(
|
||||
'inspector-torrent-file-list-entry',
|
||||
even ? 'even' : 'odd'
|
||||
even ? 'even' : 'odd',
|
||||
);
|
||||
|
||||
this.elements.root = root;
|
||||
|
@ -112,7 +112,7 @@ export class FileRow extends EventTarget {
|
|||
e.title = 'Download file';
|
||||
e.id = check_id;
|
||||
e.addEventListener('change', (event_) =>
|
||||
this.fireWantedChanged(event_.target.checked)
|
||||
this.fireWantedChanged(event_.target.checked),
|
||||
);
|
||||
root.checkbox = e;
|
||||
root.append(e);
|
||||
|
|
|
@ -45,7 +45,7 @@ export class Inspector extends EventTarget {
|
|||
|
||||
controller.addEventListener(
|
||||
'torrent-selection-changed',
|
||||
this.selection_listener
|
||||
this.selection_listener,
|
||||
);
|
||||
this._setTorrents(this.controller.getSelectedTorrents());
|
||||
|
||||
|
@ -60,7 +60,7 @@ export class Inspector extends EventTarget {
|
|||
this.elements.root.remove();
|
||||
this.controller.removeEventListener(
|
||||
'torrent-selection-changed',
|
||||
this.selection_listener
|
||||
this.selection_listener,
|
||||
);
|
||||
this.dispatchEvent(new Event('close'));
|
||||
for (const property of Object.keys(this)) {
|
||||
|
@ -190,7 +190,7 @@ export class Inspector extends EventTarget {
|
|||
['inspector-tab-tiers', pages.tiers.root, 'Tiers'],
|
||||
['inspector-tab-files', pages.files.root, 'Files'],
|
||||
],
|
||||
on_activated.bind(this)
|
||||
on_activated.bind(this),
|
||||
);
|
||||
|
||||
return { ...elements, ...pages };
|
||||
|
@ -260,7 +260,7 @@ export class Inspector extends EventTarget {
|
|||
const { elements: e, torrents } = this;
|
||||
const sizeWhenDone = torrents.reduce(
|
||||
(accumulator, t) => accumulator + t.getSizeWhenDone(),
|
||||
0
|
||||
0,
|
||||
);
|
||||
|
||||
// state
|
||||
|
@ -285,15 +285,15 @@ export class Inspector extends EventTarget {
|
|||
} else {
|
||||
const verified = torrents.reduce(
|
||||
(accumulator, t) => accumulator + t.getHaveValid(),
|
||||
0
|
||||
0,
|
||||
);
|
||||
const unverified = torrents.reduce(
|
||||
(accumulator, t) => accumulator + t.getHaveUnchecked(),
|
||||
0
|
||||
0,
|
||||
);
|
||||
const leftUntilDone = torrents.reduce(
|
||||
(accumulator, t) => accumulator + t.getLeftUntilDone(),
|
||||
0
|
||||
0,
|
||||
);
|
||||
|
||||
const d =
|
||||
|
@ -303,11 +303,11 @@ export class Inspector extends EventTarget {
|
|||
|
||||
if (unverified) {
|
||||
string = `${fmt.size(verified)} of ${fmt.size(
|
||||
sizeWhenDone
|
||||
sizeWhenDone,
|
||||
)} (${string}%), ${fmt.size(unverified)} Unverified`;
|
||||
} else if (leftUntilDone) {
|
||||
string = `${fmt.size(verified)} of ${fmt.size(
|
||||
sizeWhenDone
|
||||
sizeWhenDone,
|
||||
)} (${string}%)`;
|
||||
} else {
|
||||
string = `${fmt.size(verified)} (100%)`;
|
||||
|
@ -324,7 +324,7 @@ export class Inspector extends EventTarget {
|
|||
} else {
|
||||
const available = torrents.reduce(
|
||||
(accumulator, t) => t.getHave() + t.getDesiredAvailable(),
|
||||
0
|
||||
0,
|
||||
);
|
||||
string = `${fmt.percentString((100 * available) / sizeWhenDone)}%`;
|
||||
}
|
||||
|
@ -336,11 +336,11 @@ export class Inspector extends EventTarget {
|
|||
} else {
|
||||
const d = torrents.reduce(
|
||||
(accumulator, t) => accumulator + t.getDownloadedEver(),
|
||||
0
|
||||
0,
|
||||
);
|
||||
const f = torrents.reduce(
|
||||
(accumulator, t) => accumulator + t.getFailedEver(),
|
||||
0
|
||||
0,
|
||||
);
|
||||
string = f
|
||||
? `${fmt.size(d)} (+${fmt.size(f)} discarded after failed checksum)`
|
||||
|
@ -355,16 +355,16 @@ export class Inspector extends EventTarget {
|
|||
} else {
|
||||
const uploaded = torrents.reduce(
|
||||
(accumulator, t) => accumulator + t.getUploadedEver(),
|
||||
0
|
||||
0,
|
||||
);
|
||||
const denominator =
|
||||
torrents.reduce(
|
||||
(accumulator, t) => accumulator + t.getSizeWhenDone(),
|
||||
0
|
||||
0,
|
||||
) ||
|
||||
torrents.reduce((accumulator, t) => accumulator + t.getHaveValid(), 0);
|
||||
string = `${fmt.size(uploaded)} (Ratio: ${fmt.ratioString(
|
||||
Utils.ratio(uploaded, denominator)
|
||||
Utils.ratio(uploaded, denominator),
|
||||
)})`;
|
||||
}
|
||||
setTextContent(e.info.uploaded, string);
|
||||
|
@ -405,7 +405,7 @@ export class Inspector extends EventTarget {
|
|||
} else {
|
||||
const latest = torrents.reduce(
|
||||
(accumulator, t) => Math.max(accumulator, t.getLastActivity()),
|
||||
-1
|
||||
-1,
|
||||
);
|
||||
const now_seconds = Math.floor(now / 1000);
|
||||
if (0 < latest && latest <= now_seconds) {
|
||||
|
@ -434,13 +434,13 @@ export class Inspector extends EventTarget {
|
|||
} else {
|
||||
const size = torrents.reduce(
|
||||
(accumulator, t) => accumulator + t.getTotalSize(),
|
||||
0
|
||||
0,
|
||||
);
|
||||
if (size) {
|
||||
const get = (t) => t.getPieceSize();
|
||||
const pieceCount = torrents.reduce(
|
||||
(accumulator, t) => accumulator + t.getPieceCount(),
|
||||
0
|
||||
0,
|
||||
);
|
||||
const pieceString = fmt.number(pieceCount);
|
||||
const pieceSize = get(torrents[0]);
|
||||
|
@ -492,7 +492,7 @@ export class Inspector extends EventTarget {
|
|||
string = encodeURI(string);
|
||||
Utils.setInnerHTML(
|
||||
e.info.comment,
|
||||
`<a href="${string}" target="_blank" >${string}</a>`
|
||||
`<a href="${string}" target="_blank" >${string}</a>`,
|
||||
);
|
||||
} else {
|
||||
setTextContent(e.info.comment, string);
|
||||
|
@ -526,7 +526,7 @@ export class Inspector extends EventTarget {
|
|||
string = `Created on ${new Date(date * 1000).toDateString()}`;
|
||||
} else {
|
||||
string = `Created by ${creator} on ${new Date(
|
||||
date * 1000
|
||||
date * 1000,
|
||||
).toDateString()}`;
|
||||
}
|
||||
}
|
||||
|
@ -563,7 +563,7 @@ export class Inspector extends EventTarget {
|
|||
const link = torrents[0].getMagnetLink();
|
||||
Utils.setInnerHTML(
|
||||
e.info.magnetLink,
|
||||
`<a class="inspector-info-magnet" href="${link}"><button></button></a>`
|
||||
`<a class="inspector-info-magnet" href="${link}"><button></button></a>`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -604,12 +604,12 @@ export class Inspector extends EventTarget {
|
|||
(peer, td) =>
|
||||
setTextContent(
|
||||
td,
|
||||
peer.rateToPeer ? fmt.speedBps(peer.rateToPeer) : ''
|
||||
peer.rateToPeer ? fmt.speedBps(peer.rateToPeer) : '',
|
||||
),
|
||||
(peer, td) =>
|
||||
setTextContent(
|
||||
td,
|
||||
peer.rateToClient ? fmt.speedBps(peer.rateToClient) : ''
|
||||
peer.rateToClient ? fmt.speedBps(peer.rateToClient) : '',
|
||||
),
|
||||
(peer, td) => setTextContent(td, `${Math.floor(peer.progress * 100)}%`),
|
||||
(peer, td) => {
|
||||
|
@ -661,7 +661,7 @@ export class Inspector extends EventTarget {
|
|||
case Torrent._TrackerWaiting: {
|
||||
const timeUntilAnnounce = Math.max(
|
||||
0,
|
||||
tracker.nextAnnounceTime - Date.now() / 1000
|
||||
tracker.nextAnnounceTime - Date.now() / 1000,
|
||||
);
|
||||
return `Next announce in ${Formatter.timeInterval(timeUntilAnnounce)}`;
|
||||
}
|
||||
|
@ -779,7 +779,7 @@ export class Inspector extends EventTarget {
|
|||
element.classList.add('tier-announce');
|
||||
setTextContent(
|
||||
element,
|
||||
`${lastAnnounceStatusHash.label}: ${lastAnnounceStatusHash.value}`
|
||||
`${lastAnnounceStatusHash.label}: ${lastAnnounceStatusHash.value}`,
|
||||
);
|
||||
tier_div.append(element);
|
||||
|
||||
|
@ -787,7 +787,7 @@ export class Inspector extends EventTarget {
|
|||
element.classList.add('tier-seeders');
|
||||
setTextContent(
|
||||
element,
|
||||
`Seeders: ${tracker.seederCount > -1 ? tracker.seederCount : na}`
|
||||
`Seeders: ${tracker.seederCount > -1 ? tracker.seederCount : na}`,
|
||||
);
|
||||
tier_div.append(element);
|
||||
|
||||
|
@ -800,7 +800,7 @@ export class Inspector extends EventTarget {
|
|||
element.classList.add('tier-leechers');
|
||||
setTextContent(
|
||||
element,
|
||||
`Leechers: ${tracker.leecherCount > -1 ? tracker.leecherCount : na}`
|
||||
`Leechers: ${tracker.leecherCount > -1 ? tracker.leecherCount : na}`,
|
||||
);
|
||||
tier_div.append(element);
|
||||
|
||||
|
@ -808,7 +808,7 @@ export class Inspector extends EventTarget {
|
|||
element.classList.add('tier-scrape');
|
||||
setTextContent(
|
||||
element,
|
||||
`${lastScrapeStatusHash.label}: ${lastScrapeStatusHash.value}`
|
||||
`${lastScrapeStatusHash.label}: ${lastScrapeStatusHash.value}`,
|
||||
);
|
||||
tier_div.append(element);
|
||||
|
||||
|
@ -818,7 +818,7 @@ export class Inspector extends EventTarget {
|
|||
element,
|
||||
`Downloads: ${
|
||||
tracker.downloadCount > -1 ? tracker.downloadCount : na
|
||||
}`
|
||||
}`,
|
||||
);
|
||||
tier_div.append(element);
|
||||
|
||||
|
@ -845,7 +845,7 @@ export class Inspector extends EventTarget {
|
|||
const { indices, wanted } = event_;
|
||||
this._changeFileCommand(
|
||||
indices,
|
||||
wanted ? 'files-wanted' : 'files-unwanted'
|
||||
wanted ? 'files-wanted' : 'files-unwanted',
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -926,12 +926,12 @@ export class Inspector extends EventTarget {
|
|||
sub.depth,
|
||||
sub.name,
|
||||
sub.file_indices,
|
||||
index % 2
|
||||
index % 2,
|
||||
);
|
||||
row.addEventListener('wantedToggled', this._onFileWantedToggled.bind(this));
|
||||
row.addEventListener(
|
||||
'priorityToggled',
|
||||
this._onFilePriorityToggled.bind(this)
|
||||
this._onFilePriorityToggled.bind(this),
|
||||
);
|
||||
this.file_rows.push(row);
|
||||
parent.append(row.getElement());
|
||||
|
|
|
@ -18,7 +18,7 @@ function main() {
|
|||
const transmission = new Transmission(action_manager, notifications, prefs);
|
||||
|
||||
const scroll_soon = debounce(() =>
|
||||
transmission.elements.torrent_list.scrollTo(0, 1)
|
||||
transmission.elements.torrent_list.scrollTo(0, 1),
|
||||
);
|
||||
window.addEventListener('load', scroll_soon);
|
||||
window.addEventListener('orientationchange', scroll_soon);
|
||||
|
|
|
@ -17,13 +17,13 @@ export class Notifications {
|
|||
this.prefs.notifications_enabled = enabled;
|
||||
setTextContent(
|
||||
this._toggle,
|
||||
`${enabled ? 'Disable' : 'Enable'} Notifications`
|
||||
`${enabled ? 'Disable' : 'Enable'} Notifications`,
|
||||
);
|
||||
}
|
||||
|
||||
_requestPermission() {
|
||||
Notification.requestPermission().then((s) =>
|
||||
this._setEnabled(s === 'granted')
|
||||
this._setEnabled(s === 'granted'),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ export class OpenDialog extends EventTarget {
|
|||
new AlertDialog({
|
||||
heading: `Error adding "${file.name}"`,
|
||||
message: response.result,
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
});
|
||||
|
@ -110,7 +110,7 @@ export class OpenDialog extends EventTarget {
|
|||
new AlertDialog({
|
||||
heading: `Error adding "${url}"`,
|
||||
message: payload.result,
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -47,7 +47,7 @@ export class OverflowMenu extends EventTarget {
|
|||
this.session_manager = session_manager;
|
||||
this.session_manager.addEventListener(
|
||||
'session-change',
|
||||
this.session_listener
|
||||
this.session_listener,
|
||||
);
|
||||
|
||||
const { session_properties } = session_manager;
|
||||
|
@ -69,7 +69,7 @@ export class OverflowMenu extends EventTarget {
|
|||
this.outside.stop();
|
||||
this.session_manager.removeEventListener(
|
||||
'session-change',
|
||||
this.session_listener
|
||||
this.session_listener,
|
||||
);
|
||||
this.action_manager.removeEventListener('change', this.action_listener);
|
||||
this.prefs.removeEventListener('change', this.prefs_listener);
|
||||
|
|
|
@ -117,7 +117,7 @@ export class PrefsDialog extends EventTarget {
|
|||
|
||||
for (const [key, value] of Object.entries(o)) {
|
||||
for (const element of this.elements.root.querySelectorAll(
|
||||
`[data-key="${key}"]`
|
||||
`[data-key="${key}"]`,
|
||||
)) {
|
||||
if (key === 'blocklist-size') {
|
||||
const n = Formatter.number(value);
|
||||
|
@ -210,7 +210,7 @@ export class PrefsDialog extends EventTarget {
|
|||
if (!('unregisterProtocolHandler' in navigator)) {
|
||||
button.setAttribute(
|
||||
'title',
|
||||
'Your browser does not support removing protocol handlers. This button only allows you to re-register a handler.'
|
||||
'Your browser does not support removing protocol handlers. This button only allows you to re-register a handler.',
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
@ -220,7 +220,7 @@ export class PrefsDialog extends EventTarget {
|
|||
button.setAttribute('disabled', true);
|
||||
button.setAttribute(
|
||||
'title',
|
||||
'Your browser does not support protocol handlers'
|
||||
'Your browser does not support protocol handlers',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -237,7 +237,7 @@ export class PrefsDialog extends EventTarget {
|
|||
navigator.registerProtocolHandler(
|
||||
'magnet',
|
||||
handlerUrl.toString(),
|
||||
'Transmission Web'
|
||||
'Transmission Web',
|
||||
);
|
||||
localStorage.setItem('protocol-handler-registered', 'true');
|
||||
PrefsDialog._updateProtocolHandlerButton(button);
|
||||
|
@ -267,7 +267,7 @@ export class PrefsDialog extends EventTarget {
|
|||
|
||||
let cal = PrefsDialog._createCheckAndLabel(
|
||||
'incomplete-dir-div',
|
||||
'Use temporary folder:'
|
||||
'Use temporary folder:',
|
||||
);
|
||||
cal.check.title =
|
||||
'Separate folder to temporarily store downloads until they are complete.';
|
||||
|
@ -290,7 +290,7 @@ export class PrefsDialog extends EventTarget {
|
|||
|
||||
cal = PrefsDialog._createCheckAndLabel(
|
||||
'suffix-div',
|
||||
`Append "part" to incomplete files' names`
|
||||
`Append "part" to incomplete files' names`,
|
||||
);
|
||||
cal.check.dataset.key = 'rename-partial-files';
|
||||
root.append(cal.root);
|
||||
|
@ -298,7 +298,7 @@ export class PrefsDialog extends EventTarget {
|
|||
|
||||
cal = PrefsDialog._createCheckAndLabel(
|
||||
'download-queue-div',
|
||||
'Download queue size:'
|
||||
'Download queue size:',
|
||||
);
|
||||
cal.check.dataset.key = 'download-queue-enabled';
|
||||
root.append(cal.root);
|
||||
|
@ -318,7 +318,7 @@ export class PrefsDialog extends EventTarget {
|
|||
|
||||
cal = PrefsDialog._createCheckAndLabel(
|
||||
'stop-ratio-div',
|
||||
'Stop seeding at ratio:'
|
||||
'Stop seeding at ratio:',
|
||||
);
|
||||
cal.check.dataset.key = 'seedRatioLimited';
|
||||
root.append(cal.root);
|
||||
|
@ -335,7 +335,7 @@ export class PrefsDialog extends EventTarget {
|
|||
|
||||
cal = PrefsDialog._createCheckAndLabel(
|
||||
'stop-idle-div',
|
||||
'Stop seeding if idle for N mins:'
|
||||
'Stop seeding if idle for N mins:',
|
||||
);
|
||||
cal.check.dataset.key = 'idle-seeding-limit-enabled';
|
||||
root.append(cal.root);
|
||||
|
@ -389,7 +389,7 @@ export class PrefsDialog extends EventTarget {
|
|||
|
||||
let cal = PrefsDialog._createCheckAndLabel(
|
||||
'upload-speed-div',
|
||||
'Upload (kB/s):'
|
||||
'Upload (kB/s):',
|
||||
);
|
||||
cal.check.dataset.key = 'speed-limit-up-enabled';
|
||||
root.append(cal.root);
|
||||
|
@ -404,7 +404,7 @@ export class PrefsDialog extends EventTarget {
|
|||
|
||||
cal = PrefsDialog._createCheckAndLabel(
|
||||
'download-speed-div',
|
||||
'Download (kB/s):'
|
||||
'Download (kB/s):',
|
||||
);
|
||||
cal.check.dataset.key = 'speed-limit-down-enabled';
|
||||
root.append(cal.root);
|
||||
|
@ -567,7 +567,7 @@ export class PrefsDialog extends EventTarget {
|
|||
|
||||
let cal = PrefsDialog._createCheckAndLabel(
|
||||
'use-pex-div',
|
||||
'Use PEX to find more peers'
|
||||
'Use PEX to find more peers',
|
||||
);
|
||||
cal.check.title =
|
||||
"PEX is a tool for exchanging peer lists with the peers you're connected to.";
|
||||
|
@ -578,7 +578,7 @@ export class PrefsDialog extends EventTarget {
|
|||
|
||||
cal = PrefsDialog._createCheckAndLabel(
|
||||
'use-dht-div',
|
||||
'Use DHT to find more peers'
|
||||
'Use DHT to find more peers',
|
||||
);
|
||||
cal.check.title = 'DHT is a tool for finding peers without a tracker.';
|
||||
cal.check.dataset.key = 'dht-enabled';
|
||||
|
@ -588,7 +588,7 @@ export class PrefsDialog extends EventTarget {
|
|||
|
||||
cal = PrefsDialog._createCheckAndLabel(
|
||||
'use-lpd-div',
|
||||
'Use LPD to find more peers'
|
||||
'Use LPD to find more peers',
|
||||
);
|
||||
cal.check.title = 'LPD is a tool for finding peers on your local network.';
|
||||
cal.check.dataset.key = 'lpd-enabled';
|
||||
|
@ -603,7 +603,7 @@ export class PrefsDialog extends EventTarget {
|
|||
|
||||
cal = PrefsDialog._createCheckAndLabel(
|
||||
'blocklist-enabled-div',
|
||||
'Enable blocklist:'
|
||||
'Enable blocklist:',
|
||||
);
|
||||
cal.check.dataset.key = 'blocklist-enabled';
|
||||
root.append(cal.root);
|
||||
|
@ -679,7 +679,7 @@ export class PrefsDialog extends EventTarget {
|
|||
|
||||
let cal = PrefsDialog._createCheckAndLabel(
|
||||
'randomize-port',
|
||||
'Randomize port on launch'
|
||||
'Randomize port on launch',
|
||||
);
|
||||
cal.check.dataset.key = 'peer-port-random-on-start';
|
||||
root.append(cal.root);
|
||||
|
@ -687,7 +687,7 @@ export class PrefsDialog extends EventTarget {
|
|||
|
||||
cal = PrefsDialog._createCheckAndLabel(
|
||||
'port-forwarding',
|
||||
'Use port forwarding from my router'
|
||||
'Use port forwarding from my router',
|
||||
);
|
||||
cal.check.dataset.key = 'port-forwarding-enabled';
|
||||
root.append(cal.root);
|
||||
|
@ -700,7 +700,7 @@ export class PrefsDialog extends EventTarget {
|
|||
|
||||
cal = PrefsDialog._createCheckAndLabel(
|
||||
'utp-enabled',
|
||||
'Enable uTP for peer communication'
|
||||
'Enable uTP for peer communication',
|
||||
);
|
||||
cal.check.dataset.key = 'utp-enabled';
|
||||
root.append(cal.root);
|
||||
|
@ -775,13 +775,13 @@ export class PrefsDialog extends EventTarget {
|
|||
setTextContent(event_.target, 'Updating blocklist...');
|
||||
this.remote.updateBlocklist();
|
||||
this._setBlocklistButtonEnabled(false);
|
||||
}
|
||||
},
|
||||
);
|
||||
this.elements.torrents.register_handler_button.addEventListener(
|
||||
'click',
|
||||
(event_) => {
|
||||
PrefsDialog._toggleProtocolHandler(event_.currentTarget);
|
||||
}
|
||||
},
|
||||
);
|
||||
this.outside = new OutsideClickListener(this.elements.root);
|
||||
this.outside.addEventListener('click', () => this.close());
|
||||
|
@ -829,7 +829,7 @@ export class PrefsDialog extends EventTarget {
|
|||
this.outside.stop();
|
||||
this.session_manager.removeEventListener(
|
||||
'session-change',
|
||||
this.update_soon
|
||||
this.update_soon,
|
||||
);
|
||||
this.elements.root.remove();
|
||||
dispatchEvent(new Event('close'));
|
||||
|
|
|
@ -71,7 +71,7 @@ export class Remote {
|
|||
heading: 'Connection failed',
|
||||
message:
|
||||
'Could not connect to the server. You may need to reload the page to reconnect.',
|
||||
})
|
||||
}),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ export class Remote {
|
|||
},
|
||||
() => {
|
||||
this._controller.refreshTorrents([torrentId]);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -189,7 +189,7 @@ export class Remote {
|
|||
'torrent-stop',
|
||||
torrent_ids,
|
||||
callback,
|
||||
context
|
||||
context,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -202,7 +202,7 @@ export class Remote {
|
|||
move: true,
|
||||
},
|
||||
callback,
|
||||
context
|
||||
context,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -229,7 +229,7 @@ export class Remote {
|
|||
'torrent-verify',
|
||||
torrent_ids,
|
||||
callback,
|
||||
context
|
||||
context,
|
||||
);
|
||||
}
|
||||
reannounceTorrents(torrent_ids, callback, context) {
|
||||
|
@ -237,7 +237,7 @@ export class Remote {
|
|||
'torrent-reannounce',
|
||||
torrent_ids,
|
||||
callback,
|
||||
context
|
||||
context,
|
||||
);
|
||||
}
|
||||
addTorrentByUrl(url, options) {
|
||||
|
@ -279,7 +279,7 @@ export class Remote {
|
|||
RPC._QueueMoveTop,
|
||||
torrent_ids,
|
||||
callback,
|
||||
context
|
||||
context,
|
||||
);
|
||||
}
|
||||
moveTorrentsToBottom(torrent_ids, callback, context) {
|
||||
|
@ -287,7 +287,7 @@ export class Remote {
|
|||
RPC._QueueMoveBottom,
|
||||
torrent_ids,
|
||||
callback,
|
||||
context
|
||||
context,
|
||||
);
|
||||
}
|
||||
moveTorrentsUp(torrent_ids, callback, context) {
|
||||
|
@ -295,7 +295,7 @@ export class Remote {
|
|||
RPC._QueueMoveUp,
|
||||
torrent_ids,
|
||||
callback,
|
||||
context
|
||||
context,
|
||||
);
|
||||
}
|
||||
moveTorrentsDown(torrent_ids, callback, context) {
|
||||
|
@ -303,7 +303,7 @@ export class Remote {
|
|||
RPC._QueueMoveDown,
|
||||
torrent_ids,
|
||||
callback,
|
||||
context
|
||||
context,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ export class StatisticsDialog extends EventTarget {
|
|||
setTextContent(this.elements.session.ratio, fmt.ratioString(ratio));
|
||||
setTextContent(
|
||||
this.elements.session.time,
|
||||
fmt.timeInterval(s.secondsActive)
|
||||
fmt.timeInterval(s.secondsActive),
|
||||
);
|
||||
|
||||
s = stats['cumulative-stats'];
|
||||
|
|
|
@ -175,7 +175,7 @@ export class TorrentRendererFull {
|
|||
Formatter.size(t.getTotalSize()),
|
||||
' (',
|
||||
t.getPercentDoneStr(),
|
||||
'%)'
|
||||
'%)',
|
||||
);
|
||||
}
|
||||
// append UL stats: ', uploaded 8.59 GiB (Ratio: 12.3)'
|
||||
|
@ -184,7 +184,7 @@ export class TorrentRendererFull {
|
|||
Formatter.size(t.getUploadedEver()),
|
||||
' (Ratio ',
|
||||
Formatter.ratioString(t.getUploadRatio()),
|
||||
')'
|
||||
')',
|
||||
);
|
||||
} else {
|
||||
// not done yet
|
||||
|
@ -194,7 +194,7 @@ export class TorrentRendererFull {
|
|||
Formatter.size(sizeWhenDone),
|
||||
' (',
|
||||
t.getPercentDoneStr(),
|
||||
'%)'
|
||||
'%)',
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -325,7 +325,7 @@ export class TorrentRendererCompact {
|
|||
}
|
||||
if (t.isSeeding()) {
|
||||
return `Ratio: ${Formatter.ratioString(
|
||||
t.getUploadRatio()
|
||||
t.getUploadRatio(),
|
||||
)}, ${TorrentRendererHelper.formatUL(t)}`;
|
||||
}
|
||||
return t.getStateString();
|
||||
|
|
|
@ -42,7 +42,7 @@ export class Transmission extends EventTarget {
|
|||
this.remote = new Remote(this);
|
||||
|
||||
this.addEventListener('torrent-selection-changed', (event_) =>
|
||||
this.action_manager.update(event_)
|
||||
this.action_manager.update(event_),
|
||||
);
|
||||
|
||||
// Initialize the implementation fields
|
||||
|
@ -57,7 +57,7 @@ export class Transmission extends EventTarget {
|
|||
this.boundPopupCloseListener = this.popupCloseListener.bind(this);
|
||||
this.dispatchSelectionChangedSoon = debounce(
|
||||
() => this._dispatchSelectionChanged(),
|
||||
200
|
||||
200,
|
||||
);
|
||||
|
||||
// listen to actions
|
||||
|
@ -74,13 +74,13 @@ export class Transmission extends EventTarget {
|
|||
.querySelector('#filter-tracker')
|
||||
.addEventListener('change', (event_) => {
|
||||
this.setFilterTracker(
|
||||
event_.target.value === 'all' ? null : event_.target.value
|
||||
event_.target.value === 'all' ? null : event_.target.value,
|
||||
);
|
||||
});
|
||||
|
||||
this.action_manager.addEventListener('change', (event_) => {
|
||||
for (const element of document.querySelectorAll(
|
||||
`[data-action="${event_.action}"]`
|
||||
`[data-action="${event_.action}"]`,
|
||||
)) {
|
||||
setEnabled(element, event_.enabled);
|
||||
}
|
||||
|
@ -145,8 +145,8 @@ export class Transmission extends EventTarget {
|
|||
this,
|
||||
this.prefs,
|
||||
this.remote,
|
||||
this.action_manager
|
||||
)
|
||||
this.action_manager,
|
||||
),
|
||||
);
|
||||
const btnbox = document
|
||||
.querySelector('#toolbar-overflow')
|
||||
|
@ -155,7 +155,7 @@ export class Transmission extends EventTarget {
|
|||
this.popup.root,
|
||||
btnbox.left + btnbox.width,
|
||||
btnbox.top + btnbox.height,
|
||||
document.body
|
||||
document.body,
|
||||
);
|
||||
}
|
||||
break;
|
||||
|
@ -240,7 +240,7 @@ export class Transmission extends EventTarget {
|
|||
popup.root,
|
||||
event_.x,
|
||||
event_.y,
|
||||
document.querySelector('#torrent-container')
|
||||
document.querySelector('#torrent-container'),
|
||||
);
|
||||
event_.preventDefault();
|
||||
});
|
||||
|
@ -254,7 +254,7 @@ export class Transmission extends EventTarget {
|
|||
// this.updateButtonsSoon();
|
||||
|
||||
this.prefs.addEventListener('change', ({ key, value }) =>
|
||||
this._onPrefChanged(key, value)
|
||||
this._onPrefChanged(key, value),
|
||||
);
|
||||
for (const [key, value] of this.prefs.entries()) {
|
||||
this._onPrefChanged(key, value);
|
||||
|
@ -264,7 +264,7 @@ export class Transmission extends EventTarget {
|
|||
_openTorrentFromUrl() {
|
||||
setTimeout(() => {
|
||||
const addTorrent = new URLSearchParams(window.location.search).get(
|
||||
'addtorrent'
|
||||
'addtorrent',
|
||||
);
|
||||
if (addTorrent) {
|
||||
this.setCurrentPopup(new OpenDialog(this, this.remote, addTorrent));
|
||||
|
@ -414,7 +414,7 @@ export class Transmission extends EventTarget {
|
|||
|
||||
_indexOfLastTorrent() {
|
||||
return this._rows.findIndex(
|
||||
(row) => row.getTorrentId() === this._last_torrent_clicked
|
||||
(row) => row.getTorrentId() === this._last_torrent_clicked,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -632,7 +632,7 @@ export class Transmission extends EventTarget {
|
|||
const msec = 8000;
|
||||
this.sessionInterval = setInterval(
|
||||
this.loadDaemonPrefs.bind(this),
|
||||
msec
|
||||
msec,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -795,7 +795,7 @@ TODO: fix this when notifications get fixed
|
|||
const torrents = this.getSelectedTorrents();
|
||||
if (torrents.length > 0) {
|
||||
this.setCurrentPopup(
|
||||
new RemoveDialog({ remote: this.remote, torrents, trash })
|
||||
new RemoveDialog({ remote: this.remote, torrents, trash }),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -809,14 +809,14 @@ TODO: fix this when notifications get fixed
|
|||
Transmission._getTorrentIds(torrents),
|
||||
force,
|
||||
this.refreshTorrents,
|
||||
this
|
||||
this,
|
||||
);
|
||||
}
|
||||
_verifyTorrents(torrents) {
|
||||
this.remote.verifyTorrents(
|
||||
Transmission._getTorrentIds(torrents),
|
||||
this.refreshTorrents,
|
||||
this
|
||||
this,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -824,7 +824,7 @@ TODO: fix this when notifications get fixed
|
|||
this.remote.reannounceTorrents(
|
||||
Transmission._getTorrentIds(torrents),
|
||||
this.refreshTorrents,
|
||||
this
|
||||
this,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -832,7 +832,7 @@ TODO: fix this when notifications get fixed
|
|||
this.remote.stopTorrents(
|
||||
Transmission._getTorrentIds(torrents),
|
||||
this.refreshTorrents,
|
||||
this
|
||||
this,
|
||||
);
|
||||
}
|
||||
changeFileCommand(torrentId, rowIndices, command) {
|
||||
|
@ -844,28 +844,28 @@ TODO: fix this when notifications get fixed
|
|||
this.remote.moveTorrentsToTop(
|
||||
this._getSelectedTorrentIds(),
|
||||
this.refreshTorrents,
|
||||
this
|
||||
this,
|
||||
);
|
||||
}
|
||||
_moveUp() {
|
||||
this.remote.moveTorrentsUp(
|
||||
this._getSelectedTorrentIds(),
|
||||
this.refreshTorrents,
|
||||
this
|
||||
this,
|
||||
);
|
||||
}
|
||||
_moveDown() {
|
||||
this.remote.moveTorrentsDown(
|
||||
this._getSelectedTorrentIds(),
|
||||
this.refreshTorrents,
|
||||
this
|
||||
this,
|
||||
);
|
||||
}
|
||||
_moveBottom() {
|
||||
this.remote.moveTorrentsToBottom(
|
||||
this._getSelectedTorrentIds(),
|
||||
this.refreshTorrents,
|
||||
this
|
||||
this,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -888,11 +888,11 @@ TODO: fix this when notifications get fixed
|
|||
|
||||
const u = torrents.reduce(
|
||||
(accumulator, tor) => accumulator + tor.getUploadSpeed(),
|
||||
0
|
||||
0,
|
||||
);
|
||||
const d = torrents.reduce(
|
||||
(accumulator, tor) => accumulator + tor.getDownloadSpeed(),
|
||||
0
|
||||
0,
|
||||
);
|
||||
const string = fmt.countString('Transfer', 'Transfers', this._rows.length);
|
||||
|
||||
|
@ -943,7 +943,7 @@ TODO: fix this when notifications get fixed
|
|||
Torrent.sortTorrents(
|
||||
torrents,
|
||||
this.prefs.sort_mode,
|
||||
this.prefs.sort_direction
|
||||
this.prefs.sort_direction,
|
||||
);
|
||||
for (const [index, tor] of torrents.entries()) {
|
||||
rows[index] = id2row[tor.getId()];
|
||||
|
@ -971,7 +971,7 @@ TODO: fix this when notifications get fixed
|
|||
const countSelectedRows = () =>
|
||||
[...list.children].reduce(
|
||||
(n, e) => (n + e.classList.contains('selected') ? 1 : 0),
|
||||
0
|
||||
0,
|
||||
);
|
||||
const old_row_count = countRows();
|
||||
const old_sel_count = countSelectedRows();
|
||||
|
@ -1029,7 +1029,7 @@ TODO: fix this when notifications get fixed
|
|||
dirty_rows.push(row);
|
||||
e.addEventListener('click', this._onRowClicked.bind(this));
|
||||
e.addEventListener('dblclick', () =>
|
||||
this.action_manager.click('show-inspector')
|
||||
this.action_manager.click('show-inspector'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -1056,7 +1056,7 @@ TODO: fix this when notifications get fixed
|
|||
clean_rows[ci].getTorrent(),
|
||||
dirty_rows[di].getTorrent(),
|
||||
sort_mode,
|
||||
sort_direction
|
||||
sort_direction,
|
||||
);
|
||||
push_clean = c < 0;
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ export function createTextualTabsContainer(id, tabs, callback) {
|
|||
pages.append(page);
|
||||
|
||||
button.addEventListener('click', () =>
|
||||
toggleClass(buttons, button, pages, page, callback)
|
||||
toggleClass(buttons, button, pages, page, callback),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -119,7 +119,7 @@ export function createTabsContainer(id, tabs, callback) {
|
|||
pages.append(page);
|
||||
|
||||
button.addEventListener('click', () =>
|
||||
toggleClass(buttons, button, pages, page, callback)
|
||||
toggleClass(buttons, button, pages, page, callback),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -191,11 +191,11 @@ export function createDialogContainer(id) {
|
|||
|
||||
export function makeUUID() {
|
||||
// source: https://stackoverflow.com/a/2117523/6568470
|
||||
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, (c) =>
|
||||
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replaceAll(/[018]/g, (c) =>
|
||||
(
|
||||
c ^
|
||||
(crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))
|
||||
).toString(16)
|
||||
).toString(16),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -291,7 +291,7 @@ export function movePopup(popup, x, y, boundingElement) {
|
|||
const initial_pos = new DOMRect(x, y, popup.clientWidth, popup.clientHeight);
|
||||
const clamped_pos = getBestMenuPos(
|
||||
initial_pos,
|
||||
boundingElement.getBoundingClientRect()
|
||||
boundingElement.getBoundingClientRect(),
|
||||
);
|
||||
popup.style.left = `${clamped_pos.left}px`;
|
||||
popup.style.top = `${clamped_pos.top}px`;
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
|
||||
module.exports = {
|
||||
"extends": [
|
||||
"stylelint-config-sass-guidelines",
|
||||
"stylelint-config-prettier"
|
||||
"stylelint-config-sass-guidelines"
|
||||
],
|
||||
"plugins": [
|
||||
"@primer/stylelint-config/plugins/no-undefined-vars",
|
||||
|
@ -22,7 +21,6 @@ module.exports = {
|
|||
"no-duplicate-at-import-rules": true,
|
||||
"no-duplicate-selectors": null,
|
||||
"no-empty-source": true,
|
||||
"no-extra-semicolons": true,
|
||||
"no-invalid-double-slash-comments": true,
|
||||
"primer/no-undefined-vars": true,
|
||||
"primer/no-unused-vars": true,
|
||||
|
|
Loading…
Reference in New Issue