js:layout_filters

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

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:13] avillepreuxjs:layout_filters [2024/05/16 13:58] (Version actuelle) avillepreux
Ligne 10: Ligne 10:
     if (jQuery(".wrap_filters").length > 0)     if (jQuery(".wrap_filters").length > 0)
     {     {
 +        function GetURLParameters()
 +        {
 +            var params = [];
 +            
 +            var sPageURL = window.location.search.substring(1);
 +            var sURLVariables = sPageURL.split('&');
 +            for (var i = 0; i < sURLVariables.length; i++)
 +            {
 +                var sParameterName = sURLVariables[i].split('=');
 +                params.push([ sParameterName[0], sParameterName[1] ]);
 +            }
 +            
 +            return params;
 +        }
 +        
         function GetURLParameter(sParam)         function GetURLParameter(sParam)
         {         {
Ligne 22: Ligne 37:
                 }                 }
             }             }
 +            
 +            return null;
         }         }
  
Ligne 36: Ligne 53:
         }         }
  
-        var comments_selector = ".wrap_hi, .wrap_answer, .wrap_q, .wrap_a, .wrap_gg, .wrap_patch, .wrap_av";+        var comments_selector = ".wrap_hi, .wrap_answer, .wrap_q, .wrap_a, .wrap_gg, .wrap_patch, .wrap_av, .wrap_username";
         var designs_selector  = "[class*=gd_],[class$=_design][class*=design_][class^=plugin_include_content]";         var designs_selector  = "[class*=gd_],[class$=_design][class*=design_][class^=plugin_include_content]";
         var tips_selector     = ".wrap_tooltip";         var tips_selector     = ".wrap_tooltip";
Ligne 43: Ligne 60:
         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); }
  
-        var triggered_comments = false; jQuery("#toggle_comments, #toggle_comments>.icon").click(function() { if (!triggered_comments) { triggered_comments = true; jQuery("#toggle_comments").html('<img src="'+(hidden_layer_comments ? src_1 : src_0)+'" class="icon"> Comments'); jQuery(comments_selector ).toggle(400function() { triggered_comments = false; }); hidden_layer_comments = !hidden_layer_comments; Cookies.set('CYA_LAYERS_comments', hidden_layer_comments ? 0 : 1); } }); +        console.log("CYA LAYERS BAR INIT", "React to click events");
-        var triggered_designs  = false; jQuery("#toggle_designs,  #toggle_designs>.icon" ).click(function() { if (!triggered_designs)  { triggered_designs  = true; jQuery("#toggle_designs" ).html('<img src="'+(hidden_layer_designs  ? src_1 : src_0)+'" class="icon"> Designs' ); jQuery(designs_selector  ).toggle(400, function() { triggered_designs  = false; }); hidden_layer_designs  = !hidden_layer_designs;  Cookies.set('CYA_LAYERS_designs',  hidden_layer_designs  ? 0 : 1); } }); +
-        var triggered_tips     = false; jQuery("#toggle_tips,     #toggle_tips>.icon"    ).click(function() { if (!triggered_tips)     { triggered_tips     = true; jQuery("#toggle_tips"    ).html('<img src="'+(hidden_layer_tips     ? src_1 : src_0)+'" class="icon"> Tips'    ); jQuery(tips_selector     ).toggle(400, function() { triggered_tips     = false; }); hidden_layer_tips     = !hidden_layer_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 (("1== GetURLParameter("tips"|| + console.log("CYA LAYERS BAR INIT""React to cookies settings"); 
-             "1" == GetURLParameter("tooltips")) && hidden_layer_tips) + 
-        { +        if ((hidden_layer_comments ? "1" : "0"=== Cookies.get('CYA_LAYERS_comments') ) { console.log("CYA LAYERS: APPLY comments COOKIE");    toggle_comments (); } 
-            console.log("CYA LAYERS: APPLY URL tip PARAMETER"); +        if ((hidden_layer_designs  ? "1""0"=== Cookies.get('CYA_LAYERS_designs' ) { console.log("CYA LAYERS: APPLY designs COOKIE");     toggle_designs  (); } 
-            jQuery("#toggle_tips>.icon").click(); +        if ((hidden_layer_tips     ? "1""0"=== Cookies.get('CYA_LAYERS_tips'    ) { console.log("CYA LAYERS: APPLY tips COOKIE");        toggle_tips     (); }
-        +
-        else if (("0" == GetURLParameter("tips"|| +
-                  "0" == GetURLParameter("tooltips")) && !hidden_layer_tips) +
-        { +
-            console.log("CYA LAYERS: APPLY URL tip PARAMETER"); +
-            jQuery("#toggle_tips>.icon").click(); +
-        }+
                  
-        if ("1" == GetURLParameter("comments"&& hidden_layer_comments) +        console.log("CYA LAYERS BAR INIT", "React to URL settings"); 
-        { + 
-            console.log("CYA LAYERS: APPLY URL comments PARAMETER"); +        if ((hidden_layer_comments ? "1" : "0") === GetURLParameter('comments'       ) { console.log("CYA LAYERS: APPLY comments URL param"); toggle_comments (); } 
-            jQuery("#toggle_comments>.icon").click(); +        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     (); } 
-        else if ("0" == GetURLParameter("comments"&& hidden_layer_comments) +        if ((hidden_layer_tips     ? "1" : "0"=== GetURLParameter('tooltips'       ) { console.log("CYA LAYERS: APPLY tips URL param");     toggle_tips     (); } 
-        { +
-            console.log("CYA LAYERS: APPLY URL comments PARAMETER"); +
-            jQuery("#toggle_comments>.icon").click(); +
-        }+
     }     }
  
  • js/layout_filters.1715858031.txt.gz
  • Dernière modification : 2024/05/16 13:13
  • de avillepreux