MediaWiki:Wikia.js: Difference between revisions
From Screamer Wiki
imported>UncoveredAgent200 (Created page with "importScriptPage('MediaWiki:ScreamerWarn.js', 'screamers');") |
imported>UncoveredAgent200 No edit summary |
||
Line 1: | Line 1: | ||
/* We are to warn our viewers about any possible shocks that may come from this Wiki. */ | |||
function getCookie(c_name) { | |||
var c_value = " " + document.cookie; | |||
var c_start = c_value.indexOf(" " + c_name + "="); | |||
if (c_start == -1) { | |||
c_value = null; | |||
} else { | |||
c_start = c_value.indexOf("=", c_start) + 1; | |||
var c_end = c_value.indexOf(";", c_start); | |||
if (c_end == -1) { | |||
c_end = c_value.length; | |||
} | |||
c_value = unescape(c_value.substring(c_start, c_end)); | |||
} | |||
return c_value; | |||
} | |||
function setCookie(cname, cvalue, exdays) { | |||
var d = new Date(); | |||
d.setTime(d.getTime() + (exdays*24*60*60*1000)); | |||
var expires = "expires="+d.toUTCString(); | |||
document.cookie = cname + "=" + cvalue + "; " + expires; | |||
} | |||
/* In no way are we using this to steal accounts. We are using this for per-PC verification. */ | |||
var msg = "This Wiki may contain grotesque/horrifying images, screamers, and epilepsy-inducing flashing lights. By clicking \"Agree\", you agree that you are alright with this. If you feel uncomfortable with this, clicking \"Disagree\" will direct you to Wikia's homepage."; | |||
var cookiename = 'DiscretionVerification'; | |||
if (getCookie(cookiename) != 'true') { | |||
var WikiaPage = document.GetElementById('WikiaPage'); | |||
WikiaPage.innerHTML = ''; | |||
} |
Revision as of 13:22, 13 June 2015
/* We are to warn our viewers about any possible shocks that may come from this Wiki. */
function getCookie(c_name) {
var c_value = " " + document.cookie;
var c_start = c_value.indexOf(" " + c_name + "=");
if (c_start == -1) {
c_value = null;
} else {
c_start = c_value.indexOf("=", c_start) + 1;
var c_end = c_value.indexOf(";", c_start);
if (c_end == -1) {
c_end = c_value.length;
}
c_value = unescape(c_value.substring(c_start, c_end));
}
return c_value;
}
function setCookie(cname, cvalue, exdays) {
var d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000));
var expires = "expires="+d.toUTCString();
document.cookie = cname + "=" + cvalue + "; " + expires;
}
/* In no way are we using this to steal accounts. We are using this for per-PC verification. */
var msg = "This Wiki may contain grotesque/horrifying images, screamers, and epilepsy-inducing flashing lights. By clicking \"Agree\", you agree that you are alright with this. If you feel uncomfortable with this, clicking \"Disagree\" will direct you to Wikia's homepage.";
var cookiename = 'DiscretionVerification';
if (getCookie(cookiename) != 'true') {
var WikiaPage = document.GetElementById('WikiaPage');
WikiaPage.innerHTML = '';
}