משתמש:Lionster/common.js
הערה: לאחר הפרסום, ייתכן שיהיה צורך לנקות את זיכרון המטמון (cache) של הדפדפן כדי להבחין בשינויים.
- פיירפוקס / ספארי: להחזיק את המקש Shift בעת לחיצה על טעינה מחדש (Reload) או ללחוץ על צירוף המקשים Ctrl-F5 או Ctrl-R (במחשב מק: ⌘-R).
- גוגל כרום: ללחוץ על צירוף המקשים Ctrl-Shift-R (במחשב מק: ⌘-Shift-R).
- אינטרנט אקספלורר / אדג': להחזיק את המקש Ctrl בעת לחיצה על רענן (Refresh) או ללחוץ על צירוף המקשים Ctrl-F5.
- אופרה: ללחוץ על Ctrl-F5.
mw.loader.using( [ 'mediawiki.util' ] ).then( function() {
importUserScript(13, 40, 44, 61, 63, 67, 75, 78, 79, 103);
importScript('משתמש:Yonidebest/monobook.js/createDiffLink.js');
//צביעת שם המשתמש בדפי שיחה
//This script by ([[en:User:ais523/highlightmyname2.js]])
var w7exception;
try
{
if(wordh==undefined||wordh==null) wordh="";
}
catch(w7exception)
{
wordh="";
}
function highlightmyname(n,p) //node, parent node
{
while(n!=null)
{
if(n.nodeType==3) //text node
{
if(n.data.toLowerCase().indexOf(wordh.toLowerCase())!=-1)
{
var ix=n.data.toLowerCase().indexOf(wordh.toLowerCase());
var t1=ix?document.createTextNode(n.data.substr(0,ix)):null;
var t2=document.createTextNode(n.data.substr(ix,wordh.length));
var t3=ix+wordh.length==n.data.length?null:
document.createTextNode(n.data.substr(ix+wordh.length));
var s1=document.createElement("span");
s1.style.color="#006C35";
s1.className="word7h";
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) highlightmyname(t3,s2); //find remaining occurences in the new nodes
n=s2.nextSibling;
}
else
n=n.nextSibling;
}
else
{
if(n.firstChild!=null) highlightmyname(n.firstChild,n);
n=n.nextSibling;
}
}
}