MediaWiki:Editpage.js:версиослэн висъяськемзы
Пушкесэз ӵушемын Пушкесэз ватсамын
<div id="gadget-toolbar" style="float:left;"></div> |
Тупатонлэн валэктонэз ӧвӧл |
||
7-тӥ чур:
function createFuncBtn ( id, func, img, tip ) {
$( '<img id="' + id + '" src="' + wgImg( img ) + '" style="cursor:pointer" ' +
'title="' + tip + '" alt="' + tip.substr( 0, 3 ) + '"
.appendTo( '#gadget-toolbar' )
.click( func );
16-тӥ чур:
if ( mw.user.options.get( 'usebetatoolbar' ) ) {
var
mw.util.addCSS( '#gadget-toolbar img { padding:2px; }' +
'#gadget-toolbar { height:26px; margin:3px; }' );
23-тӥ чур:
$.ready
).then( function() {
function addGadgetsGroup() {
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {▼
gadgetToolbar();
'section': 'main',▼
▲ $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'gadgets': {}▼
▲ 'section': 'main',
'groups': {
▲ 'gadgets': {}
}
} );
$groupFormat = $( '#wikiEditor-section-main .group-format' );
if ( $groupGadgets.length && $groupFormat.length ) {▼
$groupGadgets.insertBefore( $groupFormat );▼
}
mw.hook( 'wikieditor.toolbar.gadgetsgroup' ).fire();
▲ $groupFormat = $( '#wikiEditor-section-main .group-format' );
▲ if ( $groupGadgets.length && $groupFormat.length ) {
// Quickfix until https://phabricator.wikimedia.org/T150172 is resolved
▲ $groupGadgets.insertBefore( $groupFormat );
$newlineButton = $( '.wikiEditor-toolbar-spritedButton[rel="newline"]' );
$newlineButton.off('click').on('click', function(e) {
$.wikiEditor.modules.toolbar.fn.doAction($( '#wpTextbox1' ).data( 'wikiEditor-context' ), {
type: 'encapsulate',
options: {
pre: '<br>\n'
}
}, $newlineButton);
e.preventDefault();
return false;
} );
}
}
addGadgetsGroup();
if ( !$( '#wikiEditor-section-main .group-gadgets' ).length ) {
// Лечение для случаев, когда панель инструментов поздно прорисовывается
setTimeout( addGadgetsGroup, 0 );
}
} );
} else if ( document.getElementById( 'toolbar' ) ) {
var
importMW( 'ToolbarOld' );
} else {
var
importMW( 'ToolbarNone' );
}
function
if ( !document.getElementById( 'gadget-toolbar' ) ) {
var $where = $(
if ( !$where.length ) {
return; //beta toolbar not ready yet
Гож 66 ⟶ 94:
$( function() {
setTimeout(
setTimeout(
} );
Гож 107 ⟶ 135:
margin:0 2px;cursor:pointer; font-size:86%; color:#666 }\
#userSummaryButtonsA a:hover { background:#bdf; color:black; text-decoration:none }' );
$( '<div id="userSummaryButtonsA
$.each(
[
|