Difference between revisions of "MediaWiki:Common.js"
Jump to navigation
Jump to search
(message hiding) |
m |
||
Line 2: | Line 2: | ||
// Site message hiding | // Site message hiding | ||
if($.cookie('message') != 'hide') $('.sitemessage').show().find('p').append('<a href="#hide-message">[hide this message]</a>'); | if($.cookie('message') != 'hide') $('.sitemessage').show(); | ||
$('.sitemessage').find('p').append('<a href="#hide-message">[hide this message]</a>'); | |||
$(document).on('click','a[href=#hide-message]',function(e){e.preventDefault();$('.sitemessage').hide(); $.cookie('message','hide',{expires:100})}); | $(document).on('click','a[href=#hide-message]',function(e){e.preventDefault();$('.sitemessage').hide(); $.cookie('message','hide',{expires:100})}); |
Revision as of 21:34, 10 June 2013
/* Any JavaScript here will be loaded for all users on every page load. */
// Site message hiding
if($.cookie('message') != 'hide') $('.sitemessage').show();
$('.sitemessage').find('p').append('<a href="#hide-message">[hide this message]</a>');
$(document).on('click','a[href=#hide-message]',function(e){e.preventDefault();$('.sitemessage').hide(); $.cookie('message','hide',{expires:100})});