/

// <!--

// //Wikia.AbTestConfig = {};

$(function { if (mw.config.get('wgTitle') != mw.config.get('wgPageName').replaceAll("_", " ")) $("title").html(mw.config.get('wgTitle')+" "+$("title").html);

// $(".diff-addedline").each(function{ $(this).html($(this).html.replace(/&/g, "&amp;")) }) // $(".diff-deletedline").each(function{ $(this).html($(this).html.replace(/&/g, "&amp;")) })

$(".action-edit #WikiaRailWrapper").css({"display":"none"});

if (mw.config.get("wgPageName") == "Special:UnusedFiles") $('.gallerytext a').each(function { $(this).text($(this).attr('title').replace('File:', '')) })

$('.mw-editsection a').each(function { $(this).attr('href', $(this).attr('href').replace('&section=', '&NoFuckingSectionEditingThanks=')) }); //Because wikia doesn't test for when they mess something up.

if($("#wpTextbox1").length) { if ($("#categories").attr("value")) $.each(JSON.parse($("#categories").attr("value")), function(k, v) {     $("#wpTextbox1").val($("#wpTextbox1").val+"\n["+"["+v.namespace+":"+v.name+(v.sortkey?"|"+v.sortkey:"")+"]]");    }); $("#categories").attr("value",""); // $(".module_categories").remove; // $("#CategorySelectAdd").remove; $("#wpTextbox1").focus; $("#wpTextbox1")[0].setSelectionRange(0, 0); } // $(window).on('scroll', SRWscroll ); // $('.scroller').on('scroll', SRWscroll );

// $(".hiddencats").appendTo(".EditPageRail .rail-auto-height"); /* $(".mw-logline-renameuser .comment").each(function{	if ($("a", this).length) return;	var renameparts = $(this).html.split('"');	$(this).html('(The user '+renameparts[1]+' has been renamed to '+renameparts[3]+'.)');  });

$(".mw-contributions-user-tools").append(" IP info "); $(".mw-special-Block #mw-content-text form").before(" IP info "); });

function SRWscroll { if (typeof ImgLzy != "undefined") ImgLzy.onScroll; }

window.debug452 = function(out, alert) { if (mw.config.get("wgUserName") == "452") { if ( ["object", "null", "function"].indexOf(typeof out) == -1) console.log(new Date.toJSON+" "+out); else { console.log(new Date.toJSON+" object..."); console.log(out); } if (typeof alert != "undefined") window.alert(out); } }

/*

get fucked, you incompetent thieving piece of shit.



if (typeof SRWpopup != "function") { window.SRWpopup = function(popupid, title, message, type) { $("#"+popupid).remove; $("body").append(' X '+title+'   '); $("#"+popupid+' .popupContent').append(message);

$("#"+popupid)[0].adjustTop = function { var calctop = $(window).scrollTop + (($(window).height - $("#"+popupid).outerHeight) / 2); $("#"+popupid).css("top", calctop>0?calctop:0); $("#"+popupid+" .popupWrapper").css("margin-top", Math.max((($(window).height - $("#"+popupid+" .popupWrapper").outerHeight) *0.50), 50)); }   $("#"+popupid)[0].adjustTop; $("#"+popupid).prepend(' '); $("#"+popupid+" .popupBackground").on("click", function{ $("#"+popupid).remove }); $("#"+popupid+" .close").on("click", function{ $("#"+popupid).remove }); } $('head').append('.WikiaArticle.popupContent {  border-radius: 0;}\n.scroller table, .popupContent table {  margin: 0 !important;}\n.throbber {  background: url(https://static.wikia.nocookie.net/saintsrow/images/0/05/Ajax.gif) no-repeat center white;  height: 100%;  left: 0;  opacity: 0.50;  position: fixed;  top: 0;  width: 100%;  z-index: 5000000;  background-position-y: calc(50% - 5em) !important;  background-size: 4em;}\n.longPopup {   overflow:auto;  border-top:1px dashed #BFBFBF;  border-bottom:1px dashed #BFBFBF;}\n.popupOverlay .popupWrapper.success { border: 5px solid green; }\n.popupOverlay .popupWrapper.confirm { border: 5px solid green; }\n.popupOverlay .popupWrapper.error { border: 5px solid red; }\n.popupOverlay {  width: 100%;  height: 100%;  position: absolute;  z-index: 5001102;}\n.popupOverlay .popupBackground {  background: black;  height: 100%;  opacity: 66%;  position: fixed;  width: 100%;  top:0;}\n.popupOverlay .popupWrapper {  box-shadow: 0 10px 60px 0 grey;  background: #ffffff;  border: 5px solid black;  color: #3a3a3a;  height: auto;  box-sizing: border-box;  margin: auto;  margin-bottom: 5em;  width: calc(100% - 100px);  width: fit-content;  position: relative;  left: initial;  top: initial;  z-index: initial;}\n.popupOverlay .popupWrapper > h1 {  margin: 1em 1em 1em 1em;  overflow: hidden;}\n.popupOverlay .popupWrapper .close {  float: right;  margin: 0.5em;}\n.popupOverlay .popupWrapper table.popout .toggle-expand, .popupOverlay .popupWrapper table.popout .toggle-collapse {  display:none;}\n.popupOverlay .popupWrapper table.popout tr {  display: table-row !important;}\n.popupOverlay .popupWrapper .popupContent {  margin:20px;  min-height: auto;}\n.popupContent .mw-customtoggle, .popupContent .mw-collapsible-toggle {  cursor: default;} '); }

$(function { // Wikia.AbTestConfig = {};  if (typeof $.cookie == "function") {    $.cookie("Geo", '{"region":"XX","country":"XX","continent":"XX"}', {expires:1000,path:'/'});    $.cookie("cpBenefitsModalShown", "fuck off", {expires:1000,path:'/', domain:'.wikia.com'});    $.cookie("openTabsNumber", "fuck off", {expires:1000,path:'/', domain:'.wikia.com'});    $.cookie("pageviewsInSession", "fuck off", {expires:1000,path:'/', domain:'.wikia.com'});    $.cookie("wikia_beacon_id", "fuck off", {expires:1000,path:'/', domain:'.wikia.com'});    $.cookie("pv_number", "fuck off", {expires:1000,path:'/', domain:'.wikia.com'});    $.cookie("tracking_session_id", "fuck off", {expires:1000,path:'/', domain:'.wikia.com'});    $.cookie("pv_number_global", "fuck off", {expires:1000,path:'/', domain:'.wikia.com'});    $.cookie("cpBenefitsModalShown", "fuck off", {expires:1000,path:'/', domain:'.fandom.com'}); $.cookie("openTabsNumber", "fuck off", {expires:1000,path:'/', domain:'.fandom.com'}); $.cookie("pageviewsInSession", "fuck off", {expires:1000,path:'/', domain:'.fandom.com'}); $.cookie("wikia_beacon_id", "fuck off", {expires:1000,path:'/', domain:'.fandom.com'}); $.cookie("pv_number", "fuck off", {expires:1000,path:'/', domain:'.fandom.com'}); $.cookie("pv_number_global", "fuck off", {expires:1000,path:'/', domain:'.fandom.com'}); $.cookie("tracking_session_id", "fuck off", {expires:1000,path:'/', domain:'.fandom.com'}); $.cookie("wkch_val_recommendations_blacklist", "fuck off", {expires:1000,path:'/', domain:'.fandom.com'}); $.cookie("fuck%20off_basset", "fuck off", {expires:1000,path:'/', domain:'.fandom.com'}); $.cookie("localStorageTestItem", "fuck off", {expires:1000,path:'/', domain:'.fandom.com'}); $.cookie("silver-surfer-galactus-fallback-user-profile-v2_fuck%20off", "fuck off", {expires:1000,path:'/', domain:'.fandom.com'}); $.cookie("silver_surfer_actions_v2", "fuck off", {expires:1000,path:'/', domain:'.fandom.com'}); $.cookie("silver_surfer_interactions_v2", "fuck off", {expires:1000,path:'/', domain:'.fandom.com'}); $.cookie("silver_surfer_tracking_key_v2", "fuck off", {expires:1000,path:'/', domain:'.fandom.com'}); localStorage.setItem( 'wkch_val_recommendations_blacklist', "fuck off");

} $("#lu-table_length select").append($(" ").val(1000).html(1000)); $("*[disabled]:not(option)").attr("disabled",false);

$("#WikiaBar .tools").prepend(' Links');

// $("#Recentchangestext").append(" &bull; Maintenance Report "); // $("#Recentchangestext").append(" &bull; Maintenance</a>");

if($("#mw-imagepage-nofile").length && !$("#filelogs").length) { $("#mw-imagepage-nofile").append(" "); $.getJSON('/api.php', {	'action': 'query',	'list': "logevents",	'format': "json",	'leprop':"timestamp|user|type|parsedcomment|details",	'letitle': mw.config.get("wgPageName"),   }, function( data ) {        if (!$("#filelogs:empty").length) return; //redundant race condition check        $("#filelogs").append($("#ca-undelete")); //copy existing undelete link

for (i in data.query.logevents) { $("#filelogs").append(" "+data.query.logevents[i].timestamp+" - "+data.query.logevents[i].action+"/"+data.query.logevents[i].type+" - "+data.query.logevents[i].user); if (data.query.logevents[i].parsedcomment) $("#filelogs").append(" - "+data.query.logevents[i].parsedcomment); if (data.query.logevents[i].move) $("#filelogs").append(" : <a href='./"+escape(data.query.logevents[i].move.new_title)+"'>"+data.query.logevents[i].move.new_title+"</a>"); }   });  }

$("#mw-whatlinkshere-list li>a").each(function {   if($(this).attr("href").indexOf("Thread") != -1) return;    $(this).before(" (<a href='"+ $(this).attr("href")+(($(this).attr("href").indexOf("?") != -1)?"&":"?")+"action=edit'>edit</a>) ");  });

$("#WikiaArticle a[href$='/wiki/']").each(function {   $(this).attr("href", $(this).attr("href").replace("/wiki/", "/"));  });

$("head").append(''); });

/* Custom "NewFilesModule" by 452 (with fixes by JoshuaJSlone) This script displays Special:NewFiles in the right rail There are three ways to use this, by setting the NewFilesModuleCompact variable 0 - Normal, width is 212 1 - Compact, width is 106 2 - Random, if you're not sure which version you like best.

In both modes, hovering over each displays the uploader info.

NewFilesModuleCount can be used to specify the number of displayed images. ...at least it used to. Apparently this number is now ignored. var NewFilesModuleCompact = 0; //must be 0, 1, or 2. var NewFilesModuleCount = 13; //any integer

if ($('#WikiaRail').length) { //only on pages where the rail is present $('#WikiaRail').on('DOMNodeInserted', function(event) { //fires after lazy-loading takes place.	if ($('#WikiaRail section').length && !$("#NewFilesModule").length) {	 // Only add it once	  $('#WikiaRail>section:last-of-type').after("<section id='NewFilesModule' class='module loading'> <a href='/Special:NewFiles'>New Files</a><a style='float:right' href='/Special:Upload'> Upload");	  $.get("/Special:NewFiles", function(NewFilesPage) { $("#NewFilesModule").removeClass("loading"); if (!$('.wikia-gallery', NewFilesPage).length) { console.log("No NewFiles list."); return; }

$('.wikia-gallery', NewFilesPage).html($('.wikia-gallery', NewFilesPage).html.replace(/\/scale-to-width\/\d*\?/g, "/scale-to-width/212?").replace(/\/scale-to-width-down\/\d*\?/g, "/scale-to-width-down/212?")); $("#NewFilesModule").append(' '); $(".wikia-gallery-item", NewFilesPage).each(function {		 $(".lightbox-caption", this).prepend($("").attr("href",$(".gallery-image-wrapper>a", this).attr("href")).html($(".gallery-image-wrapper>a", this).attr("title")).append($(" ")));		  $("#NewFilesModule .wikia-gallery").append(this);		}); });

if (!$("#NewFilesModuleCSS").length) $('head').append('<style type="text/css" id="NewFilesModuleCSS">\n#NewFilesModule #gallery- { position:relative;overflow-y:auto; clear: both; text-align:center; height:452px; }\n#NewFilesModule #gallery-:hover {padding-bottom: 100%; }\n#NewFilesModule .gallery-image-wrapper { top: 0 !important; left: 0 !important; width: auto !important; height: auto !important; border:none; background: none; }\n#NewFilesModule.compact .gallery-image-wrapper { width: auto !important; }\n#NewFilesModule .thumb { height:auto !important; width: fit-content !important; }\n#NewFilesModule .wikia-gallery-item { margin: 1px !important; padding: 0 !important; height: auto !important; border: none !important; }\n#NewFilesModule.compact .wikia-gallery-item { width: auto !important; }\n#NewFilesModule .wikia-gallery-item .lightbox-caption { display: none; }\n#NewFilesModule .wikia-gallery-item:hover .lightbox-caption { display:block; padding: 5px; margin:0 1em; position: absolute; border: 1px solid; background-color: #fff; z-index: 2; right: 0;  width: calc(100% - 2em) !important; }\n#NewFilesModule h2 {margin: 0 2em 0 0;}\n#NewFilesModule h2 a:first-child {color:inherit;}\n#NewFilesModule img { display: block; height: auto !important; width: auto !important; margin: auto !important; }\n#NewFilesModule .wikia-gallery-item .gallery-image-wrapper a { width: auto !important; height: auto !important; }\n#NewFilesModule .wikia-gallery-item .gallery-image-wrapper a.image-no-lightbox { line-height: normal; display: block; padding: 1em; }\n@media only screen and (max-width: 1023px) {#NewFilesModule {display:none;}}\n#NewFilesModule.loading h2:after {content: "Loading";font-size: xxx-large;width: 300px;margin-top: 1em;display: block;}\n#NewFilesModule.loading {min-height: 10em;}\n '); } /* End of custom "NewFilesModule" */ }); //end of DOMNodeInserted block  $('#WikiaRail').trigger('DOMNodeInserted'); //Prevent race condition by firing the event. } /* End of custom "NewFilesModule " */

