MediaWiki:Sysop.js/edit.js
Note: After saving, you may have to bypass your browser's cache to see the changes. Firefox / Safari: hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (Command-R on a Mac). Google Chrome: press Ctrl-Shift-R (Command-Shift-R on a Mac). Internet Explorer: hold Ctrl while clicking Refresh, or press Ctrl-F5. Konqueror: click Reload or press F5. Opera: clear the cache in Tools → Preferences
//fix edit summary prompt for undo
//this code fixes the fact that the undo function combined with the "no edit summary prompter" causes problems if leaving the
//edit summary unchanged
//this was added by [[User:Deskana]], code by [[User:Tra]]
//see bug 8912
$(function () {
if (document.location.search.indexOf("undo=") != -1
&& document.getElementsByName('wpAutoSummary')[0]) {
document.getElementsByName('wpAutoSummary')[0].value='1';
}
})
// Turn on spellchecking in the edit summary field, for Firefox.
// Temporary until [[bugzilla:21604]] is deployed
$( function() {
var wpSummary = document.getElementById( "wpSummary" );
if ( wpSummary && typeof wpSummary.spellcheck != undefined )
wpSummary.spellcheck = true;
} );
if ( $.fn.wikiEditor ) {
$( function() {
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'main',
'group': 'format',
'tools': {
'yáʼátʼééh': {
label: 'Yáʼátʼééh',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/f/f1/Smiley4.png',
action: {
type: 'encapsulate',
options: {
pre: "{{subst:",
post: "Yáʼátʼééh}}"
}
}
}
}
} );
} );
}
if ( $.fn.wikiEditor ) {
$( function() {
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'main',
'group': 'format',
'tools': {
'bot-switch': {
label: 'emergency bot-switch',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/d/d8/Toolbaricon_bold_E.png',
action: {
type: 'encapsulate',
options: {
pre: "{{Emergency-bot-shutoff",
post: "}}"
}
}
}
}
} );
} );
}
if ( $.fn.wikiEditor ) {
$( function() {
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'main',
'group': 'format',
'tools': {
'bot?': {
label: 'bot ?',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/e/e8/Toolbaricon_bold_%3F.png',
action: {
type: 'encapsulate',
options: {
pre: "{{bot|?",
post: "}}"
}
}
}
}
} );
} );
}