Changes

MediaWiki:Common.js

1,059 bytes added, 19:34, 21 November 2020
no edit summary
}
}
}
 
var customizeToolbar = function () {
$('#wpTextbox1').wikiEditor('addToToolbar', {
section: 'advanced',
group: 'insert',
tools: {
"Map": {
label: 'Insert map',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/b/b4/OOjs_UI_icon_map-ltr.svg',
action: {
type: 'encapsulate',
options: {
pre: '{{#display_map:',
peri: "Example street 1, Berlin~'''Heading'''~Short description; optional: 2nd marker",
post: '|fullscreen=on}}'
}
}
}
}
});
};
/* 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 () {
if ( mw.user.options.get( 'usebetatoolbar' ) == 1 ) {
$.when(
mw.loader.using( 'ext.wikiEditor' ), $.ready
).then( customizeToolbar );
}
} );
}