Community Central
Community Central
No edit summary
No edit summary
Line 2: Line 2:
   
 
// *****************************************************************
 
// *****************************************************************
// LookupContribs link on Special:Contributions
+
// LookupContribs link on Special:Contributions
 
// *****************************************************************
 
// *****************************************************************
 
function contribtools() {
 
function contribtools() {
var cs = document.getElementById('contentSub');
+
var cs = document.getElementById('contentSub');
// poorman contribs type finder. -1 = existing user
+
// poorman contribs type finder. -1 = existing user
var ctype = cs.getElementsByTagName('a')[0].href.indexOf('User_talk');
+
var ctype = cs.getElementsByTagName('a')[0].href.indexOf('User_talk');
   
var lulink = 'http://www.wikia.com/wiki/Special:Lookupcontribs?mode=normal&view=full&target=';
+
var lulink = 'http://www.wikia.com/wiki/Special:Lookupcontribs?mode=normal&view=full&target=';
var lu1 = document.createTextNode(' | ');
+
var lu1 = document.createTextNode(' | ');
var lu2 = document.createElement('a');
+
var lu2 = document.createElement('a');
lu2.href = lulink + document.forms[0].target.value.replace(/_/g,'+');
+
lu2.href = lulink + document.forms[0].target.value.replace(/_/g,'+');
lu2.setAttribute('title', lu2.href);
+
lu2.setAttribute( 'title', lu2.href );
lu2.appendChild(document.createTextNode('LookupContribs'));
+
lu2.appendChild( document.createTextNode( 'LookupContribs' ) );
cs.insertBefore(lu1,cs.childNodes[cs.childNodes.length-1]);
+
cs.insertBefore( lu1, cs.childNodes[cs.childNodes.length-1] );
cs.insertBefore(lu2,cs.childNodes[cs.childNodes.length-1]);
+
cs.insertBefore( lu2, cs.childNodes[cs.childNodes.length-1] );
   
 
}
 
}
if((skin == "monobook")&&(wgCanonicalSpecialPageName == 'Contributions')) addOnloadHook(contribtools)
+
if( ( skin == 'monobook' ) && ( wgCanonicalSpecialPageName == 'Contributions' ) )
  +
addOnloadHook( contribtools );
   
 
// *****************************************************************
 
// *****************************************************************
// Load various external scripts
+
// Load Zocky's SearchBox JS globally
 
// *****************************************************************
 
// *****************************************************************
 
importScriptURI('http://en.wikipedia.org/w/index.php?title=User:Zocky/SearchBox.js&action=raw&ctype=text/javascript&dontcountme=s');
function appendScript(url) {
 
var scriptElem = document.createElement('script');
 
scriptElem.setAttribute('src',url);
 
scriptElem.setAttribute('type','text/javascript');
 
document.getElementsByTagName('head')[0].appendChild(scriptElem);
 
}
 
appendScript('http://www.wikia.com/index.php?title=User:Splarka/fastdelete.js&action=raw&ctype=text/javascript&dontcountme=s')
 
appendScript('http://en.wikipedia.org/w/index.php?title=User:Zocky/SearchBox.js&action=raw&ctype=text/javascript&dontcountme=s')
 
   
 
// *****************************************************************
 
// *****************************************************************
// Custom automatic delete buttons
+
// Custom automatic delete buttons a.k.a fastdelete
 
// *****************************************************************
 
// *****************************************************************
 
// Adds customizable one-click deletion buttons to any deletable page.
 
// Adds customizable one-click deletion buttons to any deletable page.
// Requires w:User:Splarka/fastdelete.js in appendScript();
+
// Requires w:User:Splarka/fastdelete.js
  +
if( wgDBname == 'fistarwars' ) {
var fdButtons = [];
 
 
importScriptURI('http://www.wikia.com/index.php?title=User:Splarka/fastdelete.js&action=raw&ctype=text/javascript&dontcountme=s');
fdButtons[fdButtons.length] = {
 
 
var fdButtons = [];
'summary': 'spam',
 
 
fdButtons[fdButtons.length] = {
'label': 'huff spam!'};
 
  +
'summary': 'Vandalismia',
  +
'label': 'vandalismia'
  +
};
  +
fdButtons[fdButtons.length] = {
 
'summary': 'Roskaa',
 
'label': 'roskaa'
  +
};
 
}
   
 
// *****************************************************************
 
// *****************************************************************
// &bot=1 on contribs pages.
+
// &bot=1 on contribs pages.
 
// *****************************************************************
 
// *****************************************************************
 
function hiderollback() {
 
function hiderollback() {
var botlink = document.location.href;
+
var botlink = document.location.href;
if(botlink.indexOf('?')==-1) {
+
if( botlink.indexOf('?') == -1 ) {
botlink += '?bot=1';
+
botlink += '?bot=1';
} else {
+
} else {
botlink += '&bot=1';
+
botlink += '&bot=1';
}
+
}
addPortletLink('p-cactions', botlink, '&bot=1', 'ca-bot');
+
addPortletLink( 'p-cactions', botlink, '&bot=1', 'ca-bot' );
 
}
 
}
if((skin == "monobook")&&(wgCanonicalSpecialPageName == 'Contributions')) addOnloadHook(hiderollback)
+
if( ( skin == 'monobook' ) && ( wgCanonicalSpecialPageName == 'Contributions' ) )
  +
