Difference between revisions of "MediaWiki:Common.js"

From Makers Local 256
Jump to: navigation, search
m (ugg)
m (maybe?!)
 
(One intermediate revision by one user not shown)
Line 2: Line 2:
 
var customizeToolbar = function() {
 
var customizeToolbar = function() {
 
$('#wpTextbox1').wikiEditor('addToToolbar', {
 
$('#wpTextbox1').wikiEditor('addToToolbar', {
section: 'advanced',
+
section: 'main',
group: 'heading',
+
group: 'insert',
 
tools: {
 
tools: {
 
"strikethrough": {
 
"strikethrough": {
 
label: 'New Project',
 
label: 'New Project',
 
type: 'button',
 
type: 'button',
icon: '256.makerslocal.org/wiki/images/project.png',
+
icon: '//256.makerslocal.org/wiki/images/project.png',
 
action: {
 
action: {
 
type: 'encapsulate',
 
type: 'encapsulate',
 
options: {
 
options: {
pre: "<s>",
+
pre: "\{\{Project|Creator=User Name",
post: "</s>"
+
post: "\n|Status=\<onlyinclude\> Your Status \<\/onlyinclude\>                                \<\!\-\-LEAVE ONLYINCLUDES FOR STATUS HACK\-\-\> \n|Born On=\~\~\~\~\~                                                                  \<\!\-\-DO NOT EDIT \-\-\>\n|Last Updated=\{\{\#time\: H\:i\, d F Y\| \{\{REVISIONTIMESTAMP\}\} \}\} \(CDT\)              \<\!\-\-DO NOT EDIT \-\-\>\n\}\}\n\n==Overview==\nThis is for a description of your project.\n\n\n\n\n\[\[Category:Put Category Here\]\]                                                  \<\!\-\-MAKE AS MANY CATEGORIES AS YOU NEED\-\-\>"
 
}
 
}
 
}
 
}

Latest revision as of 10:22, 14 February 2014

mw.loader.load( 'ext.wikiEditor.toolbar' );
var customizeToolbar = function() {
	$('#wpTextbox1').wikiEditor('addToToolbar', {
	section: 'main',
	group: 'insert',
	tools: {
		"strikethrough": {
			label: 'New Project',
			type: 'button',
			icon: '//256.makerslocal.org/wiki/images/project.png',
			action: {
				type: 'encapsulate',
				options: {
					pre: "\{\{Project|Creator=User Name",
					post: "\n|Status=\<onlyinclude\> Your Status \<\/onlyinclude\>                                \<\!\-\-LEAVE ONLYINCLUDES FOR STATUS HACK\-\-\> \n|Born On=\~\~\~\~\~                                                                  \<\!\-\-DO NOT EDIT \-\-\>\n|Last Updated=\{\{\#time\: H\:i\, d F Y\| \{\{REVISIONTIMESTAMP\}\} \}\} \(CDT\)              \<\!\-\-DO NOT EDIT \-\-\>\n\}\}\n\n==Overview==\nThis is for a description of your project.\n\n\n\n\n\[\[Category:Put Category Here\]\]                                                  \<\!\-\-MAKE AS MANY CATEGORIES AS YOU NEED\-\-\>"
				}
			}
		}
	}
});
};
 
/* 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 () {
		if ( mw.user.options.get('usebetatoolbar') ) {
			mw.loader.using( 'ext.wikiEditor.toolbar', function () {
				$(document).ready( customizeToolbar );
			} );
		}
	} );
}
// Add the customizations to LiquidThreads' edit toolbar, if available
mw.hook( 'ext.lqt.textareaCreated' ).add( customizeToolbar );