importScript('User:AzaToth/twinkle.js');
//Interiot's javascript edit counter
if (document.title.indexOf('User:Interiot/Tool2/code.js') != -1) {
mw.loader.load('https://en.wiki.x.io/w/index.php?title=User:Interiot/Tool2/code.js&action=raw&ctype=text/javascript'); }
// [[User:Lupin/popups.js]] - please include this line
mw.loader.load(
'https://en.wiki.x.io/w/index.php?title=User:Lupin/popups.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s');
popupAdminLinks=true;
//window.onload = vote;
//function vote ()
//{
//document.forms[0].wpTextbox1.value = document.forms[0].wpTextbox1.value + "\n ";
//document.forms[0].wpSummary.value = "Vote keep";
//document.forms[0].submit();
//document.forms[0].wpMinoredit.checked = true;
//}
// Filter changes live
// [[User:Lupin/recent2.js]] - please include this line
mw.loader.load(
'https://en.wiki.x.io/w/index.php?title=User:Lupin/recent2.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s');
// Returns <li><a href="url">name</a></li>
function addlilink(url, name)
{
var na = document.createElement('a');
na.setAttribute('href', url);
var txt = document.createTextNode(name);
na.appendChild(txt);
var li = document.createElement('li');
li.appendChild(na);
return li;
}
// Adds a "blocklog" tab and fills in the username field on Special:Blockip, if a "&faketarget=username" is present.
function do_blockip_stuff()
{
// Look for a &faketarget= for the username/ip
var l = location.search.substring(1).split('&');
var target = '';
for (var i = 0; i < l.length; ++i)
{
var n = l[i].indexOf('=');
if (l[i].substring(0, n) == 'faketarget')
{
target = l[i].substring(n + 1);
break;
}
}
if (target == '')
return;
// put account name in "IP Address/username" field
var addr = document.getElementsByName('wpBlockAddress')[0];
addr.value = unescape(target);
// add "blocklog" tab
var c1 = document.getElementById('column-one');
var tabs = c1.getElementsByTagName('div')[0].getElementsByTagName('ul')[0];
tabs.appendChild(addlilink('/w/index.php?title=Special%3ALog&type=block&user=&page=User%3A' + target, 'blocklog'));
}
// Adds "block" and "blocklog" tabs to User: and User talk: pages.
function add_block_tab()
{
var c1 = document.getElementById('column-one');
var tabs = c1.getElementsByTagName('div')[0].getElementsByTagName('ul')[0];
// use the "edit this page" tab to get already-tidied url
var editlk = document.getElementById('ca-edit').getElementsByTagName('a')[0].href;
// cut everything up to "title=" from the start and everything past "&action=edit" from the end
editlk = editlk.substring(editlk.indexOf('title=') + 6, editlk.lastIndexOf('&action=edit'));
editlk = editlk.substring(editlk.indexOf(':') + 1);
var slloc = editlk.indexOf('/');
if (slloc > 0)
editlk = editlk.substring(0, slloc);
// add "block" tab
tabs.appendChild(addlilink('/w/index.php?title=Special%3ABlockip&faketarget=' + editlk, 'block'));
// add "blocklog" tab
tabs.appendChild(addlilink('/w/index.php?title=Special%3ALog&type=block&user=&page=User%3A' + editlk, 'blocklog'));
}
function do_onload()
{
if (document.title.indexOf('User:') == 0
|| document.title.indexOf('User talk:') == 0)
add_block_tab();
else if (document.title.indexOf('Block user') == 0) // could stand to be more robust
do_blockip_stuff();
// if (document.title.indexOf('Image:') == 0)
add_unverified_tab();
}
if (window.addEventListener)
window.addEventListener("load", do_onload, false);
else if (window.attachEvent)
window.attachEvent("onload", do_onload);
function add_unverified_tab()
{
//My Test
tabs.appendChild("javascript:unverified()", "unverified", "ca-unverified", "Tag as unverified", "");
}
function unverified()
{
//document.forms[0].wpTextbox1.value = document.forms[0].wpTextbox1.value + "\n erified}}";
//document.forms[0].wpSummary.value = "unverified";
//document.forms[0].submit();
//document.forms[0].wpMinoredit.checked = true;
}