summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorportix <none@none>2012-08-15 16:14:24 +0200
committerportix <none@none>2012-08-15 16:14:24 +0200
commit047d88ebbd18f503f9382e9cf211c49e239e3408 (patch)
tree3d5f997b109ea5b5d3818b2f3b57c3121b5cad85 /scripts
parent581a63b1841b3e337d8d7cd867572a02fee9689f (diff)
downloaddwb-047d88ebbd18f503f9382e9cf211c49e239e3408.zip
New method extensions.toggle
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/extensions.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/lib/extensions.js b/scripts/lib/extensions.js
index b6b6beb2..499d3332 100644
--- a/scripts/lib/extensions.js
+++ b/scripts/lib/extensions.js
@@ -172,6 +172,18 @@
_unload(arguments[0], false);
return extensions.load.apply(this, arguments);
}
+ },
+ "toggle" : {
+ value : function(name, c) {
+ if (_registered[name] !== undefined) {
+ _unload(name);
+ return false;
+ }
+ else {
+ extensions.load(name, c);
+ return true;
+ }
+ }
}
});
})();