web/static/res/js/incchoice.js
changeset 46 542252e0c615
parent 45 f7bfdc49982b
child 48 d92196482ad9
equal deleted inserted replaced
45:f7bfdc49982b 46:542252e0c615
    30 			$("#mot3").html("travail");
    30 			$("#mot3").html("travail");
    31 			$("#mot4").html("international");
    31 			$("#mot4").html("international");
    32 			$("#mot5").html("dieu");
    32 			$("#mot5").html("dieu");
    33 			$("#mot6").html("president");
    33 			$("#mot6").html("president");
    34 
    34 
    35 			// Set images for effect
    35 			// class
    36 			//incMosaic.clear();
    36 			// by default there is the calss blue
    37 	        //incMosaic.addImageUrl("static/res/img/" + this.image1);
       
    38 	        //incMosaic.addImageUrl("static/res/img/" + this.image2);
       
    39 
    37 
    40 		} else if (choiceIndex == 1) {
    38 		} else if (choiceIndex == 1) {
    41 			$("#mot1").html("actif");
    39 			$("#mot1").html("actif");
    42 			$("#mot2").html("passif");
    40 			$("#mot2").html("passif");
    43 			$("#mot3").html("corps");
    41 			$("#mot3").html("corps");
    44 			$("#mot4").html("charite");
    42 			$("#mot4").html("charite");
    45 			$("#mot5").html("patrie");
    43 			$("#mot5").html("patrie");
    46 			$("#mot6").html("politique");
    44 			$("#mot6").html("politique");
    47 
    45 
    48 			// Set images for effect
    46 			// class
    49 			//incMosaic.clear();
    47 			$("#choix").removeClass("blue").addClass("white");
    50 	        //incMosaic.addImageUrl("static/res/img/" + this.image2);
       
    51 	        //incMosaic.addImageUrl("static/res/img/" + this.image3);
       
    52 
    48 
    53 		} else {
    49 		} else {
    54 			$("#mot1").html("spleen");
    50 			$("#mot1").html("spleen");
    55 			$("#mot2").html("ideal");
    51 			$("#mot2").html("ideal");
    56 			$("#mot3").html("origines");
    52 			$("#mot3").html("origines");
    57 			$("#mot4").html("peur");
    53 			$("#mot4").html("peur");
    58 			$("#mot5").html("desir");
    54 			$("#mot5").html("desir");
    59 			$("#mot6").html("bonheur");
    55 			$("#mot6").html("bonheur");
    60 
    56 
    61 			// Set images for effect
    57 			// class
    62 			//incMosaic.clear();
    58 			$("#choix").removeClass("white").addClass("red");
    63 	        //incMosaic.addImageUrl("static/res/img/" + this.image3);
       
    64 	        //incMosaic.addImageUrl("static/res/img/" + this.image1);			
       
    65 		}
    59 		}
    66 
       
    67 	    //incMosaic.start("mosaic", effectSpeed, 9, 5, false, true, function() {incChoice.effectIsDone();});        					
       
    68 	};
    60 	};
    69 
    61 
    70 	this.selectWord = function(wordIndex)
    62 	this.selectWord = function(wordIndex)
    71 	{
    63 	{
    72 		if (!this.canSelectWord) {
    64 		if (!this.canSelectWord) {
    96 
    88 
    97 		// Stop the mosaic effect
    89 		// Stop the mosaic effect
    98 		incMosaic.UnpauseEffect(false);
    90 		incMosaic.UnpauseEffect(false);
    99 
    91 
   100 		// Fade the text
    92 		// Fade the text
   101 		$('.big_txt').animate({opacity: 1}, 20000 * 1 / effectSpeed);
    93 		$('.big_txt').animate({opacity: 1}, 10000 * 1 / effectSpeed);
   102 
    94 
   103 		if (this.currentWorldIndex == 3) {
    95 		if (this.currentWorldIndex == 3) {
   104 			// The 3 words get choosen
    96 			// The 3 words get choosen
   105 			location.href = "niv1_videoplayer.html";
    97 			location.href = "niv1_videoplayer.html";
   106 		}
    98 		}
   107 	}
    99 	};
       
   100 
       
   101 	this.getChoosenWords = function()
       
   102 	{
       
   103 		return [this.getCookie("niv1_world0"), this.getCookie("niv1_world1"), this.getCookie("niv1_world2")];
       
   104 	};
   108 
   105 
   109 	this.setCookie = function(name, value)
   106 	this.setCookie = function(name, value)
   110 	{
   107 	{
   111 		$.removeCookie(name);
   108 		$.removeCookie(name);
   112 		$.cookie(name, value, { expires: 7, path: '/' });    	
   109 		$.cookie(name, value, { expires: 7, path: '/' }); 
   113     };
   110     };
   114 
   111 
   115 	this.getCookie = function(name) {
   112 	this.getCookie = function(name) {
   116 		return $.cookie(name);
   113 		return $.cookie(name);
   117 	};
   114 	};