מדיה ויקי:ColorProtected.js

מתוך ויקיציטוט, מאגר הציטוטים החופשי.

הערה: לאחר הפרסום, ייתכן שיהיה צורך לנקות את זיכרון המטמון (cache) של הדפדפן כדי להבחין בשינויים.

  • פיירפוקס / ספארי: להחזיק את המקש Shift בעת לחיצה על טעינה מחדש (Reload) או ללחוץ על צירוף המקשים Ctrl-F5 או Ctrl-R (במחשב מק: ⌘-R).
  • גוגל כרום: ללחוץ על צירוף המקשים Ctrl-Shift-R (במחשב מק: ⌘-Shift-R).
  • אינטרנט אקספלורר / אדג': להחזיק את המקש Ctrl בעת לחיצה על רענן (Refresh) או ללחוץ על צירוף המקשים Ctrl-F5.
  • אופרה: ללחוץ על Ctrl-F5.
/*
 * Colors the "edit" tab according to protection level:
 * Gray: Move for sysop only.
 * Yellow: Semi-protected.
 * Red: Full protection.
 *
 * Created by [[User:Yonidebest]]
 *
 */

function colorProtected() {
 var caEdit = document.getElementById('ca-edit');

 if (wgRestrictionEdit[0] && wgRestrictionEdit[0] == "autoconfirmed")
  caEdit.getElementsByTagName('A')[0].style.backgroundColor = '#FCFFE5';
 else if (wgRestrictionEdit[0] && wgRestrictionEdit[0] == "sysop")
  caEdit.getElementsByTagName('A')[0].style.backgroundColor = '#FFE5E5';
 else if (wgRestrictionMove[0]&& wgRestrictionMove[0] == "sysop")
  caEdit.getElementsByTagName('A')[0].style.backgroundColor = '#E5E5E5';
}

$(colorProtected);