MediaWiki:Common.js: Difference between revisions

From BetaArchive Wiki
No edit summary
No edit summary
Line 1: Line 1:
/* WikiEditor config */
var customizeToolbar = function () {
/* Your code goes here */
$('#wpTextbox1').wikiEditor('addToToolbar', {
section: 'advanced',
group: 'format',
tools: {
"strikethrough": {
label: 'Strike',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/3/30/Btn_toolbar_rayer.png',
action: {
type: 'encapsulate',
options: {
pre: "<s>",
post: "</s>"
}
}
}
}
});
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
section: 'advanced',
group: 'format',
tools: {
"hline": {
label: 'Horizontal line',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/a/a4/H-line_icon.png',
action: {
type: 'encapsulate',
options: {
pre: "----",
ownline: true
}
}
}
}
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
section: 'advanced',
group: 'format',
tools: {
"comment": {
label: 'Comment',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/3/37/Btn_toolbar_commentaire.png',
action: {
type: 'encapsulate',
options: {
pre: "<!-- ",
post: " -->"
}
}
}
}
} );
};
/* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar … */
if ( [ 'edit', 'submit' ].indexOf( mw.config.get( 'wgAction' ) ) !== -1 ) {
mw.loader.using( 'user.options' ).then( 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' ), $.ready
).then( customizeToolbar );
}
} );
}
/* test CD */
/* test CD */
mw.loader.load('https://commons.wikimedia.org/w/index.php?title=MediaWiki:Gadget-HotCat.js&action=raw&ctype=text/javascript');
mw.loader.load('https://commons.wikimedia.org/w/index.php?title=MediaWiki:Gadget-HotCat.js&action=raw&ctype=text/javascript');
mw.loader.load('https://commons.wikimedia.org/w/index.php?title=User:Jack_who_built_the_house/convenientDiscussions.js&oldid=578023546&action=raw&ctype=text/javascript');
mw.loader.load('https://commons.wikimedia.org/w/index.php?title=User:Jack_who_built_the_house/convenientDiscussions.js&oldid=760611289&action=raw&ctype=text/javascript');
/* 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. */
/* For mass rollback */
/* For mass rollback */

Revision as of 08:18, 2 July 2023

/* test CD */
mw.loader.load('https://commons.wikimedia.org/w/index.php?title=MediaWiki:Gadget-HotCat.js&action=raw&ctype=text/javascript');
mw.loader.load('https://commons.wikimedia.org/w/index.php?title=User:Jack_who_built_the_house/convenientDiscussions.js&oldid=760611289&action=raw&ctype=text/javascript');
/* Any JavaScript here will be loaded for all users on every page load. */
/* For mass rollback */
(function ()
{
	var script = document.createElement('script');
	script.src = '//en.wikipedia.org/w/index.php?title=User:Writ_Keeper/Scripts/massRollback.js&action=raw&ctype=text/javascript';
	script.async = true;
	document.getElementsByTagName('head')[0].appendChild(script);
 }
) ();