Browse Source

Merge pull request #11838 from Chocobo1/webui

Minor WebUI code cleanups
adaptive-webui-19844
Mike Tzou 5 years ago committed by GitHub
parent
commit
e2ac97a9e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/webui/www/private/scripts/client.js
  2. 2
      src/webui/www/private/scripts/dynamicTable.js
  3. 9
      src/webui/www/private/scripts/prop-files.js
  4. 3
      src/webui/www/private/views/preferences.html
  5. 2
      src/webui/www/private/views/search.html

4
src/webui/www/private/scripts/client.js

@ -582,7 +582,7 @@ window.addEvent('load', function() { @@ -582,7 +582,7 @@ window.addEvent('load', function() {
torrentsTable.reselectRows(torrentsTableSelectedRows);
}
syncRequestInProgress = false;
syncData(getSyncMainDataInterval())
syncData(getSyncMainDataInterval());
}
});
syncRequestInProgress = true;
@ -599,7 +599,7 @@ window.addEvent('load', function() { @@ -599,7 +599,7 @@ window.addEvent('load', function() {
clearTimeout(syncMainDataTimer);
syncMainDataTimer = syncMainData.delay(delay);
}
}
};
const processServerState = function() {
let transfer_info = window.qBittorrent.Misc.friendlyUnit(serverState.dl_info_speed, true);

2
src/webui/www/private/scripts/dynamicTable.js

@ -1716,7 +1716,7 @@ window.qBittorrent.DynamicTable = (function() { @@ -1716,7 +1716,7 @@ window.qBittorrent.DynamicTable = (function() {
const size = window.qBittorrent.Misc.friendlyUnit(this.getRowValue(row), false);
td.set('text', size);
td.set('title', size);
}
};
const displayPercentage = function(td, row) {
const value = window.qBittorrent.Misc.friendlyPercentage(this.getRowValue(row));
td.set('text', value);

9
src/webui/www/private/scripts/prop-files.js

@ -160,7 +160,7 @@ window.qBittorrent.PropFiles = (function() { @@ -160,7 +160,7 @@ window.qBittorrent.PropFiles = (function() {
setCheckboxPartial(checkbox);
break;
}
}
};
const isPriorityComboExists = function(id) {
return ($('comboPrio' + id) !== null);
@ -631,7 +631,7 @@ window.qBittorrent.PropFiles = (function() { @@ -631,7 +631,7 @@ window.qBittorrent.PropFiles = (function() {
rowElem.addClass("invisible");
else
rowElem.removeClass("invisible");
}
};
/**
* Update a node's collapsed state and icon
@ -642,7 +642,6 @@ window.qBittorrent.PropFiles = (function() { @@ -642,7 +642,6 @@ window.qBittorrent.PropFiles = (function() {
if (span === null)
return;
const td = span.parentElement;
const rowElem = td.parentElement;
// store collapsed state
td.set("data-collapsed", isCollapsed);
@ -653,7 +652,7 @@ window.qBittorrent.PropFiles = (function() { @@ -653,7 +652,7 @@ window.qBittorrent.PropFiles = (function() {
collapseIcon.addClass("rotate");
else
collapseIcon.removeClass("rotate");
}
};
const _isCollapsed = function(node) {
const span = $('filesTablefileName' + node.rowId);
@ -692,7 +691,7 @@ window.qBittorrent.PropFiles = (function() { @@ -692,7 +691,7 @@ window.qBittorrent.PropFiles = (function() {
});
});
torrentFilesTable.altRow();
}
};
/**
* Collapses a folder node with the option to recursively collapse all children

3
src/webui/www/private/views/preferences.html

@ -1109,7 +1109,6 @@ @@ -1109,7 +1109,6 @@
updateQueueingSystem: updateQueueingSystem,
updateSlowTorrentsSettings: updateSlowTorrentsSettings,
updateMaxRatioTimeEnabled: updateMaxRatioTimeEnabled,
updateMaxRatioTimeEnabled: updateMaxRatioTimeEnabled,
updateAddTrackersEnabled: updateAddTrackersEnabled,
updateHttpsSettings: updateHttpsSettings,
updateBypasssAuthSettings: updateBypasssAuthSettings,
@ -1443,7 +1442,7 @@ @@ -1443,7 +1442,7 @@
$('optionalIPAddressToBind').setProperty('value', default_addr);
}
}).send();
}
};
const loadPreferences = function() {
const url = 'api/v2/app/preferences';

2
src/webui/www/private/views/search.html

@ -486,7 +486,7 @@ @@ -486,7 +486,7 @@
searchPlugins.length = 0;
response.forEach(function(plugin) {
searchPlugins.push(plugin);
})
});
const pluginsHtml = [];
pluginsHtml.push('<option value="enabled">QBT_TR(Only enabled)QBT_TR[CONTEXT=SearchEngineWidget]</option>');

Loading…
Cancel
Save