MediaWiki:Gadget-PatrolTab.js: Difference between revisions

From Zelda Dungeon Wiki
Jump to navigation Jump to search
Want an adless experience? Log in or Create an account.
mNo edit summary
(Testing another method.)
Line 1: Line 1:
function patrol(){
jQuery(".patrollink a").click();
};
$( 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 9: Line 5:
if ( $patrollinks.length > 0 )
if ( $patrollinks.length > 0 )
{
{
addPortletLink ('p-cactions', 'javascript:patrol()', 'Patrol', 'ca-patrol', 'Mark as patrolled', '1');
var portletLink=addPortletLink ('p-cactions', ' ', 'Patrol', 'ca-patrol', 'Mark as patrolled', '1');
}
}
$(portletLink).click( function( e ) {
        e.preventDefault();
        // doSomeStuff();
        jQuery(".patrollink a").click();
});
}
}
$(patroltab);
$(patroltab);
   }
   }
});
});

Revision as of 08:17, November 8, 2011

$( function() {
  if ( wgUserGroups.toString().indexOf('sysop') == -1 || wgUserGroups.toString().indexOf('patroller') == -1) {
function patroltab() {
        var $patrollinks = $('.patrollink a');
	if ( $patrollinks.length > 0 )
{
var portletLink=addPortletLink ('p-cactions', ' ', 'Patrol', 'ca-patrol', 'Mark as patrolled', '1');
}
$(portletLink).click( function( e ) {
        e.preventDefault();
        // doSomeStuff();
        jQuery(".patrollink a").click();
});
}
$(patroltab);
  }
});