422
правки
Godville (обсуждение | вклад) мНет описания правки |
Godville (обсуждение | вклад) (обновление викификатора) |
||
| Строка 81: | Строка 81: | ||
if (hasClass(child, 'NavPic') || hasClass(child, 'NavContent')) | if (hasClass(child, 'NavPic') || hasClass(child, 'NavContent')) | ||
child.style.display = disp | child.style.display = disp | ||
} | } | ||
| Строка 99: | Строка 88: | ||
} | } | ||
if (wgAction | |||
/*WikiEditor/Викификатор*/ | |||
if ( $.inArray( mw.config.get( 'wgAction' ), ['edit', 'submit'] ) !== -1 ) { | |||
mw.loader.load( '//ru.wikipedia.org/w/index.php?title=MediaWiki:Wikificator.js&action=raw&ctype=text/javascript' ); | |||
} | |||
var customizeToolbar = function() { | |||
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { | |||
'section': 'advanced', | |||
'group': 'format', | |||
'tools': { | |||
'wikify': { | |||
label: 'Викификатор', | |||
type: 'button', | |||
icon: '//upload.wikimedia.org/wikipedia/commons/0/06/Wikify-toolbutton.png', | |||
action: { | |||
type: 'callback', | |||
execute: function(context){ | |||
Wikify(); | |||
} | |||
} | |||
} | |||
} | |||
} ); | |||
}; | |||
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 ); | |||
} ); | |||
} | |||
} ); | |||
} | } | ||