Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente |
js:layout_filters [2024/05/16 13:47] – avillepreux | js:layout_filters [2024/05/16 13:58] (Version actuelle) – avillepreux |
---|
var hidden_layer_designs = (jQuery("#toggle_designs" ).html().indexOf("unchecked") > -1); | var hidden_layer_designs = (jQuery("#toggle_designs" ).html().indexOf("unchecked") > -1); |
var hidden_layer_tips = (jQuery("#toggle_tips" ).html().indexOf("unchecked") > -1); | var hidden_layer_tips = (jQuery("#toggle_tips" ).html().indexOf("unchecked") > -1); |
| |
| function toggle_comments() { console.log("CYA LAYERS: Toggle comments"); hidden_layer_comments = !hidden_layer_comments; jQuery(comments_selector ).toggle(); jQuery("#toggle_comments").html('<img src="'+(hidden_layer_comments ? src_0 : src_1)+'" class="icon"> Comments'); Cookies.set('CYA_LAYERS_comments', hidden_layer_comments ? 0 : 1); } |
| function toggle_designs() { console.log("CYA LAYERS: Toggle designs"); hidden_layer_designs = !hidden_layer_designs; jQuery(designs_selector ).toggle(); jQuery("#toggle_designs" ).html('<img src="'+(hidden_layer_designs ? src_0 : src_1)+'" class="icon"> Designs' ); Cookies.set('CYA_LAYERS_designs', hidden_layer_designs ? 0 : 1); } |
| function toggle_tips() { console.log("CYA LAYERS: Toggle tips"); hidden_layer_tips = !hidden_layer_tips; jQuery(tips_selector ).toggle(); jQuery("#toggle_tips" ).html('<img src="'+(hidden_layer_tips ? src_0 : src_1)+'" class="icon"> Tips' ); Cookies.set('CYA_LAYERS_tips', hidden_layer_tips ? 0 : 1); } |
| |
jQuery("#toggle_comments, #toggle_comments>.icon").click(function() { console.log("CYA LAYERS: APPLY comments click"); hidden_layer_comments = !hidden_layer_comments; jQuery(comments_selector ).toggle(); jQuery("#toggle_comments").html('<img src="'+(hidden_layer_comments ? src_0 : src_1)+'" class="icon"> Comments'); Cookies.set('CYA_LAYERS_comments', hidden_layer_comments ? 0 : 1); }); | console.log("CYA LAYERS BAR INIT", "React to click events"); |
jQuery("#toggle_designs, #toggle_designs>.icon" ).click(function() { console.log("CYA LAYERS: APPLY designs click"); hidden_layer_designs = !hidden_layer_designs; jQuery(designs_selector ).toggle(); jQuery("#toggle_designs" ).html('<img src="'+(hidden_layer_designs ? src_0 : src_1)+'" class="icon"> Designs' ); Cookies.set('CYA_LAYERS_designs', hidden_layer_designs ? 0 : 1); }); | |
jQuery("#toggle_tips, #toggle_tips>.icon" ).click(function() { console.log("CYA LAYERS: APPLY tips click"); hidden_layer_tips = !hidden_layer_tips; jQuery(tips_selector ).toggle(); jQuery("#toggle_tips" ).html('<img src="'+(hidden_layer_tips ? src_0 : src_1)+'" class="icon"> Tips' ); Cookies.set('CYA_LAYERS_tips', hidden_layer_tips ? 0 : 1); }); | |
| |
if ((hidden_layer_comments ? "1" : "0") === Cookies.get('CYA_LAYERS_comments') ) { console.log("CYA LAYERS: APPLY comments COOKIE"); jQuery("#toggle_comments>.icon" ).click(); } | jQuery("#toggle_comments").click(function() { console.log("CYA LAYERS: APPLY comments CLICK"); toggle_comments (); }); |
if ((hidden_layer_designs ? "1" : "0") === Cookies.get('CYA_LAYERS_designs') ) { console.log("CYA LAYERS: APPLY designs COOKIE"); jQuery("#toggle_designs>.icon" ).click(); } | jQuery("#toggle_designs" ).click(function() { console.log("CYA LAYERS: APPLY designs CLICK"); toggle_designs (); }); |
if ((hidden_layer_tips ? "1" : "0") === Cookies.get('CYA_LAYERS_tips') ) { console.log("CYA LAYERS: APPLY tips COOKIE"); jQuery("#toggle_tips>.icon" ).click(); } | jQuery("#toggle_tips" ).click(function() { console.log("CYA LAYERS: APPLY tips CLICK"); toggle_tips (); }); |
| |
if ((hidden_layer_comments ? "1" : "0") === GetURLParameter('comments') ) { console.log("CYA LAYERS: APPLY comments URL param"); jQuery("#toggle_comments>.icon" ).click(); } | console.log("CYA LAYERS BAR INIT", "React to cookies settings"); |
if ((hidden_layer_designs ? "1" : "0") === GetURLParameter('designs') ) { console.log("CYA LAYERS: APPLY designs URL param"); jQuery("#toggle_designs>.icon" ).click(); } | |
if ((hidden_layer_tips ? "1" : "0") === GetURLParameter('tips') ) { console.log("CYA LAYERS: APPLY tips URL param"); jQuery("#toggle_tips>.icon" ).click(); } | if ((hidden_layer_comments ? "1" : "0") === Cookies.get('CYA_LAYERS_comments') ) { console.log("CYA LAYERS: APPLY comments COOKIE"); toggle_comments (); } |
if ((hidden_layer_tips ? "1" : "0") === GetURLParameter('tooltips') ) { console.log("CYA LAYERS: APPLY tips URL param"); jQuery("#toggle_tips>.icon" ).click(); } | if ((hidden_layer_designs ? "1" : "0") === Cookies.get('CYA_LAYERS_designs') ) { console.log("CYA LAYERS: APPLY designs COOKIE"); toggle_designs (); } |
| if ((hidden_layer_tips ? "1" : "0") === Cookies.get('CYA_LAYERS_tips') ) { console.log("CYA LAYERS: APPLY tips COOKIE"); toggle_tips (); } |
| |
| console.log("CYA LAYERS BAR INIT", "React to URL settings"); |
| |
| if ((hidden_layer_comments ? "1" : "0") === GetURLParameter('comments') ) { console.log("CYA LAYERS: APPLY comments URL param"); toggle_comments (); } |
| if ((hidden_layer_designs ? "1" : "0") === GetURLParameter('designs') ) { console.log("CYA LAYERS: APPLY designs URL param"); toggle_designs (); } |
| if ((hidden_layer_tips ? "1" : "0") === GetURLParameter('tips') ) { console.log("CYA LAYERS: APPLY tips URL param"); toggle_tips (); } |
| if ((hidden_layer_tips ? "1" : "0") === GetURLParameter('tooltips') ) { console.log("CYA LAYERS: APPLY tips URL param"); toggle_tips (); } |
| |
} | } |