מדיה ויקי:Gadget-rcPatrol.js: הבדלים בין גרסאות בדף
מ דף חדש: function rcSaveClick() { var url = 'http://he.wikipedia.org/w/index.php?title=' + encodeURIComponent('משתמש:Yonidebest/ניסיון') + '&action=edit&rcsavepage=savepage'; newWin... |
מאין תקציר עריכה |
||
| שורה 1: | שורה 1: | ||
/* | |||
function rcSaveClick() { | function rcSaveClick() { | ||
var url = 'http://he.wikipedia.org/w/index.php?title=' + encodeURIComponent('משתמש:Yonidebest/ניסיון') + '&action=edit&rcsavepage=savepage'; | var url = 'http://he.wikipedia.org/w/index.php?title=' + encodeURIComponent('משתמש:Yonidebest/ניסיון') + '&action=edit&rcsavepage=savepage'; | ||
| שורה 42: | שורה 43: | ||
} | } | ||
} | } | ||
*/ | |||
function | function rcPatrol() { | ||
if (getParamValue('rcsavepage') == 'savepage') { | if (getParamValue('rcsavepage') == 'savepage') { | ||
window.title = 'מבצע שמירה...'; | window.title = 'מבצע שמירה...'; | ||
} | } | ||
else { | else { | ||
if (wgPageName != ' | if (wgPageName != 'מיוחד:שינויים_אחרונים') return; | ||
var itemList = document.getElementById('bodyContent').getElementsByTagName('LI'); | var itemList = document.getElementById('bodyContent').getElementsByTagName('LI'); | ||
for (var i = 0; i < itemList.length; i++) { | for (var i = 0; i < itemList.length; i++) { | ||
var unpatrolled = getElemntsByClassName(itemList, 'SPAN', 'unpatrolled'); | |||
if (!unpatrolled[0]) continue; // patrolled | |||
var checkbox = document.createElement('INPUT'); | var checkbox = document.createElement('INPUT'); | ||
checkbox.type = 'checkbox'; | checkbox.type = 'checkbox'; | ||
var firstA = itemList[i].getElementsByTagName('A')[0]; | |||
if ( | if (!firstA) continue; | ||
var rx = new RegExp('rcid=(\\d+)'); | |||
var m = rx.exec(firstA.href); | |||
if (!m) continue; | |||
checkbox.id = m[1]; | |||
itemList[i].insertBefore(checkbox, | checkbox.defaultChecked = false; | ||
itemList[i].insertBefore(checkbox, unpatrolled[0]); | |||
} | } | ||
var saveLink = document.createElement('A'); | var saveLink = document.createElement('A'); | ||
| שורה 72: | שורה 78: | ||
} | } | ||
addOnloadHook( | addOnloadHook(rcPatrol); | ||