source: extensions/stripped_black_bloc/local_head.tpl @ 13892

Revision 13892, 4.7 KB checked in by flop25, 8 years ago (diff)

features : vertical space between blocks is the same as the horizontal one

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