mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 15:37:26 -06:00
Make WebUI images self-contained
This commit is contained in:
@@ -417,7 +417,7 @@ window.addEvent('load', function() {
|
||||
|
||||
const create_link = function(hash, text, count) {
|
||||
const html = '<a href="#" onclick="setCategoryFilter(' + hash + ');return false;">'
|
||||
+ '<img src="icons/view-categories.svg"/>'
|
||||
+ '<img src="images/view-categories.svg"/>'
|
||||
+ window.qBittorrent.Misc.escapeHtml(text) + ' (' + count + ')' + '</a>';
|
||||
const el = new Element('li', {
|
||||
id: hash,
|
||||
@@ -474,7 +474,7 @@ window.addEvent('load', function() {
|
||||
|
||||
const createLink = function(hash, text, count) {
|
||||
const html = '<a href="#" onclick="setTagFilter(' + hash + ');return false;">'
|
||||
+ '<img src="icons/tags.svg"/>'
|
||||
+ '<img src="images/tags.svg"/>'
|
||||
+ window.qBittorrent.Misc.escapeHtml(text) + ' (' + count + ')' + '</a>';
|
||||
const el = new Element('li', {
|
||||
id: hash,
|
||||
@@ -528,7 +528,7 @@ window.addEvent('load', function() {
|
||||
|
||||
const createLink = function(hash, text, count) {
|
||||
const html = '<a href="#" onclick="setTrackerFilter(' + hash + ');return false;">'
|
||||
+ '<img src="icons/trackers.svg"/>'
|
||||
+ '<img src="images/trackers.svg"/>'
|
||||
+ window.qBittorrent.Misc.escapeHtml(text.replace("%1", count)) + '</a>';
|
||||
const el = new Element('li', {
|
||||
id: hash,
|
||||
@@ -768,15 +768,15 @@ window.addEvent('load', function() {
|
||||
|
||||
switch (serverState.connection_status) {
|
||||
case 'connected':
|
||||
$('connectionStatus').src = 'icons/connected.svg';
|
||||
$('connectionStatus').src = 'images/connected.svg';
|
||||
$('connectionStatus').alt = 'QBT_TR(Connection status: Connected)QBT_TR[CONTEXT=MainWindow]';
|
||||
break;
|
||||
case 'firewalled':
|
||||
$('connectionStatus').src = 'icons/firewalled.svg';
|
||||
$('connectionStatus').src = 'images/firewalled.svg';
|
||||
$('connectionStatus').alt = 'QBT_TR(Connection status: Firewalled)QBT_TR[CONTEXT=MainWindow]';
|
||||
break;
|
||||
default:
|
||||
$('connectionStatus').src = 'icons/disconnected.svg';
|
||||
$('connectionStatus').src = 'images/disconnected.svg';
|
||||
$('connectionStatus').alt = 'QBT_TR(Connection status: Disconnected)QBT_TR[CONTEXT=MainWindow]';
|
||||
break;
|
||||
}
|
||||
@@ -813,11 +813,11 @@ window.addEvent('load', function() {
|
||||
|
||||
const updateAltSpeedIcon = function(enabled) {
|
||||
if (enabled) {
|
||||
$('alternativeSpeedLimits').src = 'icons/slow.svg';
|
||||
$('alternativeSpeedLimits').src = 'images/slow.svg';
|
||||
$('alternativeSpeedLimits').alt = 'QBT_TR(Alternative speed limits: On)QBT_TR[CONTEXT=MainWindow]';
|
||||
}
|
||||
else {
|
||||
$('alternativeSpeedLimits').src = 'icons/slow_off.svg';
|
||||
$('alternativeSpeedLimits').src = 'images/slow_off.svg';
|
||||
$('alternativeSpeedLimits').alt = 'QBT_TR(Alternative speed limits: Off)QBT_TR[CONTEXT=MainWindow]';
|
||||
}
|
||||
};
|
||||
|
||||
@@ -433,10 +433,10 @@ window.qBittorrent.ContextMenu = (function() {
|
||||
const categoryList = $('contextCategoryList');
|
||||
categoryList.empty();
|
||||
categoryList.appendChild(new Element('li', {
|
||||
html: '<a href="javascript:torrentNewCategoryFN();"><img src="icons/list-add.svg" alt="QBT_TR(New...)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(New...)QBT_TR[CONTEXT=TransferListWidget]</a>'
|
||||
html: '<a href="javascript:torrentNewCategoryFN();"><img src="images/list-add.svg" alt="QBT_TR(New...)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(New...)QBT_TR[CONTEXT=TransferListWidget]</a>'
|
||||
}));
|
||||
categoryList.appendChild(new Element('li', {
|
||||
html: '<a href="javascript:torrentSetCategoryFN(0);"><img src="icons/edit-clear.svg" alt="QBT_TR(Reset)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Reset)QBT_TR[CONTEXT=TransferListWidget]</a>'
|
||||
html: '<a href="javascript:torrentSetCategoryFN(0);"><img src="images/edit-clear.svg" alt="QBT_TR(Reset)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Reset)QBT_TR[CONTEXT=TransferListWidget]</a>'
|
||||
}));
|
||||
|
||||
const sortedCategories = [];
|
||||
@@ -449,7 +449,7 @@ window.qBittorrent.ContextMenu = (function() {
|
||||
Object.each(sortedCategories, function(categoryName) {
|
||||
const categoryHash = genHash(categoryName);
|
||||
const el = new Element('li', {
|
||||
html: '<a href="javascript:torrentSetCategoryFN(\'' + categoryHash + '\');"><img src="icons/view-categories.svg"/> ' + window.qBittorrent.Misc.escapeHtml(categoryName) + '</a>'
|
||||
html: '<a href="javascript:torrentSetCategoryFN(\'' + categoryHash + '\');"><img src="images/view-categories.svg"/> ' + window.qBittorrent.Misc.escapeHtml(categoryName) + '</a>'
|
||||
});
|
||||
if (first) {
|
||||
el.addClass('separator');
|
||||
@@ -466,13 +466,13 @@ window.qBittorrent.ContextMenu = (function() {
|
||||
|
||||
contextTagList.appendChild(new Element('li', {
|
||||
html: '<a href="javascript:torrentAddTagsFN();">'
|
||||
+ '<img src="icons/list-add.svg" alt="QBT_TR(Add...)QBT_TR[CONTEXT=TransferListWidget]"/>'
|
||||
+ '<img src="images/list-add.svg" alt="QBT_TR(Add...)QBT_TR[CONTEXT=TransferListWidget]"/>'
|
||||
+ ' QBT_TR(Add...)QBT_TR[CONTEXT=TransferListWidget]'
|
||||
+ '</a>'
|
||||
}));
|
||||
contextTagList.appendChild(new Element('li', {
|
||||
html: '<a href="javascript:torrentRemoveAllTagsFN();">'
|
||||
+ '<img src="icons/edit-clear.svg" alt="QBT_TR(Remove All)QBT_TR[CONTEXT=TransferListWidget]"/>'
|
||||
+ '<img src="images/edit-clear.svg" alt="QBT_TR(Remove All)QBT_TR[CONTEXT=TransferListWidget]"/>'
|
||||
+ ' QBT_TR(Remove All)QBT_TR[CONTEXT=TransferListWidget]'
|
||||
+ '</a>'
|
||||
}));
|
||||
|
||||
@@ -327,7 +327,7 @@ window.qBittorrent.DynamicTable = (function() {
|
||||
});
|
||||
|
||||
const createLi = function(columnName, text) {
|
||||
const html = '<a href="#' + columnName + '" ><img src="icons/checked-completed.svg"/>' + window.qBittorrent.Misc.escapeHtml(text) + '</a>';
|
||||
const html = '<a href="#' + columnName + '" ><img src="images/checked-completed.svg"/>' + window.qBittorrent.Misc.escapeHtml(text) + '</a>';
|
||||
return new Element('li', {
|
||||
html: html
|
||||
});
|
||||
@@ -944,33 +944,33 @@ window.qBittorrent.DynamicTable = (function() {
|
||||
case "forcedMetaDL":
|
||||
case "downloading":
|
||||
state = "downloading";
|
||||
img_path = "icons/downloading.svg";
|
||||
img_path = "images/downloading.svg";
|
||||
break;
|
||||
case "forcedUP":
|
||||
case "uploading":
|
||||
state = "uploading";
|
||||
img_path = "icons/upload.svg";
|
||||
img_path = "images/upload.svg";
|
||||
break;
|
||||
case "stalledUP":
|
||||
state = "stalledUP";
|
||||
img_path = "icons/stalledUP.svg";
|
||||
img_path = "images/stalledUP.svg";
|
||||
break;
|
||||
case "stalledDL":
|
||||
state = "stalledDL";
|
||||
img_path = "icons/stalledDL.svg";
|
||||
img_path = "images/stalledDL.svg";
|
||||
break;
|
||||
case "pausedDL":
|
||||
state = "torrent-stop";
|
||||
img_path = "icons/torrent-stop.svg";
|
||||
img_path = "images/torrent-stop.svg";
|
||||
break;
|
||||
case "pausedUP":
|
||||
state = "checked-completed";
|
||||
img_path = "icons/checked-completed.svg";
|
||||
img_path = "images/checked-completed.svg";
|
||||
break;
|
||||
case "queuedDL":
|
||||
case "queuedUP":
|
||||
state = "queued";
|
||||
img_path = "icons/queued.svg";
|
||||
img_path = "images/queued.svg";
|
||||
break;
|
||||
case "checkingDL":
|
||||
case "checkingUP":
|
||||
@@ -978,12 +978,12 @@ window.qBittorrent.DynamicTable = (function() {
|
||||
case "checkingResumeData":
|
||||
case "moving":
|
||||
state = "force-recheck";
|
||||
img_path = "icons/force-recheck.svg";
|
||||
img_path = "images/force-recheck.svg";
|
||||
break;
|
||||
case "unknown":
|
||||
case "missingFiles":
|
||||
state = "error";
|
||||
img_path = "icons/error.svg";
|
||||
img_path = "images/error.svg";
|
||||
break;
|
||||
default:
|
||||
break; // do nothing
|
||||
@@ -1526,7 +1526,7 @@ window.qBittorrent.DynamicTable = (function() {
|
||||
return;
|
||||
}
|
||||
|
||||
const img_path = 'icons/flags/' + country_code + '.svg';
|
||||
const img_path = 'images/flags/' + country_code + '.svg';
|
||||
|
||||
if (td.getChildren('img').length > 0) {
|
||||
const img = td.getChildren('img')[0];
|
||||
@@ -1898,7 +1898,7 @@ window.qBittorrent.DynamicTable = (function() {
|
||||
}
|
||||
else {
|
||||
const collapseIcon = new Element('img', {
|
||||
src: 'icons/go-down.svg',
|
||||
src: 'images/go-down.svg',
|
||||
styles: {
|
||||
'margin-left': (node.depth * 20)
|
||||
},
|
||||
@@ -1912,7 +1912,7 @@ window.qBittorrent.DynamicTable = (function() {
|
||||
id: fileNameId
|
||||
});
|
||||
const dirImg = new Element('img', {
|
||||
src: 'icons/directory.svg',
|
||||
src: 'images/directory.svg',
|
||||
styles: {
|
||||
'width': 15,
|
||||
'padding-right': 5,
|
||||
@@ -2193,19 +2193,19 @@ window.qBittorrent.DynamicTable = (function() {
|
||||
let img_path;
|
||||
switch (row.full_data.status) {
|
||||
case 'default':
|
||||
img_path = 'icons/application-rss.svg';
|
||||
img_path = 'images/application-rss.svg';
|
||||
break;
|
||||
case 'hasError':
|
||||
img_path = 'icons/task-reject.svg';
|
||||
img_path = 'images/task-reject.svg';
|
||||
break;
|
||||
case 'isLoading':
|
||||
img_path = 'images/spinner.gif';
|
||||
break;
|
||||
case 'unread':
|
||||
img_path = 'icons/mail-inbox.svg';
|
||||
img_path = 'images/mail-inbox.svg';
|
||||
break;
|
||||
case 'isFolder':
|
||||
img_path = 'icons/folder-documents.svg';
|
||||
img_path = 'images/folder-documents.svg';
|
||||
break;
|
||||
}
|
||||
let td;
|
||||
|
||||
Reference in New Issue
Block a user