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

From The Official Visionaire Studio: Adventure Game Engine Wiki
No edit summary
No edit summary
 
(45 intermediate revisions by the same user not shown)
Line 1: Line 1:
$(function() {
/* Toggle theme - written by AFRLme [Lee Clarke] */
 
$(document).ready(function() {  
   
   
var cookie_monster = $.cookie('name');
$("#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"});
});
//}
   
   
        $( "#switchLights" ).click(function() {  
$("#switchDark").click(function() {  
  if ((cookie_monster == 'lightmode' || (cookie_monster == null))
        $("#switchDark").hide();
                        cookie_monster = $.cookie('name', 'darkmode');
        $("#switchLight").show();
$(".themeToggle").attr({href : "http://wiki.visionaire-tracker.net/css/dark.css"});
        $(".switchTheme").attr("href",$(this).attr('rel'));
              } else {
    $.cookie("css",$(this).attr('rel'), {expires: 365, path: '/'});
                        cookie_monster = $.cookie('name', 'lightmode');
    return false;
$(".themeToggle").attr({href : "http://wiki.visionaire-tracker.net/css/light.css"});
    });
        });
   
   
});
});

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;
    });
 
});