MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
will work on this toolbar later
No edit summary
(will work on this toolbar later)
Line 3: Line 3:
  * @stats [[File:Krinkle_InsertWikiEditorButton.js]]
  * @stats [[File:Krinkle_InsertWikiEditorButton.js]]
  */
  */
/* Custom toolbar code starts here*/
var customizeToolbar = function() {
/*
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'sections': {
'emoticons': {
'type': 'toolbar', // Can also be 'booklet'
'label': 'Emoticons'
// or 'labelMsg': 'section-emoticons-label' for a localized label
}
}
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'emoticons',
'groups': {
'faces': {
'label': 'Faces' // or use labelMsg for a localized label, see above
}
}
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'emoticons',
'group': 'faces',
'tools': {
'smile': {
label: 'Smile!', // or use labelMsg for a localized label, see above
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/a/a4/Gnome-face-smile.svg/22px-Gnome-face-smile.svg.png',
action: {
type: 'encapsulate',
options: {
pre: ":)" // text to be inserted
}
}
}
}
} );
/* add booklet*/
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'sections': {
'info': {
'type': 'booklet',
'label': 'Info'
}
}
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'info',
'pages': {
'colors': {
'layout': 'table',
'label': 'Colors',
'headings': [
{ text: 'Name' }, // or use textMsg for localization, see also above
{ text: 'Temperature' },
{ text: 'Swatch' }
],
'rows': [
{
'name': { text: 'Red' },
'temp': { text: 'Warm' },
'swatch': { html: '<div style="width:10px;height:10px;background-color:red;">' }
},
{
'name': { text: 'Blue' },
'temp': { text: 'Cold' },
'swatch': { html: '<div style="width:10px;height:10px;background-color:blue;">' }
},
{
'name': { text: 'Silver' },
'temp': { text: 'Neutral' },
'swatch': { html: '<div style="width:10px;height:10px;background-color:silver;">' }
}
]
}
}
} );
*/
/* Custom code ends here*/
};
/* 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 );
} );
}
} );
}
// Add the customizations to LiquidThreads' edit toolbar, if available
mw.hook( 'ext.lqt.textareaCreated' ).add( customizeToolbar );
jQuery.getScript('//www.wikiislam.net/w/index.php?title=MediaWiki:InsertWikiEditorButton.js&action=raw&ctype=text/javascript', function () {
jQuery.getScript('//www.wikiislam.net/w/index.php?title=MediaWiki:InsertWikiEditorButton.js&action=raw&ctype=text/javascript', function () {


Line 307: Line 198:


/*
/*
// ----------------
// Begin: OLD Edit toolbar code
// ----------------
if (mwCustomEditButtons) {
if (mwCustomEditButtons) {
buttomimagepath = "http://www.wikiislam.net/wiki/uploads/"
buttomimagepath = "http://www.wikiislam.net/wiki/uploads/"
Line 461: Line 349:


  }
  }
// END: OLD Edit Toolbar code
*/
*/


Autochecked users, Bureaucrats, Editors, oversight, recentchangescleanup, Reviewers, rollback, Administrators
19,746

edits

Navigation menu