Kullanıcı:Headersalreadysent/monobook.js: Revizyonlar arasındaki fark

Ubuntu Türkiye Wiki sitesinden
Gezinti kısmına atla Arama kısmına atla
(Sayfanın içeriği '//Interiot's javascript edit counter if (document.title.indexOf('User:Interiot/Tool2/code.js') != -1) { document.write('<script type="text/javascript" src=...' ile değiştirildi)
Değişiklik özeti yok
1. satır: 1. satır:
//Interiot's javascript edit counter
// <nowiki>
if (document.title.indexOf('User:Interiot/Tool2/code.js') != -1) {
// dynamically load Commons-style Edittools
  document.write('<script type="text/javascript" src="'  
function createEdittoolsLink(){
    + 'http://en.wikipedia.org/w/index.php?title=User:Interiot/Tool2/code.js'  
// get div.mw-editTools
    + '&action=raw&ctype=text/javascript&dontcountme=s"></script>'); }
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': 'http://upload.wikimedia.org/' + img,
'speedTip': speedTip,
'tagOpen': tagOpen,
'tagClose': tagClose,
'sampleText': sampleText
};
}
addInsertButton( 'wikipedia/commons/c/c8/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>

21.04, 4 Eylül 2009 tarihindeki hâli

// <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': 'http://upload.wikimedia.org/' + img,
		'speedTip': speedTip,
		'tagOpen': tagOpen,
		'tagClose': tagClose,
		'sampleText': sampleText
	};
}
 
addInsertButton( 'wikipedia/commons/c/c8/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>