MediaWiki:Common.js: Porovnání verzí

Z Gewiki
Bez shrnutí editace
Bez shrnutí editace
Řádek 4: Řádek 4:
//importScriptURI('resources/wikEd.js');
//importScriptURI('resources/wikEd.js');


$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
$.ajax({
'section': 'emoticons',
dataType: 'script',
'group': 'faces',
cache: true,
'tools': {
url: 'http://meta.wikimedia.org/w/index.php?title=User:Krinkle/Scripts/InsertWikiEditorButton.js&action=raw&ctype=text/javascript'
'smile': {
}).done(function () {
label: 'Smile!', // or use labelMsg for a localized label, see above
type: 'button',
// Happy face
icon: 'http://upload.wikimedia.org/wikipedia/commons/thumb/a/a4/Gnome-face-smile.svg/22px-Gnome-face-smile.svg.png',
krInsertWikiEditorButton({
action: {
id: "mw-customeditbutton-myspecialbutton",
type: 'encapsulate',
icon: "http://upload.wikimedia.org/wikipedia/commons/thumb/a/a4/Gnome-face-smile.svg/22px-Gnome-face-smile.svg.png",
options: {
label: 'Insert happy face',
pre: ":)" // text to be inserted
insertBefore: '[[File:Gnome-face-smile.svg|21px|',
}
insertAfter: ']]',
}
sampleText: 'Happy face'
}
});
}
} );
// Monkey
krInsertWikiEditorButton({
id: 'mw-customeditbutton-anotherspecialbutton',
icon: 'http://upload.wikimedia.org/wikipedia/commons/thumb/1/1b/Gnome-face-monkey.svg/22px-Gnome-face-monkey.svg.png',
label: 'Insert monkey',
insertBefore: '[[File:Gnome-face-monkey.svg|21px|',
insertAfter: ']]',
sampleText: 'Happy face'
});
});

Verze z 31. 1. 2015, 11:52

/* Zde uvedený JavaScript bude použit pro všechny uživatele při načtení každé stránky. */

// install [[Wikipedia:User:Cacycle/wikEd]] in-browser text editor
//importScriptURI('resources/wikEd.js');

$.ajax({
	dataType: 'script',
	cache: true,
	url: 'http://meta.wikimedia.org/w/index.php?title=User:Krinkle/Scripts/InsertWikiEditorButton.js&action=raw&ctype=text/javascript'
}).done(function () {
 
	// Happy face
	krInsertWikiEditorButton({
		id: "mw-customeditbutton-myspecialbutton",
		icon: "http://upload.wikimedia.org/wikipedia/commons/thumb/a/a4/Gnome-face-smile.svg/22px-Gnome-face-smile.svg.png",
		label: 'Insert happy face',
		insertBefore: '[[File:Gnome-face-smile.svg|21px|',
		insertAfter: ']]',
		sampleText: 'Happy face'
	});
 
	// Monkey
	krInsertWikiEditorButton({
		id: 'mw-customeditbutton-anotherspecialbutton',
		icon: 'http://upload.wikimedia.org/wikipedia/commons/thumb/1/1b/Gnome-face-monkey.svg/22px-Gnome-face-monkey.svg.png',
		label: 'Insert monkey',
		insertBefore: '[[File:Gnome-face-monkey.svg|21px|',
		insertAfter: ']]',
		sampleText: 'Happy face'
	});
 
});