User:NQ/eotwreminder.js

$(document).ready(function { var today = new Date;  var day = today.getDay;  if (day === 0||day === 1){    if(mw.config.get("wgPageName") === "Special:Watchlist") {    var eotwDiv = document.createElement("div");    eotwDiv.innerHTML = 'Reminder: Congratulate  Editor of the Week.';    eotwDiv.className = "hatnote";    $("#contentSub").after(eotwDiv);    eotwDiv.setAttribute( "id", "EOTW-reminder" );    }  } });

function addDismissButtonReminder { var eotwReminder = document.getElementById("EOTW-reminder"); if ( eotwReminder === null ) return; if ( document.cookie.indexOf( "hideeotwreminder=yes" ) != -1 ) { eotwReminder.style.display = "none"; }

var Button    = document.createElement( "span" ); var ButtonLink = document.createElement( "a" ); var ButtonText = document.createTextNode( "dismiss" );

ButtonLink.setAttribute( "id", "dismissButtonReminder" ); ButtonLink.setAttribute( "href", "javascript:dismissEotwReminder;" ); ButtonLink.setAttribute( "title", "dismiss(session)" ); ButtonLink.appendChild( ButtonText );

Button.appendChild( document.createTextNode( "[" ) ); Button.appendChild( ButtonLink ); Button.appendChild( document.createTextNode( "]" ) );

eotwReminder.appendChild( Button ); }

function dismissEotwReminder { document.cookie = "hideeotwreminder=yes; path=/"; var eotwReminder = document.getElementById("EOTW-reminder"); eotwReminder.style.display = "none"; }

$( addDismissButtonReminder );