User:Technical 13/common.js: Difference between revisions

Content deleted Content added
Technical 13 (talk | contribs)
This should be annoying enough...
Technical 13 (talk | contribs)
Since they changed from bugzilla to phabricator, it's no longer stable.
 
(30 intermediate revisions by the same user not shown)
Line 1:
/* WikiBreak */
// importScript( 'User:Technical_13/Scripts/WikiBreak.js' );//[[User:Technical 13/Scripts/WikiBreak]] annoyer...
var stillOnBreak = confirm('You are still on a WikiBreak because you need to get your school work done');
if(stillOnBreak === null){
stillOnBreak = confirm('Are you sure you are done with your break?');
if(stillOnBreak === null){
setTimeout(function(){___location = 'https://en.wikipedia.org/w/index.php?title=User:Technical_13/common.js&action=edit#editform'},1);
} else {
stillOnBreak = alert('You are still on a WikiBreak because you need to get your school work done');
}
} else {
alert('You are still on a WikiBreak because you need to get your school work done');
setTimeout(function(){___location = ''},1);
}
 
/*
$('li.toclevel-2').each(function(){
Line 19 ⟶ 7:
 
*/
 
if (mw.config.get( 'wgPageName' ) == "Special:Watchlist" && $('td').html().search('since last visit') !== -1) {
//mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Hedonil/XTools/XTools.js&action=raw&ctype=text/javascript');//[[Meta:User:Hedonil/XTools/XTools.js]]
$('td').each(function(){
 
$(this).html($(this).html().replace('since last visit','new'));
});
}
/*
importScript( 'User:Anomie/previewtemplatelastmod.js' ); // Linkback: [[User:Anomie/previewtemplatelastmod.js]]
Line 30 ⟶ 16:
importScript( 'User:Technical 13/Scripts/admin eye.js' );// [[User:Technical 13/Scripts/admin eye]]
importScript( 'User:Technical 13/Scripts/Gadget-pageCount.js' );// [[User:Technical 13/Scripts/Gadget-pageCount]]
importScript( 'User:Technical 13/Scripts/Gadget-BugStatusUpdate.js' );// [[User:Technical 13/Scripts/Gadget-BugStatusUpdate.js]] -- Last stable version
/*
// // // importScript( 'User:Technical_13/Scripts/GANreview.js' );// [[User:Technical_13/Scripts/GANreview]]
Line 41 ⟶ 26:
/// importScript( 'User:Technical_13/Scripts/Gadget-listStyles.js' );// [[User:Technical_13/Scripts/Gadget-listStyles]] (running sandbox version in [[User:Technical 13/vector.js]])
 
/* AFCH */
importScript( 'User:Theopolisme/afch-rewrite.js' );// [[User:Theopolisme/afch-rewrite.js]]
// importScript( 'User:Theo's Little BotTheopolisme/afch/afchelper-rewrite.js' );// [[User:Theo's Little BotTheopolisme/afch/afchelper-rewrite.js]] [[WP:AFCHRW|AFCHRW]]
// importScript( 'MediaWikiUser:Technical 13/Gadget-afchelper-beta.js' );// Pushed betaDevelop [[MediaWikiUser:Technical 13/Gadget-afchelper-beta.js]]
// importScript( 'MediaWiki:Gadget-afchelper-beta.js' );// Pushed beta [[MediaWiki:Gadget-afchelper-beta.js]] [[WP:AFCHB|AFCHB]]
 
