Move WebUI icons to its own folder

After this change: "http://<server>/icons" will point to "src/icons"
folder and "http://<server>/images" points to the real "images" folder
in the relative path.
This commit is contained in:
Chocobo1
2020-05-19 13:41:41 +08:00
parent dde7421f59
commit 02c25dbe2a
39 changed files with 173 additions and 173 deletions

View File

@@ -386,7 +386,7 @@ window.addEvent('load', function() {
const create_link = function(hash, text, count) {
const html = '<a href="#" onclick="setCategoryFilter(' + hash + ');return false;">'
+ '<img src="images/inode-directory.svg"/>'
+ '<img src="icons/inode-directory.svg"/>'
+ window.qBittorrent.Misc.escapeHtml(text) + ' (' + count + ')' + '</a>';
const el = new Element('li', {
id: hash,
@@ -443,7 +443,7 @@ window.addEvent('load', function() {
const createLink = function(hash, text, count) {
const html = '<a href="#" onclick="setTagFilter(' + hash + ');return false;">'
+ '<img src="images/inode-directory.svg"/>'
+ '<img src="icons/inode-directory.svg"/>'
+ window.qBittorrent.Misc.escapeHtml(text) + ' (' + count + ')' + '</a>';
const el = new Element('li', {
id: hash,
@@ -497,7 +497,7 @@ window.addEvent('load', function() {
const createLink = function(hash, text, count) {
const html = '<a href="#" onclick="setTrackerFilter(' + hash + ');return false;">'
+ '<img src="images/network-server.svg"/>'
+ '<img src="icons/network-server.svg"/>'
+ window.qBittorrent.Misc.escapeHtml(text.replace("%1", count)) + '</a>';
const el = new Element('li', {
id: hash,
@@ -737,17 +737,17 @@ window.addEvent('load', function() {
switch (serverState.connection_status) {
case 'connected': {
$('connectionStatus').src = 'images/connected.svg';
$('connectionStatus').src = 'icons/connected.svg';
$('connectionStatus').alt = 'QBT_TR(Connection status: Connected)QBT_TR[CONTEXT=MainWindow]';
}
break;
case 'firewalled': {
$('connectionStatus').src = 'images/firewalled.svg';
$('connectionStatus').src = 'icons/firewalled.svg';
$('connectionStatus').alt = 'QBT_TR(Connection status: Firewalled)QBT_TR[CONTEXT=MainWindow]';
}
break;
default: {
$('connectionStatus').src = 'images/disconnected.svg';
$('connectionStatus').src = 'icons/disconnected.svg';
$('connectionStatus').alt = 'QBT_TR(Connection status: Disconnected)QBT_TR[CONTEXT=MainWindow]';
}
break;
@@ -785,11 +785,11 @@ window.addEvent('load', function() {
const updateAltSpeedIcon = function(enabled) {
if (enabled) {
$('alternativeSpeedLimits').src = 'images/slow.svg';
$('alternativeSpeedLimits').src = 'icons/slow.svg';
$('alternativeSpeedLimits').alt = 'QBT_TR(Alternative speed limits: On)QBT_TR[CONTEXT=MainWindow]';
}
else {
$('alternativeSpeedLimits').src = 'images/slow_off.svg';
$('alternativeSpeedLimits').src = 'icons/slow_off.svg';
$('alternativeSpeedLimits').alt = 'QBT_TR(Alternative speed limits: Off)QBT_TR[CONTEXT=MainWindow]';
}
};

View File

@@ -430,10 +430,10 @@ window.qBittorrent.ContextMenu = (function() {
const categoryList = $('contextCategoryList');
categoryList.empty();
categoryList.appendChild(new Element('li', {
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>'
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>'
}));
categoryList.appendChild(new Element('li', {
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>'
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>'
}));
const sortedCategories = [];
@@ -446,7 +446,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="images/inode-directory.svg"/> ' + window.qBittorrent.Misc.escapeHtml(categoryName) + '</a>'
html: '<a href="javascript:torrentSetCategoryFN(\'' + categoryHash + '\');"><img src="icons/inode-directory.svg"/> ' + window.qBittorrent.Misc.escapeHtml(categoryName) + '</a>'
});
if (first) {
el.addClass('separator');
@@ -463,13 +463,13 @@ window.qBittorrent.ContextMenu = (function() {
contextTagList.appendChild(new Element('li', {
html: '<a href="javascript:torrentAddTagsFN();">'
+ '<img src="images/list-add.svg" alt="QBT_TR(Add...)QBT_TR[CONTEXT=TransferListWidget]"/>'
+ '<img src="icons/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="images/edit-clear.svg" alt="QBT_TR(Remove All)QBT_TR[CONTEXT=TransferListWidget]"/>'
+ '<img src="icons/edit-clear.svg" alt="QBT_TR(Remove All)QBT_TR[CONTEXT=TransferListWidget]"/>'
+ ' QBT_TR(Remove All)QBT_TR[CONTEXT=TransferListWidget]'
+ '</a>'
}));

View File

@@ -314,7 +314,7 @@ window.qBittorrent.DynamicTable = (function() {
});
const createLi = function(columnName, text) {
const html = '<a href="#' + columnName + '" ><img src="images/checked.svg"/>' + window.qBittorrent.Misc.escapeHtml(text) + '</a>';
const html = '<a href="#' + columnName + '" ><img src="icons/checked.svg"/>' + window.qBittorrent.Misc.escapeHtml(text) + '</a>';
return new Element('li', {
html: html
});
@@ -897,7 +897,7 @@ window.qBittorrent.DynamicTable = (function() {
break; // do nothing
}
const img_path = 'images/' + state + '.svg';
const img_path = 'icons/' + state + '.svg';
if (td.getChildren('img').length > 0) {
const img = td.getChildren('img')[0];
@@ -1419,7 +1419,7 @@ window.qBittorrent.DynamicTable = (function() {
return;
}
const img_path = 'images/flags/' + country_code + '.svg';
const img_path = 'icons/flags/' + country_code + '.svg';
if (td.getChildren('img').length > 0) {
const img = td.getChildren('img')[0];
@@ -1760,7 +1760,7 @@ window.qBittorrent.DynamicTable = (function() {
}
else {
const treeImg = new Element('img', {
src: 'images/L.gif',
src: '../images/L.gif',
styles: {
'margin-bottom': -2
}
@@ -1785,7 +1785,7 @@ window.qBittorrent.DynamicTable = (function() {
}
else {
const collapseIcon = new Element('img', {
src: 'images/go-down.svg',
src: 'icons/go-down.svg',
styles: {
'margin-left': (node.depth * 20)
},
@@ -1799,7 +1799,7 @@ window.qBittorrent.DynamicTable = (function() {
id: fileNameId
});
const dirImg = new Element('img', {
src: 'images/inode-directory.svg',
src: 'icons/inode-directory.svg',
styles: {
'width': 15,
'padding-right': 5,

File diff suppressed because one or more lines are too long

View File

@@ -1625,7 +1625,7 @@ MUI.Window = new Class({
// Fix a mouseover issue with gauges in IE7
if ( MUI.ieLegacySupport && options.shape == 'gauge') {
this.windowEl.setStyle('backgroundImage', 'url(../images/spacer.gif)');
this.windowEl.setStyle('backgroundImage', 'url(../../images/spacer.gif)');
}
if (options.loadMethod == 'iframe') {