MediaWiki:Common.js: Difference between revisions

From The Jolly Contrarian
Jump to navigation Jump to search
m Reverted edits by Amwelladmin (talk) to last revision by Root
No edit summary
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */
var customizeToolbar = function() {
/* Good source of edit buttons: http://commons.wikimedia.org/wiki/Mediawiki_edit_toolbar */
$('#wpTextbox1').wikiEditor('addToToolbar', {
if (mwCustomEditButtons) {
section: 'advanced',
group: 'format',
tools: {
  mwCustomEditButtons[mwCustomEditButtons.length] = {
"strikethrough": {
    "imageFile": "http://upload.wikimedia.org/wikipedia/commons/e/eb/Button_plantilla.png",
label: 'boogaloo',
    "speedTip": "template {{ }}",
type: 'button',
    "tagOpen": "{{",
icon: '//upload.wikimedia.org/wikipedia/commons/3/30/Btn_toolbar_rayer.png',
    "tagClose": "}}",
action: {
    "sampleText": "text"}
type: 'encapsulate',
options: {
pre: "<s>",
post: "</s>"
}
}
}
}
});
};


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


  mwCustomEditButtons[mwCustomEditButtons.length] = {
var customizeToolbar = function() {
    "imageFile": "http://localhost/mediawiki/images/h1.png",
$('#wpTextbox1').wikiEditor('addToToolbar', {
    "speedTip": "h1",
section: 'advanced',
    "tagOpen": "{{h1|",
group: 'format',
    "tagClose": "}}",
tools: {
    "sampleText": "text"}
"gmslaprov": {
label: 'gmslaprov',
type: 'button',
icon: 'http://amwellclear.co.uk/w/images/e/ed/G.PNG',
action: {
type: 'encapsulate',
options: {
pre: "{{gmslaprov|",
post: "}}"
}
}
}
}
});
};


  mwCustomEditButtons[mwCustomEditButtons.length] = {
var customizeToolbar = function() {
    "imageFile": "http://localhost/mediawiki/images/h2.png",
$('#wpTextbox1').wikiEditor('addToToolbar', {
    "speedTip": "h2",
section: 'advanced',
    "tagOpen": "{{h2|",
group: 'format',
    "tagClose": "}}",
tools: {
    "sampleText": "text"}
"gmraprov": {
label: 'grmaprov',
type: 'button',
icon: 'http://amwellclear.co.uk/w/images/e/ed/gmr.PNG',
action: {
type: 'encapsulate',
options: {
pre: "{{gmraprov|",
post: "}}"
}
}
}
}
});
};


  mwCustomEditButtons[mwCustomEditButtons.length] = {
var customizeToolbar = function() {
    "imageFile": "http://localhost/mediawiki/images/h3.png",
$('#wpTextbox1').wikiEditor('addToToolbar', {
    "speedTip": "h3",
section: 'advanced',
    "tagOpen": "{{h3|",
group: 'format',
    "tagClose": "}}",
tools: {
    "sampleText": "text"}
"Substitute": {
label: 'subst:',
type: 'button',
icon: 'http://amwellclear.co.uk/w/images/e/ed/Sbs.PNG',
action: {
type: 'encapsulate',
options: {
pre: "{{subst:",
post: "}}"
}
}
}
}
});
};


  mwCustomEditButtons[mwCustomEditButtons.length] = {
var customizeToolbar = function() {
    "imageFile": "http://localhost/mediawiki/images/h4.png",
$('#wpTextbox1').wikiEditor('addToToolbar', {
    "speedTip": "h4",
section: 'advanced',
    "tagOpen": "{{h4|",
group: 'format',
    "tagClose": "}}",
tools: {
    "sampleText": "text"}
"Equity Derivs": {
label: 'eqderivprov',
type: 'button',
icon: 'http://amwellclear.co.uk/w/images/e/ed/Eq.PNG',
action: {
type: 'encapsulate',
options: {
pre: "{{eqderivprov|",
post: "}}"
}
}
}
}
});
};


  mwCustomEditButtons[mwCustomEditButtons.length] = {
var customizeToolbar = function() {
    "imageFile": "http://localhost/mediawiki/images/c.png",
$('#wpTextbox1').wikiEditor('addToToolbar', {
    "speedTip": "1 category",
section: 'advanced',
    "tagOpen": "{{c|",
group: 'format',
    "tagClose": "}}",
tools: {
    "sampleText": "text"}
"template": {
label: '{{ - }}',
type: 'button',
icon: 'http://amwellclear.co.uk/w/images/e/ed/template.PNG',
action: {
type: 'encapsulate',
options: {
pre: "{{",
post: "}}"
}
}
}
}
});
};


  mwCustomEditButtons[mwCustomEditButtons.length] = {
var customizeToolbar = function() {
    "imageFile": "http://localhost/mediawiki/images/c2.png",
$('#wpTextbox1').wikiEditor('addToToolbar', {
    "speedTip": "2 categories",
section: 'advanced',
    "tagOpen": "{{c2|",
group: 'format',
    "tagClose": "|}}",
tools: {
    "sampleText": "text"}
"ISDAprov": {
label: 'isdaprov',
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/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] = {
/* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar … */
    "imageFile": "http://localhost/mediawiki/images/b2.png",
if ( $.inArray( mw.config.get( 'wgAction' ), [ 'edit', 'submit' ] ) !== -1 ) {
    "speedTip": "b2",
mw.loader.using( 'user.options', function () {
    "tagOpen": "{{b2|",
// This can be the string "0" if the user disabled the preference ([[phab:T54542#555387]])
    "tagClose": "}}",
if ( mw.user.options.get( 'usebetatoolbar' ) == 1 ) {
    "sampleText": "text"}
$.when(
mw.loader.using( 'ext.wikiEditor.toolbar' ), $.ready
).then( customizeToolbar );
}
} );
}
// Add the customizations to LiquidThreads' edit toolbar, if available
mw.hook( 'ext.lqt.textareaCreated' ).add( customizeToolbar );


  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] = {
/* Any JavaScript here will be loaded for all users on every page load. */
    "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] = {
/* Any JavaScript here will be loaded for all users on every page load. */
    "imageFile": "http://upload.wikimedia.org/wikipedia/commons/3/3f/Button_attendre.png",
/* Good site for buttons: http://commons.wikimedia.org/wiki/Mediawiki_edit_toolbar */
    "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:11, 22 December 2015

var customizeToolbar = function() {
$('#wpTextbox1').wikiEditor('addToToolbar', {
	section: 'advanced',
	group: 'format',
	tools: {
		"strikethrough": {
			label: 'boogaloo',
			type: 'button',
			icon: '//upload.wikimedia.org/wikipedia/commons/3/30/Btn_toolbar_rayer.png',
			action: {
				type: 'encapsulate',
				options: {
					pre: "<s>",
					post: "</s>"
				}
			}
		}
	}
});	
};

var customizeToolbar = function() {
$('#wpTextbox1').wikiEditor('addToToolbar', {
	section: 'advanced',
	group: 'format',
	tools: {
		"ISDAprov": {
			label: 'isdaprov',
			type: 'button',
			icon: 'http://amwellclear.co.uk/w/images/e/ed/Button_I.PNG',
			action: {
				type: 'encapsulate',
				options: {
					pre: "{{isdaprov|",
					post: "}}"
				}
			}
		}
	}
});	
};

var customizeToolbar = function() {
$('#wpTextbox1').wikiEditor('addToToolbar', {
	section: 'advanced',
	group: 'format',
	tools: {
		"gmslaprov": {
			label: 'gmslaprov',
			type: 'button',
			icon: 'http://amwellclear.co.uk/w/images/e/ed/G.PNG',
			action: {
				type: 'encapsulate',
				options: {
					pre: "{{gmslaprov|",
					post: "}}"
				}
			}
		}
	}
});	
};

var customizeToolbar = function() {
$('#wpTextbox1').wikiEditor('addToToolbar', {
	section: 'advanced',
	group: 'format',
	tools: {
		"gmraprov": {
			label: 'grmaprov',
			type: 'button',
			icon: 'http://amwellclear.co.uk/w/images/e/ed/gmr.PNG',
			action: {
				type: 'encapsulate',
				options: {
					pre: "{{gmraprov|",
					post: "}}"
				}
			}
		}
	}
});	
};

var customizeToolbar = function() {
$('#wpTextbox1').wikiEditor('addToToolbar', {
	section: 'advanced',
	group: 'format',
	tools: {
		"Substitute": {
			label: 'subst:',
			type: 'button',
			icon: 'http://amwellclear.co.uk/w/images/e/ed/Sbs.PNG',
			action: {
				type: 'encapsulate',
				options: {
					pre: "{{subst:",
					post: "}}"
				}
			}
		}
	}
});	
};

var customizeToolbar = function() {
$('#wpTextbox1').wikiEditor('addToToolbar', {
	section: 'advanced',
	group: 'format',
	tools: {
		"Equity Derivs": {
			label: 'eqderivprov',
			type: 'button',
			icon: 'http://amwellclear.co.uk/w/images/e/ed/Eq.PNG',
			action: {
				type: 'encapsulate',
				options: {
					pre: "{{eqderivprov|",
					post: "}}"
				}
			}
		}
	}
});	
};

var customizeToolbar = function() {
$('#wpTextbox1').wikiEditor('addToToolbar', {
	section: 'advanced',
	group: 'format',
	tools: {
		"template": {
			label: '{{ - }}',
			type: 'button',
			icon: 'http://amwellclear.co.uk/w/images/e/ed/template.PNG',
			action: {
				type: 'encapsulate',
				options: {
					pre: "{{",
					post: "}}"
				}
			}
		}
	}
});	
};

var customizeToolbar = function() {
$('#wpTextbox1').wikiEditor('addToToolbar', {
	section: 'advanced',
	group: 'format',
	tools: {
		"ISDAprov": {
			label: 'isdaprov',
			type: 'button',
			icon: 'http://amwellclear.co.uk/w/images/e/ed/Button_I.PNG',
			action: {
				type: 'encapsulate',
				options: {
					pre: "{{isdaprov|",
					post: "}}"
				}
			}
		}
	}
});	
};




/* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar … */
if ( $.inArray( mw.config.get( 'wgAction' ), [ 'edit', 'submit' ] ) !== -1 ) {
	mw.loader.using( 'user.options', function () {
		// This can be the string "0" if the user disabled the preference ([[phab:T54542#555387]])
		if ( mw.user.options.get( 'usebetatoolbar' ) == 1 ) {
			$.when(
				mw.loader.using( 'ext.wikiEditor.toolbar' ), $.ready
			).then( customizeToolbar );
		}
	} );
}
// Add the customizations to LiquidThreads' edit toolbar, if available
mw.hook( 'ext.lqt.textareaCreated' ).add( customizeToolbar );





/* Any JavaScript here will be loaded for all users on every page load. */

 /* Any JavaScript here will be loaded for all users on every page load. */
 /* Good site for buttons: http://commons.wikimedia.org/wiki/Mediawiki_edit_toolbar */