aboutsummaryrefslogtreecommitdiffstats
path: root/pino.js
diff options
context:
space:
mode:
authoranekos2010-03-27 14:25:29 +0000
committeranekos2010-03-27 14:25:29 +0000
commitad7c94d476ec71fa2317f748ce9d666a4891d216 (patch)
treefd9389db1e6890a7e58ca0a8f2ac1e7d21a9e07c /pino.js
parentd21b9bcbe692ee47e7e6b630473d81ef410b5d3e (diff)
downloadvimperator-plugins-ad7c94d476ec71fa2317f748ce9d666a4891d216.tar.bz2
コマンド追加(seek)
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@37100 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'pino.js')
0 files changed, 0 insertions, 0 deletions
ss="o">="http://d.hatena.ne.jp/hogelog/">hogelog</author> <version>0.1.2</version> <minVersion>2.0pre</minVersion> <maxVersion>2.0pre</maxVersion> <updateURL>http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk/xpath_hint.js</updateURL> <license>MIT</license> <detail><![CDATA[ == MAPPING == ;x: copy selected element's XPath ]]></detail> </VimperatorPlugin>; //}}} (function(){ const DEFAULT_MAP = "x"; let xpathHintMap = liberator.globalVariables.xpath_hint_map || DEFAULT_MAP; let xh = plugins.xpath_hint = { getElementXPath: function(elem) { if (elem.nodeType == 9) { // DOCUMENT_NODE = 9 return ""; } if (elem.hasAttribute("id")) { return 'id("'+elem.getAttribute("id")+'")'; } let name = elem.tagName.toLowerCase(); let parent = elem.parentNode; let path = arguments.callee(parent)+"/"+name; let children = Array.filter(parent.childNodes, function(e) e.nodeName == elem.nodeName && e.nodeType == elem.nodeType); if (children.length != 1 && children[0]!=elem) { path += "["+(children.indexOf(elem)+1)+"]"; } return path; }, addMode: function(mode, prompt, action, tags) { hints.addMode(mode, prompt, function(e) action(xh.getElementXPath(e)), tags); }, }; xh.addMode(xpathHintMap, "copy xpath", function(xpath) util.copyToClipboard(xpath, true), function() "//*"); })(); // vim: set fdm=marker sw=4 ts=4 et: