Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes.
A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the
appropriate village pump. This code will be executed when previewing this page. |
![]() | The accompanying .css page for this skin can be added at User:Kyle key/monobook.css. |
//<nowiki>
// Vandalism detection tools
// Filter changes live
// [[User:Lupin/recent2.js]] - please include this line
mw.loader.load(
'https://en.wikipedia.org/?title=User:Lupin/recent2.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s');
// Show diffs on recent changes, history pages and so on
// [[User:Lupin/recentdiffs.js]] - please include this line
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/?title=User:Lupin/recentdiffs.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
// [[User:Zocky/PicturePopups.js]] - please include this line
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/?title=User:Zocky/PicturePopups.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
// setInterval(function () { alert('Stop.'); }, 5000);
// [[User:Lupin/popups.js]] - please include this line
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/?title=User:Lupin/popupsdev.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/?title=User:Lupin/editblind.js'
+ '&fubar=' + Math.random()
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
//popupLiveOptions=true;
popupAdminLinks=true;
popupShortcutKeys=true;
popupFixDabs=true;
popupPreviewKillTemplates=false;
popupPreviewFirstParOnly=false;
//popupLastModified=true;
//popupActionsMenu=true;
//popupStructure='menus'
//popupNavLinkStyle='cryptic';
function addRefsLinks(btn) {
var pageTitle=document.getElementsByTagName('h1')[0].innerHTML;
var lks=document.links;
for (var i=0; i<lks.length; ++i) {
var article=articleFromURL(lksi].href);
if(!article) continue;
var talk=null;
if (!userName(article)) continue;
talk=talkPage(article);
if(!talk) continue;
var a=document.createElement('a');
a.href=titlebase + talk +
'&action=edit&autoedit=s#$#\n{{subst:unref-talk|' +
pageTitle +
'}} ~~~~#&autoclick=' +
btn +
'&autosummary=References for [['+
pageTitle+
']]';
var tt=document.createTextNode(' . . ');
a.innerHTML='request references';
lksi].parentNode.appendChild(tt);
lksi].parentNode.appendChild(a);
}
}
var refs=addRefsLinks;
function removeAccessKeys(keylist) {
var t=document.getElementsByTagName('A'), u=document.getElementsByTagName('input');
for (var i=0; i<t.length+u.length; ++i) {
var s=((i<t.length) ? ti : ui-t.length]);
for (var j=0; j<keylist.length; ++j) if (s.accessKey==keylistj]) s.accessKey='';
}
};
function removeDeleteKey() {removeAccessKeys(['d']);}
if (window.addEventListener) window.addEventListener("load",removeDeleteKey,false);
else if (window.attachEvent) window.attachEvent("onload",removeDeleteKey);
function addOnloadFunction (f) {
if (window.addEventListener) window.addEventListener("load",f,false);
else if (window.attachEvent) window.attachEvent("onload",f);
};
function fixWatchlistLink () {
for (var i=0; i<document.links.length; ++i) {
if (document.linksi].href.indexOf('Special:Watchlist')>0) {
document.linksi].href+='?hideOwn=1';
break;
}
}
};
addOnloadFunction(fixWatchlistLink);
// summary nag
function perhapsSave(ev)
{
var sum = document.getElementsByName('wpSummary');
var submit = true;
if (sum.length > 0) {
sum = sum0];
if (isBadSummary(sum.value)) {
if (!document.getElementById('jn-fillIn')) {
var div = document.createElement('p');
div.appendChild(document.createTextNode('Fill in the summary!'));
div.setAttribute('style', 'color: #f00; font-size: 150%;');
div.id = 'jn-fillIn';
sum.parentNode.insertBefore(div, sum.nextSibling);
}
sum.focus();
submit = false;
}
}
if (submit) {
var btn = document.getElementById('wpSave');
btn.onclick = null;
btn.setAttribute('type', 'submit');
btn.click();
}
}
function isBadSummary(str) {
var sumRe=RegExp('^ *$|^/[*].*?[*]/ *$');
return (sumRe.test(str));
}
function modifySaveButton()
{
// action=edit for edit pages, action=submit for previews
var loc=window.location.href;
if ((loc.indexOf('&action=edit') != -1 ||
loc.indexOf('&action=submit') != -1
) && loc.indexOf(':Lupin') == -1 ) {
var btn = document.getElementById('wpSave');
btn.setAttribute('type', 'button');
btn.onclick = perhapsSave;
}
}
addOnloadFunction(modifySaveButton);
////////////////////////////////////////////////////////////////
// Evaluator
// Source: http://krolik.net/js-eval.shtml
var evaluatorHTML='<FORM ID="Tester" NAME="Tester" onsubmit="return TesterExecute();" >' +
'<TEXTAREA NAME="MyCommand" COLS=60 ROWS=25 WRAP="off"></TEXTAREA>' +
'<TEXTAREA NAME="MyResult" COLS=40 ROWS=25 WRAP="off"></TEXTAREA>' +
'<BR>' +
'<INPUT TYPE=BUTTON value="Show Object" onclick="ObjectDumpClicked();" >' +
'<INPUT TYPE=BUTTON value="Execute" onclick="TesterExecute();">' +
'</FORM>';
function ObjectDump(strObject)
{
var strOutput;
var vTemp;
var vAnotherTemp;
var vElement;
vElement = eval(strObject);
strOutput = "typeof = " + typeof(vElement) + "\n\n";
AppendOutput(strOutput);
for (var x in vElement )
{
vTemp = strObject + "." + x.toString() ;
vAnotherTemp = strObject + "[" + x + "]" ;
strOutput = strOutput + vTemp + " = " + eval(vTemp) + "\n";
AppendOutput(vTemp + " = " + eval(vTemp) + "\n");
}
return strOutput ;
}
function AppendOutput(strText)
{
document.Tester.MyResult.value = document.Tester.MyResult.value + strText;
}
function Output(strText)
{
document.Tester.MyResult.value = strText;
}
function ObjectDumpClicked()
{
document.Tester.MyResult.value="";
ObjectDump(document.Tester.MyCommand.value);
return false;
}
function TesterExecute()
{
document.Tester.MyResult.value="";
document.Tester.MyResult.value=eval(document.Tester.MyCommand.value);
return false;
}
function addEvaluator() {
var evalNode=document.createElement('div');
evalNode.id='evalNode';
evalNode.innerHTML=evaluatorHTML;
document.body.appendChild(evalNode);
document.Tester=document.getElementById('Tester');
}
addOnloadFunction(addEvaluator);
//
// end evaluator
////////////////////////////////////////////////////////////////
// testing
// Useful stuff from [[Wikipedia:WikiProject_User_scripts]]
function addToolboxLink(url, name, id){
var tb = document.getElementById('p-tb').getElementsByTagName('ul')[0];
addlilink(tb, url, name, id);
}
function addlilink(tabs, url, name, id, title, key){
var na = document.createElement('a');
na.href = url;
na.appendChild(document.createTextNode(name));
var li = document.createElement('li');
if(id) li.id = id;
li.appendChild(na);
tabs.appendChild(li);
if(id) {
if(key && title) taid = key, title];
else if(key) taid = key, ''];
else if(title) taid = '', title];
}
// re-render the title and accesskeys from existing code in wikibits.js
akeytt();
return li;
}
function addTab(url, name, id, title, key){
var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
addlilink(tabs, url, name, id, title, key);
}
function addPurge(){
ta'ca-purge' = 'g', 'Purge the internal cache for this page'];
var x = document.getElementById('ca-history');
if(!x) return;
if(x.children) x = x.children0].href;
else x = x.childNodes0].href;
addTab(x.replace(/=history/, "=purge"), 'purge', 'ca-purge');
akeytt();
}
// culled from [[User:Lupin/popups.js]]
function nichalp_articleFromURL(h) {
if (typeof h != 'String') h=String(h);
h=decodeURI(h);
var m=RegExp('[^:]*://en\\.wikipedia\\.org/(wiki/|w/index\\.php\\?title=)([^&?]*)').exec(h);
if(m===null) return null;
return m2];
}
function nichalp_isIpUser(user) {
return RegExp('(User:)?' +
'((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}' +
'(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])')
.test(user);
}
function nichalp_removeAnchor(article) {
// is there a #? if not, we're done
var i=article.indexOf('#');
if (i == -1) return article;
return article.substring(0,i);
}
function nichalp_userName(article) {
var i=article.indexOf('User');
var j=article.indexOf(':');
if (i != 0 || j == -1) return null;
var k=article.indexOf('/');
if (k==-1) return article.substring(j+1);
else return article.substring(j+1,k);
}
// do it
function nichalp_customLinks() {
addPurge();
var article=nichalp_articleFromURL(document.location.href);
if (!article) return;
var user=nichalp_userName(article);
if(!user) return;
user=nichalp_removeAnchor(user);
if (!nichalp_isIpUser(user)) {
addToolboxLink('http://kohl.wikimedia.org/~kate/cgi-bin/count_edits?dbname=enwiki&user='+user, user+"'s edit count", 'toolbox_katestool');
}
var special='http://en.wikipedia.org/?title=Special:';
addToolboxLink(special + 'Log&user='+user, user+"'s log", 'toolbox_userlog');
addToolboxLink(special + 'Blockip&ip='+user, 'Block '+user, 'toolbox_blockuser');
addToolboxLink(special + 'Special:Ipblocklist&action=unblock&ip='+user, 'Unblock '+user, 'toolbox_unblockuser');
}
// make it all happen on page load
if (window.addEventListener) window.addEventListener("load",nichalp_customLinks,false);
else if (window.attachEvent) window.attachEvent("onload",nichalp_customLinks);
else {
window._old_nichalp_onload = window.onload;
window.onload = function() { window._old_nichalp_onload(); nichalp_customLinks(); }
}
//</nowiki>
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes.
A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the
appropriate village pump. This code will be executed when previewing this page. |
![]() | The accompanying .css page for this skin can be added at User:Kyle key/monobook.css. |
//<nowiki>
// Vandalism detection tools
// Filter changes live
// [[User:Lupin/recent2.js]] - please include this line
mw.loader.load(
'https://en.wikipedia.org/?title=User:Lupin/recent2.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s');
// Show diffs on recent changes, history pages and so on
// [[User:Lupin/recentdiffs.js]] - please include this line
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/?title=User:Lupin/recentdiffs.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
// [[User:Zocky/PicturePopups.js]] - please include this line
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/?title=User:Zocky/PicturePopups.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
// setInterval(function () { alert('Stop.'); }, 5000);
// [[User:Lupin/popups.js]] - please include this line
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/?title=User:Lupin/popupsdev.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/?title=User:Lupin/editblind.js'
+ '&fubar=' + Math.random()
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
//popupLiveOptions=true;
popupAdminLinks=true;
popupShortcutKeys=true;
popupFixDabs=true;
popupPreviewKillTemplates=false;
popupPreviewFirstParOnly=false;
//popupLastModified=true;
//popupActionsMenu=true;
//popupStructure='menus'
//popupNavLinkStyle='cryptic';
function addRefsLinks(btn) {
var pageTitle=document.getElementsByTagName('h1')[0].innerHTML;
var lks=document.links;
for (var i=0; i<lks.length; ++i) {
var article=articleFromURL(lksi].href);
if(!article) continue;
var talk=null;
if (!userName(article)) continue;
talk=talkPage(article);
if(!talk) continue;
var a=document.createElement('a');
a.href=titlebase + talk +
'&action=edit&autoedit=s#$#\n{{subst:unref-talk|' +
pageTitle +
'}} ~~~~#&autoclick=' +
btn +
'&autosummary=References for [['+
pageTitle+
']]';
var tt=document.createTextNode(' . . ');
a.innerHTML='request references';
lksi].parentNode.appendChild(tt);
lksi].parentNode.appendChild(a);
}
}
var refs=addRefsLinks;
function removeAccessKeys(keylist) {
var t=document.getElementsByTagName('A'), u=document.getElementsByTagName('input');
for (var i=0; i<t.length+u.length; ++i) {
var s=((i<t.length) ? ti : ui-t.length]);
for (var j=0; j<keylist.length; ++j) if (s.accessKey==keylistj]) s.accessKey='';
}
};
function removeDeleteKey() {removeAccessKeys(['d']);}
if (window.addEventListener) window.addEventListener("load",removeDeleteKey,false);
else if (window.attachEvent) window.attachEvent("onload",removeDeleteKey);
function addOnloadFunction (f) {
if (window.addEventListener) window.addEventListener("load",f,false);
else if (window.attachEvent) window.attachEvent("onload",f);
};
function fixWatchlistLink () {
for (var i=0; i<document.links.length; ++i) {
if (document.linksi].href.indexOf('Special:Watchlist')>0) {
document.linksi].href+='?hideOwn=1';
break;
}
}
};
addOnloadFunction(fixWatchlistLink);
// summary nag
function perhapsSave(ev)
{
var sum = document.getElementsByName('wpSummary');
var submit = true;
if (sum.length > 0) {
sum = sum0];
if (isBadSummary(sum.value)) {
if (!document.getElementById('jn-fillIn')) {
var div = document.createElement('p');
div.appendChild(document.createTextNode('Fill in the summary!'));
div.setAttribute('style', 'color: #f00; font-size: 150%;');
div.id = 'jn-fillIn';
sum.parentNode.insertBefore(div, sum.nextSibling);
}
sum.focus();
submit = false;
}
}
if (submit) {
var btn = document.getElementById('wpSave');
btn.onclick = null;
btn.setAttribute('type', 'submit');
btn.click();
}
}
function isBadSummary(str) {
var sumRe=RegExp('^ *$|^/[*].*?[*]/ *$');
return (sumRe.test(str));
}
function modifySaveButton()
{
// action=edit for edit pages, action=submit for previews
var loc=window.location.href;
if ((loc.indexOf('&action=edit') != -1 ||
loc.indexOf('&action=submit') != -1
) && loc.indexOf(':Lupin') == -1 ) {
var btn = document.getElementById('wpSave');
btn.setAttribute('type', 'button');
btn.onclick = perhapsSave;
}
}
addOnloadFunction(modifySaveButton);
////////////////////////////////////////////////////////////////
// Evaluator
// Source: http://krolik.net/js-eval.shtml
var evaluatorHTML='<FORM ID="Tester" NAME="Tester" onsubmit="return TesterExecute();" >' +
'<TEXTAREA NAME="MyCommand" COLS=60 ROWS=25 WRAP="off"></TEXTAREA>' +
'<TEXTAREA NAME="MyResult" COLS=40 ROWS=25 WRAP="off"></TEXTAREA>' +
'<BR>' +
'<INPUT TYPE=BUTTON value="Show Object" onclick="ObjectDumpClicked();" >' +
'<INPUT TYPE=BUTTON value="Execute" onclick="TesterExecute();">' +
'</FORM>';
function ObjectDump(strObject)
{
var strOutput;
var vTemp;
var vAnotherTemp;
var vElement;
vElement = eval(strObject);
strOutput = "typeof = " + typeof(vElement) + "\n\n";
AppendOutput(strOutput);
for (var x in vElement )
{
vTemp = strObject + "." + x.toString() ;
vAnotherTemp = strObject + "[" + x + "]" ;
strOutput = strOutput + vTemp + " = " + eval(vTemp) + "\n";
AppendOutput(vTemp + " = " + eval(vTemp) + "\n");
}
return strOutput ;
}
function AppendOutput(strText)
{
document.Tester.MyResult.value = document.Tester.MyResult.value + strText;
}
function Output(strText)
{
document.Tester.MyResult.value = strText;
}
function ObjectDumpClicked()
{
document.Tester.MyResult.value="";
ObjectDump(document.Tester.MyCommand.value);
return false;
}
function TesterExecute()
{
document.Tester.MyResult.value="";
document.Tester.MyResult.value=eval(document.Tester.MyCommand.value);
return false;
}
function addEvaluator() {
var evalNode=document.createElement('div');
evalNode.id='evalNode';
evalNode.innerHTML=evaluatorHTML;
document.body.appendChild(evalNode);
document.Tester=document.getElementById('Tester');
}
addOnloadFunction(addEvaluator);
//
// end evaluator
////////////////////////////////////////////////////////////////
// testing
// Useful stuff from [[Wikipedia:WikiProject_User_scripts]]
function addToolboxLink(url, name, id){
var tb = document.getElementById('p-tb').getElementsByTagName('ul')[0];
addlilink(tb, url, name, id);
}
function addlilink(tabs, url, name, id, title, key){
var na = document.createElement('a');
na.href = url;
na.appendChild(document.createTextNode(name));
var li = document.createElement('li');
if(id) li.id = id;
li.appendChild(na);
tabs.appendChild(li);
if(id) {
if(key && title) taid = key, title];
else if(key) taid = key, ''];
else if(title) taid = '', title];
}
// re-render the title and accesskeys from existing code in wikibits.js
akeytt();
return li;
}
function addTab(url, name, id, title, key){
var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
addlilink(tabs, url, name, id, title, key);
}
function addPurge(){
ta'ca-purge' = 'g', 'Purge the internal cache for this page'];
var x = document.getElementById('ca-history');
if(!x) return;
if(x.children) x = x.children0].href;
else x = x.childNodes0].href;
addTab(x.replace(/=history/, "=purge"), 'purge', 'ca-purge');
akeytt();
}
// culled from [[User:Lupin/popups.js]]
function nichalp_articleFromURL(h) {
if (typeof h != 'String') h=String(h);
h=decodeURI(h);
var m=RegExp('[^:]*://en\\.wikipedia\\.org/(wiki/|w/index\\.php\\?title=)([^&?]*)').exec(h);
if(m===null) return null;
return m2];
}
function nichalp_isIpUser(user) {
return RegExp('(User:)?' +
'((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}' +
'(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])')
.test(user);
}
function nichalp_removeAnchor(article) {
// is there a #? if not, we're done
var i=article.indexOf('#');
if (i == -1) return article;
return article.substring(0,i);
}
function nichalp_userName(article) {
var i=article.indexOf('User');
var j=article.indexOf(':');
if (i != 0 || j == -1) return null;
var k=article.indexOf('/');
if (k==-1) return article.substring(j+1);
else return article.substring(j+1,k);
}
// do it
function nichalp_customLinks() {
addPurge();
var article=nichalp_articleFromURL(document.location.href);
if (!article) return;
var user=nichalp_userName(article);
if(!user) return;
user=nichalp_removeAnchor(user);
if (!nichalp_isIpUser(user)) {
addToolboxLink('http://kohl.wikimedia.org/~kate/cgi-bin/count_edits?dbname=enwiki&user='+user, user+"'s edit count", 'toolbox_katestool');
}
var special='http://en.wikipedia.org/?title=Special:';
addToolboxLink(special + 'Log&user='+user, user+"'s log", 'toolbox_userlog');
addToolboxLink(special + 'Blockip&ip='+user, 'Block '+user, 'toolbox_blockuser');
addToolboxLink(special + 'Special:Ipblocklist&action=unblock&ip='+user, 'Unblock '+user, 'toolbox_unblockuser');
}
// make it all happen on page load
if (window.addEventListener) window.addEventListener("load",nichalp_customLinks,false);
else if (window.attachEvent) window.attachEvent("onload",nichalp_customLinks);
else {
window._old_nichalp_onload = window.onload;
window.onload = function() { window._old_nichalp_onload(); nichalp_customLinks(); }
}
//</nowiki>