User talk:Robinr78/common.js
var customizeToolbar = function () {
/* Stable as of 2019-1007-1300 */
/* ======================================Add SM-201 & category Sections */
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { 'sections': { 'SM-201': { 'type': 'toolbar', // Can also be 'booklet' 'label': 'SM-201' } } } ); $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { 'sections': { 'Cats': { 'type': 'toolbar', // Can also be 'booklet' 'label': 'Cats' } } } );
/* ===============================================================Add groups */
/* -------------------add Format group ------------------- */ $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { 'section': 'SM-201', 'groups': { 'Format': { 'label': 'Format' } } } );
/* ------------------- add <inc> group ----------------------*/ $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { 'section': 'SM-201', 'groups': { 'Inc': { 'label': 'Inc' } } } );
/* ------------------- add footers group ----------------------*/ $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { 'section': 'SM-201', 'groups': { 'Footer': { 'label': 'Footer' } } } );
/* ------------------- add Categories group -----------------*/ $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { 'section': 'Cats', 'groups': { 'Cats': { 'label': 'Cats' } } } );
/* Add <Inc> buttons ============================================================ */
$('#wpTextbox1').wikiEditor('addToToolbar', { section: 'SM-201', group: 'Inc', tools: { "Incl": { label: 'Incl', type: 'button',
icon: 'http://www.sm-201.org/a/images/3/3b/Button_in.jpg',
action: { type: 'encapsulate', options: { pre: "" } } } } });
$('#wpTextbox1').wikiEditor('addToToolbar', {
section: 'SM-201',
group: 'Inc',
tools: {
"Noinclude": {
label: 'Noinclude',
type: 'button',
icon: 'http://www.sm-201.org/a/images/1/1b/Button_no.jpg',
action: { type: 'encapsulate', options: { pre: "",
post:""
} } } } });
/* Add footer buttons ============================================================*/ /* Add Footers */
$('#wpTextbox1').wikiEditor('addToToolbar', { section: 'SM-201', group: 'Footer', tools: { "Footer": { label: 'Footer', type: 'button',
icon: 'http://www.sm-201.org/a/images/3/31/Editor_f.png',
action: { type: 'encapsulate', options: { pre: "{ {Header}}",
post:"{ {Footer}}"
} } } } });
/* Add Biofooters - Biographies */
$('#wpTextbox1').wikiEditor('addToToolbar', {
section: 'SM-201',
group: 'Footer',
tools: {
"Biofooter": {
label: 'Biofooter',
type: 'button',
icon: 'http://www.sm-201.org/a/images/b/b4/Editor_b.png',
action: { type: 'encapsulate', options: { pre: "{ {Bioheader}}",
post:"{ {Biofooter}}"
} } } } });
/* Add Historyfooter */ $('#wpTextbox1').wikiEditor('addToToolbar', { section: 'SM-201', group: 'Footer', tools: { "Historyfooter": { label: 'History footer', type: 'button',
icon: 'http://www.sm-201.org/a/images/e/e4/Editor_h.png',
action: { type: 'encapsulate', options: { pre: "{ {Historyheader}}",
post: "{ {Historyfooter}}"
} } } } });
/* Add Libfooter Library*/ $('#wpTextbox1').wikiEditor('addToToolbar', { section: 'SM-201', group: 'Footer', tools: { "Libraryfooter": { label: 'Libraryfooter', type: 'button',
icon: 'http://www.sm-201.org/a/images/e/e0/Editor_book.png',
action: { type: 'encapsulate', options: { pre: "{ {Libheader}}",
post: "{ {Libfooter}}"
} } } } });
/* Add Lifefooter */ $('#wpTextbox1').wikiEditor('addToToolbar', { section: 'SM-201', group: 'Footer', tools: { "Life Lessons footer": { label: 'Lifefooter', type: 'button',
icon: 'http://www.sm-201.org/a/images/1/16/Editor_l.png',
action: { type: 'encapsulate', options: { pre: "{ {Lifeheader}}",
post: "{ {Lifefooter}}"
} } } } });
/* Add Macrofooter */
$('#wpTextbox1').wikiEditor('addToToolbar', {
section: 'SM-201',
group: 'Footer',
tools: {
"Life Lessons footer": {
label: 'Macrofooter',
type: 'button',
icon: 'http://www.sm-201.org/a/images/f/fc/Editor_mac.png',
action: { type: 'encapsulate', options: { pre: "{ {Macroheader}}",
post: "{ {Macrofooter}}"
} } } } });
/* Add Microfooter */
$('#wpTextbox1').wikiEditor('addToToolbar', {
section: 'SM-201',
group: 'Footer',
tools: {
"Micropedia footers": {
label: 'Microfooter',
type: 'button',
icon: 'http://www.sm-201.org/a/images/9/95/Editor_mic.png',
action: { type: 'encapsulate', options: { pre: "{ {Microheader}}",
post: "{ {Microfooter}}"
} } } } });
/* Add PMfooters */
$('#wpTextbox1').wikiEditor('addToToolbar', {
section: 'SM-201',
group: 'Footer',
tools: {
"Robins Personal memories": {
label: 'Robin Mem',
type: 'button',
icon: 'http://www.sm-201.org/a/images/b/bf/Editor_p.png',
action: { type: 'encapsulate', options: { pre: "{ {Pmheader}}",
post: "{ {Pmfooter}}"
} } } } });
/* Add Storyfooters */ $('#wpTextbox1').wikiEditor('addToToolbar', { section: 'SM-201', group: 'Footer', tools: { "Storyfooter": { label: 'Storyfooter', type: 'button',
icon: 'http://www.sm-201.org/a/images/6/60/Editor_s.png',
action: {
type: 'encapsulate',
options: {
pre: "{ {Storyheader}}
",
post:"{ {Storyfooter}}
"
} } } } });
/* Add Timefooters */ $('#wpTextbox1').wikiEditor('addToToolbar', { section: 'SM-201', group: 'Footer', tools: { "Timefooter": { label: 'Timefooter', type: 'button',
icon: 'http://www.sm-201.org/a/images/1/19/Editor_t.png',
action: {
type: 'encapsulate',
options: {
pre: "{ {Timeheader}}
",
post:"{ {Timefooter}}
"
} } } } });
/*=====================Format Buttons====================================*/
/* Toolbar <Comment Button */ $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { section: 'SM-201', group: 'Format', tools: { "Comment": { label: 'Comment', type: 'button', icon: 'http://www.sm-201.org/a/images/6/66/Editor_!.png', action: { type: 'encapsulate', options: { pre: } } } } } );
/* Toolbar Apostrophe Button */ $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { section: 'SM-201', group: 'Format', tools: { "Apostrope": { label: 'Apostrphe', type: 'button', icon: 'http://www.sm-201.org/a/images/3/39/Editor_apos.png', action: { type: 'encapsulate', options: { pre: "'", post: "'" } } } } } );
/* Add 'clear' =====================*/
$('#wpTextbox1').wikiEditor('addToToolbar', {
section: 'SM-201',
group: 'Format',
tools: {
"Clear": {
label: 'Clear',
type: 'button',
icon: 'http://sm-201.org/a/images/b/be/Editor_c.png',
action: {
type: 'encapsulate',
options: {
pre: '
',
post:
}
}
}
}
});
/* Toolbar gallery button =======================*/
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
section: 'SM-201',
group: 'Format',
tools: {
"Gallery": {
label: 'Gallery',
type: 'button',
icon: 'http://www.sm-201.org/a/images/3/35/Editor_g.png',
action: {
type: 'encapsulate',
options: {
pre: '
- ',
'
} } } } } );
/* Toolbar [[ ]] Button */ $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { section: 'SM-201', group: 'Format', tools: { "Template": { label: 'Link', type: 'button', icon: 'http://www.sm-201.org/a/images/c/c0/Button_link.png', action: { type: 'encapsulate', options: { pre: '[[', post: ']]' } } } } } );
/* Toolbar double curly brackets Button */ $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { section: 'SM-201', group: 'format', tools: { "Template": { label: 'Template', type: 'button', icon: 'http://www.sm-201.org/a/images/5/5f/Button_temp.png', action: { type: 'encapsulate', options: { pre: "{{", post: "}}" } } } } } );
/* Quotes */ $('#wpTextbox1').wikiEditor('addToToolbar', { section: 'SM-201', group: 'Format', tools: { "Quotes": { label: 'Quotes', type: 'button', icon: 'http://www.sm-201.org/a/images/7/7d/Button_quot.png', action: { type: 'encapsulate', options: { pre: '"', post: '"', } } } } });
/* Center */
$('#wpTextbox1').wikiEditor('addToToolbar', {
section: 'SM-201',
group: 'Format',
tools: {
"Center": {
label: 'Center',
type: 'button',
icon: 'http://www.sm-201.org/a/images/5/5f/Button_center.png',
action: {
type: 'encapsulate',
options: {
pre: '
',
} } } } });
/* Justify */
$('#wpTextbox1').wikiEditor('addToToolbar', {
section: 'SM-201',
group: 'Format',
tools: {
"Justify": {
label: 'Justify',
type: 'button',
icon: 'http://www.sm-201.org/a/images/0/0f/Button_just.png',
action: {
type: 'encapsulate',
options: {
pre: '
', post: '
',
} } } } });
/* =============================================Category Buttons =================================== */
/* Add buttons ======================================= */
/* Toolbar Category Button */ $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { section: 'Cats', group: 'Cats', tools: { "Cats": { label: 'Category', type: 'button', icon: 'http://www.sm-201.org/a/images/d/d0/Button_Cat.Png', action: { type: 'encapsulate', options: { pre: '[[Category:', post: ']]' } } } } } );
/* Toolbar Anatomy category Button */ $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { section: 'Cats', group: 'Cats', tools: { "Template": { label: 'Human anatomy', type: 'button', icon: 'http://www.sm-201.org/a/images/e/e0/Editor_a.png', action: { type: 'encapsulate', options: { pre: ' ', post: } } } } } );
/* Toolbar Anatomy category Button */ $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { section: 'Cats', group: 'Cats', tools: { "Template": { label: 'Book', type: 'button', icon: 'http://www.sm-201.org/a/images/b/b4/Editor_b.png', action: { type: 'encapsulate', options: { pre: , post: } } } } } ); /* Toolbar "Classes" category Button */ $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { section: 'Cats', group: 'Cats', tools: { "Template": { label: 'Classes', type: 'button', icon: 'http://www.sm-201.org/a/images/b/be/Editor_c.png', action: { type: 'encapsulate', options: { pre: , post: } } } } } );
/* Toolbar "Club" category Button */
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
section: 'Cats',
group: 'Cats',
tools: {
"Template": {
label: '
',
type: 'button',
icon: 'http://www.sm-201.org/a/images/b/be/Editor_c.png',
action: {
type: 'encapsulate',
options: {
pre: ,
post:
}
}
}
}
} );
/* Toolbar "Events" category Button */
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
section: 'Cats',
group: 'Cats',
tools: {
"Events": {
label: 'Events',
type: 'button',
icon: 'http://www.sm-201.org/a/images/e/e3/Editor_e.png',
action: {
type: 'encapsulate',
options: {
pre: ,
post:
}
}
}
}
} );
/* Toolbar "Film" category button */ $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { section: 'Cats', group: 'Cats', tools: { "Film": { label: 'Film', type: 'button', icon: 'http://www.sm-201.org/a/images/3/31/Editor_f.png', action: { type: 'encapsulate', options: { pre: 'Cateory:Film', post: } } } } } );
/* Toolbar Film category button */ $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { section: 'Cats', group: 'Cats', tools: { "Film": { label: 'Film', type: 'button', icon: 'http://www.sm-201.org/a/images/3/31/Editor_f.png', action: { type: 'encapsulate', options: { pre: 'Cateory:Film', post: } } } } } );
/* Toolbar Icon category Button */ $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { section: 'Cats', group: 'Cats', tools: { "Icon": { label: 'Icon', type: 'button', icon: 'http://www.sm-201.org/a/images/5/5e/Editor_i.png', action: { type: 'encapsulate', options: { pre: , post: } } } } } );
/* Toolbar Link category Button */
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
section: 'Cats',
group: 'Cats',
tools: {
"Link": {
label: 'Link',
type: 'button',
icon: 'http://www.sm-201.org/a/images/1/16/Editor_l.png',
action: {
type: 'encapsulate',
options: {
pre: ,
post:
}
}
}
}
} );
/* Toolbar N=Info Box category Button */
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
section: 'Cats',
group: 'Cats',
tools: {
"Info box": {
label: 'Info box',
type: 'button',
icon: 'http://www.sm-201.org/a/images/0/0e/Editor_n.png',
action: {
type: 'encapsulate',
options: {
pre: ,
post:
}
}
}
}
} );
/* Toolbar Magazine category Button */
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
section: 'Cats',
group: 'Cats',
tools: {
"Magazine": {
label: 'Magazine',
type: 'button',
icon: 'http://www.sm-201.org/a/images/6/6d/Editor_m_.png',
action: {
type: 'encapsulate',
options: {
pre: ,
post:
}
}
}
}
} );
/* Toolbar Places category Button */ $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { section: 'Cats', group: 'Cats', tools: { "Places": { label: 'Places', type: 'button', icon: 'http://www.sm-201.org/a/images/b/bf/Editor_p.png', action: { type: 'encapsulate', options: { pre: , post: } } } } } );
/* Toolbar Stories by Robin category Button */ $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { section: 'Cats', group: 'Cats', tools: { "Robin": { label: 'Robin', type: 'button', icon: 'http://www.sm-201.org/a/images/d/d5/Editor_r.png', action: { type: 'encapsulate', options: { pre: , post: } } } } } );
/* Toolbar Sessions category Button */
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
section: 'Cats',
group: 'Cats',
tools: {
"Sessions": {
label: 'Sessions',
type: 'button',
icon: 'http://www.sm-201.org/a/images/6/60/Editor_s.png',
action: {
type: 'encapsulate',
options: {
pre: ,
post:
}
}
}
}
} );
/* Toolbar Toy box category Button */ $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { section: 'Cats', group: 'Cats', tools: { "Toy box": { label: 'Toy box', type: 'button', icon: 'http://www.sm-201.org/a/images/1/19/Editor_t.png', action: { type: 'encapsulate', options: { pre: , post: } } } } } );
/* Leave everything below this line alone ===================== */ };
/* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar … */ if ( [ 'edit', 'submit' ].indexOf( mw.config.get( 'wgAction' ) ) !== -1 ) { mw.loader.using( 'user.options' ).then( function () { // 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 ); } } ); }