82,891
edits
Amwelladmin (talk | contribs) No edit summary |
Amwelladmin (talk | contribs) No edit summary |
||
(65 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
var customizeToolbar = function() { | var customizeToolbar = function() { | ||
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { | |||
'sections': { | |||
'manual': { | |||
'type': 'toolbar', // Can also be 'booklet' | |||
'label': 'Manual' | |||
// or 'labelMsg': 'section-manual-label' for a localized label | |||
} | |||
} | |||
} ); | |||
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { | |||
'section': 'manual', | |||
'groups': { | |||
'tags': { | |||
'label': 'Tags' // or use labelMsg for a localized label, see above | |||
} | |||
} | |||
} ); | |||
$('#wpTextbox1').wikiEditor('addToToolbar', { | |||
section: 'advanced', | |||
group: 'format', | |||
tools: { | |||
"template": { | |||
label: 'long dash', | |||
type: 'button', | |||
icon: 'https://jollycontrarian.com/images/5/55/Dash.png', | |||
action: { | |||
type: 'encapsulate', | |||
options: { | |||
pre: "—", | |||
post: "" | |||
} | |||
} | |||
} | |||
} | |||
}); | |||
$('#wpTextbox1').wikiEditor('addToToolbar', { | |||
section: 'advanced', | |||
group: 'format', | |||
tools: { | |||
"template": { | |||
label: 'scarequotes', | |||
type: 'button', | |||
icon: 'https://jollycontrarian.com/images/b/ba/Scare.png', | |||
action: { | |||
type: 'encapsulate', | |||
options: { | |||
pre: "“", | |||
post: "”" | |||
} | |||
} | |||
} | |||
} | |||
}); | |||
$('#wpTextbox1').wikiEditor('addToToolbar', { | |||
section: 'advanced', | |||
group: 'format', | |||
tools: { | |||
"template": { | |||
label: 'apostrophe', | |||
type: 'button', | |||
icon: 'https://jollycontrarian.com/images/5/5b/Apo.png', | |||
action: { | |||
type: 'encapsulate', | |||
options: { | |||
pre: "’", | |||
post: "" | |||
} | |||
} | |||
} | |||
} | |||
}); | |||
$('#wpTextbox1').wikiEditor('addToToolbar', { | |||
section: 'advanced', | |||
group: 'format', | |||
tools: { | |||
"template": { | |||
label: '{{ - }}', | |||
type: 'button', | |||
icon: 'https://jollycontrarian.com/images/3/30/Template.png', | |||
action: { | |||
type: 'encapsulate', | |||
options: { | |||
pre: "{{", | |||
post: "}}" | |||
} | |||
} | |||
} | |||
} | |||
}); | |||
$('#wpTextbox1').wikiEditor('addToToolbar', { | |||
section: 'advanced', | |||
group: 'format', | |||
tools: { | |||
"Substitute": { | |||
label: 'subst:', | |||
type: 'button', | |||
icon: 'https://jollycontrarian.com/images/0/03/Sbs.png', | |||
action: { | |||
type: 'encapsulate', | |||
options: { | |||
pre: "{{subst:", | |||
post: "}}" | |||
} | |||
} | |||
} | |||
} | |||
}); | |||
$('#wpTextbox1').wikiEditor('addToToolbar', { | $('#wpTextbox1').wikiEditor('addToToolbar', { | ||
Line 8: | Line 119: | ||
label: '==>', | label: '==>', | ||
type: 'button', | type: 'button', | ||
icon: ' | icon: 'https://jollycontrarian.com/images/9/91/Redirect.png', | ||
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', | ||
Line 14: | Line 125: | ||
pre: "#redirect[[", | pre: "#redirect[[", | ||
post: "]]" | post: "]]" | ||
} | |||
} | |||
} | |||
} | |||
}); | |||
$('#wpTextbox1').wikiEditor('addToToolbar', { | |||
section: 'advanced', | |||
group: 'format', | |||
tools: { | |||
"template": { | |||
label: 'tag', | |||
type: 'button', | |||
icon: 'https://jollycontrarian.com/images/7/76/Tag.png', | |||
action: { | |||
type: 'encapsulate', | |||
options: { | |||
pre: "{{t|", | |||
post: "}}" | |||
} | } | ||
} | } | ||
Line 24: | Line 155: | ||
group: 'format', | group: 'format', | ||
tools: { | tools: { | ||
" | "Prov": { | ||
label: 'isdaprov', | label: 'isdaprov', | ||
type: 'button', | type: 'button', | ||
icon: ' | icon: 'https://jollycontrarian.com/images/5/50/Isd.png', | ||
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', | ||
Line 37: | Line 168: | ||
} | } | ||
} | } | ||
}); | }); | ||
$('#wpTextbox1').wikiEditor('addToToolbar', { | $('#wpTextbox1').wikiEditor('addToToolbar', { | ||
Line 44: | Line 174: | ||
group: 'format', | group: 'format', | ||
tools: { | tools: { | ||
" | "Prov": { | ||
label: ' | label: 'euaprov', | ||
type: 'button', | type: 'button', | ||
icon: ' | icon: 'https://jollycontrarian.com/images/5/50/eua.png', | ||
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', | ||
options: { | options: { | ||
pre: "{{ | pre: "{{euaprov|", | ||
post: "}}" | post: "}}" | ||
} | } | ||
Line 58: | Line 188: | ||
} | } | ||
}); | }); | ||
$('#wpTextbox1').wikiEditor('addToToolbar', { | $('#wpTextbox1').wikiEditor('addToToolbar', { | ||
section: 'advanced', | section: 'advanced', | ||
group: 'format', | group: 'format', | ||
tools: { | tools: { | ||
" | "ietaprov": { | ||
label: ' | label: 'ietaprov', | ||
type: 'button', | type: 'button', | ||
icon: ' | icon: 'https://jollycontrarian.com/images/e/e9/Gms.png', | ||
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', | ||
options: { | options: { | ||
pre: "{{ | pre: "{{ietaprov|", | ||
post: "}}" | post: "}}" | ||
} | } | ||
Line 82: | Line 211: | ||
group: 'format', | group: 'format', | ||
tools: { | tools: { | ||
" | "gmraprov": { | ||
label: ' | label: '{{{1}}}|', | ||
type: 'button', | type: 'button', | ||
icon: ' | icon: 'https://jollycontrarian.com/images/4/49/blank.png', | ||
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', | ||
options: { | options: { | ||
pre: "{{ | pre: "{{{{{1}}}|", | ||
post: "}}" | post: "}}" | ||
} | } | ||
Line 104: | Line 233: | ||
label: 'eqderivprov', | label: 'eqderivprov', | ||
type: 'button', | type: 'button', | ||
icon: ' | icon: 'https://jollycontrarian.com/images/c/c3/Eqd.png', | ||
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', | ||
Line 116: | Line 245: | ||
}); | }); | ||
$('#wpTextbox1').wikiEditor('addToToolbar', { | |||
section: 'advanced', | |||
group: 'format', | |||
tools: { | |||
"template": { | |||
label: 'vmcsaprov', | |||
type: 'button', | |||
icon: 'https://jollycontrarian.com/images/3/37/Csa.png', | |||
action: { | |||
type: 'encapsulate', | |||
options: { | |||
pre: "{{vmcsaprov|", | |||
post: "}}" | |||
} | |||
} | |||
} | |||
} | |||
}); | |||
$('#wpTextbox1').wikiEditor('addToToolbar', { | $('#wpTextbox1').wikiEditor('addToToolbar', { | ||
section: 'advanced', | section: 'advanced', | ||
Line 121: | Line 269: | ||
tools: { | tools: { | ||
"template": { | "template": { | ||
label: '{{ | label: 'top trumps', | ||
type: 'button', | |||
icon: 'http://jollycontrarian.com/w/images/7/7d/Tag2.png', | |||
action: { | |||
type: 'encapsulate', | |||
options: { | |||
pre: "{{fwmdtt|nickname=", | |||
post: "| imagetype=png| tagline= | documentation= | docscore=0| amendability= |amendscore=0| collateral= | collateralscore =0| transferability= | transferscore =0| leverage= | leveragescore =0| frightometer= | frightscore=0}}" | |||
} | |||
} | |||
} | |||
} | |||
}); | |||
$('#wpTextbox1').wikiEditor('addToToolbar', { | |||
section: 'advanced', | |||
group: 'format', | |||
tools: { | |||
"template": { | |||
label: 'wasteprov', | |||
type: 'button', | |||
icon: 'https://jollycontrarian.com/images/2/27/Wp.png', | |||
action: { | |||
type: 'encapsulate', | |||
options: { | |||
pre: "{{wasteprov|", | |||
post: "}}" | |||
} | |||
} | |||
} | |||
} | |||
}); | |||
$('#wpTextbox1').wikiEditor('addToToolbar', { | |||
section: 'advanced', | |||
group: 'format', | |||
tools: { | |||
"template": { | |||
label: 'cddprov', | |||
type: 'button', | |||
icon: 'https://jollycontrarian.com/images/e/ec/Cp.png', | |||
action: { | |||
type: 'encapsulate', | |||
options: { | |||
pre: "{{cddprov|", | |||
post: "}}" | |||
} | |||
} | |||
} | |||
} | |||
}); | |||
$('#wpTextbox1').wikiEditor('addToToolbar', { | |||
section: 'advanced', | |||
group: 'format', | |||
tools: { | |||
"template": { | |||
label: '{{g}}', | |||
type: 'button', | |||
icon: 'https://jollycontrarian.com/images/a/a7/Gl.PNG', | |||
action: { | |||
type: 'encapsulate', | |||
options: { | |||
pre: "{{g}}", | |||
post: "" | |||
} | |||
} | |||
} | |||
} | |||
}); | |||
$('#wpTextbox1').wikiEditor('addToToolbar', { | |||
section: 'advanced', | |||
group: 'format', | |||
tools: { | |||
"template": { | |||
label: '{{sa}}', | |||
type: 'button', | |||
icon: 'https://jollycontrarian.com/images/7/7c/Sa.PNG', | |||
action: { | |||
type: 'encapsulate', | |||
options: { | |||
pre: "{{sa}}", | |||
post: "" | |||
} | |||
} | |||
} | |||
} | |||
}); | |||
$('#wpTextbox1').wikiEditor('addToToolbar', { | |||
section: 'advanced', | |||
group: 'format', | |||
tools: { | |||
"template": { | |||
label: '{{ucits5prov|}}', | |||
type: 'button', | |||
icon: 'https://jollycontrarian.com/images/d/d7/U.PNG', | |||
action: { | |||
type: 'encapsulate', | |||
options: { | |||
pre: "{{ucits5prov|", | |||
post: "}}" | |||
} | |||
} | |||
} | |||
} | |||
}); | |||
$('#wpTextbox1').wikiEditor('addToToolbar', { | |||
section: 'advanced', | |||
group: 'format', | |||
tools: { | |||
"template": { | |||
label: '{{strike|}}', | |||
type: 'button', | |||
icon: 'https://jollycontrarian.com/images/8/83/Aif.PNG', | |||
action: { | |||
type: 'encapsulate', | |||
options: { | |||
pre: "{{strike|", | |||
post: "|}}" | |||
} | |||
} | |||
} | |||
} | |||
}); | |||
$('#wpTextbox1').wikiEditor('addToToolbar', { | |||
section: 'advanced', | |||
group: 'tags', | |||
tools: { | |||
"template": { | |||
label: 'isdamanual', | |||
type: 'button', | type: 'button', | ||
icon: ' | icon: 'https://jollycontrarian.com/images/c/c2/MI2002.png', | ||
action: { | action: { | ||
type: 'encapsulate', | type: 'encapsulate', | ||
options: { | options: { | ||
pre: "{{", | pre: "{{isdamanual|", | ||
post: "}}" | post: "}}" | ||
} | } | ||
Line 133: | Line 407: | ||
} | } | ||
} | } | ||
}); | }); | ||
}; | }; | ||
if ( [ 'edit', 'submit' ].indexOf( mw.config.get( 'wgAction' ) ) !== -1 ) { | |||
mw.loader.using( 'user.options' ).then( function () { | |||
mw.loader.using( 'user.options' | |||
if ( mw.user.options.get( 'usebetatoolbar' ) == 1 ) { | if ( mw.user.options.get( 'usebetatoolbar' ) == 1 ) { | ||
$.when( | $.when( | ||
mw.loader.using( 'ext.wikiEditor | mw.loader.using( 'ext.wikiEditor' ), $.ready | ||
).then( customizeToolbar ); | ).then( customizeToolbar ); | ||
} | } | ||
} ); | } ); | ||
} | } | ||
// Add the customizations to LiquidThreads' edit toolbar, if available | // Add the customizations to LiquidThreads' edit toolbar, if available | ||
mw.hook( 'ext.lqt.textareaCreated' ).add( customizeToolbar ); | mw.hook( 'ext.lqt.textareaCreated' ).add( customizeToolbar ); | ||
/* Any JavaScript here will be loaded for all users on every page load. */ | /* Any JavaScript here will be loaded for all users on every page load. */ |