FANDOM


function UpdateSkin(){
    $( 'body' ).css({"color": wikiCustoms.look.fontColor});
    if (wikiCustoms.look.fontFamily != "undefined") {
	 $( 'body' ).css({"font-family": wikiCustoms.look.fontFamily});
    } else {
	$( 'body' ).css({"font-family": "arial"});
    }
    $( 'body' ).css({"font-size": wikiCustoms.look.fontSize});
    $( '#WikiaPageBackground' ).css({"background-color": wikiCustoms.look.wikiPageColor});
    mw.util.addCSS( wikiCustoms.customCSS.code );
}
function setCookie( cookie_name, data ) {
	var domain = wgServer.split("//")[1];
	document.cookie =
	    cookie_name + "=" + encodeURIComponent(data) +
	    "; max-age=" + 60*60*24*150 +
	    "; path=/; domain=" + domain;
}
function getCookie( cookie_name, pos ) {
	var x, y, cookie_array = document.cookie.split(";");
	for (var i=0; i < cookie_array.length; i++) {
		x = cookie_array[i].substr(0,cookie_array[i].indexOf("="));
		y = cookie_array[i].substr(cookie_array[i].indexOf("=")+1);
		x = x.replace(/^\s+|\s+$/g,"");
		if (x == cookie_name) {
			var style_objects = y.split(", ");
			return unescape(style_objects[pos]);
		}
	}
}
var mw = this.mediaWiki,
	wgPageName = mw.config.get('wgPageName'),
	wgServer = mw.config.get('wgServer'),
	wgScriptPath = mw.config.get('wgScriptPath'),
	EditToken = mw.user.tokens.values.editToken,
	PageID = mw.config.get('wgArticleId'),
	Namespace = mw.config.get('wgNamespaceNumber'),
	Signature = '~~' + '~~';
