个人工具

MediaWiki:Editpage.js

出自Meshal Lite

(修订版本间的差异)
跳转到: 导航, 搜索
第33行: 第33行:
 
function addInsertButton( img, speedTip, tagOpen, tagClose, sampleText ){
 
function addInsertButton( img, speedTip, tagOpen, tagClose, sampleText ){
 
mwCustomEditButtons[mwCustomEditButtons.length] = {
 
mwCustomEditButtons[mwCustomEditButtons.length] = {
'imageFile': '//upload.wikimedia.org/' + img,
+
'imageFile': '//www.necroz.com/images/lite/' + img,
 
'speedTip': speedTip,
 
'speedTip': speedTip,
 
'tagOpen': tagOpen,
 
'tagOpen': tagOpen,
第40行: 第40行:
 
};
 
};
 
}
 
}
+
 
addInsertButton( 'wikipedia/commons/c/c8/Button_redirect.png', 'Redirect', '#REDIRECT [[', ']]', '' ); //+ buttons
+
// Customized Quickedit Buttons
 +
 
 +
/* h1~h6 frame */
 +
addInsertButton( 'button_button_s1.png', 'Frame Level 1', '\n= ', ' =\n{{!}}\n\n|}\n', 'Title');
 +
 
 +
addInsertButton( 'button_redirect.png', 'Redirect', '#REDIRECT [[', ']]', '' ); //+ buttons
 
addInsertButton( 'wikisource/ru/a/a9/Button-dash.png', ' — ', '—', '', '' );
 
addInsertButton( 'wikisource/ru/a/a9/Button-dash.png', ' — ', '—', '', '' );
addInsertButton( 'wikipedia/commons/2/2a/Button_category_plus.png', 'Category', '[[Category:\n', ']]', '' );
+
addInsertButton( 'wikipedia/commons/2/2a/Button_category_plus.png', 'Category', '[[Category:', ']]', '' );
 +
 
 
   
 
   
 
// </nowiki>
 
// </nowiki>

在2011年11月11日 (五) 08:15所做的修订版本

// <nowiki>
// dynamically load Commons-style Edittools
function createEdittoolsLink(){
	// get div.mw-editTools
	var box = document.getElementById('wpTextbox1');
	while( box && box.className != 'mw-editTools' )
		box = box.nextSibling;
	if( !box )
		return;
	// create a link
	var lnk = document.createElement('a');
	lnk.href = 'javascript:loadCommonsTools()';
	lnk.title = 'Load Commons-style Edittools';
	lnk.id = 'loadCommonsEdittoos';
	lnk.appendChild(document.createTextNode('[load edittools]'));
	lnk.style.cssText = 'float:right';
	box.appendChild(lnk);
}
 
function loadCommonsTools(){
	importScript('MediaWiki:Scripts/Edittools1.js');
	var lnk = document.getElementById('loadCommonsEdittoos');
	if( lnk )
		lnk.parentNode.removeChild(lnk);
}
 
if( doneOnloadHook )
	createEdittoolsLink();
else
	addOnloadHook( createEdittoolsLink );
 
// Add Insert Buttons
function addInsertButton( img, speedTip, tagOpen, tagClose, sampleText ){
	mwCustomEditButtons[mwCustomEditButtons.length] = {
		'imageFile': '//www.necroz.com/images/lite/' + img,
		'speedTip': speedTip,
		'tagOpen': tagOpen,
		'tagClose': tagClose,
		'sampleText': sampleText
	};
}
 
// Customized Quickedit Buttons
 
/* h1~h6 frame */
addInsertButton( 'button_button_s1.png', 'Frame Level 1', '\n= ', ' =\n{{!}}\n\n|}\n', 'Title');
 
addInsertButton( 'button_redirect.png', 'Redirect', '#REDIRECT [[', ']]', '' ); //+ buttons
addInsertButton( 'wikisource/ru/a/a9/Button-dash.png', ' — ', '—', '', '' );
addInsertButton( 'wikipedia/commons/2/2a/Button_category_plus.png', 'Category', '[[Category:', ']]', '' );
 
 
// </nowiki>