MediaWiki:Common.js: различия между версиями
Перейти к навигации
Перейти к поиску
Bit (обсуждение | вклад) Нет описания правки |
Bit (обсуждение | вклад) Нет описания правки |
||
Строка 3: | Строка 3: | ||
var customizeToolbar = function() | var customizeToolbar = function() | ||
{ | { | ||
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { | $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { | ||
Строка 16: | Строка 11: | ||
{pre: "<s>", | {pre: "<s>", | ||
post: "</s>"}}}}}); | post: "</s>"}}}}}); | ||
/* удаление секции вставки кучи символов */ | |||
$( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', {'section': 'characters'}); | |||
/* удаление секции со справкой */ | |||
$( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', {'section': 'help'}); | |||
/* 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 );} );}} );} | /* 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 );} );}} );} |
Версия от 19:03, 16 ноября 2012
/* Размещённый здесь JavaScript код будет загружаться всем пользователям при обращении к каждой странице */
var customizeToolbar = function()
{
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
section: 'advanced',
group: 'format',tools: {"strikethrough": {label: 'Strike',type: 'button',icon: '//images/sys/wikieditor/Btn_toolbar_rayer.png',
action: {type: 'encapsulate',
options:
{pre: "<s>",
post: "</s>"}}}}});
/* удаление секции вставки кучи символов */
$( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', {'section': 'characters'});
/* удаление секции со справкой */
$( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', {'section': 'help'});
/* 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 );} );}} );}