Lankide:Zuiarra/customizeToolbar.js: berrikuspenen arteko aldeak
Ezabatutako edukia Gehitutako edukia
tNo edit summary |
No edit summary |
||
1. lerroa:
var customizeToolbar = function () {
'sections': {
▲ var title = mw.config.get( 'wgTitle' );
'type': 'toolbar', // Can also be 'booklet'
// 'euskara' atala▼
'label': 'Orrialde berriak'
$wpTextbox1.wikiEditor( 'addToToolbar', {▼
// or 'labelMsg': 'section-emoticons-label' for a localized label
section: 'advanced',▼
groups: {▼
}
eu: {▼
} );
tools: {▼
▲ 'izena': {
type: 'button',▼
'label': 'Euskara' // or use labelMsg for a localized label, see above
icon: '//upload.wikimedia.org/wikipedia/commons/4/4a/Toolbaricon_bold_I.png',▼
action: {▼
}
type: 'encapsulate',▼
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
pre: "=={{-eu-}}==\n ==={{Ahoskera}}===\n==={{Etimologia}}===\n==={{Izena}}===\n",▼
'section': 'berriak',
peri: "'''" + title +"'''\n:# [[ ]].\n\n===={{Hitz eratorriak}}====\n:* [[ ]].\n\n",▼
'group': 'euskara',
post: "===={{Itzulpen}}====\n{{(}}\n* {{es}}: {{itz|es| }}\n{{-}}\n* {{pl}}: {{itz|pl|}}\n{{)}}\n\n[[Kategoria:Euskara]]\n[[Kategoria:Izenak euskaraz]]"▼
'sortu': {
▲ }
label: 'Sortu!', // or use labelMsg for a localized label, see above
▲ }
▲
▲
}
}
}
}
} ); ▲}
};
/* 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'
// This can be the string "0" if the user disabled the preference ([[phab:T54542#555387]])
if ( mw.user.options.get( 'usebetatoolbar' ) == 1 ) {
$.when(
mw.loader.using( 'ext.wikiEditor' ), $.ready
).then( customizeToolbar );
}
} );
}
|