MediaWiki:Common.js: Difference between revisions

From The Jolly Contrarian
Jump to navigation Jump to search
Undo revision 10189 by Amwelladmin (talk)
m Reverted edits by Amwelladmin (talk) to last revision by Root
Line 1: Line 1:
var customizeToolbar = function() {
/* Any JavaScript here will be loaded for all users on every page load. */
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
/* Good source of edit buttons: http://commons.wikimedia.org/wiki/Mediawiki_edit_toolbar */
'sections': {
if (mwCustomEditButtons) {
'Amwell': {
'type': 'toolbar',
'label': 'Amwell'
  mwCustomEditButtons[mwCustomEditButtons.length] = {
}
    "imageFile": "http://upload.wikimedia.org/wikipedia/commons/e/eb/Button_plantilla.png",
}
    "speedTip": "template {{ }}",
} );
    "tagOpen": "{{",
    "tagClose": "}}",
    "sampleText": "text"}


$('#wpTextbox1').wikiEditor('addToToolbar', {
  mwCustomEditButtons[mwCustomEditButtons.length] = {
section: 'advanced',
    "imageFile": "http://upload.wikimedia.org/wikipedia/commons/1/16/Button_fairuse.png",
group: 'format',
    "speedTip": "{{tag|xxx}}",
tools: {
    "tagOpen": "{{tag|",
"ISDAprov": {
    "tagClose": "}}",
label: 'isdaprov',
    "sampleText": "text"}
type: 'button',
icon: 'http://amwellclear.co.uk/w/images/e/ed/Button_I.PNG',
action: {
type: 'encapsulate',
options: {
pre: "{{isdaprov|",
post: "}}"
}
}
}
}
});


  mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "http://localhost/mediawiki/images/h1.png",
    "speedTip": "h1",
    "tagOpen": "{{h1|",
    "tagClose": "}}",
    "sampleText": "text"}


};
  mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "http://localhost/mediawiki/images/h2.png",
    "speedTip": "h2",
    "tagOpen": "{{h2|",
    "tagClose": "}}",
    "sampleText": "text"}


/* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar … */
  mwCustomEditButtons[mwCustomEditButtons.length] = {
if ( $.inArray( mw.config.get( 'wgAction' ), [ 'edit', 'submit' ] ) !== -1 ) {
    "imageFile": "http://localhost/mediawiki/images/h3.png",
mw.loader.using( 'user.options', function () {
    "speedTip": "h3",
// This can be the string "0" if the user disabled the preference ([[phab:T54542#555387]])
    "tagOpen": "{{h3|",
if ( mw.user.options.get( 'usebetatoolbar' ) == 1 ) {
    "tagClose": "}}",
$.when(
    "sampleText": "text"}
mw.loader.using( 'ext.wikiEditor.toolbar' ), $.ready
).then( customizeToolbar );
}
} );
}


};
  mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "http://localhost/mediawiki/images/h4.png",
    "speedTip": "h4",
    "tagOpen": "{{h4|",
    "tagClose": "}}",
    "sampleText": "text"}


// Add the customizations to LiquidThreads' edit toolbar, if available
  mwCustomEditButtons[mwCustomEditButtons.length] = {
mw.hook( 'ext.lqt.textareaCreated' ).add( customizeToolbar );
    "imageFile": "http://localhost/mediawiki/images/c.png",
    "speedTip": "1 category",
    "tagOpen": "{{c|",
    "tagClose": "}}",
    "sampleText": "text"}
 
  mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "http://localhost/mediawiki/images/c2.png",
    "speedTip": "2 categories",
    "tagOpen": "{{c2|",
    "tagClose": "|}}",
    "sampleText": "text"}
 
  mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "http://localhost/mediawiki/images/c3.png",
    "speedTip": "3 categories",
    "tagOpen": "{{c3|",
    "tagClose": "||}}",
    "sampleText": "text"}
 
  mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "http://localhost/mediawiki/images/c4.png",
    "speedTip": "4 categories",
    "tagOpen": "{{c4|",
    "tagClose": "|||}}",
    "sampleText": "text"}
 
  mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "http://localhost/mediawiki/images/b1.png",
    "speedTip": "b1",
    "tagOpen": "{{b1|",
    "tagClose": "}}",
    "sampleText": "text"}
 
  mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "http://localhost/mediawiki/images/b2.png",
    "speedTip": "b2",
    "tagOpen": "{{b2|",
    "tagClose": "}}",
    "sampleText": "text"}
 
  mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "http://upload.wikimedia.org/wikipedia/en/c/c8/Button_redirect.png",
    "speedTip": "redirect",
    "tagOpen": "#redirect[[",
    "tagClose": "]]",
    "sampleText": "pagename"}
 
  mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "http://upload.wikimedia.org/wikipedia/commons/a/a0/Button_references_alt.png",
    "speedTip": "falcon head",
    "tagOpen": "{{falconrat|",
    "tagClose": "}}",
    "sampleText": "text"}
 
  mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "http://upload.wikimedia.org/wikipedia/commons/e/e1/Button_smiley.png",
    "speedTip": "Arabella Story Tag",
    "tagOpen": "{{Arabella|",
    "tagClose": "}}",
    "sampleText": "text"}
 
  mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "http://upload.wikimedia.org/wikipedia/en/f/fd/Button_blockquote.png",
    "speedTip": "Arabella Page Tag",
    "tagOpen": "{{Arabellastory}}",
    "tagClose": "",
    "sampleText": ""}
 
  mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "http://upload.wikimedia.org/wikipedia/commons/b/bc/Button_guillemet.png",
    "speedTip": "Nextprev",
    "tagOpen": "{{nextprev|",
    "tagClose": "}}",
    "sampleText": "{{Arabella|}}|{{Arabella|}}"}
 
  mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "http://upload.wikimedia.org/wikipedia/commons/1/16/Button_fairuse.png",
    "speedTip": "orcacle",
    "tagOpen": "{{oracle|",
    "tagClose": "}}",
    "sampleText": ""}
    mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "http://localhost/mediawiki/images/a/a9/Fender_button.png",
    "speedTip": "guitar",
    "tagOpen": "{{g|",
    "tagClose": "}}",
    "sampleText": ""}
 
    mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "http://upload.wikimedia.org/wikipedia/commons/3/3f/Button_attendre.png",
    "speedTip": "guitar",
    "tagOpen": "{{c|Oracle Timeline}} <small>''[http://localhost/mediawiki/index.php?title=Template: _ _ _-_Oracle&action=edit edit template]''</small><br>",
    "tagClose": "",
    "sampleText": ""}
}

