source: extensions/stripped_black_bloc/local_head.tpl @ 12268

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

update for the new stripped layout

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