For the latest updates, send a blank email to our SUBSCRIPTION ADDRESS
HEADLINES | CLASSIFIED | SPORTS | FORUM | BUSINESS | ENTERTAINMENT
Vol. 1, Issue 9
The News Organ of Liberty City
Thursday October 18th, 2001
" Yesterday's News Today "
MediaWiki:Common.js: Difference between revisions
From Liberty Tree
Jump to navigationJump to search
(Replaced content with "window.onload=function(){ const toggleSwitch = document.querySelector('.theme-switch input[type="checkbox"]'); const currentTheme = localStorage.getItem('theme'); if (cur...") Tag: Replaced |
|||
Line 1: | Line 1: | ||
var customizeToolbar = function() { | |||
/* TRANSLATE GROUP */ | |||
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { | |||
'section': 'main', | |||
'groups': { | |||
'translate': { | |||
'label': 'Translate' // or use labelMsg for a localized label, see above | |||
} | |||
} | |||
} | } ); | ||
/* TRANSLATE GROUP END */ | |||
/* LANGUAGES BUTTON */ | |||
$('#wpTextbox1').wikiEditor('addToToolbar', { | |||
section: 'main', | |||
} | group: 'translate', | ||
tools: { | |||
"languages": { | |||
label: 'Languages', | |||
type: 'button', | |||
icon: '//xat.wiki/w/images/2/29/Button_languages.png', | |||
action: { | |||
type: 'encapsulate', | |||
options: { | |||
pre: "<languages/>", | |||
post: "" | |||
} | |||
} | |||
} | |||
} | |||
}); | |||
/* LANGUAGES BUTTON END */ | |||
/* TRANSLATE BUTTON */ | |||
$('#wpTextbox1').wikiEditor('addToToolbar', { | |||
section: 'main', | |||
group: 'translate', | |||
tools: { | |||
"translate": { | |||
label: 'Translate', | |||
type: 'button', | |||
icon: '//xat.wiki/w/images/5/5c/Button_translate.png', | |||
action: { | |||
type: 'encapsulate', | |||
options: { | |||
pre: "<translate>", | |||
post: "</translate>" | |||
} | |||
} | |||
} | |||
} | |||
}); | |||
/* TRANSLATE BUTTON END */ | |||
/* TRANS TEMPLATE BUTTON */ | |||
$('#wpTextbox1').wikiEditor('addToToolbar', { | |||
section: 'main', | |||
group: 'translate', | |||
tools: { | |||
"tt": { | |||
label: 'Translatable template', | |||
type: 'button', | |||
icon: '//xat.wiki/w/images/f/f6/Button_tt.png', | |||
action: { | |||
type: 'encapsulate', | |||
options: { | |||
pre: "{{ {{tt|trans/", | |||
post: "}} }}" | |||
} | |||
} | |||
} | |||
} | |||
}); | |||
/* TRANS TEMPLATE BUTTON END */ | |||
/* TVAR BUTTON */ | |||
$('#wpTextbox1').wikiEditor('addToToolbar', { | |||
section: 'main', | |||
group: 'translate', | |||
tools: { | |||
"tvar": { | |||
label: 'Variable', | |||
type: 'button', | |||
icon: '//xat.wiki/w/images/e/e4/Button_tvar.png', | |||
action: { | |||
type: 'encapsulate', | |||
options: { | |||
pre: "<tvar|1>", | |||
post: "</>" | |||
} | |||
} | |||
} | |||
} | |||
}); | |||
/* TVAR BUTTON END */ | |||
/* MYLANGUAGE BUTTON */ | |||
$('#wpTextbox1').wikiEditor('addToToolbar', { | |||
section: 'main', | |||
group: 'translate', | |||
tools: { | |||
"tvar": { | |||
label: 'MyLanguage', | |||
type: 'button', | |||
icon: '//xat.wiki/w/images/8/84/Button_ml.png', | |||
action: { | |||
type: 'encapsulate', | |||
options: { | |||
pre: "[[<tvar|1>Special:MyLanguage/</>|", | |||
post: "]]" | |||
} | |||
} | |||
} | |||
} | |||
}); | |||
/* MYLANGUAGE BUTTON END */ | |||
/* REMOVED BUTTONS */ | |||
/* REMOVED BUTTONS END */ | |||
}; | |||
/* TOOLBAR CONFIG */ | |||
/* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar … */ | |||
/* 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 ); | |||
} | |||
} ); | |||
} | } |
Latest revision as of 20:04, 4 February 2025
var customizeToolbar = function() { /* TRANSLATE GROUP */ $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { 'section': 'main', 'groups': { 'translate': { 'label': 'Translate' // or use labelMsg for a localized label, see above } } } ); /* TRANSLATE GROUP END */ /* LANGUAGES BUTTON */ $('#wpTextbox1').wikiEditor('addToToolbar', { section: 'main', group: 'translate', tools: { "languages": { label: 'Languages', type: 'button', icon: '//xat.wiki/w/images/2/29/Button_languages.png', action: { type: 'encapsulate', options: { pre: "<languages/>", post: "" } } } } }); /* LANGUAGES BUTTON END */ /* TRANSLATE BUTTON */ $('#wpTextbox1').wikiEditor('addToToolbar', { section: 'main', group: 'translate', tools: { "translate": { label: 'Translate', type: 'button', icon: '//xat.wiki/w/images/5/5c/Button_translate.png', action: { type: 'encapsulate', options: { pre: "<translate>", post: "</translate>" } } } } }); /* TRANSLATE BUTTON END */ /* TRANS TEMPLATE BUTTON */ $('#wpTextbox1').wikiEditor('addToToolbar', { section: 'main', group: 'translate', tools: { "tt": { label: 'Translatable template', type: 'button', icon: '//xat.wiki/w/images/f/f6/Button_tt.png', action: { type: 'encapsulate', options: { pre: "{{ {{tt|trans/", post: "}} }}" } } } } }); /* TRANS TEMPLATE BUTTON END */ /* TVAR BUTTON */ $('#wpTextbox1').wikiEditor('addToToolbar', { section: 'main', group: 'translate', tools: { "tvar": { label: 'Variable', type: 'button', icon: '//xat.wiki/w/images/e/e4/Button_tvar.png', action: { type: 'encapsulate', options: { pre: "<tvar|1>", post: "</>" } } } } }); /* TVAR BUTTON END */ /* MYLANGUAGE BUTTON */ $('#wpTextbox1').wikiEditor('addToToolbar', { section: 'main', group: 'translate', tools: { "tvar": { label: 'MyLanguage', type: 'button', icon: '//xat.wiki/w/images/8/84/Button_ml.png', action: { type: 'encapsulate', options: { pre: "[[<tvar|1>Special:MyLanguage/</>|", post: "]]" } } } } }); /* MYLANGUAGE BUTTON END */ /* REMOVED BUTTONS */ /* REMOVED BUTTONS END */ }; /* TOOLBAR CONFIG */ /* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar … */ /* 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 ); } } ); }