User:Technical 13/common.js

This is an old revision of this page, as edited by Technical 13 (talk | contribs) at 14:54, 13 March 2013 (Debugging Refresh my WatchList page when viewing every minute: ...). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
/* Visual name change mechanic so that I see "ShoeMaker" as I prefer while being able to keep my "Technical_13" login. */
$('h1[id^="firstHeading"]').each(function() {
    this.innerHTML = this.innerHTML.replace("User:Technical 13", "User:ShoeMaker");
});
$('a[href^="/wiki/User:Technical_13"]').each(function() {
    this.innerHTML = this.innerHTML.replace("Technical 13", "ShoeMaker");
});

/* Virtual signature */
$('span[class="ShoeSig"]').each(function() {
    this.innerHTML = this.innerHTML.replace('>T13<', '>ShoeMaker<');
    this.innerHTML = this.innerHTML.replace('>C<', '>Contributions<');
    this.innerHTML = this.innerHTML.replace('•', '<span style="text-decoration: blink; color: #FA88AF;">•</span>');
    this.innerHTML = this.innerHTML.replace('<a href="/wiki/User_talk:Technical_13" title="User talk:Technical 13" class="mw-redirect">M</a>', '<a target="_blank" rel="nofollow" class="external text" href="http://ddowiki.com/page/User_talk:Technical_13">Message</a>');
    this.innerHTML = this.innerHTML.replace('• <a href="/wiki/User:Technical_13/Sig" title="User:Technical 13/Sig" class="mw-redirect">Click to learn how to view this signature as intended</a> ', '');
    this.innerHTML = this.innerHTML.replace('<a href="/wiki/User_talk:Technical_13" title="User talk:Technical 13" class="mw-redirect">talk</a><span class="before-localcomments">', '&nbsp;<a href="/wiki/Special:Contributions/Technical_13" title="Special:Contributions/Technical 13">Contributions</a>&nbsp;<span style="text-decoration: blink; color: #FA88AF;">•</span>&nbsp;<a target="_blank" rel="nofollow" class="external text" href="http://ddowiki.com/page/User_talk:Technical_13">Message</a>&nbsp;')
});

/* Refresh my WatchList page when viewing every minute */
if (document.___location.href == "http://en.wikipedia.org/wiki/Special:Watchlist") {
    setTimeout(function(){___location = ''},60000);
    var timeNow = new Date();
    var minNow = timeNow.getMinutes();
    var minNow = minNow - 5;
    timeNow.setMinutes(minNow);
    var postTime = $('td.mw-enhanced-rc').html();
    for (i=0;i<6;i++) {var postTime = postTime.replace('&nbsp;', '');}
    var postTime = postTime.replace('<span class="mw-enhancedchanges-arrow-space"></span>', '');
    var postTime = postTime.replace('<abbr class="newpage" title="This edit created a new page">N</abbr>', '');
    var postTime = postTime.replace('<abbr class="minoredit" title="This is a minor edit">m</abbr>', '');
    var postTime = postTime.replace('<abbr class="botedit" title="This edit was performed by a bot">b</abbr>', '');
    var postTime = postTime.replace('<abbr class="unpatrolled" title="This edit has not yet been patrolled">!</abbr>', '');
    var postTime = postTime.split(':', '2');
    var postHour = postTime[0];
    var postMin = postTime[1];
    var timePost = new Date();
    timePost.setHours(postHour);
    timePost.setMinutes(postMin);
var SHOE = timePost + " =?= " timeNow;/*
$('td[class="mw-enhanced-rc"]').each(function() {this.innerHTML = this.innerHTML.replace('&nbsp;&nbsp;&nbsp;', SHOE);});
    if (timePost >= timeNow) {$('td.mw-enhanced-rc').css({fontWeight: 'bold', fontSize: '12pt'});}*/
}