MediaWiki:Gadget-PatrolTab.js: Difference between revisions
Jump to navigation
Jump to search
Want an adless experience? Log in or Create an account.
mNo edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
function mark_as_patrolled(){ | |||
jQuery(".patrollink a").click(); | |||
} | |||
{ | |||
document.getElementById("spoilercontents_" + num).style.display="none"; | |||
var lk = document.getElementById("spoilerlk_" + num); | |||
lk.replaceChild(document.createTextNode("show"), lk.firstChild); | |||
lk.setAttribute("href", "javascript:show_spoilerbox(" + num + ")"); | |||
} | |||
$( function() { | $( function() { | ||
if ( wgUserGroups.toString().indexOf('sysop') != -1 || wgUserGroups.toString().indexOf('patroller') != -1) { | if ( wgUserGroups.toString().indexOf('sysop') != -1 || wgUserGroups.toString().indexOf('patroller') != -1) { | ||
Line 5: | Line 15: | ||
if ( $patrollinks.length > 0 ) | if ( $patrollinks.length > 0 ) | ||
{ | { | ||
addPortletLink ('p-cactions', ' | addPortletLink ('p-cactions', 'mark_as_patrolled()', 'Patrol', 'ca-patrol', 'Mark as patrolled', '1'); | ||
} | } | ||
} | } |
Revision as of 05:55, November 7, 2011
function mark_as_patrolled(){ jQuery(".patrollink a").click(); } { document.getElementById("spoilercontents_" + num).style.display="none"; var lk = document.getElementById("spoilerlk_" + num); lk.replaceChild(document.createTextNode("show"), lk.firstChild); lk.setAttribute("href", "javascript:show_spoilerbox(" + num + ")"); } $( function() { if ( wgUserGroups.toString().indexOf('sysop') != -1 || wgUserGroups.toString().indexOf('patroller') != -1) { function patroltab() { var $patrollinks = $('.patrollink a'); if ( $patrollinks.length > 0 ) { addPortletLink ('p-cactions', 'mark_as_patrolled()', 'Patrol', 'ca-patrol', 'Mark as patrolled', '1'); } } $(patroltab); } });