mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 15:07:22 -06:00
WebUI: enforce string quotes coding style
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
* exception statement from your version.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
"use strict";
|
||||
|
||||
if (window.qBittorrent === undefined) {
|
||||
window.qBittorrent = {};
|
||||
@@ -51,35 +51,35 @@ window.qBittorrent.PiecesBar = (() => {
|
||||
const PiecesBar = new Class({
|
||||
initialize(pieces, parameters) {
|
||||
const vals = {
|
||||
'id': 'piecesbar_' + (piecesBarUniqueId++),
|
||||
'width': 0,
|
||||
'height': 0,
|
||||
'downloadingColor': 'hsl(110deg 94% 27%)', // @TODO palette vars not supported for this value, apply average
|
||||
'haveColor': 'hsl(210deg 55% 55%)', // @TODO palette vars not supported for this value, apply average
|
||||
'borderSize': 1,
|
||||
'borderColor': 'var(--color-border-default)'
|
||||
"id": "piecesbar_" + (piecesBarUniqueId++),
|
||||
"width": 0,
|
||||
"height": 0,
|
||||
"downloadingColor": "hsl(110deg 94% 27%)", // @TODO palette vars not supported for this value, apply average
|
||||
"haveColor": "hsl(210deg 55% 55%)", // @TODO palette vars not supported for this value, apply average
|
||||
"borderSize": 1,
|
||||
"borderColor": "var(--color-border-default)"
|
||||
};
|
||||
|
||||
if (parameters && (typeOf(parameters) === 'object'))
|
||||
if (parameters && (typeOf(parameters) === "object"))
|
||||
Object.append(vals, parameters);
|
||||
vals.height = Math.max(vals.height, 12);
|
||||
|
||||
const obj = new Element('div', {
|
||||
'id': vals.id,
|
||||
'class': 'piecesbarWrapper',
|
||||
'styles': {
|
||||
'border': vals.borderSize.toString() + 'px solid ' + vals.borderColor,
|
||||
'height': vals.height.toString() + 'px',
|
||||
const obj = new Element("div", {
|
||||
"id": vals.id,
|
||||
"class": "piecesbarWrapper",
|
||||
"styles": {
|
||||
"border": vals.borderSize.toString() + "px solid " + vals.borderColor,
|
||||
"height": vals.height.toString() + "px",
|
||||
}
|
||||
});
|
||||
obj.vals = vals;
|
||||
obj.vals.pieces = [pieces, []].pick();
|
||||
|
||||
obj.vals.canvas = new Element('canvas', {
|
||||
'id': vals.id + '_canvas',
|
||||
'class': 'piecesbarCanvas',
|
||||
'width': (vals.width - (2 * vals.borderSize)).toString(),
|
||||
'height': '1' // will stretch vertically to take up the height of the parent
|
||||
obj.vals.canvas = new Element("canvas", {
|
||||
"id": vals.id + "_canvas",
|
||||
"class": "piecesbarCanvas",
|
||||
"width": (vals.width - (2 * vals.borderSize)).toString(),
|
||||
"height": "1" // will stretch vertically to take up the height of the parent
|
||||
});
|
||||
obj.appendChild(obj.vals.canvas);
|
||||
|
||||
@@ -124,7 +124,7 @@ window.qBittorrent.PiecesBar = (() => {
|
||||
this.vals.canvas.width = width - (2 * this.vals.borderSize);
|
||||
|
||||
const canvas = this.vals.canvas;
|
||||
const ctx = canvas.getContext('2d');
|
||||
const ctx = canvas.getContext("2d");
|
||||
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||
|
||||
const imageWidth = canvas.width;
|
||||
@@ -246,7 +246,7 @@ window.qBittorrent.PiecesBar = (() => {
|
||||
|
||||
function drawStatus(ctx, start, width, statusValues) {
|
||||
// mix the colors by using transparency and a composite mode
|
||||
ctx.globalCompositeOperation = 'lighten';
|
||||
ctx.globalCompositeOperation = "lighten";
|
||||
|
||||
if (statusValues[STATUS_DOWNLOADING]) {
|
||||
ctx.globalAlpha = statusValues[STATUS_DOWNLOADING];
|
||||
|
||||
Reference in New Issue
Block a user