Difference between revisions 5245522 and 5245648 on enwikisource//<source lang="javascript">
/* ProofreadPage extension specific */
self.proofreadpage_disable_wheelzoom = true;
self.layout_overrides_have_precedence = true;
// self.proofreadpage_disable_ocr = true; Now handled in User prefs ~ Gadgets
/* CharInsert specific */
// window.charinsertDontMove = true;
window.charinsertMoveTop = true;
window.editToolsRecall = true;
window.charinsertCustom = {
"User": ' œ £ § · º Æ É Ë Ñ Œ Ö à á â ã ä æ ç è é ê ë î ï ñ ó ô ö ù ú û ü '
};
// if(window.updateEditTools) window.updateEditTools();
/**
* WikiEditor specific
*
* Custom buttons ONLY when Prefs set to - Enable enhanced editing toolbar - is selected,
* Enable wizards for... - must not be selected. Show [old]edit toolbar - should be off.
* based upon - https://github.com/he7d3r/mw-gadget-ExtraEditButtons
*/
var iconPathWE = mw.config.get( 'wgExtensionAssetsPath' ) + '/WikiEditor/modules/images/toolbar/';
var customizeToolbar = function() {
$( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', { 'section': 'main', 'group': 'insert', 'tool': 'xlink' } )
.wikiEditor( 'removeFromToolbar', { 'section': 'main', 'group': 'insert', 'tool': 'ilink' } )
.wikiEditor( 'removeFromToolbar', { 'section': 'main', 'group': 'insert', 'tool': 'file' } )
.wikiEditor( 'removeFromToolbar', { 'section': 'main', 'group': 'insert', 'tool': 'reference' } )
.wikiEditor( 'removeFromToolbar', { 'section': 'main', 'group': 'insert', 'tool': 'signature' } )
.wikiEditor( 'removeFromToolbar', { 'section': 'characters' } )
.wikiEditor( 'removeFromToolbar', { 'section': 'advanced' } )
.wikiEditor( 'removeFromToolbar', { 'section': 'help' } )
.wikiEditor( 'addToToolbar', {
'section': 'main',
'group': 'format',
'tools': {
'underline': {
'labelMsg': 'wikieditor-toolbar-tool-underline',
'label': 'Underline',
'id': 'underline',
'filters': [ 'body:not(.ns-2, .ns-8, .ns-828)' ],
'type': 'button',
'icon': '//upload.wikimedia.org/wikipedia/commons/8/8b/Button_underline_he.png',
'action': {
'type': 'encapsulate',
'options': {
'pre': "<u>",
'periMsg': 'wikieditor-toolbar-tool-underline-example',
'post': "</u>"
}
}
},
'strikeout': {
'labelMsg': 'wikieditor-toolbar-tool-strikeout',
'label': 'Strike out',
'id': 'strikeout',
'filters': [ 'body:not(.ns-2, .ns-8, .ns-828)' ],
'type': 'button',
'icon': '//upload.wikimedia.org/wikipedia/commons/6/6d/Vector_strikeout.png',
'action': {
'type': 'encapsulate',
'options': {
'pre': "<s>",
'periMsg': 'wikieditor-toolbar-tool-strikeout-example',
'post': "</s>"
}
}
},
'emdash': {
'labelMsg': 'wikieditor-toolbar-tool-emdash',
'label': 'em-dash',
'id': 'emdash',
'filters': [ 'body:not(.ns-2, .ns-8, .ns-828)' ],
'type': 'button',
'icon': '//upload.wikimedia.org/wikipedia/commons/8/8b/Button_m-dash.png',
'action': {
'type': 'replace',
'options': {
'peri': '\u2014',
'selectPeri': false
}
}
}
}
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'main',
'group': 'insert',
'tools': {
'ilink': {
'labelMsg': 'wikieditor-toolbar-tool-ilink',
'label': 'Wiki link',
'id': 'ilink',
'type': 'button',
'icon': iconPathWE + 'insert-ilink.png',
'offset': [2, -1582],
'action': {
'type': 'encapsulate',
'options': {
'pre': "[[",
'periMsg': 'wikieditor-toolbar-tool-ilink-example',
'post': "]]"
}
}
},
'xlink': {
'labelMsg': 'wikieditor-toolbar-tool-xlink',
'label': 'URL link',
'id': 'xlink',
'type': 'button',
'icon': iconPathWE + 'insert-xlink.png',
'offset': [-70, 2],
'action': {
'type': 'encapsulate',
'options': {
'pre': "[",
'periMsg': 'wikieditor-toolbar-tool-xlink-example',
'post': "]"
}
}
},
'nowiki': {
'labelMsg': 'wikieditor-toolbar-tool-nowiki',
'label': 'NoWiki',
'id': 'nowiki',
'type': 'button',
'icon': iconPathWE + 'insert-nowiki.png',
'offset': [-70, -70],
'action': {
'type': 'encapsulate',
'options': {
'pre': "<nowiki>",
'periMsg': 'wikieditor-toolbar-tool-nowiki-example',
'post': "</nowiki>"
}
}
},
'redirect': {
'labelMsg': 'wikieditor-toolbar-tool-redirect',
'label': 'ReDirect',
'id': 'redirect',
'filters': [ 'body:not(.ns-828, .ns-829)' ],
'type': 'button',
'icon': iconPathWE + 'insert-redirect.png',
'offset': [-70, -142],
'action': {
'type': 'encapsulate',
'options': {
'pre': mw.config.get( 'wgWikiEditorMagicWords' ).redirect + ' [[',
'periMsg': 'wikieditor-toolbar-tool-redirect-example',
'post': "]]",
'ownline': true
}
}
},
'signature': {
'labelMsg': 'wikieditor-toolbar-tool-signature',
'label': 'Your Signature',
'id': 'signature',
'filters': [ 'body.ns-talk, body.ns-4' ],
'type': 'button',
'icon': iconPathWE + 'insert-signature.png',
'offset': [2, -1872],
'action': {
'type': 'encapsulate',
'options': {
'pre': '— ~~~~'
}
}
}
}
} );
};
/* Check that required mode and modules are available. Then, customize */
if ( $.inArray( mw.config.get( 'wgAction' ), [ 'edit', 'submit' ] ) !== -1 ) {
mw.loader.using( 'user.options', function () {
if ( mw.user.options.get( 'usebetatoolbar' ) == 1 ) {
$.when(
mw.loader.using( 'ext.wikiEditor.toolbar' ),
$.ready
).then( customizeToolbar );
}
} );
}
//</source>All content in the above text box is licensed under the Creative Commons Attribution-ShareAlike license Version 4 and was originally sourced from https://en.wikisource.org/w/index.php?diff=prev&oldid=5245648.
![]() ![]() This site is not affiliated with or endorsed in any way by the Wikimedia Foundation or any of its affiliates. In fact, we fucking despise them.
|