General
: K-Meleon Forum
General discussion about K-Meleon.
Goto:
Forum List
•
Message List
•
Search
•
Log In
Your Name:
Subject:
Help information
BBcode help
Smileys help
[quote=disrupted] [url=http://kmext.sourceforge.net/macros/highlighter.7z]http://kmext.sourceforge.net/macros/highlighter.7z[/url] based on jsnj's search xtra javascript, this enables selecting a text or phrase and highlighting all similar..this can be useful when searching for specific terms on a website and don't want to fire the find dialog [img]http://kmeleon.holaservers.com/disrupted/highlightall.jpg[/img] [code] [color=green][sub]# K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage) # ---------- highlighter ------js code by jsnj-------------------- _Highlighttext{ setclipboard(""); id(ID_EDIT_COPY); $highlighted=getclipboard(); open("javascript: (function(){var count=0, text, dv;text=%22".$highlighted."%22;if(text==null)return;dv=document.defaultView;function searchWithinNode(node, te, len){var pos, skip, spannode, middlebit, endbit, middleclone;skip=0;if( node.nodeType==3 ){pos=node.data.toUpperCase().indexOf(te);if(pos>=0){spannode=document.createElement(%22SPAN%22);spannode.style.backgroundColor=%22#A3E897%22;middlebit=node.splitText(pos);endbit=middlebit.splitText(len);middleclone=middlebit.cloneNode(true);spannode.appendChild(middleclone);middlebit.parentNode.replaceChild(spannode,middlebit);++count;skip=1;}}else if( node.nodeType==1&& node.childNodes&& dv.getComputedStyle(node, null).getPropertyValue(%22display%22)!=%22none%22){for (var child=0; child < node.childNodes.length; ++child){child=child+searchWithinNode(node.childNodes[child], te, len);}}return skip;}window.status=%22Searching for '%22+text+%22'...%22;searchWithinNode(document.body, text.toUpperCase(), text.length);window.status=%22Found %22+count+%22 occurrence%22+(count==1?%22%22:%22s%22)+%22 of '%22+text+%22'.%22;})();"); } highlighter_BuildMenu{ setmenu(Selection,inline,highlighter,5); setmenu(highlighter,macro,"Highlight All",_Highlighttext); } $OnInit=$OnInit."highlighter_BuildMenu;"; # ------------------------------------------------ $macroModules=$macroModules."texthighlighter;";[/sub][/color] [/code] special thanks to jsnj[/quote]
[Please Enable JavaScript]
K-Meleon forum is powered by
Phorum
.
Home/News
Screenshots
Download
Documentation
Resources
Get Involved
Forum
Bugs
Development