//Restore ogg_player info link click - Wikia has been informed of this problem, and the cause. $(".ogg_player a.image").each(function{ $(this).off("click").on("click", function { window.open($(this).prop("href"));  }); })

function toggleCSS {$("link[rel='stylesheet'][href*='modules=site']").attr( "disabled",function(idx, oldAttr){return !oldAttr;});$(window).trigger('resize');} function toggleUserCSS { $("link[rel='stylesheet'][href*='modules=user']").attr("disabled",function(idx,oldAttr){return!oldAttr;}); $("link[rel='stylesheet'][href*='modules=site']+style").attr( "media",function(idx, oldAttr){return oldAttr=="none"?"all":"none" }); $(window).trigger('resize'); }

$(function {  /* use monobook when editing CSS/JS pages. */  if (!$("#toggleCSS").length) $("#WikiaBarWrapper .toolbar .tools").append("<a id='toggleCSS' href='javascript:toggleCSS'>Toggle CSS</a></li><a href='javascript:toggleUserCSS'>Toggle User CSS</a></li>");

if (mw.config.get("wgCityId") == 4470) return; if ((mw.config.get("wgPageName").substr(-3) == ".js") || (mw.config.get("wgPageName").substr(-4) == ".css")) { $("a[href*='.js?action=edit'], a[href*='.css?action=edit']").each(function{     $(this).attr("href", $(this).attr("href").replace('?action=edit', '?action=edit&useskin=monobook&usesitecss=0'));    }); if (mw.util.getParamValue('action') == "edit") { if (!mw.util.getParamValue('useskin') ) { window.location.href = window.location.href.replace('?action=edit','?action=edit&useskin=monobook&usesitecss=0'); } else { $("#editform").attr("action", $("#editform").attr("action")+"&useskin="+mw.util.getParamValue('useskin')); }   }  } });

