Utilizador:Gusta/common.js
Nota: Depois de publicar, poderá ter de contornar a cache do seu navegador para ver as alterações.
- Firefox / Safari: Pressione Shift enquanto clica Recarregar, ou pressione Ctrl-F5 ou Ctrl-R (⌘-R no Mac)
- Google Chrome: Pressione Ctrl-Shift-R (⌘-Shift-R no Mac)
- Internet Explorer / Edge: Pressione Ctrl enquanto clica Recarregar, ou pressione Ctrl-F5
- Opera: Pressione Ctrl-F5.
var customizeToolbar = function() {
$( function() {
if ( typeof $.fn.wikiEditor != 'undefined' ) {
$( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', {
'section': 'main',
'group': 'insert',
'tool': 'reference'
});
}
});
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'Main',
'groups': {
'Itens': {
'label': 'Itens' // or use labelMsg for a localized label, see above
}
}
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'main',
'group': 'Itens',
'tools': {
'Itens': {
label: 'Item da seção Veja', // or use labelMsg for a localized label, see above
type: 'button',
icon: 'http://upload.wikimedia.org/wikipedia/commons/b/b7/Italian_traffic_signs_-_icona_museo.svg',
action: {
type: 'encapsulate',
options: {
pre: "* {{veja |nome=",
post: " |alt= |endereço= |direções= |tel= |email= |site= |funcionamento= |preço= |lat= |long= |sobre= }}" // text to be inserted
}
}
}
}
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'main',
'group': 'Itens',
'tools': {
'Itens': {
label: 'Item da seção Faça', // or use labelMsg for a localized label, see above
type: 'button',
icon: 'http://upload.wikimedia.org/wikipedia/commons/3/30/Pictograms-nps-bicycle_trail-2.svg',
action: {
type: 'encapsulate',
options: {
pre: "* {{faça |nome=",
post: " |alt= |endereço= |direções= |tel= |email= |site= |funcionamento= |preço= |lat= |long= |sobre= }}" // text to be inserted
}
}
}
}
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'main',
'group': 'Itens',
'tools': {
'Itens': {
label: 'Item da seção Compre', // or use labelMsg for a localized label, see above
type: 'button',
icon: 'http://upload.wikimedia.org/wikipedia/commons/a/a1/Italian_traffic_signs_-_icona_supermercato.svg',
action: {
type: 'encapsulate',
options: {
pre: "* {{compre |nome=",
post: " |alt= |endereço= |direções= |tel= |email= |site= |funcionamento= |preço= |lat= |long= |sobre= }}" // text to be inserted
}
}
}
}
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'main',
'group': 'Itens',
'tools': {
'Itens': {
label: 'Item da seção Come', // or use labelMsg for a localized label, see above
type: 'button',
icon: 'http://upload.wikimedia.org/wikipedia/commons/2/2c/Italian_traffic_signs_-_icona_ristorante.svg',
action: {
type: 'encapsulate',
options: {
pre: "* {{come |nome=",
post: " |alt= |endereço= |direções= |tel= |email= |site= |funcionamento= |preço= |lat= |long= |sobre= }}" // text to be inserted
}
}
}
}
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'main',
'group': 'Itens',
'tools': {
'Itens': {
label: 'Item da seção Beba', // or use labelMsg for a localized label, see above
type: 'button',
icon: 'http://upload.wikimedia.org/wikipedia/commons/a/a5/Verre_cocktail.svg',
action: {
type: 'encapsulate',
options: {
pre: "* {{beba |nome=",
post: " |alt= |endereço= |direções= |tel= |email= |site= |funcionamento= |preço= |lat= |long= |sobre= }}" // text to be inserted
}
}
}
}
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'main',
'group': 'Itens',
'tools': {
'Itens': {
label: 'Item da seção Durma', // or use labelMsg for a localized label, see above
type: 'button',
icon: 'http://upload.wikimedia.org/wikipedia/commons/2/25/Pictograms-nps-lodging.svg',
action: {
type: 'encapsulate',
options: {
pre: "* {{durma |nome=",
post: " |alt= |endereço= |direções= |tel= |email= |site= |funcionamento= |preço= |lat= |long= |sobre= }}" // text to be inserted
}
}
}
}
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'main',
'group': 'Itens',
'tools': {
'Itens': {
label: 'Item de outra seção', // or use labelMsg for a localized label, see above
type: 'button',
icon: 'http://upload.wikimedia.org/wikipedia/commons/7/7e/Italian_traffic_signs_-_icona_informazioni.svg',
action: {
type: 'encapsulate',
options: {
pre: "* {{outroitem |nome=",
post: " |alt= |endereço= |direções= |tel= |email= |site= |funcionamento= |preço= |lat= |long= |sobre= }}" // text to be inserted
}
}
}
}
} );
};
/* 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', function () {
$(document).ready( customizeToolbar );
} );
}
} );
}