User:Root/common.js: Difference between revisions

From www.PSALTIKI.info
Jump to navigation Jump to search
Created page with "/* $('#wpTextbox1').wikiEditor('addToToolbar', { section: 'main', group: 'format', tools: { 'bluetext': { label: 'Blue text', type: 'button..."
 
mNo edit summary
Line 1: Line 1:
/*
// OLD WAY - "classic toolbar":
  $('#wpTextbox1').wikiEditor('addToToolbar', {
mw.toolbar.addButton({
    section: 'main',
imageId: 'mw-customeditbutton-myspecialbutton',
    group: 'format',
imageFile: '//upload.wikimedia.org/wikipedia/commons/thumb/a/a4/Gnome-face-smile.svg/22px-Gnome-face-smile.svg.png',
    tools: {
speedTip: "Title label",
      'bluetext': {
tagOpen: "Smile (",
        label: 'Blue text',
tagClose: ")",
        type: 'button',
sampleText: "sample"
        icon: '/images/BoutonsDefaut03.png',
});
        action: {
          type: 'encapsulate',
          options: {
            pre: "<font color='blue'>",
            peri: "Insert comment here",
            post: "</font>"
          }
        }
      }
    }
  });
*/


$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
// NEW WAY - "WikiEditor":
'sections': {
krInsertWikiEditorButton({
'emoticons': {
id: 'mw-customeditbutton-myspecialbutton',
'type': 'toolbar', // Can also be 'booklet'
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/a/a4/Gnome-face-smile.svg/22px-Gnome-face-smile.svg.png',
'label': 'Emoticons'
label: 'Title label',
// or 'labelMsg': 'section-emoticons-label' for a localized label
insertBefore: 'Smile (',
}
insertAfter: ')',
}
sampleText: 'sample'
} );
});
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'emoticons',
'groups': {
'faces': {
'label': 'Faces' // or use labelMsg for a localized label, see above
}
}
} );
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section': 'emoticons',
'group': 'faces',
'tools': {
'smile': {
label: 'Smile!', // or use labelMsg for a localized label, see above
filters: [ 'body.ns-talk' ],
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
}
}
}
}
} );

Revision as of 02:29, 22 June 2017

// OLD WAY - "classic toolbar":
mw.toolbar.addButton({
	imageId: 'mw-customeditbutton-myspecialbutton',
	imageFile: '//upload.wikimedia.org/wikipedia/commons/thumb/a/a4/Gnome-face-smile.svg/22px-Gnome-face-smile.svg.png',
	speedTip: "Title label",
	tagOpen: "Smile (",
	tagClose: ")",
	sampleText: "sample"
});

// NEW WAY - "WikiEditor":
krInsertWikiEditorButton({
	id: 'mw-customeditbutton-myspecialbutton',
	icon: '//upload.wikimedia.org/wikipedia/commons/thumb/a/a4/Gnome-face-smile.svg/22px-Gnome-face-smile.svg.png',
	label: 'Title label',
	insertBefore: 'Smile (',
	insertAfter: ')',
	sampleText: 'sample'
});