User:Gan Luo/monobook.js
Appearance
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:Gan Luo/monobook.css. |
// {{commons ok}} tagger
function commonsOK() {
document.editform.wpTextbox1.value += "\n{{commons ok}}";
document.editform.wpSummary.value = "{{[[Template:commons ok|commons ok]]}}";
document.editform.submit();
}
function nrd() {
document.editform.wpTextbox1.value += "\n{{subst:nrd}" + "}";
document.editform.wpSummary.value = "no rationale given";
document.editform.submit();
}
function nsd() {
document.editform.wpTextbox1.value += "\n{{subst:nsd}" + "}";
document.editform.wpSummary.value = "no source given";
document.editform.submit();
}
function addCommonsOK(){
if (document.editform && wgCanonicalNamespace == "Image") {
mw.util.addPortletLink("p-cactions", "javascript:commonsOK()", "{{commons ok}}", "");
mw.util.addPortletLink("p-cactions", "javascript:nrd()", "nrd", "");
mw.util.addPortletLink("p-cactions", "javascript:nsd()", "nsd", "");
}
}
$(addCommonsOK);
// [[User:Lupin/popups.js]] - please include this line
mw.loader.load(
'https://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s');
popupDelay=0;
popupAdminLinks=true;
mw.loader.load(
'https://en.wikipedia.org/w/index.php?title=User:Voice_of_All/Addtabs/monobook.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s');
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Voice_of_All/CheckUser/monobook.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
/* <pre><nowiki> */
/**** Initialize on window load ****/
$( myLoadFuncs );
/**** Load custom functions ****/
function myLoadFuncs()
{
if(!document.getElementById) return;
// add a clock
var toplinks = document.getElementById('p-personal').getElementsByTagName('ul')[0];
addlilink(toplinks, '#', '', 'utcdate');
showtime();
morelinks();
}
/**** 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;
}