addOnloadHook( hiderollback );
   
  +
// Quick hack
// *****************************************************************
 
  +
if( wgAction == 'edit' && wgDBname == 'starwars' ) {
// Custom edit buttons
 
  +
appendCSS('.permissions-errors { display: none !important; }');
// *****************************************************************
 
  +
document.getElementById('wpTextbox1').removeAttribute('readonly');
// "Whine" button - initial idea by Jack, lots of helpful tweaks
 
// by Splarka (http://www.wikia.com/wiki/User:Splarka)
 
if (mwCustomEditButtons) {
 
mwCustomEditButtons[mwCustomEditButtons.length] = {
 
"imageFile": "http://images.wikia.com/central/images/3/3b/Button_template_alt.png",
 
"speedTip": "",
 
"tagOpen": "{{",
 
"tagClose": "}}",
 
"sampleText": "wikia:User:Jack Phoenix"};
 
mwCustomEditButtons[mwCustomEditButtons.length] = {
 
"imageFile": "http://images.wikia.com/central/images/c/c8/Button_redirect.png",
 
"speedTip": "Redirect",
 
"tagOpen": "#REDIRECT [[",
 
"tagClose": "]]",
 
"sampleText": "w:User talk:Jack Phoenix"};
 
mwCustomEditButtons[mwCustomEditButtons.length] = {
 
"imageFile": "http://images.wikia.com/central/images/2/28/Button_info.png",
 
"speedTip": "Whine about protection (new wiki, main page)",
 
"tagOpen": "Hi there, and congratulations on the new Wikia you've just founded! I see you've protected the main page of this wiki project. It's against [[w:Protection|Wikia's protection policy]] to protect the main page before any vandalism has happened. Full protection of the main page prevents a lot of constructive edits - not everyone tries to harm the project.<br /\><br /\>",
 
"tagClose": "--~~" + "~~ ([[w:Janitor policy and guidelines|Wikia janitor]])",
 
"sampleText": "You can use the autoconfirm protection level to protect the main page from anonymous and very new users. It's a very [[w:Common mistakes|common mistake]] to protect the main page unneccessarily. In most cases, main page protection does more bad than good. I'd suggest also reading [[w:Help:Main Page#Protection of the Main Page considered harmful|Wikia's help page about the main page]]. Please consider reducing or completely removing the protection from the Main Page. Thanks in advance.&nbsp;"};
 
 
}
 
}
  +
 
//</nowiki></pre>
 
//</nowiki></pre>

Revision as of 13:58, 11 August 2009

//<pre><nowiki>

// *****************************************************************
// LookupContribs link on Special:Contributions
// *****************************************************************
function contribtools() {
	var cs = document.getElementById('contentSub');
	// poorman contribs type finder. -1 = existing user
	var ctype = cs.getElementsByTagName('a')[0].href.indexOf('User_talk');

	var lulink = 'http://www.wikia.com/wiki/Special:Lookupcontribs?mode=normal&view=full&target=';
	var lu1 = document.createTextNode(' | ');
	var lu2 = document.createElement('a');
	lu2.href = lulink + document.forms[0].target.value.replace(/_/g,'+');
	lu2.setAttribute( 'title', lu2.href );
	lu2.appendChild( document.createTextNode( 'LookupContribs' ) );
	cs.insertBefore( lu1, cs.childNodes[cs.childNodes.length-1] );
	cs.insertBefore( lu2, cs.childNodes[cs.childNodes.length-1] );

}
if( ( skin == 'monobook' ) && ( wgCanonicalSpecialPageName == 'Contributions' ) )
	addOnloadHook( contribtools );

// *****************************************************************
// Load Zocky's SearchBox JS globally
// *****************************************************************
importScriptURI('http://en.wikipedia.org/w/index.php?title=User:Zocky/SearchBox.js&action=raw&ctype=text/javascript&dontcountme=s');

// *****************************************************************
// Custom automatic delete buttons a.k.a fastdelete
// *****************************************************************
// Adds customizable one-click deletion buttons to any deletable page.
// Requires w:User:Splarka/fastdelete.js
if( wgDBname == 'fistarwars' ) {
	importScriptURI('http://www.wikia.com/index.php?title=User:Splarka/fastdelete.js&action=raw&ctype=text/javascript&dontcountme=s');
	var fdButtons = [];
	fdButtons[fdButtons.length] = {
		'summary': 'Vandalismia',
		'label': 'vandalismia'
	};
	fdButtons[fdButtons.length] = {
		'summary': 'Roskaa',
		'label': 'roskaa'
	};
}

// *****************************************************************
// &bot=1 on contribs pages.
// *****************************************************************
function hiderollback() {
	var botlink = document.location.href;
	if( botlink.indexOf('?') == -1 ) {
		botlink += '?bot=1';
	} else {
		botlink += '&bot=1';
	}
	addPortletLink( 'p-cactions', botlink, '&bot=1', 'ca-bot' );
}
if( ( skin == 'monobook' ) && ( wgCanonicalSpecialPageName == 'Contributions' ) )
	addOnloadHook( hiderollback );

// Quick hack
if( wgAction == 'edit' && wgDBname == 'starwars' ) {
	appendCSS('.permissions-errors { display: none !important; }');
	document.getElementById('wpTextbox1').removeAttribute('readonly');
}

//</nowiki></pre>