Difference between revisions of "User:Root/common.js"

From www.PSALTIKI.info
Jump to: navigation, search
m
m
Line 4: Line 4:
 
  */
 
  */
 
$.ajax({
 
$.ajax({
url: 'https://meta.wikimedia.org/w/index.php?title=User:Krinkle/Scripts/InsertWikiEditorButton.js&action=raw&ctype=text/javascript',
+
url: '//localhost:8001/index.php?title=MediaWiki:InsertWikiEditorButton.js&action=raw&ctype=text/javascript',
 
dataType: 'script',
 
dataType: 'script',
 
cache: true
 
cache: true
Line 11: Line 11:
 
// Happy face
 
// Happy face
 
krInsertWikiEditorButton({
 
krInsertWikiEditorButton({
id: "mw-customeditbutton-myspecialbutton",
+
id: "mw-text-blue",
icon: "//upload.wikimedia.org/wikipedia/commons/thumb/a/a4/Gnome-face-smile.svg/22px-Gnome-face-smile.svg.png",
+
icon: "/images/BoutonsDefaut03.png",
label: 'Insert happy face',
+
label: 'make text blue',
insertBefore: '[[File:Gnome-face-smile.svg|21px|',
+
insertBefore: '<font color="blue">',
insertAfter: ']]',
+
insertAfter: '</font>',
sampleText: 'Happy face'
+
sampleText: 'past your text'
 
});
 
});
  
 
// Monkey
 
// Monkey
 
krInsertWikiEditorButton({
 
krInsertWikiEditorButton({
id: 'mw-customeditbutton-anotherspecialbutton',
+
id: 'mw-text-red',
 
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/1/1b/Gnome-face-monkey.svg/22px-Gnome-face-monkey.svg.png',
 
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/1/1b/Gnome-face-monkey.svg/22px-Gnome-face-monkey.svg.png',
 
label: 'Insert monkey',
 
label: 'Insert monkey',
insertBefore: '[[File:Gnome-face-monkey.svg|21px|',
+
insertBefore: '<font color="red">',
insertAfter: ']]',
+
insertAfter: '</font>',
sampleText: 'Happy face'
+
sampleText: 'past your text'
 
});
 
});
  
 
});
 
});
 +
 +
 +
/*
 +
  $('#wpTextbox1').wikiEditor('addToToolbar', {
 +
    section: 'main',
 +
    group: 'format',
 +
    tools: {
 +
      'bluetext': {
 +
        label: 'Blue text',
 +
        type: 'button',
 +
        icon: '/images/BoutonsDefaut03.png',
 +
        action: {
 +
          type: 'encapsulate',
 +
          options: {
 +
            pre: "<font color='blue'>",
 +
            peri: "Insert comment here",
 +
            post: "</font>"
 +
          }
 +
        }
 +
      }
 +
    }
 +
  });
 +
*/

Revision as of 02:46, 22 June 2017

/**
 * Extra buttons in toolbar
 * @stats [[File:Krinkle_InsertWikiEditorButton.js]]
 */
$.ajax({
	url: '//localhost:8001/index.php?title=MediaWiki:InsertWikiEditorButton.js&action=raw&ctype=text/javascript',
	dataType: 'script',
	cache: true
}).done(function () {

	// Happy face
	krInsertWikiEditorButton({
		id: "mw-text-blue",
		icon: "/images/BoutonsDefaut03.png",
		label: 'make text blue',
		insertBefore: '<font color="blue">',
		insertAfter: '</font>',
		sampleText: 'past your text'
	});

	// Monkey
	krInsertWikiEditorButton({
		id: 'mw-text-red',
		icon: '//upload.wikimedia.org/wikipedia/commons/thumb/1/1b/Gnome-face-monkey.svg/22px-Gnome-face-monkey.svg.png',
		label: 'Insert monkey',
		insertBefore: '<font color="red">',
		insertAfter: '</font>',
		sampleText: 'past your text'
	});

});


/*
  $('#wpTextbox1').wikiEditor('addToToolbar', {
    section: 'main',
    group: 'format',
    tools: {
      'bluetext': {
        label: 'Blue text',
        type: 'button',
        icon: '/images/BoutonsDefaut03.png',
        action: {
          type: 'encapsulate',
          options: {
            pre: "<font color='blue'>",
            peri: "Insert comment here",
            post: "</font>"
          }
        }
      }
    }
  });
*/