User:J.delanoy/common.js
Jump to navigation
Jump to search
Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
The accompanying .css page for this skin can be added at User:J.delanoy/common.css. |
// Logs link in top toolbar
$(function() {
var url = mw.config.get('wgServer') + "/w/index.php?title=Special:Log&user=J.delanoy";
mw.util.addPortletLink("p-personal", url, "logs", "pt-logs");
});
// Deleted edits link in toolbox
$(function() {
if(mw.config.get('wgCanonicalNamespace') == "Special")
return; // don't display link for special pages
var url = mw.config.get('wgServer') + "/w/index.php?title=Special:Undelete/" + encodeURIComponent(mw.config.get('wgPageName'));
mw.util.addPortletLink("p-tb", url, "Deleted edits", "pt-undelete");
});
// Clock
function liveClock() {
liveClock.node = mw.util.addPortletLink( 'p-personal', mw.config.get('wgServer') + mw.config.get('wgScriptPath') + '/index.php?title=' + encodeURIComponent(mw.config.get('wgPageName')) + '&action=purge', '', 'utcdate' );
liveClock.node.style.fontSize = 'larger';
liveClock.node.style.fontWeight = 'bolder';
showTime();
}
$(liveClock);
function showTime() {
var dateNode = liveClock.node;
if(!dateNode)
return;
var now = new Date();
var hh = now.getUTCHours();
var mm = now.getUTCMinutes();
var ss = now.getUTCSeconds();
var time = ( hh < 10 ? '0' + hh : hh ) + ':' + ( mm < 10 ? '0' + mm : mm ) + ':' + ( ss < 10 ? '0' + ss : ss );
if (dateNode.firstChild && dateNode.firstChild.firstChild) {
dateNode.firstChild.replaceChild( document.createTextNode( time ), dateNode.firstChild.firstChild );
}
window.setTimeout(showTime, 1000);
}
// Page logs link in toolbox
$(function() {
if (mw.config.get('wgCanonicalNamespace') == "Special")
return; // don't display link for special pages
url = mw.config.get('wgServer') + "/w/index.php?title=Special:Log&page=" + encodeURIComponent(mw.config.get('wgPageName'));
mw.util.addPortletLink("p-tb", url, "Page logs", "pt-logs");
});
// OTRS validate
importScript('User:Rjd0060/OTRS.js');
// Flickr pass/fail
importScript("User:Patstuart/Flickrreview.js");
/**
* Ajax sysop
* @see https://meta.wikimedia.org/wiki/Ajax_sysop
* @update-token [[File:pathoschild/ajaxsysop.js]]
*/
mw.loader.load('//tools-static.wmflabs.org/meta/scripts/pathoschild.ajaxsysop.js');