source: extensions/stripped/js/scripts-tcp.js

Last change on this file was 24444, checked in by flop25, 11 years ago

register link added in menubar quickconnect
script js hardly corrected to works with latest version of jQuery

File size: 4.0 KB
Line 
1jQuery("document").ready(function(jQuery){
2
3// scripts Category Page ------------------------------------------------------------------------------------------------------------
4
5        // menu switcher script from Simple Theme
6       
7        var delay;
8        var animation_webkit = true;
9        if (options.animatedMenu) {
10                delay = "slow";
11        } else {
12                delay = 0;
13        }
14
15        jQuery("#menuswitcher").click(function(){
16                if (jQuery("#menubar").is(":hidden")) {
17                        if (delay == 0) {
18                                jQuery("#menubar").show();
19                                tnb_resize();
20                        } else {
21                                if (animation_webkit) {
22                                        jQuery("#menubar").show("blind",{},delay, function (){tnb_resize();});
23                                } else {
24                                        jQuery("#menubar").show(delay, function (){tnb_resize();});
25                                }
26                        }
27                        jQuery.cookie('side-menu', 'showing', {path: "/"});
28                        if (jQuery("#thumbnails_block2").length != 0) tnb_resize();
29                        return false;
30                } else {
31                                if (animation_webkit) {
32                                        jQuery("#menubar").hide("blind",{},delay, function (){tnb_resize();});
33                                } else {
34                                        jQuery("#menubar").hide(delay, function (){tnb_resize();});
35                                }
36                        jQuery.cookie('side-menu', 'hiding', {path: "/"});
37                return false;
38                }
39        });
40
41        // creates a variable with the contents of the cookie side-menu
42        var sidemenu = jQuery.cookie('side-menu');
43       
44        // if cookie says the menu is hiding, keep it hidden!
45        if (sidemenu == 'hiding') {
46                jQuery("#menubar").hide();
47        }
48        if (sidemenu == 'showing') {
49                jQuery("#menubar").show();
50        }
51 
52        // resize thumbnail block
53        jQuery(window).resize(function() { tnb_resize(); });
54        tnb_resize();
55
56        // display alt from PWG stuffs actions.
57
58        var stuffs_actions=jQuery(".categoryActions",".stuffs_block .stuffs");
59       
60        if (stuffs_actions.length != 0) {
61                stuffs_actions.each(function(index) {
62                        var images=jQuery(this).find("img");
63                        if (images.length !=0) {
64                                images.each(function(index) {
65                                        var alt_text = (jQuery(this).attr("alt"));
66                                        jQuery(this).before(alt_text);
67                                        jQuery(this).parents("li").css("width","auto");
68                                        jQuery(this).remove();
69                                });
70                        }
71                });
72        }
73       
74        // gmaps icon
75       
76        var icon_gmaps=jQuery("#icon_gmaps");
77        var text_gmaps=jQuery("#text_gmaps");
78        if ((icon_gmaps.length == 1) && (text_gmaps.length ==1)) {
79                icon_gmaps.text(text_gmaps.text());
80                icon_gmaps.css("text-align","right");
81        }       
82       
83        // bug with MSIE6 & language switch
84        /*
85        if ((jQuery.browser.msie) && (jQuery.browser.version.substr(0,1) == "6")) {
86                var lswitch = jQuery(".menuf > div > ul");
87                if (lswitch.length==1) {
88                        var flags = lswitch.children("li").children("a");
89                        if (flags.length==2) {
90                                flags.first().remove();
91                        }
92                }
93        }*/
94       
95});
96
97
98
99// Thumbnails Block Resize function
100
101function tnb_resize() {
102        if (jQuery("#thumbnails_block2").length != 0) {
103                var tnb_width = 40+180*parseInt((jQuery("#thumbnails_block1").width()-40)/180);
104                jQuery("#thumbnails_block2").css("max-width",tnb_width+"px");
105        };
106}
107
108/**
109 * Cookie plugin
110 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
111 * Dual licensed under the MIT and GPL licenses:
112 */
113jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options=jQuery.extend({},options);options.expires=-1;}
114var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}
115expires='; expires='+date.toUTCString();}
116var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}
117return cookieValue;}};
Note: See TracBrowser for help on using the repository browser.