MediaWiki:ChapterCountdown.js

/* Next chapter release countdown clock */ // Takes the current month and year var monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; var month = monthNames[new Date.getMonth]; var year = new Date.getFullYear; // Generates the countdown var countdown = ' ' +        ' Only ' + month + ' 08 ' + year + ' 16:00:00 -0700 for the chapter\'s official release! ' +       ' This month\'s chapter has been released! ' +   ' '; // Appends it to the (to load faster and as a standard initial placement) $('body').append(countdown); // Moves it to different places accordingly if (mw.config.get('wgNamespaceNumber') === 1201) { // Above message box in threads $('.new-reply').prepend($('#chapter-countdown')); } else if (mw.config.get('wgNamespaceNumber') === 1200) { // Above message box in Message Walls $('#chapter-countdown').prependTo($('#wall-new-message, .new-reply')); } // Below Visual Editor $('.wikia-menu-button').click(function {   setTimeout(function { $('#WikiaArticle').prepend($('#chapter-countdown')); }, 7000); });