Difference between revisions of "MediaWiki:Common.js"
Jump to navigation
Jump to search
m |
(remove unnecessary things) |
||
(One intermediate revision by the same user not shown) | |||
Line 6: | Line 6: | ||
$('.sitemessage').find('p').append('<a href="#hide-message">[hide this message]</a>'); | $('.sitemessage').find('p').append('<a href="#hide-message">[hide this message]</a>'); | ||
$(document).on('click','a[href=#hide-message]',function(e){e.preventDefault();$('.sitemessage').fadeOut(750); $.cookie('message','hide',{expires:100})}); | $(document).on('click','a[href=#hide-message]',function(e){e.preventDefault();$('.sitemessage').fadeOut(750); $.cookie('message','hide',{expires:100})}); | ||
/* | /* | ||
Line 22: | Line 11: | ||
*/ | */ | ||
/ | /*if ('mwCustomEditButtons' in window) { | ||
mwCustomEditButtons.push({ | mwCustomEditButtons.push({ | ||
"imageFile": "http://upload.wikimedia.org/wikipedia/en/c/c8/Button_redirect.png", | "imageFile": "http://upload.wikimedia.org/wikipedia/en/c/c8/Button_redirect.png", | ||
Line 29: | Line 18: | ||
"tagClose": "]]", | "tagClose": "]]", | ||
"sampleText": "Insert text"}); | "sampleText": "Insert text"}); | ||
/ | }*/ |
Latest revision as of 03:00, 1 December 2013
/* Any JavaScript here will be loaded for all users on every page load. */
// Site message hiding
if($.cookie('message') != 'hide' && wgUserName) $('.sitemessage').fadeIn(750);
else $('.sitemessage').hide();
$('.sitemessage').find('p').append('<a href="#hide-message">[hide this message]</a>');
$(document).on('click','a[href=#hide-message]',function(e){e.preventDefault();$('.sitemessage').fadeOut(750); $.cookie('message','hide',{expires:100})});
/*
Custom edit buttons
*/
/*if ('mwCustomEditButtons' in window) {
mwCustomEditButtons.push({
"imageFile": "http://upload.wikimedia.org/wikipedia/en/c/c8/Button_redirect.png",
"speedTip": "Redirect",
"tagOpen": "#REDIRECT [[",
"tagClose": "]]",
"sampleText": "Insert text"});
}*/