$(function { //  console.log("start of welcome block");

/* Race condition solution:

*RecentChangesUpdate always exits by triggering RecentChangesComplete *RecentChangesComplete checks RCfirstloadStatus, then calls RCfirstload or InitWelcome *If RecentChangesUpdate is complete before trigger is set, RCfirstload is called *RCfirstload loads log, then calls InitWelcome. No Race: RCfirstload is always after RecentChangesComplete. *InitWelcome triggers WelcomeComplete. No Race: InitWelcome is is always after RecentChangesComplete. *WelcomeComplete removes log, and sets RCfirstloadStatus. No Race: WelcomeComplete is always last.

*When the welcome script is ready, either RecentChangesComplete has been called, or has not been called. *When RecentChangesComplete is triggered, either the welcome script is either ready or not ready */

window.RCfirstloadStatus = "initial"; window.RCnope = 0;

$(document).on('RecentChangesComplete', function{    if (window.RCnope) return; //   console.log("RecentChangesComplete with RCfirstloadStatus="+RCfirstloadStatus);

if (RCfirstloadStatus == "running") { console.log("!! This is impossible. RCfirstloadStatus ="+RCfirstloadStatus); // setTimeout(function{ alert("This is impossible."); }, 4000); //unfortunately, this is apparently not impossible. likely because of both scripts running at once. }  if (RCfirstloadStatus == "initial") RCfirstload(" RC=complete, firstload="+RCfirstloadStatus); else if (RCfirstloadStatus == "complete") initWelcome(" RC=complete, firstload="+RCfirstloadStatus) });

$(document).on('WelcomeComplete', function{  $(document).off('WelcomeComplete');   if (RCfirstloadStatus != "running") setTimeout(function{ alert("This is impossible. "+RCfirstloadStatus); }, 4000);

if ($(".mw-changeslist>div>ul").length) { console.log("WelcomeComplete - everything is fine. Removing log"); $(".mw-changeslist>div>ul").remove; } else { debug452("WelcomeComplete without log? - "+RCfirstloadStatus+ " (running?) - "+$(".mw-changeslist>div>ul").length+" (1?)",1); }  RCfirstloadStatus = "complete"; });

window.RCfirstload = function(source) { if (window.RCnope) return; if (mw.config.get("wgCityId") != 4470) return; // if (source) console.log("RCfirstload "+source); RCfirstloadStatus = "running"; $.get(window.location.origin+"/wiki/Special:Log", function(newRClog) {   $(".mw-changeslist div").eq(0).prepend($("#mw-content-text>ul",newRClog));    if(!$(".mw-logline-newusers", newRClog).text) console.log("There are no new users");    initWelcome("RCfirstload "+source);  }); }

window.initWelcome = function(source) { if (window.RCnope) return; if (mw.config.get("wgCityId") != 4470) return; // console.log("initWelcome "+source); if (["Special:RecentChanges","Special:Log"].indexOf(mw.config.get("wgPageName")) == -1) return;

$('span[data-uncrawlable-url]').off.each(function {    $(this).replaceWith($(this).prop('outerHTML').replace("span", "a"));  }); $('a[data-uncrawlable-url]').off.each(function {    $(this).attr('href', window.atob($(this).attr('data-uncrawlable-url')));  });

var delay = 800, tempdelay = 0; var welcome = { userpage:'', talkpage:'', users:[], talks:[], queue:function(what) { if ($(what).attr("href") && !$('a.alreadydone[href*="'+ $(what).attr("href") +'"]').length) { who = $(what).attr("href").replace("/wiki/","").replace("User:","").replace("User_talk:","").replace("\?action=edit&redlink=1",""); if (-1 == welcome.users.indexOf(who)) { welcome.users.push(who);      console.log("queue "+who); } }   }  };

debug452($(".mw-changeslist-line .new.mw-userlink").length+" "+$(".mw-logline-newusers .new.mw-userlink").length +" "+  $(".mw-logline-newusers .new.mw-usertoollinks-talk").length+" "+  $(".mw-logline-useravatar .new.mw-usertoollinks-talk").length +" "+ $(".mw-changeslist-line:not('.mw-changeslist-log-block') .new.mw-usertoollinks-talk").length +" "+$(".mw-changeslist-line:not('.mw-changeslist-log-block') .mw-anonuserlink").length) $(".mw-changeslist-line .new.mw-userlink").each(function{ welcome.queue(this); }); $(".mw-logline-newusers .new.mw-userlink").each(function{ welcome.queue(this); }); $(".mw-logline-newusers .new.mw-usertoollinks-talk").each(function{ welcome.queue(this); }); $(".mw-logline-useravatar .new.mw-usertoollinks-talk").each(function{ welcome.queue(this); }); $(".mw-changeslist-line:not('.mw-changeslist-log-block') .new.mw-usertoollinks-talk").each(function{ welcome.queue(this); });

$(".mw-changeslist-line:not('.mw-changeslist-log-block') .mw-anonuserlink").each(function{   if (-1 == welcome.users.indexOf($(this).attr("href").replace("/wiki/Special:Contributions/",""))) {      if (!$('a.alreadydone[href*="'+ $(this).attr("href").replace("/wiki/Special:Contributions/","") +'"]').length) {

//if anons welcomes are broken, it's this.

welcome.users.push($(this).attr("href").replace("/wiki/Special:Contributions/","")); //if anyone gets skipped, check this. }   }  });

if (mw.config.get("wgCityId") != 4470) { console.log(welcome.users); console.log("welcome script exiting. "+source); $(document).trigger('WelcomeComplete'); return; }

if (welcome.users.length) { $.get(mw.util.getUrl('MediaWiki:Welcome-user-page', {action: 'raw'})).done(function (data) {     welcome.userpage = data;      welcomeContinue(source);    }); $.get(mw.util.getUrl('MediaWiki:Welcome-message-user', {action: 'raw'})).done(function (data) {     welcome.talkpage = data;      welcomeContinue(source);    }); } if(!welcome.users.length) { console.log("none to welcome "+source); $(document).trigger('WelcomeComplete'); //   welcomeContinue(source); //has to run the cleanup script. }

function welcomeContinue(source) { if (welcome.users.length && (!welcome.userpage.length || !welcome.talkpage.length)) return; tempdelay = 0; if (welcome.users.length) { if ($('a.alreadydone[href*="'+ welcome.users[0] +'"]').length) { console.log('welcomeContinue alreadydone: a[href*="'+ welcome.users[0] +'"]'); welcome.users.shift; welcomeContinue(source); return; }

} else { console.log("all welcomed ! "+source); $(document).trigger('WelcomeComplete'); return; }   if (source) console.log("welcomeContinue "+source); new mw.Api.post({	'format': 'json',	'action': 'edit',       'createonly': '1',        'recreate':1,        'bot':1,        'minor':1,        'summary': 'Automated Welcome',	'title': decodeURIComponent("User_talk:"+welcome.users[0]),	'token': mw.user.tokens.get('editToken'),	'text': welcome.talkpage.replace("|page=$1","").replace("$4","")    }) .done(function(result) {     if (!result.error) {        new mw.Api.post({ 'format': 'json', 'action': 'edit', 'createonly': '1', 'recreate':1, 'bot':1, 'minor':1, 'summary': 'Automated user page creation', 'title': decodeURIComponent("User:"+welcome.users[0]), 'token': mw.user.tokens.get('editToken'), 'text': welcome.userpage })       .done(function(result) { console.log('Welcomed: "'+welcome.users[0]+'"');

if (welcome.users.length) welcome.users.shift

$('a.new.mw-usertoollinks-talk[href*="' +welcome.users[0]+'"]').removeClass("new"); $('a.new.mw-userlink[href*="' +welcome.users[0]+'"]').removeClass("new"); })     } else {        if (result.error && result.error.info) {          console.log('Error: "'+welcome.users[0]+ '" - '+result.error.info);        } else {          console.log('Error: "'+welcome.users[0]+ '" - Unknown Error');          console.log(result);        }      }      setTimeout(welcomeContinue,delay);    }) .fail(function(code, failed) {     if (code == "ratelimited") delay += 100; tempdelay = delay;

if (failed.error && failed.error.info) { console.log('Failed: "'+welcome.users[0]+ '" - '+code+' : '+failed.error.info+ ' - delay:' + delay);

if (["invalidtitle", "articleexists"].indexOf(code) != -1) { $('a[href*="'+ welcome.users[0]+'"]').addClass("alreadydone"); console.log('alreadydone: a[href*="'+ welcome.users[0]+'"]'); if (welcome.users.length) welcome.users.shift; }

} else if (failed.textStatus) { console.log('Failed: ('+code+') textStatus: '+failed.textStatus+' - "'+welcome.users[0]+'"'); } else { console.log('Failed: "'+welcome.users[0]+'" ('+code+') - Unknown Error'); }     console.log(failed);

if(code == "badtoken") { console.log("Getting new token...");

$.ajax({         type: "POST",          url: "/api.php",            data: {            format: "json",            action: "query",            titles: '452',            prop: 'info',            intoken: 'edit',          },          'success': function(result) {            console.log("Got new token.");            mw.user.tokens.set("editToken", result.query.pages[Object.keys(result.query.pages)].edittoken);            setTimeout(welcomeContinue,delay+tempdelay);          }        }); } else { setTimeout(welcomeContinue,delay+tempdelay); }   }); //api  } //welcomeContinue } //initWelcome

if ("Special:Log" == mw.config.get("wgPageName")) { $(document).off('WelcomeComplete'); initWelcome("from log"); }

if ("Special:RecentChanges" == mw.config.get("wgPageName")) { if (RCfirstloadStatus != "initial") { console.log("!! This is impossible. RCfirstloadStatus ="+RCfirstloadStatus); setTimeout(function{ alert("This is impossible."); }, 4000); }  if ($("#RCUbutton").attr("title")) { RCfirstload("RC already complete"); } } });

/* add powerusers checkbox to Special:Listuers */ if (mw.config.get("wgCanonicalSpecialPageName") == "Listusers") $("fieldset.lu_fieldset tr:last-child").prepend('<td valign="middle" style="padding:0px 2px 0px 1px;"><label for="checkBoxForpoweruser"> <input type="checkbox" name="lu_target" class="lu_target" value="poweruser" checked="checked" id="checkBoxForpoweruser"> Power Users ');

if ($("#UserProfileMasthead").length) $("#UserProfileMasthead .tally em").wrap($("").attr("href", "/wiki/Special:EditCount/"+$("#UserProfileMasthead h1[itemprop=name]").html));

if (mw.config.get("wgCanonicalNamespace") == "Special") $(".WikiaArticle ul:not(.counted)").each(function{ if ($(">li", this).length != 50 && $(">li", this).length > 15) $(this).addClass("counted").before(" Displaying "+$(">li", this).length+" ");  });

if ($(".WikiaPageHeaderDiffHistory").length && $(".wikia-button[data-id=edit]").length) { /* change the "edit" link of a diff page to edit the current version, as there is already an edit link for both diffs */ oldhref = $(".wikia-button[data-id=edit]").attr("href"); var newhref = oldhref.split("&oldid=")[0]; $(".wikia-button[data-id=edit]").attr("href", newhref); } if (!$("#ca-diff").length && $("#ca-history").closest("ul").length) { //adapted from NullEditButton script $("#ca-history").closest("ul").prepend($('').html( $('<a/>').attr({     href: $("li>#ca-history").attr("href").replace("action=history", "diff=cur"),      accesskey: "0",      id: "ca-diff",      title: mw.config.get('wgPageName')    }).text("Last diff").click(function{      if (!$("#diffstylefull").length) $('head').append(' table.diff{border:none;border-spacing:4px;margin:0;width:100%; table-layout:fixed}table.diff td{padding:0.33em 0.5em}table.diff td.diff-marker{ padding:0.25em}table.diff col.diff-marker{width:2%}table.diff col.diff-content{width:48%}table.diff td div{ word-wrap:break-word}td.diff-otitle,td.diff-ntitle{text-align:center}td.diff-lineno{font-weight:bold}td.diff-marker{text-align:right;font-weight:bold;font-size:1.25em;line-height:1.2}td.diff-addedline,td.diff-deletedline,td.diff-context{word-break: break-word;font-size:88%;line-height:1.6;vertical-align:top;white-space:-moz-pre-wrap;white-space:pre-wrap;border-style:solid;border-width:1px 1px 1px 4px;border-radius:0.33em}td.diff-addedline{border-color:#a3d3ff;color:#2d2d2d}td.diff-deletedline{border-color:#ffe49c;color:#2d2d2d}td.diff-context{background-color:#f7f7f7;border-color:#e6e6e6;color:#2d2d2d}.diffchange{font-weight:bold;text-decoration:none}.diffchange-inline{color:#2d2d2d}td.diff-addedline .diffchange,td.diff-deletedline .diffchange{border-radius:0.33em;padding:0.25em 0}td.diff-addedline .diffchange{background:#d8ecff}td.diff-deletedline .diffchange{background:#feeec8} .diff-currentversion-title,.diff{direction:ltr;unicode-bidi:embed} .diff-contentalign-right td{direction:rtl;unicode-bidi:embed} .diff-contentalign-left td{direction:ltr;unicode-bidi:embed}.diff-multi,.diff-otitle,.diff-ntitle,.diff-lineno{direction:ltr !important;unicode-bidi:embed}');

var request = { format: 'json', action: 'compare', torelative : "prev", prop: "diff", fromtitle: mw.config.get('wgPageName') //       token: mw.user.tokens.get("editToken"), }     new mw.Api.post(request).done(function(result) {        diffhtml = result.compare['*'];

SRWpopup("ModalDiff","Last Diff",diffhtml); });     return false;    }) )) }

if ((mw.config.get("wgNamespaceNumber") == 1201) && !$(".msg-title a").text) { $("ul.replies").prepend("<h1 class='center'><a href="+$(".msg-title a").attr("href")+">Link to parent thread</a> </li>"); } if ($(".SpeechBubble.message").length && mw.config.get("wgNamespaceNumber") != 1200) { $(".SpeechBubble.message").each(function{		if ($(this).attr("id") != 1) $(".msg-toolbar .timestamp", this).append("(<a href='/wiki/Thread:"+$(this).attr("data-id")+"'>link</a>)");		if(typeof $(this).attr("data-id") == "undefined") return;		$(".msg-toolbar .timestamp", this).attr("id","id"+$(this).attr("data-id"));		$.getJSON('/api.php?action=query&format=json&pageids='+$(this).attr("data-id")+'&requestid='+$(this).attr("data-id"), function(results) { $("#id"+results.requestid).append(" (<a href='/wiki/"+results.query.pages[results.requestid].title.replace(/ /g,"_")+"?diff=curr'>real</a>)"); if (!$(".page-header__page-subtitle").length) { $(".page-header__title").after('<div class="page-header__page-subtitle"> &lt; <a href="/'+results.query.pages[results.requestid].title.split("/")[0].replace("Thread", "Message_Wall")+'">'+results.query.pages[results.requestid].title.split("/")[0].split(":")[1]+'\'s Wall</a> '); }		});	}); }

/* Add countdown to cached special pages. Uses some of /countdown.js */ if (mw.config.get("wgNamespaceNumber") == -1) { var datestring = $('*:contains("The following data is cached, and was last updated")'); if (datestring.length && !$("#UpdateCountdown").length) { founddate = datestring[datestring.length-1].innerHTML.match(/updated (.*). A/)[1]; now = new Date; now_utc = new Date(now.getUTCFullYear, now.getUTCMonth, now.getUTCDate, now.getUTCHours, now.getUTCMinutes, now.getUTCSeconds); then = new Date(founddate.split(",")[1]+ " "+founddate.split(",")[0]); next = new Date(then.getTime+(24*60*60000)); diff = count=Math.floor((next.getTime-now_utc.getTime)); if (diff > 0) { var left = diff>86400000?(new Date(diff).toISOString.substr(8, 2) - 1)+" days, ":""; left += new Date(diff).toISOString.substr(11, 8);

$(datestring[datestring.length-1]).append(" Time left until next update: "+left+" "); } else $(datestring[datestring.length-1]).append(" The special page cache update is overdue. "); } } //end special pages countdown

var nocache = new URLSearchParams(window.location.search).has("nocache"); //direct cross-wiki cache-busting isn't possible, neither with # or ? //But we can randomise the load order to bust the cache.

window.DragDropUploader = true; var loadUserScripts = new Array;

loadUserScripts.push('u:u3403151:user:452/PageLookup');            //UCP updated loadUserScripts.push('u:u3403151:user:452/MassNullEdit');          //UCP updated loadUserScripts.push('u:u3403151:user:452/FileLookup');            //UCP working loadUserScripts.push('u:u3403151:user:452/Maintenance');           //UCP updated

//if (mw.config.get("wgCityId") == 4470) loadUserScripts.push('u:u3403151:user:452/SaintsRow');

if(mw.config.get("wgPageName") == "Special:RecentChanges") {

loadUserScripts.push('u:u3403151:user:452/RecentChangesUpdate'); //UCP updated

} else if ($("#mw-upload-form").length) {

loadUserScripts.push('u:u3403151:user:452/DragDropUploader');    //UCP working

} else if (mw.config.get("wgIsEditPage") != null      || (["edit", "submit"].indexOf(new URLSearchParams(window.location.search).get("action")) != -1)       || mw.config.get("wgPageName") == "Special:CreateBlogPage" ) {

loadUserScripts.push('u:sr:MediaWiki:Common.js/htmlentities.js'); //UCP updated loadUserScripts.push('u:u3403151:user:452/editHelper');      //UCP updated /*   $.ajax({      url: "https://saintsrow.fandom.com/index.php?title=MediaWiki:Common.js/htmlentities.js&action=raw&ctype=text/javascript",      dataType: 'script',      cache: true    }).done(function  { console.log("htmlentities loaded, now loading edithelper.")      $.ajax({ url: "https://u:u3403151.fandom.com/index.php?title=user:452/editHelper&action=raw&ctype=text/javascript", dataType: 'script', cache: true }).done(function { console.log("edithelper loaded.") });   });

} else { loadUserScripts.push('u:u3403151:user:452/TinyEditor');                                    //UCP needs update. //User:452/stdSummaries                                         - for tinyedit - not UCP updated //User:452/stdTemplates                                        - for tinyedit - not UCP updated

loadUserScripts.push('u:u3403151:user:452/PageRefresh');       //UCP updated loadUserScripts.push('u:u3403151:user:452/View_Source');          //UCP updated // loadUserScripts.push('u:u3403151:user:452/AutoEditDropdown');    //UCP redundant? // loadUserScripts.push('u:u3403151:user:452/RevealAnonIP');                                 //necessary - requires UCP fix loadUserScripts.push('u:u3403151:user:452/AjaxBatchDelete');      //UCP updated loadUserScripts.push('u:u3403151:user:452/AjaxBatchUndelete');    //UCP updated

}

if (nocache) { for(var cachebuster=0;cachebuster < (Math.floor(Math.random*10)+10);cachebuster++) loadUserScripts.push(''); loadUserScripts.sort(function { return 0.5 - Math.random }); }

//importArticles({ type: 'script', articles: loadUserScripts });

loadUserScripts.forEach(function(v){ vArr = v.split(":");  vArr.shift;  vW = vArr.shift;  vPage = vArr.join(":");  console.log("loading "+vPage+" from "+vW);

if (vW == "sr") vW = "saintsrow";

importScriptPage(vPage, vW); });

$(document).on('readystatechange', function {   debug452("readyState (452/452): '"+document.readyState+"'");    if (document.readyState == "complete") {      //Wikia.AbTestConfig = {};      if (typeof $.cookie == "function") {        $.cookie("Geo", '{"region":"XX","country":"XX","continent":"XX"}', {expires:1000,path:'/'});        $.cookie("cpBenefitsModalShown", "fuck off", {expires:1000,path:'/', domain:'.wikia.com'});        $.cookie("openTabsNumber", "fuck off", {expires:1000,path:'/', domain:'.wikia.com'});        $.cookie("pageviewsInSession", "fuck off", {expires:1000,path:'/', domain:'.wikia.com'});        $.cookie("wikia_beacon_id", "fuck off", {expires:1000,path:'/', domain:'.wikia.com'});        $.cookie("pv_number", "fuck off", {expires:1000,path:'/', domain:'.wikia.com'});        $.cookie("tracking_session_id", "fuck off", {expires:1000,path:'/', domain:'.wikia.com'}); $.cookie("pv_number_global", "fuck off", {expires:1000,path:'/', domain:'.wikia.com'}); $.cookie("cpBenefitsModalShown", "fuck off", {expires:1000,path:'/', domain:'.fandom.com'}); $.cookie("openTabsNumber", "fuck off", {expires:1000,path:'/', domain:'.fandom.com'}); $.cookie("pageviewsInSession", "fuck off", {expires:1000,path:'/', domain:'.fandom.com'}); $.cookie("wikia_beacon_id", "fuck off", {expires:1000,path:'/', domain:'.fandom.com'}); $.cookie("pv_number", "fuck off", {expires:1000,path:'/', domain:'.fandom.com'}); $.cookie("pv_number_global", "fuck off", {expires:1000,path:'/', domain:'.fandom.com'}); $.cookie("tracking_session_id", "fuck off", {expires:1000,path:'/', domain:'.fandom.com'}); $.cookie("wkch_val_recommendations_blacklist", "fuck off", {expires:1000,path:'/', domain:'.fandom.com'}); $.cookie("fuck%20off_basset", "fuck off", {expires:1000,path:'/', domain:'.fandom.com'}); $.cookie("localStorageTestItem", "fuck off", {expires:1000,path:'/', domain:'.fandom.com'}); $.cookie("silver-surfer-galactus-fallback-user-profile-v2_fuck%20off", "fuck off", {expires:1000,path:'/', domain:'.fandom.com'}); $.cookie("silver_surfer_actions_v2", "fuck off", {expires:1000,path:'/', domain:'.fandom.com'}); $.cookie("silver_surfer_interactions_v2", "fuck off", {expires:1000,path:'/', domain:'.fandom.com'}); $.cookie("silver_surfer_tracking_key_v2", "fuck off", {expires:1000,path:'/', domain:'.fandom.com'}); localStorage.setItem( 'wkch_val_recommendations_blacklist', "fuck off"); }

if($("#wpTextbox1").length) { $("#wpTextbox1").focus; $("#wpTextbox1")[0].setSelectionRange(0, 0); }

$("#mw-content-text script").remove; //     if (!$(".action-edit").length && !$(".diff").length && ($(".ns-0 #mw-content-text").text.indexOf("}") != -1 || $(".ns-0 #mw-content-text").text.indexOf("{") != -1)) window.alert(" } { ")

if (typeof window.snowStorm != 'undefined') { window.snowStorm.autoStart = false; window.snowStorm.disabled = true; }   }  });  $(function { $(document).trigger('readystatechange'); });

if (mw.config.get("wgCanonicalNamespace") == "File") { // $("#file img").after($(" ").attr("src", $("#file>a").attr("href") )); // $("#file img:first-child").remove; }

$(function { $("#ExpandFilenamesLink").html( $("", { html:"Expand filenames" }) .on("click", function {	 $('.gallerytext a').each(function { $(this).text($(this).attr('title').replace('File:', '')); })	}) ) }); $(function {  //Fix issue first reported in 2012. http://community.wikia.com/wiki/User_blog:DaNASCAT/Technical_Update:_April_24,_2012#comm-378194  if($("#mw-imagepage-nofile").length && !$("#filelogs").length) {    $("#mw-imagepage-nofile").append(" ");    $.getJSON('/api.php', { 'action': 'query', 'list': "logevents", 'format': "json", 'leprop':"timestamp|user|type|parsedcomment|details", 'letitle': mw.config.get("wgPageName"), }, function( data ) { if (!$("#filelogs:empty").length) return; //redundant race condition check $("#filelogs").append($("#ca-undelete")); //copy existing undelete link

for (i in data.query.logevents) { $("#filelogs").append(" "+data.query.logevents[i].timestamp+" - "+data.query.logevents[i].action+"/"+data.query.logevents[i].type+" - "+data.query.logevents[i].user); if (data.query.logevents[i].parsedcomment) $("#filelogs").append(" - "+data.query.logevents[i].parsedcomment); if (data.query.logevents[i].move) $("#filelogs").append(" : <a href='./"+escape(data.query.logevents[i].move.new_title)+"'>"+data.query.logevents[i].move.new_title+"</a>"); }   });  } });

function deleteFile(operation, fileName, reason, callback) { $.ajax({		type: "POST",		url: "/api.php",		data: {			token:mw.user.tokens.get("editToken"),			action: operation,			title: fileName,			reason: reason		},		success: function(data) {			if (typeof callback === "function") {				callback;			}		},		error: function(data) {			outputMessage(data);		}	}); } function moveFile(oldName, newName) { $.ajax({		type: "POST",		url: "/api.php",		data: {			token:mw.user.tokens.get("editToken"),			action: "move",			from: oldName,			to: newName,			noredirect:1,			watchlist:"watch",			movetalk:1,			ignorewarnings:1,			reason: "Merging: Rename file being merged"		},		success: function(data) {			outputMessage("File moved!");			outputMessage("Deleting renamed file...");			deleteFile("delete", newName, "Merging: Deleting renamed file to maintain order", function { outputMessage("File deleted!"); outputMessage("Restoring merged file..."); deleteFile("undelete",						newName,						"Merging: Restoring merged file",						function {							outputMessage("Merged file undeleted!");							outputMessage("Merge complete!");						}					); }			);		},		error: function(data) {			outputMessage(data);		}	}); } function mergeFileModal { var modalhtml = 'New filename <input type="text" style="width:600px" id="inputFilename" /> <input type="button" id="buttonMerge" value="Merge" /> <pre id="outputMessage">To-do: Check WhatLinksHere ';

SRWpopup("ModalTable","Merge File",modalhtml);

$("#ModalTable .modalContent").css({     textAlign: "center",    }); $( '#buttonMerge' ).click( function {	mergeFile(mw.config.get("wgPageName"), $("#inputFilename").val);    }); } function outputMessage(message) { if ($("#outputMessage")) $("#outputMessage").append(" "+message); else debug452(message); } function loadDeleteReasons { stdDeletion = localStorage.getItem('stdDeletion'); if (stdDeletion) { sSArray = stdDeletion.split("\t"); for (i in sSArray ) { var val = (sSArray[i].indexOf('**') == 0) ? sSArray[i].substring(2).trim : ''; var text = (sSArray[i].indexOf('**') == 0) ? ' ' + sSArray[i].substring(2).trim : sSArray[i].substring(1).trim; var disable = (sSArray[i].indexOf('**') == 0 || sSArray[i].indexOf('(') == 0) ? '' : 'disabled';		var $opt = '<option value="' + val + '" ' + disable + '>' + text + ' ';		$("#stdDeletion").append($opt);	} } else {    $.ajax({ 'dataType': 'text', 'data': { 'title': 'MediaWiki:Filedelete-reason-dropdown', 'action': 'raw', 'ctype': 'text/plain' },	'url': mw.config.get("wgScript"), 'success': function(data) { var lines = data.split("\n"); sSArray = new Array; for (var i in lines) { if (!lines[i].length) continue; sSArray.push(lines[i]); }		stdDeletion = sSArray.join("\t"); localStorage.setItem( 'stdDeletion', stdDeletion); loadDeleteReasons; }   });  } } function deleteFileModal {  var modalhtml = 'Filename '    +'<input type="text" style="width:100%;box-sizing:border-box;" id="inputFilename" value="'+mw.config.get("wgPageName")+ '"/>'    +' Reason <select style="width:100%;box-sizing:border-box;" id="stdDeletion"> Other  '    +' <input type="text" style="width:100%;box-sizing:border-box;" id="inputDeletion" />'    +' <input type="button" id="buttonDelete" value="Delete" />'    +' <pre id="outputMessage">To-do: check WhatLinksHere ';

SRWpopup("ModalTable","Fast Delete",modalhtml);

$("#ModalTable .modalContent").css({   textAlign: "center",  });

loadDeleteReasons;

$( '#buttonDelete' ).click( function {	outputMessage("Deleting "+$("#inputFilename").val);

if ($('#stdDeletion').val == 'Superseded by replacement file') if ($("#inputDeletion").val.indexOf("File:") == -1) $("#inputDeletion").val("")

DeletionReason = $('#stdDeletion').val?($("#inputDeletion").val?($('#stdDeletion').val+": "+$("#inputDeletion").val):$('#stdDeletion').val):($("#inputDeletion").val?$("#inputDeletion").val:"");

deleteFile(		"delete",		$("#inputFilename").val,		DeletionReason,		function {			outputMessage($("#inputFilename").val+" deleted!");		}	) }); }

$(function { if (mw.config.get("wgNamespaceNumber") == 6) {	$button = $('<a/>').find("a")	.attr({ href: "#", title: "Merge" }).text("Merge").on('click', function(e) { e.preventDefault; mergeFileModal; }).end;	$("#ca-move").parent.after($button);

$button = $('<a/>').find("a") .attr({		href: "#",		title: "Fast Delete"	}).text("Fast Delete").on('click', function(e) {		e.preventDefault;		deleteFileModal;	}).end; $("#ca-delete").parent.after($button); } }); function mergeFile(oldName, newName) {	if (newName.substr(0,5) != "File:" ) newName = "File:"+newName;	if (oldName == newName.replace(/ /g, "_")) {		outputMessage("Filename is identical.");		return;	}	outputMessage("Deleting destination file...");	deleteFile("delete", newName, "Merging: Deleting destination in preparation for move", function { outputMessage("Destination file deleted!"); outputMessage("Moving file..."); moveFile(oldName, newName); }	); } //mergeFile("File:Dex_Homie_Head.png", "File:Saints Row low-quality homie head - Dex.png")

$(function { if (window.mw.loader.getState("ext.wikia.TimeAgoMessaging") == "loading") { mw.loader.implement("ext.wikia.TimeAgoMessaging",function($){$('.timeago').timeago;;},{},{"timeago-year":"NaN $1 yearss ago","timeago-month":"NaN $1 monthss ago","timeago-day":"NaN $1 dayss ago","timeago-hour":"NaN $1 hourss ago","timeago-minute":"NaN $1 minutess ago","timeago-second":"a minute ago","timeago-day-from-now":"NaN $1 dayss from now","timeago-hour-from-now":"NaN $1 hourss from now","timeago-minute-from-now":"NaN $1 minutess from now","timeago-month-from-now":"NaN $1 monthss from now","timeago-second-from-now":"a minute from now"}); } }); //

debug452("452 global.js loaded 2019");