source: extensions/stripped_black_bloc/local_head.tpl @ 11871

Revision 11871, 4.0 KB checked in by flop25, 9 years ago (diff)

improving calendar : min-height inherited
for footer and navigation, position relative

Line 
1{if ($BODY_ID=='theCategoryPage')}
2{combine_script id='jquery.masonry' load='header' require='jquery' path='themes/stripped_black_bloc/js/masonry.js'}
3{html_head}{literal}
4<style>
5#theHeader a, .titrePage a, .footer_login a, .navigationBar a {
6        color: {/literal}{if $stripped_black_bloc.color_main}#{$stripped_black_bloc.color_main}{/if}{literal};
7}
8.bloc {
9        max-width: {/literal}{if $stripped_black_bloc.thumbnail_width}{$stripped_black_bloc.thumbnail_width}{/if}{literal}px;
10}
11.bloc a {
12        max-width:{/literal}{if $stripped_black_bloc.thumbnail_width}{$stripped_black_bloc.thumbnail_width}{/if}{literal}px;
13}
14.content_block, .bloc_stuff, .two_columns {
15        width:{/literal}{if $stripped_black_bloc.thumbnail_width}{$stripped_black_bloc.column_width*2-10}{/if}{literal}px;
16}
17.stuffs_thumbnails, .stuffs_thumbnails #thumbnails, .one_column {
18        width:{/literal}{if $stripped_black_bloc.thumbnail_width}{$stripped_black_bloc.thumbnail_width-10 }{/if}{literal}px;
19}
20{/literal}{if isset($chronology_calendar)}{literal}
21#subcontent {
22        min-height: inherit;
23}
24{/literal}{/if}{literal}
25
26</style>
27<script type="text/javascript">
28/**
29* jQuery Cookie plugin
30*
31* Copyright (c) 2010 Klaus Hartl (stilbuero.de)
32* Dual licensed under the MIT and GPL licenses:
33* http://www.opensource.org/licenses/mit-license.php
34* http://www.gnu.org/licenses/gpl.html
35*
36*/
37jQuery.cookie = function (key, value, options) {
38
39    // key and at least value given, set cookie...
40    if (arguments.length > 1 && String(value) !== "[object Object]") {
41        options = jQuery.extend({}, options);
42
43        if (value === null || value === undefined) {
44            options.expires = -1;
45        }
46
47        if (typeof options.expires === 'number') {
48            var days = options.expires, t = options.expires = new Date();
49            t.setDate(t.getDate() + days);
50        }
51
52        value = String(value);
53
54        return (document.cookie = [
55            encodeURIComponent(key), '=',
56            options.raw ? value : encodeURIComponent(value),
57            options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
58            options.path ? '; path=' + options.path : '',
59            options.domain ? '; domain=' + options.domain : '',
60            options.secure ? '; secure' : ''
61        ].join(''));
62    }
63
64    // key and possibly options given, get cookie...
65    options = value || {};
66    var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent;
67    return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null;
68};
69
70    // MASONRY
71
72function tnb_resize() {
73        $('#subcontent').masonry({
74                columnWidth: {/literal} {if $stripped_black_bloc.column_width}{$stripped_black_bloc.column_width}{/if}{literal},
75                itemSelector: '.bloc, .content_block, .bloc_stuff',
76                isAnimated: true
77        });
78}
79
80
81jQuery(document).ready(function(jQuery){
82
83        // fade onmouseover
84        jQuery(".bloc a").hover(function() { jQuery(this).fadeTo(500, 1); }, function() { jQuery(this).fadeTo(500, 0.75);  });
85
86        // sidemenu managment
87        var sidemenu = jQuery.cookie('side-menu');
88        var isdisplayed;
89                // if cookie says the menu is hiding, keep it hidden!
90        {/literal} {if $stripped.hideMenu} {literal}
91        if (sidemenu == 'showing') {
92                jQuery("#subcontent").css({'margin-left' : '20em'});
93                isdisplayed=true;
94        }
95        else {
96                jQuery("#subcontent").css({'margin-left' : '0'});
97                isdisplayed=false;
98        }
99        {/literal} {else} {literal}
100        if (sidemenu == 'hiding') {
101                jQuery("#subcontent").css({'margin-left' : '0'});
102                isdisplayed=false;
103        }
104        else {
105                jQuery("#subcontent").css({'margin-left' : '20em'});
106                isdisplayed=true;
107        }
108        {/literal} {/if} {literal}
109        // creates a variable with the contents of the cookie side-menu
110        jQuery("#menuswitcher").click(function(){
111                if (jQuery("#menubar").is(":hidden") || isdisplayed==false ) {
112                        jQuery("#subcontent").css({'margin-left' : '20em'});
113                        isdisplayed=true;
114                } else {
115                        jQuery("#subcontent").css({'margin-left' : '0'});
116                        isdisplayed=false;
117                }
118        });
119        tnb_resize();
120
121});
122  </script>
123{/literal}
124{/html_head}
125{/if}
Note: See TracBrowser for help on using the repository browser.