source: extensions/stripped_black_bloc/local_head.tpl @ 13211

Last change on this file since 13211 was 13211, checked in by flop25, 9 years ago

masonry changed for isotope.js
enhanced compat. with stuffs_thumbnails.tpl

File size: 4.4 KB
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{/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').isotope({
80         masonry: {
81                columnWidth: {/literal} {if $stripped_black_bloc.column_width}{$stripped_black_bloc.column_width}{/if}{literal}
82 },
83                itemSelector: '.bloc, .bloc_big, .content_block, .bloc_stuff',
84                isAnimated: true
85        });
86}
87
88
89jQuery(document).ready(function(jQuery){
90
91        // fade onmouseover
92        jQuery(".bloc a").hover(function() { jQuery(this).fadeTo(500, 1); }, function() { jQuery(this).fadeTo(500, 0.75);  });
93
94        // sidemenu managment
95        var sidemenu = jQuery.cookie('side-menu');
96        var isdisplayed;
97                // if cookie says the menu is hiding, keep it hidden!
98        {/literal} {if $stripped.hideMenu} {literal}
99        if (sidemenu == 'showing') {
100                jQuery("#content_cell").css({'margin-left' : '20em'});
101                isdisplayed=true;
102        }
103        else {
104                jQuery("#content_cell").css({'margin-left' : '0'});
105                isdisplayed=false;
106        }
107        {/literal} {else} {literal}
108        if (sidemenu == 'hiding') {
109                jQuery("#content_cell").css({'margin-left' : '0'});
110                isdisplayed=false;
111        }
112        else {
113                jQuery("#content_cell").css({'margin-left' : '20em'});
114                isdisplayed=true;
115        }
116        {/literal} {/if} {literal}
117        // creates a variable with the contents of the cookie side-menu
118        jQuery("#menuswitcher").click(function(){
119                if (jQuery("#menubar").is(":hidden") || isdisplayed==false ) {
120                        jQuery("#content_cell").css({'margin-left' : '20em'});
121                        isdisplayed=true;
122                } else {
123                        jQuery("#content_cell").css({'margin-left' : '0'});
124                        isdisplayed=false;
125                }
126        });
127        tnb_resize();
128
129});
130  </script>
131{/literal}
132{/html_head}
133{/if}
Note: See TracBrowser for help on using the repository browser.