/*
//// importScript( 'Wikipedia:AutoEd/complete.js' );// [[WP:AutoEd]]*/
//importScript( 'User:Writ Keeper/Scripts/teahouseUtility.js' );// 1-click to + TH invite/tb to a user [[User:Writ Keeper]]
/*importScript( 'User:Lupin/recent2.js' );// Lupin's AVT tool [[User:Lupin]]
importScript( 'User:Technical 13/Scripts/LagToHours.js' );// based on [[User:Equazcion/LagToMinutes]]
Line 52 ⟶ 39:
/* Shrink all things on my "Contributions" page that no-one has edited since me. *//*
$('.mw-uctop').closest('li').css({"font-size":"6px", "text-decoration":"italic"});
 
/* Refresh my WatchList page when viewing every minute
if (pageName == "Special:Watchlist" || pageName == "Special:RecentChanges") {
setTimeout(function(){___location = ''},180000);// Currently set to a static 3 minutes... May make it dynamic 1 min for PC 3 for mobile.
var timeNow = new Date();
var minNow = timeNow.getMinutes();
var minNow = minNow - 3;
var timeCheck = new Date();
timeCheck.setMinutes(minNow);
var postTime = $('td.mw-enhanced-rc').html();
var nbsp = (postTime.match(/ /g)||[]).length;
for (i=0;i<nbsp;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 timePost = timePost.getTime();
var timeCheck = timeCheck.getTime();
var timeNow = timeNow.toLocaleTimeString();
var headTitle = timeNow + " - " + document.title;
if (timePost >= timeCheck) {
var enhRC = $('td.mw-enhanced-rc').html();
$('td[class^="mw-enhanced-rc"]').each(function() {this.innerHTML = this.innerHTML.replace(enhRC, '<span style="font-weight: bold; font-size: 12pt;">' + enhRC + '</span>');});
// Using this styles ALL times $('td[class^="mw-enhanced-rc"]').css({"font-weight":"bold", "font-size":"12pt"});
var headTitlePrefix = "N";
}
if ($('abbr.unpatrolled:first').length != 0){
var patrolRequired = $('abbr.unpatrolled:first').text();
var headTitlePrefix = patrolRequired + headTitlePrefix;
}
if (headTitlePrefix){ headTitle = headTitlePrefix + " - " + headTitle; }
document.title = headTitle;
}
/*
 
if (pageName == "User:Technical_13" || pageName == "User:Technical_13/common.js") {
/* test section *//*
var pageWatchers = 0;
$.ajax({
url: '//en.wikipedia.org/w/api.php?action=query&prop=info&format=json&inprop=watchers&titles=' + pageName,
dataType: 'json',
success: function (result) {
var pageID = $.map(result.query.pages, function (v, k) {
return k;
})[0];
pageWatchers = result.query.pages[pageID].watchers;
}
});
/* test section *//*
var oldTitle = document.title;
var osVer = "?";
if (navigator.appVersion.indexOf("Win") != -1) {
var osName = "Windows";
} else if (navigator.appVersion.indexOf("Mac") != -1) {
var osName = "MacOS";
} else if (navigator.appVersion.indexOf("X11") != -1) {
var osName = "UNIX";
} else if (navigator.appVersion.indexOf("Linux") != -1) {
var osName = "Linux";
} else if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i) != "null") {
osName = navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i);
var isMobile = TRUE;
} else {
osName = "?";
}
if (navigator.userAgent.indexOf("Firefox") != -1) {
var browserName = "Firefox";
var browserVerStart = navigator.userAgent.lastIndexOf("/") + 1;
var browserVer = navigator.userAgent.substr(browserVerStart);
if (navigator.oscpu == "Windows NT 6.2; Win64; x64" || navigator.oscpu == "Windows NT 6.2; WOW64") {
osVer = "8 (64-bit)";
} else if (navigator.oscpu == "Windows NT 6.2") {
osVer = "8";
} else if (navigator.oscpu == "Windows NT 6.1; Win64; x64" || navigator.oscpu == "Windows NT 6.1; WOW64") {
osVer = "7 (64-bit)";
} else if (navigator.oscpu == "Windows NT 6.1") {
osVer = "7";
} else if (navigator.oscpu == "Windows NT 6.0; Win64; x64" || navigator.oscpu == "Windows NT 6.0; WOW64") {
osVer = "Vista (64-bit)";
} else if (navigator.oscpu == "Windows NT 6.0") {
osVer = "Vista";
} else if (navigator.oscpu == "Windows NT 5.1") {
osVer = "XP";
} else {
alert(navigator.oscpu);
osVer = "version that is so old that I'm going to refuse to tell you. UPGRADE YOUR SYSTEM!";
}
} else if (navigator.userAgent.indexOf("OPR") != -1) {
var browserName = "Opera";
var browserVerStart = navigator.userAgent.lastIndexOf("OPR/") + 4;
var browserVer = navigator.userAgent.substr(browserVerStart);
} else if (navigator.userAgent.indexOf("Chrome") != -1) {
var browserName = "Chrome";
var browserVerStart = navigator.userAgent.lastIndexOf("Chrome/") + 7;
var browserVer = navigator.userAgent.substr(browserVerStart);
var browserVerEnd = browserVer.indexOf(" ");
browserVer = browserVer.slice(0, browserVerEnd);
} else if (navigator.userAgent.indexOf("Safari") != -1) {
var browserName = "Safari";
var browserVerStart = navigator.userAgent.lastIndexOf("Version/") + 8;
var browserVer = navigator.userAgent.substr(browserVerStart);
var browserVerEnd = browserVer.indexOf(" ");
browserVer = browserVer.slice(0, browserVerEnd);
} else if (navigator.userAgent.indexOf("MSIE") != -1) {
var browserName = "Internet Explorer";
var browserVerStart = navigator.userAgent.lastIndexOf("MSIE") + 5;
var browserVer = navigator.userAgent.substr(browserVerStart);
var browserVerEnd = browserVer.indexOf("; ");
browserVer = browserVer.slice(0, browserVerEnd);
} else {
var browserName = navigator.userAgent;
var browserVer = navigator.userAgent;
}
if (isNaN(window.screen.width)) {
var screenWidth = "?";
} else {
var screenWidth = window.screen.width;
}
if (isNaN(window.screen.height)) {
var screenHeight = "?";
} else {
var screenHeight = window.screen.height;
}
if (isNaN(window.screen.pixelDepth)) {
var screenDepth = "?";
} else {
var screenDepth = window.screen.pixelDepth;
}
var osNameVer = osName + " " + osVer;
var browserNameVer = browserName + " " + browserVer;
if (screenWidth != "?" && screenHeight != "?") {
var screenRes = screenWidth + "×" + screenHeight;
var screenMP = screenWidth * screenHeight / 1000000;
if (screenDepth != "?") {
screenRes = screenRes + "×" + screenDepth;
}
var screenResolution = "Your resolution is set to " + screenRes + " (" + screenMP + " MegaPixels)";
var screenResolutionLinked = "Your resolution is set to " + screenRes + " (" + screenMP + " <a href='http://enwp.org/Pixel#Megapixel'>MegaPixels</a>)";
}
 
console.info( 'Done: %d', pageWatchers );
var currentTitle = "You are running " + browserNameVer + " on a " + osNameVer + " system. " + screenResolution + " - " + oldTitle;
var currentSiteSub = "You are running " + browserNameVer + " on a " + osNameVer + " system. " + screenResolutionLinked + " - " + oldTitle;
document.title = currentTitle;
document.getElementById("siteSub").innerHTML = currentSiteSub;
}
*/