Revision as of 12:10, 22 December 2015

/* Any JavaScript here will be loaded for all users on every page load. */
/* Good source of edit buttons: http://commons.wikimedia.org/wiki/Mediawiki_edit_toolbar */
if (mwCustomEditButtons) {
 
 
   mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/e/eb/Button_plantilla.png",
     "speedTip": "template {{ }}",
     "tagOpen": "{{",
     "tagClose": "}}",
     "sampleText": "text"}

   mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/1/16/Button_fairuse.png",
     "speedTip": "{{tag|xxx}}",
     "tagOpen": "{{tag|",
     "tagClose": "}}",
     "sampleText": "text"}

  mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://localhost/mediawiki/images/h1.png",
     "speedTip": "h1",
     "tagOpen": "{{h1|",
     "tagClose": "}}",
     "sampleText": "text"}

   mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://localhost/mediawiki/images/h2.png",
     "speedTip": "h2",
     "tagOpen": "{{h2|",
     "tagClose": "}}",
     "sampleText": "text"}

   mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://localhost/mediawiki/images/h3.png",
     "speedTip": "h3",
     "tagOpen": "{{h3|",
     "tagClose": "}}",
     "sampleText": "text"}

   mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://localhost/mediawiki/images/h4.png",
     "speedTip": "h4",
     "tagOpen": "{{h4|",
     "tagClose": "}}",
     "sampleText": "text"}

  mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://localhost/mediawiki/images/c.png",
     "speedTip": "1 category",
     "tagOpen": "{{c|",
     "tagClose": "}}",
     "sampleText": "text"}

  mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://localhost/mediawiki/images/c2.png",
     "speedTip": "2 categories",
     "tagOpen": "{{c2|",
     "tagClose": "|}}",
     "sampleText": "text"}

  mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://localhost/mediawiki/images/c3.png",
     "speedTip": "3 categories",
     "tagOpen": "{{c3|",
     "tagClose": "||}}",
     "sampleText": "text"}

  mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://localhost/mediawiki/images/c4.png",
     "speedTip": "4 categories",
     "tagOpen": "{{c4|",
     "tagClose": "|||}}",
     "sampleText": "text"}

   mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://localhost/mediawiki/images/b1.png",
     "speedTip": "b1",
     "tagOpen": "{{b1|",
     "tagClose": "}}",
     "sampleText": "text"}

   mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://localhost/mediawiki/images/b2.png",
     "speedTip": "b2",
     "tagOpen": "{{b2|",
     "tagClose": "}}",
     "sampleText": "text"}

   mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/en/c/c8/Button_redirect.png",
     "speedTip": "redirect",
     "tagOpen": "#redirect[[",
     "tagClose": "]]",
     "sampleText": "pagename"}

  mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/a/a0/Button_references_alt.png",
     "speedTip": "falcon head",
     "tagOpen": "{{falconrat|",
     "tagClose": "}}",
     "sampleText": "text"}

   mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/e/e1/Button_smiley.png",
     "speedTip": "Arabella Story Tag",
     "tagOpen": "{{Arabella|",
     "tagClose": "}}",
     "sampleText": "text"}

   mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/en/f/fd/Button_blockquote.png",
     "speedTip": "Arabella Page Tag",
     "tagOpen": "{{Arabellastory}}",
     "tagClose": "",
     "sampleText": ""}

   mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/b/bc/Button_guillemet.png",
     "speedTip": "Nextprev",
     "tagOpen": "{{nextprev|",
     "tagClose": "}}",
     "sampleText": "{{Arabella|}}|{{Arabella|}}"}

   mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/1/16/Button_fairuse.png",
     "speedTip": "orcacle",
     "tagOpen": "{{oracle|",
     "tagClose": "}}",
     "sampleText": ""}
 
    mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://localhost/mediawiki/images/a/a9/Fender_button.png",
     "speedTip": "guitar",
     "tagOpen": "{{g|",
     "tagClose": "}}",
     "sampleText": ""}

    mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/3/3f/Button_attendre.png",
     "speedTip": "guitar",
     "tagOpen": "{{c|Oracle Timeline}} <small>''[http://localhost/mediawiki/index.php?title=Template: _ _ _-_Oracle&action=edit edit template]''</small><br>",
     "tagClose": "",
     "sampleText": ""}
 
 }