var wgPageName = wgPageName.replace(/_/g, ' ');
var wikiCustoms = {
    look: {
	fontColor: decodeURIComponent(getCookie("wikiSkinCustomization", 0)),
	fontFamily: decodeURIComponent(getCookie("wikiSkinCustomization", 1)),
	fontSize: decodeURIComponent(getCookie("wikiSkinCustomization", 2)),
	wikiPageColor: decodeURIComponent(getCookie("wikiSkinCustomization", 3))
    },
    customCSS: {
	code: decodeURIComponent(getCookie("wikiSkinCSS", 0))
    }
};
function userSkinEditor() {
    var $userSkinEditBox = $.showCustomModal( "User Skin Editor", '<form method="" name="" class="WikiaForm "><fieldset><p style="font-size:120%; font-weight:bold;">Text Editor</p><p style="font-size:80%;">Enter here a color name or hex</p><p>Font Color:&nbsp;<input type="text" name="fontColorInput" id="fontColorInput" value="' + wikiCustoms.look.fontColor + '"/></p><br/><p style="font-size:80%;">Enter here font size in precent or px</p><p>Font Size: &nbsp;<input type="text" name="fontSizeInput" id="fontSizeInput" value="' + wikiCustoms.look.fontSize + '"/></p><br/><p style="font-size: 80%;">Choose a font from the list below</p><p>Font Family: &nbsp;<select id="wikiCustomFontsList"><option value="arial" style="font-family:arial;">Arial</option><option value="courier new" style="font-family:courier new;">Courier new</option><option value="georgia" style="font-family:georgia;">Georgia</option><option value="palatino linotype" style="font-family:palatino linotype;">Palatino linotype</option><option value="Comic Sans MS" style="font-family:Comic Sans MS;">Comic sans</option><option value="tahoma" style="font-family:tahoma;">Tahoma</option><option value="Trebuchet MS" style="font-family:Trebuchet MS;">Trebuchet MS</option><option value="Verdana" style="font-family:Verdana;">Verdana</option><option value="Lucida Console" style="font-family:Lucida Console;">Lucida Console</option></select><br /><br /><p style="font-size:120%; font-weight:bold;">Others Editor</p>Text Editor</p><p style="font-size:80%;">Enter here a color name or hex or rgb</p><p>Wiki Page Color:&nbsp;<input type="text" name="pageColorInput" id="pageColorInput" value="' + wikiCustoms.look.wikiPageColor + '"/></form>', {
	    id: "wikiSkinEditor",
	    width: 600,
	    buttons: [
		{
			id: "cancel",
		    message: "Cancel",
		    handler: function () {
				cancelSkinChanges();
		    }
		},
		{
			id: "updateCookie",
			defaultButton: true,
			message: "Apply",
			handler: function () {
			    wikiaSkinEditCookies();
		        }
	    }
		]
	});
};
function cancelSkinChanges() {
    $('#wikiSkinEditor').closeModal();
};
function Skin() {
	skinselector = prompt('Please enter skin ID to change the skin! Skin IDs: 1: Oasis, 2: Monobook, 3: Cologneblue, 4: Mobile, 5: Vector');
	oasisurl = wgScriptPath + '/index.php?title=' + wgPageName + '&useskin=oasis';
	monobookurl = wgScriptPath + '/index.php?title=' + wgPageName + '&useskin=monobook';
	blueurl = wgScriptPath + '/index.php?title=' + wgPageName + '&useskin=cologneblue';
	mobileurl = wgScriptPath + '/index.php?title=' + wgPageName + '&useskin=wikiamobile';
	vectorurl = wgScriptPath + '/index.php?title=' + wgPageName + '&useskin=vector';
	if (skinselector == 1) {
		window.location = oasisurl;
	}
	if (skinselector == 2) {
		window.location = monobookurl;
	}
	if (skinselector == 3) {
		window.location = blueurl;
	}
	if (skinselector == 4) {
		window.location = mobileurl;
	}
	if (skinselector == 5) {
		window.location = vectorurl;
	}
};
function EditSkin() {
	$('#WikiHeader').append('<div class="custom-dropdown wikia-menu-button"><span>Wikia Skin Edit</span><ul class="WikiaMenuElement"><li class="ajax-block"><a onclick="Skin();">Change Skin</a></li><li class="ajax-block"><a onclick="userSkinEditor();">Skin Editor</a></li><li class="ajax-block"><a onclick="customCSSEdit();">Custom CSS</a></li></ul></div>');
	mw.util.addCSS('.custom-dropdown{padding:1px 8px}.custom-dropdown>:first-child:after{background-image:url("data:image/gif;base64,R0lGODlhAQABAIABAAAAAP///yH5BAEAAAEALAAAAAABAAEAQAICTAEAOw%3D%3D");border-color:#fff transparent transparent;border-style:solid;border-width:4px;content:"";display:inline-block;height:1px;margin-left:4px;margin-top:2px;position:relative;vertical-align:middle;width:1px}.custom-dropdown:hover{border-bottom-left-radius:0;border-bottom-right-radius:0;margin-bottom:-1px;padding-bottom:2px}.custom-dropdown ul{list-style:none outside none;min-width:100%;top:23px}.custom-dropdown:hover ul{display:block}.custom-dropdown li a{font-size:12px;height:14px;line-height:14px}');
};
function customCSSEdit(){
    var $userCustomCSSBox = $.showCustomModal( "Custom CSS Editor", '<form method="" name="" class="WikiaForm "><p style="font-size: 100%">This is CSS Editor. This CSS code will be used on wiki you are on. Be sure to save CSS somwhere safe on your computer, because after web browser resets cookies reset too. This CSS code will be used on the wiki you are on.</p><textarea id="WikiaUserSkinEditCSS" cols="72" rows="15">' + wikiCustoms.customCSS.code + '</textarea></form>', {
	id: "WikiaCustomCSSEdit",
	width: 600,
	buttons: [
	    {
		id: "cancel",
		message: "Cancel",
		handler: function () {
		    $('#WikiaCustomCSSEdit').closeModal();
		}
	    },
	    {
		id: "updateCookie",
		defaultButton: true,
		message: "Apply",
		handler: function () {
		    wikiCustoms.customCSS.code = $('#WikiaUserSkinEditCSS').val();
		    setCookie("wikiSkinCSS", $.trim(wikiCustoms.customCSS.code));
		    $('#WikiaCustomCSSEdit').closeModal();
		    location.reload();
		}
	    }
	]
    });
}
function wikiaSkinEditCookies() {
    wikiCustoms.look.fontColor = $('#fontColorInput').val();
    wikiCustoms.look.fontFamily = $('#wikiCustomFontsList').val();
    wikiCustoms.look.fontSize = $('#fontSizeInput').val();
    wikiCustoms.look.wikiPageColor = $('#pageColorInput').val();
    // Set the cookies
    setCookie("wikiSkinCustomization", wikiCustoms.look.fontColor + ", " + wikiCustoms.look.fontFamily + ", " + wikiCustoms.look.fontSize + ", " +wikiCustoms.look.wikiPageColor);
    UpdateSkin();
    cancelSkinChanges();
}
addOnloadHook(EditSkin);
addOnloadHook(UpdateSkin);

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.