Diferencia entre revisiones de «Usuario:King of Herdaz/common.js»

Ir a la navegación Ir a la búsqueda
m (testing new button)
(removing experimental things I no longer need)
var customizeToolbar = function() {
/* Your code goes here */
 
// New 'toolbar' section
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'sections': {
'emoticons': {
'type': 'toolbar', // Can also be 'booklet'
'label': 'Emoticons'
}
}
} );
 
// New group example
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'emoticons',
'groups': {
'faces': {
'label': 'Faces'
}
}
} );
 
// Button example
$( '#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
}
}
}
}
} );
 
// New 'booklet' section
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'sections': {
'info': {
'type': 'booklet',
'label': 'Info'
}
}
} );
 
// Add booklet page of text to existing section
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'info',
'pages': {
'colors': {
'layout': 'table',
'label': 'Colors',
'headings': [
{ text: 'Name' },
{ 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;">' }
}
]
}
}
} );
 
// Add booklet page of buttons to existing section
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'info',
'pages': {
'emoticons': {
'layout': 'characters',
'label': 'Emoticons',
'characters': [
':)',
':))',
':(',
'<3',
';)'
]
}
}
} );
 
// Add new booklet section with pages of encapsulating buttons
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'sections': {
'new': {
'type': 'booklet',
'label': 'Useful Snippets',
'pages': {
'section-xml': {
'label': 'XML Tags',
'layout': 'characters',
'characters': [
'<references/>',
{
'action': {
'type': 'encapsulate',
'options': {
'pre': '<' + 'ref>',
'peri': '',
'post': '</ref>'
}
},
'label': '<' + 'ref></ref>'
}
]
},
'section-links': {
'label': 'Wikilinks',
'layout': 'characters',
'characters': [
{
'action': {
'type': 'encapsulate',
'options': {
'pre': '[[Category:',
'peri': '',
'post': ']]'
}
},
'label': '[[Category:]]'
},
{
'action': {
'type': 'encapsulate',
'options': {
'pre': '[[File:',
'peri': '',
'post': ']]'
}
},
'label': '[[File:]]'
}
]
}
}
}
}
} );
 
//add new section to editing toolbar