//<pre><nowiki>
//---------------------------------------------------------------
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// Script loading function by Quarl (http://en.wikipedia.org/wiki/User:Quarl)
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// loads from en...
function winc(s) {
s = s.replace(/^\[\[/, '').replace(/\]\]$/, '');
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=' + s
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
}
// loads from commons...
// from [[Talk:Wikimedia logo mosaic]] (image dimension checker)
// [[User:Nux/dimcheck_n_title.js]]
mw.loader.load('<script type="text/javascript" src="http://commons.wikimedia.org/w/index.php?title=User:Nux/dimcheck_n_title.js&action=raw&ctype=text/javascript&dontcountme=s"></script>');
//[[MediaWiki talk:Quick-delete.js]]
document.write('<script type="text/javascript" src="/w/index.php?title=MediaWiki:Quick-delete.js&action=raw&ctype=text/javascript"><\/script>');
// switches for same
nfd_autosave = false;
mnx_autosave = false;
/*** [[en:User:Lightdarkness]]'s include function ***/
function co_inc (file) {
var lt = String.fromCharCode(60);
var gt = String.fromCharCode(62);
document.writeln(lt+'script type="text/javascript" src="/w/index.php?title='+file+'&action=raw&ctype=text/javascript&dontcountme=s"'+gt+lt+'/script'+gt);
}
function cur_date_year()
{
var months2 = new Array('January', 'February', 'March', 'April', 'May', 'June',
'July', 'August', 'September', 'October', 'November', 'December');
var date = new Date();
var yearStr = date.getUTCFullYear();
var MoDayStr = months2[date.getUTCMonth()]+" "+date.getUTCDate();
var t = MoDayStr+", "+yearStr;
return t;
}
// for image upload page to automate the image information template insertion
function imageInfo()
{
// var res = prompt("Result?","Keep - No Consensus");
// if(!res) return;
// var afddate = prompt("Nomination date?",cur_date());
// document.editform.wpSummary.value = 'AFD result - ' + res.replace(/'/g, '');
// a page edit box is called wpTextbox1
// the description box on an upload page is called wpUploadDescription
// works for edit box but not here, wrong form and field
// var txt = document.editform.wpTextbox1;
// upload is the ID but not the name... so this fails
// var txt = document.upload.wpUploadDescription;
// this works but it is brittle
// var txt=document.forms[0].wpUploadDescription;
var txt=document.getElementById('upload').wpUploadDescription;
if(txt.value.length > 0) txt.value += '\n';
txt.value += "{{Information " +'\n'
+ "|Description= " +'\n'
+ "|Source=Picture taken by [[User:Lar]]" +'\n'
+ "|Date=" + cur_date_year() +'\n'
+ "|Author= Larry Pieniazek, [[User:Lar]], [[en:User:Lar]] (primary)" +'\n'
+ "|Permission=Dual licensed under [[w:GNU_Free_Documentation_License|GFDL]] and [[w:Creative Commons|Creative Commons]] [http://creativecommons.org/licenses/by/2.5/ Attribution 2.5] (CC-BY 2.5)" +'\n'
+ "|other_versions= none but contact author for other similar images" +'\n'
+ "}}" +'\n'
+ "== Licensing ==" +'\n'
+ "{{self2|GFDL|cc-by-2.5}}" +'\n';
txt.focus();
}
// add a {{subst:unsigned2|00:49, 27 May 2006|Joe Random User}}
// at the end of the current edit contents.
// will have problems at the change in years since it depends on date.getUTCFullYear()
function addUnsigned2()
{
// sample string to paste in is "18:32, 18 June 2006 FredUser" or "00:49, 27 May 2006 Timothy Usher "
var date = new Date();
var idString = prompt("ID string?");
var f = document.editform, t = f.wpTextbox1;
// a regexp for the date part of the string would be a better way to do this...
//... but slicing on year should almost always work
var pipeLoc= idString.indexOf(date.getUTCFullYear()); // assume 4 digit year, breaks after 9999
var idStringPiped= idString.substr(0,pipeLoc+4)+'|'+idString.substr(pipeLoc+5,idString.length);
t.value += "{{subst:unsigned2|" + idStringPiped + "}}";
f.wpSummary.value = "add {{tl|Unsigned2}} using string:" + idString;
}
// **** Add generic tab ****
function addlilink(tabs, url, name, id){
var na = document.createElement('a');
na.href = url;
na.appendChild(document.createTextNode(name));
var li = document.createElement('li');
li.id = id;
li.appendChild(na);
tabs.appendChild(li);
return li;
}
// there is a version of the above in en:User:Voice_of_All/Addtabs/monobook.js
function addlimenu(tabs, name, id)
{
var na = document.createElement('a');
na.href = '#';
var mn = document.createElement('ul');
na.appendChild(document.createTextNode(name));
var li = document.createElement('li');
li.id = id;
li.className = 'tabmenu';
li.appendChild(na);
li.appendChild(mn);
tabs.appendChild(li);
return li;
}
// UTC clock
winc('[[User:Voice_of_All/UTCclock.js]]');
//---------------------------------------------------------------
/* like submitting the URL http://en.wikipedia.org/w/index.php?title={{{PAGENAME}}}&action=purge */
function addpurge() {
ta['ca-purge'] = ['g', 'Purge the internal cache for this page'];
if(!document.getElementById) return;
var x = document.getElementById('ca-history');
var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
if(!x) return;
if(x.children) x = x.children[0];
else x = x.childNodes[0];
addlilink(tabs, x.href.replace(/=history/, "=purge"), 'purge', 'ca-purge');
}
//---------------------------------------------------------------
//Toolbox links
// changes top links
function changelinks() {
if(!document.getElementById) return;
document.getElementById('pt-mytalk').firstChild.innerHTML = 'my Talk';
document.getElementById('pt-preferences').firstChild.innerHTML = 'Change Prefs';
document.getElementById('pt-watchlist').firstChild.innerHTML = 'My Watchlist';
document.getElementById('pt-mycontris').firstChild.innerHTML = 'My Contribs';
document.getElementById('pt-logout').firstChild.innerHTML = 'Log out';
}
// adds useful links
function addtoolboxlinks() {
var tb = document.getElementById('p-tb').getElementsByTagName('ul')[0];
addlilink(tb, '/wiki/Special:Newpages', 'New pages', '');
addlilink(tb, '/wiki/Special:Log/newusers', 'New users', '');
addlilink(tb, '/wiki/Special:Log', 'Log', '');
addlilink(tb, '/wiki/Special:Log/delete', 'Delete log', '');
addlilink(tb, '/wiki/Special:Log/block', 'Block log', '');
addlilink(tb, '/wiki/Special:Ipblocklist', 'IPBlocklist', '');
}
// adds various tabs and menu tabs
function add_more_tabs()
{
var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
var username=document.getElementById("pt-userpage").textContent;
if (document.title.indexOf("Upload file") != -1) {
addlimenu(tabs, 'upTags', 'upFm');
var upFm = document.getElementById('upFm').getElementsByTagName('ul')[0];
addlilink(upFm,'javascript:imageInfo()','ImageInfo');
addlilink(upFm,'javascript:addUnsigned2()','Unsigned2');
}
// Only add for pages with "Editing User talk:" somewhere in the title
if (document.title.indexOf("Editing User talk:") != -1) {
addlimenu(tabs, 'artTalk msgs', 'talkm');
var talkm = document.getElementById('talkm').getElementsByTagName('ul')[0];
addlilink(talkm,'javascript:addUnsigned2()','Unsigned2');
}
if (document.title.indexOf("Editing") != 0)
{
}
}
//END
$(Mainfast)
function Mainfast()
{
// changemovetab();
changelinks();
addpurge();
addtoolboxlinks();
add_more_tabs();
}
window.onload = Main;
function Main()
{
// addtoplink();
// LivePreviewInstall();
// if(addSinceTab)
// {addSinceTab();}
}
// slow load tools
//includes
// popups
co_inc ("User:Kylu/popups.js");;
//Tool2 (localized)
co_inc ("User:Kylu/Tool2/code.js");
//editcount toolbox link (not localized, just username adjusted)
co_inc ("User:Kylu/editcount.js");
// Popups options:
simplePopups = false;
popupFixRedirs = true;
popupSubpopups = false;
popupNavLinkSeparator = ' • ';
popupRedirAutoClick = 'wpPreview';
//Beta!
popupLiveOptions=true; //Lets you change frequently-changed Popups options while in-use
popupLiveOptionsExpanded=false; //Starts with the options tab open on popover (annoying)
// I am an admin so do use this
popupAdminLinks=true; // optional: enable admin links [[Category:VoA scripted admins]]
popupSubpopups=false;
popupStructure='shortmenus';
popupDelay=1.0; // optional: time in s before popup happens (slowed down from default of .5s
popupEditCounterTool='interiot'; // other value is 'kate' but I prefer interiot's as it has more features
popupOnEditSelection=false; // I do not want popups for links that I select while editing.
popupFixDabs=true; // I do want to be able to fix disambigs
popupExtendedRevertSummary='Revert to version $1 by $2 using [[:en:Wikipedia:Tools/Navigation_popups|popups]]';
//
//END
//</nowiki> </pre>