User:Gilderien/vector.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:Gilderien/vector.css. |
importScript('User:AzaToth/twinkle.js');
importScript('User:Ucucha/HarvErrors.js');
importScript('User:Xenocidic/satusChanger2.js');
importScript('User:Shubinator/DYKcheck.js'); //DYKcheck tool
importScript('User:Cameltrader/Advisor.js');
mw.loader.load('https://ru.wikipedia.org/w/index.php?title=MediaWiki:Gadget-markblocked.js&action=raw&ctype=text/javascript');
importScript('User:Js/ajaxPreview.js'); // [[user:js/ajaxPreview]]
importScript('User:Anomie/linkclassifier.js'); // Linkback: User:Anomie/linkclassifier.js
importStylesheet('User:Anomie/linkclassifier.css'); // Linkback: User:Anomie/linkclassifier.css
/*** BEGIN WIKIBREAK ENFORCER ***/
$(function() {
/*** Start editing here ***/
// When you want to end your break?
// no leading zeroes. (example: 7 - correct, 07 - incorrect)
var date = { year: 2012, month: 4, day: 16};
var time = { hours: 23, minutes: 52, seconds: 13 };
/*** Stop editing here ***/
var currentDate = new Date();
var enforcedBreakEnd = new Date(
date.year,date.month-1,date.day,time.hours,time.minutes,time.seconds);
if (currentDate <= enforcedBreakEnd) {
alert("Enforced wikibreak until "+enforcedBreakEnd.toLocaleString()
+ "\n(now is "+currentDate.toLocaleString()+")\n\nBye!");
location = "http://"+location.host+"/w/index.php?title="
+ "Special:Userlogout&returnto=Main_Page";
}
});
/*** END WIKIBREAK ENFORCER ***/
// Add [[WP:Reflinks]] launcher in the toolbox on left addOnloadHook(function () { mw.util.addPortletLink( "p-tb", // toolbox portlet "http://toolserver.org/~dispenser/cgi-bin/webreflinks.py/" + wgPageName + "?client=script&citeweb=on&overwrite=&limit=20&lang=" + wgContentLanguage, "Reflinks" // link label )});
importScript("User:Writ Keeper/Scripts/teahouseUtility.js"); // Gives one-click option to add Teahouse invitation or talkback to a user
importScript("User:Writ Keeper/Scripts/teahouseTalkback.js"); // Adds Talkback reminder when you save an edit at the Teahouse
importScript("User:Writ Keeper/Scripts/teahouseTalkbackLink.js"); // Adds a talkback link to signatures on the Teahouse
importScript("User:Ocaasi/WikiLoveinstallscript.js");// Adds Teahouse Badges to WikiLove
/*
FOR FUTURE REFERENCE, SHOULD THE WMF EVER DECIDE TO REMOVE THE ORANGE BAR FOR REAL:
.usermessage {
background-color: #ffce7b;
border: 1px solid #ffa500;
color: black;
font-weight: bold;
margin: 2em 0 1em;
padding: .5em 1em;
vertical-align: middle;
}
These are the CSS styles applied to the OBoD to make it look the way it is.
*/
function orangeBarOfDoom()
{
var cookieResult = $.cookie("lastTalkpageView");
if(cookieResult != null)
{
var escapedUsername = wgUserName.replace(/ /g, "_");
if(wgPageName == "User_talk:"+ escapedUsername)
{
var d = new Date();
$.cookie("lastTalkpageView", d.getTime(), {expires:365, path: '/'});
}
else
{
var data = {action: "query", prop:"revisions", format:"json", rvprop:"timestamp|user", rvlimit:"1", rvdir:"older", rvexcludeuser: wgUserName, titles: "User talk:"+wgUserName};
$.post("/w/api.php", data, function(results)
{
var index = Object.keys(results.query.pages)[0];
var lastUser = results.query.pages[index].revisions[0].user
var lastTimestamp = Date.parse(results.query.pages[index].revisions[0].timestamp);
if( cookieResult < lastTimestamp )
{
var orangeBarDiv = document.createElement("div");
orangeBarDiv.innerHTML = 'You have <a href="/w/index.php?title=User_talk:'+escapedUsername+'&redirect=no" title="User talk:'+wgUserName+'">new messages.</a> Last edit by '+lastUser+'.';
orangeBarDiv.className = "usermessage";
$("#contentSub").after(orangeBarDiv);
}
})
}
}
else
{
var d = new Date();
$.cookie("lastTalkpageView", d.getTime(), {expires:365, path: '/'});
}
}
$(document).ready(orangeBarOfDoom);