משתמש:ויקימנטור/common.js
הערה: לאחר הפרסום, ייתכן שיהיה צורך לנקות את זיכרון המטמון (cache) של הדפדפן כדי להבחין בשינויים.
- פיירפוקס / ספארי: להחזיק את המקש Shift בעת לחיצה על טעינה מחדש (Reload) או ללחוץ על צירוף המקשים Ctrl-F5 או Ctrl-R (במחשב מק: ⌘-R).
- גוגל כרום: ללחוץ על צירוף המקשים Ctrl-Shift-R (במחשב מק: ⌘-Shift-R).
- אינטרנט אקספלורר / אדג': להחזיק את המקש Ctrl בעת לחיצה על רענן (Refresh) או ללחוץ על צירוף המקשים Ctrl-F5.
- אופרה: ללחוץ על Ctrl-F5.
//this script is coulering the word ויקימנטור in every page
//<nowiki><pre>
/*
var w72exception;
try
{
if(wordhii==undefined||wordhi==null) wordhi="";
}
catch(w72exception)
{
wordhi="";
}
function highlightword(n,p) //node, parent node
{
while(n!=null)
{
if(n.nodeType==3) //text node
{
if(n.data.toLowerCase().indexOf(wordhi.toLowerCase())!=-1)
{
var ix=n.data.toLowerCase().indexOf(wordhi.toLowerCase());
var t1=ix?document.createTextNode(n.data.substr(0,ix)):null;
var t2=document.createTextNode(n.data.substr(ix,wordhi.length));
var t3=ix+wordhi.length==n.data.length?null:
document.createTextNode(n.data.substr(ix+wordhi.length));
var s1=document.createElement("span");
s1.style.color="#006600";
//next line is for orange background - ovedc
s1.style.backgroundColor="#FF9900";
s1.className="word722h";
s1.appendChild(t2);
var s2=document.createElement("span");
if(t1!=null) s2.appendChild(t1);
s2.appendChild(s1);
if(t3!=null) s2.appendChild(t3);
p.replaceChild(s2,n);
if(t3!=null) highlightword(t3,s2); //find remaining occurences in the new nodes
n=s2.nextSibling;
}
else
n=n.nextSibling;
}
else
{
if(n.firstChild!=null) highlightword(n.firstChild,n);
n=n.nextSibling;
}
}
}
$(function() {
if(wordhi=="") wordhi="ויקימנטור";
// The two occurrences of 'word72' in the following line are to prevent conflicts with
// other scripts I've written; don't change them to your own username (the script will
// change to your username automatically).
if(location.href.indexOf("?word72")==-1&&location.href.indexOf("&word72")==-1&&
location.href.indexOf("?action=edit")==-1&&location.href.indexOf("?action=submit")==-1&&
location.href.indexOf("&action=edit")==-1&&location.href.indexOf("&action=submit")==-1&&
location.href.indexOf("&action=raw")==-1&&wgPageName!="Special:Preferences")
highlightword(document.getElementById('bodyContent').firstChild,
document.getElementById('bodyContent'));
});
//</pre></nowiki>
*/