MediaWiki:Common.js/lightswitch.js: Difference between revisions

From The Official Visionaire Studio: Adventure Game Engine Wiki
No edit summary
No edit summary
 
(48 intermediate revisions by the same user not shown)
Line 1: Line 1:
/* Toggle theme - written by AFRLme [Lee Clarke] */


$(function() {
$(document).ready(function() {  
   
   
var cookie_monster = $.cookie('lightmode');
$("#switchLight").click(function() {  
 
        $("#switchLight").hide();
//if (cookie_monster == 'lightmode')
        $("#switchDark").show();
//{
        $(".switchTheme").attr("href",$(this).attr('rel'));
// $(".themeToggle").attr({href : "http://wiki.visionaire-tracker.net/css/light.css"});
    $.cookie("css",$(this).attr('rel'), {expires: 365, path: '/'});
//} else {
    return false;
// $(".themeToggle").attr({href : "http://wiki.visionaire-tracker.net/css/dark.css"});
});
//}
 
function toggleCSS() {
if (cookie_monster == 'lightmode')
{
cookie_monster = $.cookie('lightmode', 'darkmode');
$(".themeToggle").attr({href : "http://wiki.visionaire-tracker.net/css/dark.css"});
} else {
cookie_monster = $.cookie('darkmode', 'lightmode');
$(".themeToggle").attr({href : "http://wiki.visionaire-tracker.net/css/light.css"});
}
};
   
   
$( "#switchLights" ).click(function() { toggleCSS(); });
$("#switchDark").click(function() {  
        $("#switchDark").hide();
        $("#switchLight").show();
        $(".switchTheme").attr("href",$(this).attr('rel'));
    $.cookie("css",$(this).attr('rel'), {expires: 365, path: '/'});
    return false;
    });
   
   
});
});

Latest revision as of 22:19, 9 May 2016

/* Toggle theme - written by AFRLme [Lee Clarke] */

$(document).ready(function() { 
 
	$("#switchLight").click(function() { 
        $("#switchLight").hide();
        $("#switchDark").show();
        $(".switchTheme").attr("href",$(this).attr('rel'));
	    $.cookie("css",$(this).attr('rel'), {expires: 365, path: '/'});
	    return false;
	});
 
	$("#switchDark").click(function() { 
        $("#switchDark").hide();
        $("#switchLight").show();
        $(".switchTheme").attr("href",$(this).attr('rel'));
	    $.cookie("css",$(this).attr('rel'), {expires: 365, path: '/'});
	    return false;
    });
 
});