User:Penguin-Pal/wikia.js/tparchive.js

/* insert talk page notices if talk page length is 27,750 bytes or more */

$("document").ready(function {	if ($('header#WikiaHeader [data-id="mytalk"]').attr("href").search(/^\/wiki\/Message_Wall:/g) > -1) {		$.getJSON("/api.php?action=query&format=json&prop=revisions&titles=User_talk:Penguin-Pal&rvprop=content&cb=" + new Date.getTime, function(info) { talkPageContent = info.query.pages; for (var first in talkPageContent) { var myTalkPageId = first; talkPageContent = talkPageContent[myTalkPageId].revisions[0]["*"]; if (typeof talkPageContent === "string" && talkPageContent.length >= 27750) { $("header#WikiaHeader").prepend(' \n\						Note! \n\						 \n\							Your current talk page size is getting near 30,000 bytes. The current page size is ' + talkPageContent.length + ' bytes long. Please consider archiving it ASAP.\n\						 \n\					 '); }			}		});	} });