[Web] Magnet link, Main window toolbar accessibility, ARM build fix, Dependencies update (#2586)
Add magnet link to web client's torrent inspector
This commit is contained in:
parent
f105c6ac81
commit
b11cf4ca00
|
@ -1,3 +1,4 @@
|
||||||
|
.idea
|
||||||
.vscode
|
.vscode
|
||||||
/REVISION
|
/REVISION
|
||||||
/beta
|
/beta
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
v16.14.0
|
|
@ -18,20 +18,19 @@
|
||||||
"lint:stylelint:fix": "stylelint --fix style/*scss"
|
"lint:stylelint:fix": "stylelint --fix style/*scss"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.14.3",
|
"@babel/core": "^7.14.8",
|
||||||
"@babel/eslint-parser": "^7.14.3",
|
"@babel/eslint-parser": "^7.14.9",
|
||||||
"@babel/plugin-proposal-class-properties": "^7.13.0",
|
"@babel/plugin-proposal-class-properties": "^7.13.0",
|
||||||
"css-loader": "^5.2.4",
|
"css-loader": "^5.2.7",
|
||||||
"css-minimizer-webpack-plugin": "^3.0.0",
|
"css-minimizer-webpack-plugin": "^3.0.2",
|
||||||
"eslint": "^7.26.0",
|
"eslint": "^7.26.0",
|
||||||
"eslint-plugin-sonarjs": "^0.7.0",
|
"eslint-plugin-sonarjs": "^0.7.0",
|
||||||
"eslint-plugin-unicorn": "^32.0.1",
|
"eslint-plugin-unicorn": "^32.0.1",
|
||||||
"file-loader": "^6.2.0",
|
"file-loader": "^6.2.0",
|
||||||
"img-optimize-loader": "^1.0.7",
|
"mini-css-extract-plugin": "^1.6.2",
|
||||||
"mini-css-extract-plugin": "^1.6.0",
|
"node-sass": "^6.0.1",
|
||||||
"node-sass": "^6.0.0",
|
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
"prettier": "^2.3.0",
|
"prettier": "^2.3.2",
|
||||||
"sass": "^1.32.13",
|
"sass": "^1.32.13",
|
||||||
"sass-loader": "^11.1.1",
|
"sass-loader": "^11.1.1",
|
||||||
"style-loader": "^2.0.0",
|
"style-loader": "^2.0.0",
|
||||||
|
@ -40,14 +39,14 @@
|
||||||
"stylelint-config-primer": "^11.0.1",
|
"stylelint-config-primer": "^11.0.1",
|
||||||
"stylelint-config-sass-guidelines": "^8.0.0",
|
"stylelint-config-sass-guidelines": "^8.0.0",
|
||||||
"stylelint-config-standard": "^22.0.0",
|
"stylelint-config-standard": "^22.0.0",
|
||||||
"svgo": "^2.3.0",
|
"svgo": "^2.3.1",
|
||||||
"svgo-loader": "^3.0.0",
|
"svgo-loader": "^3.0.0",
|
||||||
"terser-webpack-plugin": "^5.1.2",
|
"terser-webpack-plugin": "^5.1.4",
|
||||||
"url-loader": "^4.1.1",
|
"url-loader": "^4.1.1",
|
||||||
"webpack": "^5.37.0",
|
"webpack": "^5.37.1",
|
||||||
"webpack-bundle-analyzer": "^4.4.2",
|
"webpack-bundle-analyzer": "^4.4.2",
|
||||||
"webpack-cli": "^4.7.0",
|
"webpack-cli": "^4.7.2",
|
||||||
"webpack-dev-server": "^3.11.2"
|
"webpack-dev-server": "^3.11.3"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lodash.isequal": "^4.5.0"
|
"lodash.isequal": "^4.5.0"
|
||||||
|
|
|
@ -24,22 +24,24 @@
|
||||||
class="toolbar-button"
|
class="toolbar-button"
|
||||||
data-action="open-torrent"
|
data-action="open-torrent"
|
||||||
id="toolbar-open"
|
id="toolbar-open"
|
||||||
|
tabindex="0"
|
||||||
></button>
|
></button>
|
||||||
<button
|
<button
|
||||||
aria-keyshortcuts="Alt+Delete"
|
aria-keyshortcuts="Alt+Delete"
|
||||||
aria-label="Remove selected torrents"
|
aria-label="Remove selected torrents"
|
||||||
class="toolbar-button"
|
class="toolbar-button"
|
||||||
data-action="remove-selected-torrents"
|
data-action="remove-selected-torrents"
|
||||||
href="#"
|
|
||||||
id="toolbar-remove"
|
id="toolbar-remove"
|
||||||
|
tabindex="0"
|
||||||
></button>
|
></button>
|
||||||
<div href="#" class="toolbar-separator"></div>
|
<div class="toolbar-separator"></div>
|
||||||
<button
|
<button
|
||||||
aria-keyshortcuts="Alt+R"
|
aria-keyshortcuts="Alt+R"
|
||||||
aria-label="Resume selected torrents"
|
aria-label="Resume selected torrents"
|
||||||
class="toolbar-button"
|
class="toolbar-button"
|
||||||
data-action="resume-selected-torrents"
|
data-action="resume-selected-torrents"
|
||||||
id="toolbar-start"
|
id="toolbar-start"
|
||||||
|
tabindex="0"
|
||||||
></button>
|
></button>
|
||||||
<button
|
<button
|
||||||
aria-keyshortcuts="Alt+P"
|
aria-keyshortcuts="Alt+P"
|
||||||
|
@ -47,14 +49,16 @@
|
||||||
class="toolbar-button"
|
class="toolbar-button"
|
||||||
data-action="pause-selected-torrents"
|
data-action="pause-selected-torrents"
|
||||||
id="toolbar-pause"
|
id="toolbar-pause"
|
||||||
|
tabindex="0"
|
||||||
></button>
|
></button>
|
||||||
<div href="#" class="toolbar-separator"></div>
|
<div class="toolbar-separator"></div>
|
||||||
<button
|
<button
|
||||||
aria-keyshortcuts="Alt+I"
|
aria-keyshortcuts="Alt+I"
|
||||||
aria-label="Toggle inspector"
|
aria-label="Toggle inspector"
|
||||||
class="toolbar-button"
|
class="toolbar-button"
|
||||||
data-action="show-inspector"
|
data-action="show-inspector"
|
||||||
id="toolbar-inspector"
|
id="toolbar-inspector"
|
||||||
|
tabindex="0"
|
||||||
></button>
|
></button>
|
||||||
<div class="toolbar-separator"></div>
|
<div class="toolbar-separator"></div>
|
||||||
<button
|
<button
|
||||||
|
@ -63,6 +67,7 @@
|
||||||
class="toolbar-button"
|
class="toolbar-button"
|
||||||
data-action="show-overflow-menu"
|
data-action="show-overflow-menu"
|
||||||
id="toolbar-overflow"
|
id="toolbar-overflow"
|
||||||
|
tabindex="0"
|
||||||
></button>
|
></button>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -115,6 +115,7 @@ export class Inspector extends EventTarget {
|
||||||
['hash', 'Hash:'],
|
['hash', 'Hash:'],
|
||||||
['privacy', 'Privacy:'],
|
['privacy', 'Privacy:'],
|
||||||
['origin', 'Origin:'],
|
['origin', 'Origin:'],
|
||||||
|
['magnetLink', 'Magnet:'],
|
||||||
['comment', 'Comment:'],
|
['comment', 'Comment:'],
|
||||||
];
|
];
|
||||||
for (const [name, text] of rows) {
|
for (const [name, text] of rows) {
|
||||||
|
@ -528,6 +529,19 @@ export class Inspector extends EventTarget {
|
||||||
string = torrents.every((t) => get(t) === first) ? first : mixed;
|
string = torrents.every((t) => get(t) === first) ? first : mixed;
|
||||||
}
|
}
|
||||||
setTextContent(e.info.location, string);
|
setTextContent(e.info.location, string);
|
||||||
|
|
||||||
|
// magnetLink
|
||||||
|
if (torrents.length === 0) {
|
||||||
|
setTextContent(e.info.magnetLink, none);
|
||||||
|
} else if (torrents.length > 1) {
|
||||||
|
setTextContent(e.info.magnetLink, mixed);
|
||||||
|
} else {
|
||||||
|
const link = torrents[0].getMagnetLink();
|
||||||
|
Utils.setInnerHTML(
|
||||||
|
e.info.magnetLink,
|
||||||
|
`<a class="inspector-info-magnet" href="${link}"><button></button></a>`
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// PEERS PAGE
|
/// PEERS PAGE
|
||||||
|
|
|
@ -209,6 +209,9 @@ export class Torrent extends EventTarget {
|
||||||
getLeftUntilDone() {
|
getLeftUntilDone() {
|
||||||
return this.fields.leftUntilDone;
|
return this.fields.leftUntilDone;
|
||||||
}
|
}
|
||||||
|
getMagnetLink() {
|
||||||
|
return this.fields.magnetLink;
|
||||||
|
}
|
||||||
getMetadataPercentComplete() {
|
getMetadataPercentComplete() {
|
||||||
return this.fields.metadataPercentComplete;
|
return this.fields.metadataPercentComplete;
|
||||||
}
|
}
|
||||||
|
@ -653,6 +656,7 @@ Torrent.Fields.InfoExtra = [
|
||||||
'files',
|
'files',
|
||||||
'hashString',
|
'hashString',
|
||||||
'isPrivate',
|
'isPrivate',
|
||||||
|
'magnetLink',
|
||||||
'pieceCount',
|
'pieceCount',
|
||||||
'pieceSize',
|
'pieceSize',
|
||||||
];
|
];
|
||||||
|
|
|
@ -25,6 +25,7 @@ license: MIT
|
||||||
* files.svg
|
* files.svg
|
||||||
* gear-fill.svg
|
* gear-fill.svg
|
||||||
* lock-fill.svg
|
* lock-fill.svg
|
||||||
|
* magnet.svg
|
||||||
* search.svg
|
* search.svg
|
||||||
* three-dots-vertical.svg
|
* three-dots-vertical.svg
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-magnet" viewBox="0 0 16 16">
|
||||||
|
<path fill-rule="evenodd" d="M8 1a7 7 0 0 0-7 7v3h4V8a3 3 0 0 1 6 0v3h4V8a7 7 0 0 0-7-7Zm7 11h-4v3h4v-3ZM5 12H1v3h4v-3ZM0 8a8 8 0 1 1 16 0v8h-6V8a2 2 0 1 0-4 0v8H0V8Z"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 303 B |
|
@ -42,6 +42,7 @@ $image-chevron-dn: 'images/chevron-down.svg';
|
||||||
$image-chevron-up: 'images/chevron-up.svg';
|
$image-chevron-up: 'images/chevron-up.svg';
|
||||||
$image-lock-fill: 'images/lock-fill.svg';
|
$image-lock-fill: 'images/lock-fill.svg';
|
||||||
$image-network: 'images/router.svg';
|
$image-network: 'images/router.svg';
|
||||||
|
$image-magnet: 'images/magnet.svg';
|
||||||
$image-overflow: 'images/three-dots-vertical.svg';
|
$image-overflow: 'images/three-dots-vertical.svg';
|
||||||
$image-pause-circle-active: 'images/pause-circle-active.svg';
|
$image-pause-circle-active: 'images/pause-circle-active.svg';
|
||||||
$image-pause-circle-idle: 'images/pause-circle-idle.svg';
|
$image-pause-circle-idle: 'images/pause-circle-idle.svg';
|
||||||
|
@ -934,6 +935,20 @@ $popup-top: 61px; // TODO: ugly that this is hardcoded
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.inspector-info-magnet {
|
||||||
|
button {
|
||||||
|
background-color: transparent;
|
||||||
|
background-image: url($image-magnet);
|
||||||
|
background-position: top;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
border: 0;
|
||||||
|
cursor: pointer;
|
||||||
|
height: 1rem;
|
||||||
|
vertical-align: middle;
|
||||||
|
width: 1rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#inspector .tabs-button,
|
#inspector .tabs-button,
|
||||||
#prefs-dialog .tabs-button {
|
#prefs-dialog .tabs-button {
|
||||||
background-size: 20px 20px, 40px 30px;
|
background-size: 20px 20px, 40px 30px;
|
||||||
|
|
4884
web/yarn.lock
4884
web/yarn.lock
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue