Jump to content

User:Go Phightins!/common.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Go Phightins! (talk | contribs) at 20:05, 20 November 2012 (move code). 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.
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:Equazcion/TeahouseRespond.js'); // Adds a styled "respond to this discussion" link on the Q&A questions

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/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:Equazcion/TeahouseRespond.js'); // Adds a styled "respond to this discussion" link on the Q&A questions


importScript("User:Writ Keeper/Scripts/teahouseUtility.js");

importScript("User:Writ Keeper/Scripts/teahouseTalkbackLink.js");

$(document).ready(teahouseReminder);

function teahouseReminder()
{

  /*Enter the number of days in advance that you'd like to be reminded about your shift*/
  reminderRange = 3;

  /*Enter the start dateof your next shift in this format: "month day year". */
  maitreStartDate = new Date("December 26 2012");

  /*Enter the length of the shift in days */
  maitreRange = 6;


  var today = new Date();
  var maitreReminderDate = new Date(maitreStartDate.toDateString());
  var maitreEndDate = new Date(maitreStartDate.toDateString());
  maitreReminderDate.setDate(maitreStartDate.getDate() - reminderRange);
  maitreEndDate.setDate(maitreStartDate.getDate() + maitreRange);


  if(mw.config.get("wgPageName") === "Special:UserLogin")
  {
    if(today < maitreStartDate && today >= maitreReminderDate)
    {
      alert("Remember: you're scheduled to be the Teahouse maître d' starting on " + maitreStartDate.toDateString() + "!");
    }
    if(today >= maitreStartDate && today < maitreEndDate)
    {
      alert("Remember: you're scheduled to be the Teahouse maître d' until " + maitreEndDate.toDateString() + "!");
    }
  }
}