source: extensions/floOS/OS_glass/local_head.tpl @ 11940

Last change on this file since 11940 was 11940, checked in by flop25, 13 years ago

jquery.cookie for managing tabs : now the theme remembers the status hidden/shown of each tabs

File size: 4.5 KB
Line 
1
2{footer_script}
3{literal}
4var max_dim_width = 0;
5var max_dim_height = 0;
6$(document).ready(function() {
7  $(".thumbnails img").each(function () {
8    if (jQuery(this).height() > max_dim_height)
9      max_dim_height = jQuery(this).height() + 10;
10    if (jQuery(this).width() > max_dim_width)
11      max_dim_width = jQuery(this).width() + 10;
12
13    jQuery(".wrap2")
14      .css('width', max_dim_width+'px')
15      .css('height', max_dim_height+'px');
16  });
17});
18{/literal}
19{/footer_script}
20
21{combine_script id='jquery.tipTip.minified' load='header' require='jquery' path='themes/OS_glass/tiptip/jquery.tipTip.minified.js'}
22{html_head}{literal}
23<script type="text/javascript">
24/**
25* jQuery Cookie plugin
26*
27* Copyright (c) 2010 Klaus Hartl (stilbuero.de)
28* Dual licensed under the MIT and GPL licenses:
29* http://www.opensource.org/licenses/mit-license.php
30* http://www.gnu.org/licenses/gpl.html
31*
32*/
33jQuery.cookie = function (key, value, options) {
34
35    // key and at least value given, set cookie...
36    if (arguments.length > 1 && String(value) !== "[object Object]") {
37        options = jQuery.extend({}, options);
38
39        if (value === null || value === undefined) {
40            options.expires = -1;
41        }
42
43        if (typeof options.expires === 'number') {
44            var days = options.expires, t = options.expires = new Date();
45            t.setDate(t.getDate() + days);
46        }
47
48        value = String(value);
49
50        return (document.cookie = [
51            encodeURIComponent(key), '=',
52            options.raw ? value : encodeURIComponent(value),
53            options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
54            options.path ? '; path=' + options.path : '',
55            options.domain ? '; domain=' + options.domain : '',
56            options.secure ? '; secure' : ''
57        ].join(''));
58    }
59
60    // key and possibly options given, get cookie...
61    options = value || {};
62    var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent;
63    return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
64};
65
66
67
68jQuery(document).ready(function(){
69        $(".titre_acordeon, .titre_acordeon_0").each(function () {
70                var id = $(this).parent().attr("id");
71                if (!jQuery.cookie(id))
72                {
73                        if ( $(this).attr("class")=="titre_acordeon")
74                        {
75                                jQuery.cookie($(this).parent().attr("id"),false, {path: "/"});
76                                $(this).next().hide();
77                        }
78                        else
79                        {
80                                $(this).next().show();
81                                jQuery.cookie($(this).parent().attr("id"),true, {path: "/"});
82                        }
83                }
84                else if (jQuery.cookie(id) == "true")
85                {
86                        $(this).next().show();
87                }
88                else
89                {
90                        $(this).next().hide();
91                }
92        });
93       
94        $(".titre_acordeon, .titre_acordeon_0").click(function() {
95                $(this).next().toggle("medium");
96                var id = $(this).parent().attr("id");
97                if ( jQuery.cookie(id) == "true")
98                {
99                        jQuery.cookie(id, false, {path: "/"});
100                }
101                else
102                {
103                        jQuery.cookie(id, true, {path: "/"});
104                }
105        });
106});
107$(function(){
108    $(".categoryActions A").tipTip({delay : 0, fadeIn : 200, fadeOut : 200 });
109    $("#home_icon A").tipTip({edgeOffset : 10, fadeIn : 200, fadeOut : 200, defaultPosition : "top" });
110    $(".randomButtons A").tipTip({delay : 0, fadeIn : 200, fadeOut : 200 });
111    $(".navButtons A").tipTip({delay : 0, fadeIn : 200, fadeOut : 200 });
112    $("#mbCategories a").tipTip({delay : 0, fadeIn : 200, fadeOut : 200 });
113});
114  </script>
115{/literal}
116{/html_head}
117{literal}
118<!--[if lt IE 7]>
119<style>
120        #menubar dl, #section_in {
121        background:  #FFF!important;
122        }
123        /* contenu "section" */
124        #section_up_left, #section_up, #section_up_right, #section_left, #section_bottom_left, #section_bottom, #section_bottom_right, #section_right{
125        background:none!important;
126        }
127</style>
128<![endif]-->
129<!--[if IE 7]>
130<style>
131        #menubar dl, #section_in {
132        background:  #FFF!important;
133        }
134        /* contenu "section" */
135        #section_up_left, #section_up, #section_up_right, #section_left, #section_bottom_left, #section_bottom, #section_bottom_right, #section_right{
136        background:none!important;
137        }
138        BODY#theCommentsPage .content,
139        BODY#theUploadPage .content,
140        BODY#theRegisterPage .content,
141        BODY#theIdentificationPage .content,
142        BODY#theProfilePage .content,
143        BODY#theSearchPage .content,
144        BODY#theAboutPage .content,
145        BODY#thePopuphelpPage .content,
146        BODY#thePasswordPage .content,
147        BODY#theNotificationPage .content,
148        BODY#theTagsPage .content,
149        BODY#theNBMPage .content,
150        #action_pict,
151        #comments
152        {
153        background:  #FFF!important;
154        }
155</style>
156<![endif]-->
157{/literal}
Note: See TracBrowser for help on using the repository browser.