diff options
author | drry | 2008-11-03 15:58:50 +0000 |
---|---|---|
committer | drry | 2008-11-03 15:58:50 +0000 |
commit | 443857dffe946e93865bfd36bef4001203df2a39 (patch) | |
tree | dba694b23739c5c88c6d16eb596ab832430d77c7 /inspector.js | |
parent | 596c1ec007a3f431b84da3fed1a30871e8bd64dc (diff) | |
download | vimperator-plugins-443857dffe946e93865bfd36bef4001203df2a39.tar.bz2 |
* cosmetic changes.
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@22654 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'inspector.js')
-rw-r--r-- | inspector.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/inspector.js b/inspector.js index 22aba05..91d5417 100644 --- a/inspector.js +++ b/inspector.js @@ -1,6 +1,6 @@ /** * ==VimperatorPlugin== - * @name inspector + * @name inspector * @description DOM Inspector commands * @depend "DOM Inspector" inspector@mozilla.org * @author teramako teramako@gmail.com @@ -18,13 +18,13 @@ (function(){ -const inspectorID = 'inspector@mozilla.org'; +const inspectorID = "inspector@mozilla.org"; if (!Application.extensions.has(inspectorID) || !Application.extensions.get(inspectorID).enabled) return; /* これやるとFirefox終了時に実行されるんだけど...なぜ? -> Ubiquityが悪さしているみたい Object.prototype.inspect = function(){ runInspector(this); -} +}; */ function runInspector(node){ @@ -32,7 +32,7 @@ function runInspector(node){ inspectDOMDocument(node); } else if (node instanceof Node){ inspectDOMNode(node); - } else if (node !== null && typeof(node) != "undefined"){ + } else if (node !== null && typeof node != "undefined"){ inspectObject(node); } } @@ -46,7 +46,7 @@ function getIDList(filter, isChrome){ var options = [ [["-frame","-f"], commands.OPTION_NOARG] ]; -commands.addUserCommand(['inspect','dominspect'],'run DOM Inspector', +commands.addUserCommand(["inspect","dominspect"],"run DOM Inspector", function(args, bang){ var arg = args.arguments[0]; var doc = bang ? document : content.document; @@ -54,16 +54,16 @@ commands.addUserCommand(['inspect','dominspect'],'run DOM Inspector', if (!arg){ node = doc; } else if (arg.charAt(0) == "#"){ - var id = arg.substr(1); + let id = arg.substr(1); node = doc.getElementById(id); - if (!node) { + if (!node){ liberator.echoerr("No such id: " + id ); return; } } else { try { node = __eval(args.string); - } catch (e) { + } catch (e){ liberator.echoerr(e); } } @@ -79,7 +79,7 @@ commands.addUserCommand(['inspect','dominspect'],'run DOM Inspector', return [filter.indexOf(arg), completion.filter(getIDList(arg.substr(1),bang),arg,true)]; } return completion.javascript(filter); - }, + } } ); |