summaryrefslogtreecommitdiffstats
path: root/deluge/ui/web/js/deluge-all/Deluge.js
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2021-01-17 15:48:35 +0000
committerCalum Lind <calumlind+deluge@gmail.com>2021-01-24 20:40:20 +0000
commit610a1bb3139f8ded69561b290d7ce61b5a039676 (patch)
tree4e18e880de320e248e0f079adab74fe1c67157f8 /deluge/ui/web/js/deluge-all/Deluge.js
parent23a48dd01c86ef01cd1d13371de51247ec9a503b (diff)
downloaddeluge-610a1bb3139f8ded69561b290d7ce61b5a039676.tar.gz
deluge-610a1bb3139f8ded69561b290d7ce61b5a039676.tar.bz2
deluge-610a1bb3139f8ded69561b290d7ce61b5a039676.zip
[Lint] Update pre-commit hook and isort versions
* Fixed black hook requiring Py3.6 to installed locally. Will now assume Py3.6+ in installed. * Added isort traceback in pre-commit flake8 hook fails * Updated versions of Black, Prettier and isort * Keep Flake8 at 3.7.9 due to E402 issue: https://gitlab.com/pycqa/flake8/-/issues/638 * New pyproject config for isort v5 with fixes for Python 2 imports. * Fixed travis config to run Python 3.6 for lint run. Replaced the virtualenv with_system_site_packages config with Travis specific Python config value so lint run doesn't attempt to append with_system_site_packages to Python 3.6 command.
Diffstat (limited to 'deluge/ui/web/js/deluge-all/Deluge.js')
-rw-r--r--deluge/ui/web/js/deluge-all/Deluge.js24
1 files changed, 11 insertions, 13 deletions
diff --git a/deluge/ui/web/js/deluge-all/Deluge.js b/deluge/ui/web/js/deluge-all/Deluge.js
index 31b9947cc..86cae6d89 100644
--- a/deluge/ui/web/js/deluge-all/Deluge.js
+++ b/deluge/ui/web/js/deluge-all/Deluge.js
@@ -25,21 +25,19 @@ Ext.state.Manager.setProvider(
// Add some additional functions to ext and setup some of the
// configurable parameters
Ext.apply(Ext, {
- escapeHTML: function(text) {
- text = String(text)
- .replace('<', '&lt;')
- .replace('>', '&gt;');
+ escapeHTML: function (text) {
+ text = String(text).replace('<', '&lt;').replace('>', '&gt;');
return text.replace('&', '&amp;');
},
- isObjectEmpty: function(obj) {
+ isObjectEmpty: function (obj) {
for (var i in obj) {
return false;
}
return true;
},
- areObjectsEqual: function(obj1, obj2) {
+ areObjectsEqual: function (obj1, obj2) {
var equal = true;
if (!obj1 || !obj2) return false;
for (var i in obj1) {
@@ -50,7 +48,7 @@ Ext.apply(Ext, {
return equal;
},
- keys: function(obj) {
+ keys: function (obj) {
var keys = [];
for (var i in obj)
if (obj.hasOwnProperty(i)) {
@@ -59,7 +57,7 @@ Ext.apply(Ext, {
return keys;
},
- values: function(obj) {
+ values: function (obj) {
var values = [];
for (var i in obj) {
if (obj.hasOwnProperty(i)) {
@@ -69,7 +67,7 @@ Ext.apply(Ext, {
return values;
},
- splat: function(obj) {
+ splat: function (obj) {
var type = Ext.type(obj);
return type ? (type != 'array' ? [obj] : obj) : [];
},
@@ -106,7 +104,7 @@ Ext.apply(Deluge, {
* @param {String} text The text to display on the bar
* @param {Number} modified Amount to subtract from the width allowing for fixes
*/
- progressBar: function(progress, width, text, modifier) {
+ progressBar: function (progress, width, text, modifier) {
modifier = Ext.value(modifier, 10);
var progressWidth = ((width / 100.0) * progress).toFixed(0);
var barWidth = progressWidth - 1;
@@ -125,7 +123,7 @@ Ext.apply(Deluge, {
* Constructs a new instance of the specified plugin.
* @param {String} name The plugin name to create
*/
- createPlugin: function(name) {
+ createPlugin: function (name) {
return new Deluge.pluginStore[name]();
},
@@ -133,7 +131,7 @@ Ext.apply(Deluge, {
* Check to see if a plugin has been registered.
* @param {String} name The plugin name to check
*/
- hasPlugin: function(name) {
+ hasPlugin: function (name) {
return Deluge.pluginStore[name] ? true : false;
},
@@ -142,7 +140,7 @@ Ext.apply(Deluge, {
* @param {String} name The plugin name to register
* @param {Plugin} plugin The plugin to register
*/
- registerPlugin: function(name, plugin) {
+ registerPlugin: function (name, plugin) {
Deluge.pluginStore[name] = plugin;
},
});