diff options
author | teramako | 2011-03-25 21:58:50 +0900 |
---|---|---|
committer | teramako | 2011-03-25 21:58:50 +0900 |
commit | 55c19e9b6af78c522148c43ee658e5189fce6ded (patch) | |
tree | 4de81c44226c55d52ca831c71b10c6d307d7474f /xpathBlink.js | |
parent | 30c4c6b5598cf75463f2bf60794b4df1db5efbc6 (diff) | |
download | vimperator-plugins-55c19e9b6af78c522148c43ee658e5189fce6ded.tar.bz2 |
もやは使われていないよね
Diffstat (limited to 'xpathBlink.js')
-rw-r--r-- | xpathBlink.js | 104 |
1 files changed, 0 insertions, 104 deletions
diff --git a/xpathBlink.js b/xpathBlink.js deleted file mode 100644 index 3175dc1..0000000 --- a/xpathBlink.js +++ /dev/null @@ -1,104 +0,0 @@ -let INFO = -<plugin name="xpathBlink" version="1.1.2" - href="http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk/xpathBlink.js" - summary="blink elements by XPath" - xmlns="http://vimperator.org/namespaces/liberator"> - <author email="teramako@gmail.com">teramako</author> - <license href="http://www.mozilla.org/MPL/MPL-1.1.txt">MPL 1.1</license> - <project name="Vimperator" minVersion="2.2"/> - <p> - For test XPath. - </p> - <p>CAUTION: This plugin needs "DOM Inspector" addon.</p> - <item> - <tags>:xpathb :xpathblink</tags> - <spec>:xpathb<oa>link</oa> <a>expression</a></spec> - <description> - <p> - blink specified elements with XPath <a>expression</a> - </p> - </description> - </item> -</plugin>; - -let PLUGIN_INFO = -<VimperatorPlugin> -<name>{NAME}</name> -<description>blink elements by XPath</description> -<author mail="teramako@gmail.com" homepage="http://vimperator.g.hatena.ne.jp/teramako/">teramako</author> -<require type="extension" id="inspector@mozilla.org">DOM Inspector</require> -<license>MPL 1.1</license> -<version>1.1.2</version> -<minVersion>2.2</minVersion> -<maxVersion>3.0</maxVersion> -<updateURL>https://github.com/vimpr/vimperator-plugins/raw/master/xpathBlink.js</updateURL> -<detail><![CDATA[ -for test xpath - -== Usage== -:xpathb[link] {expression}: -:xb {expression} - blink specified elements with XPath {expression} - -== Caution == -It's need "DOM Inspector" addon -]]></detail> -</VimperatorPlugin>; - -(function(){ -let extid = "inspector@mozilla.org"; -Application.getExtensions( - function (extensions){ - if (!extensions.has(extid) || !extensions.get(extid).enabled){ - liberator.echomsg("DOM Inspector is not installed or enabled", 2); - return; - } - let flasher = null; - function getFlasher(){ - if (!flasher){ - flasher = Cc['@mozilla.org/inspector/flasher;1'].createInstance(Ci.inIFlasher); - flasher.color = '#FF0000'; - flasher.thickness = 2; - } - return flasher; - } - /** - * @param {Node} aNode - */ - function blink(aNode){ - if (aNode.nodeType == 3) aNode = aNode.parentNode; - let toggle = true; - let flasher = getFlasher(); - function setOutline(){ - if (toggle){ - flasher.drawElementOutline(aNode); - } else { - flasher.repaintElement(aNode); - } - toggle = !toggle; - } - for (let i=1; i<7; ++i){ - setTimeout(setOutline, i * 100); - } - } - commands.addUserCommand(['xpathb[link]','xb'],'XPath blink nodes', - function(expression){ - let result; - try { - result = util.evaluateXPath(expression.string); - } catch(e) { - liberator.echoerr('XPath blink: ' + e); - } - if (!result.snapshotLength){ - liberator.echo('XPath blink: none'); - return; - } - for (let i=0; i<result.snapshotLength; i++){ - blink(result.snapshotItem(i)); - } - },{} - ); -}); -})(); - -// vim: set fdm=marker sw=4 ts=4 noet: |