jscompletion.js ( http://vimperator.org/trac/ticket/20 )
* id:otsune に教えてもらった。まだちゃんと動いてないみたいなんだけど期待 age 。 getElementsByTagName や getElementById なんかで特定した DOM object がもつプロパティやメソッドを補完対象に出す plugin 。これができあがると firebug への依存がぐっと減るというか機能的には firebug 超えるんじゃね ?
最新のに対応が遅れているだけっぽい。
:%s/arrayIter/Array.iterator/
で、OK
--- jscompletion.js.orig +++ jscompletion.js @@ -11,7 +11,7 @@ } function elemToString(elem) { - return "<" + [elem.localName].concat([a.name + "=" + a.value for (a in util.arrayIter(elem.attributes))]).join(" ") + ">"; + return "<" + [elem.localName].concat([a.name + "=" + a.value for (a in util.Array.iterator(elem.attributes))]).join(" ") + ">"; } addCompleter(["getElementById"], function (func, obj, string, args) { @@ -28,7 +28,7 @@ return []; let doc = this.eval(obj); let iter = buffer.evaluateXPath("//@class", doc); - return util.uniq([e for (e in iter)]).map(function (class) [class, ""]); + return util.Array.uniq([e for (e in iter)]).map(function (class) [class, ""]); }); /* TODO: Check for matching NS in XPath search. */ @@ -39,7 +39,7 @@ let doc = this.eval(obj); /* *Very* bad idea. */ let iter = buffer.evaluateXPath("//*", doc); - return util.uniq([e.localName for (e in iter)]).map(function (tag) [tag, ""]); + return util.Array.uniq([e.localName for (e in iter)]).map(function (tag) [tag, ""]); }); addCompleter(["getElementsByClassName", "getElementsByClassNameNS"], function (func, obj, string, args) { @@ -47,7 +47,7 @@ return NAMESPACES; let doc = this.eval(obj); let iter = buffer.evaluateXPath("//@class", doc); - return util.uniq([e.value for (e in iter)]).map(function (class) [class, ""]); + return util.Array.uniq([e.value for (e in iter)]).map(function (class) [class, ""]); }); addCompleter(["getElementsByAttribute", "getElementsByAttributeNS"], function (func, obj, string, args) { @@ -59,11 +59,11 @@ return NAMESPACES; case 1: let iter = buffer.evaluateXPath("//@*", doc); - return util.uniq([e.name for (e in iter)]).map(function (attrib) [attrib, ""]); + return unil.Array.uniq([e.name for (e in iter)]).map(function (attrib) [attrib, ""]); case 2: let attrib = this.eval(args[0 + isNS]); iter = buffer.evaluateXPath("//@" + attrib, doc); - return util.uniq([e.value for (e in iter)]).map(function (value) [value, ""]); + return unil.Array.uniq([e.value for (e in iter)]).map(function (value) [value, ""]); } }); @@ -72,7 +72,7 @@ if (args.length > 1) return []; let node = this.eval(obj); - return [[a.name, a.value] for (a in util.arrayIter(node.attributes))]; + return [[a.name, a.value] for (a in unil.Array.iterator(node.attributes))]; }); function fnCompleter(funcs, fn) {