source: extensions/stripped_black_bloc/local_head.tpl @ 13920

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

feature :
-ajax loading : js+loading.gif
bug correction :
-max width for Gmap

File size: 4.7 KB
RevLine 
[10851]1{if ($BODY_ID=='theCategoryPage')}
[13211]2{combine_script id='jquery.isotope' load='header' require='jquery' path='themes/stripped_black_bloc/js/isotope.js'}
[11699]3{html_head}{literal}
4<style>
[11823]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}
[13920]8.bloc, .gmapsMarkup {
[11842]9        max-width: {/literal}{if $stripped_black_bloc.thumbnail_width}{$stripped_black_bloc.thumbnail_width}{/if}{literal}px;
[11699]10}
[13211]11.bloc a{
[11699]12        max-width:{/literal}{if $stripped_black_bloc.thumbnail_width}{$stripped_black_bloc.thumbnail_width}{/if}{literal}px;
13}
[12048]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}
[11823]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;
[11709]22}
[11823]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;
[11709]25}
[13892]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}
[11871]32{/literal}{if isset($chronology_calendar)}{literal}
33#subcontent {
34        min-height: inherit;
35}
36{/literal}{/if}{literal}
37
[11699]38</style>
[10851]39<script type="text/javascript">
[11679]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};
[11699]81
82    // MASONRY
83
[10851]84function tnb_resize() {
[13211]85        $('#content_cell').isotope({
86         masonry: {
87                columnWidth: {/literal} {if $stripped_black_bloc.column_width}{$stripped_black_bloc.column_width}{/if}{literal}
88 },
[12048]89                itemSelector: '.bloc, .bloc_big, .content_block, .bloc_stuff',
[11679]90                isAnimated: true
[10851]91        });
92}
[11699]93
94
[11677]95jQuery(document).ready(function(jQuery){
[11699]96
97        // fade onmouseover
[11677]98        jQuery(".bloc a").hover(function() { jQuery(this).fadeTo(500, 1); }, function() { jQuery(this).fadeTo(500, 0.75);  });
[11699]99
100        // sidemenu managment
[11677]101        var sidemenu = jQuery.cookie('side-menu');
102        var isdisplayed;
103                // if cookie says the menu is hiding, keep it hidden!
[11679]104        {/literal} {if $stripped.hideMenu} {literal}
105        if (sidemenu == 'showing') {
[12406]106                jQuery("#content_cell").css({'margin-left' : '20em'});
[11679]107                isdisplayed=true;
108        }
109        else {
[12406]110                jQuery("#content_cell").css({'margin-left' : '0'});
[11679]111                isdisplayed=false;
112        }
113        {/literal} {else} {literal}
[11677]114        if (sidemenu == 'hiding') {
[12406]115                jQuery("#content_cell").css({'margin-left' : '0'});
[11677]116                isdisplayed=false;
117        }
[11679]118        else {
[12406]119                jQuery("#content_cell").css({'margin-left' : '20em'});
[11677]120                isdisplayed=true;
121        }
[11679]122        {/literal} {/if} {literal}
[11677]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 ) {
[12406]126                        jQuery("#content_cell").css({'margin-left' : '20em'});
[11677]127                        isdisplayed=true;
128                } else {
[12406]129                        jQuery("#content_cell").css({'margin-left' : '0'});
[11677]130                        isdisplayed=false;
131                }
132        });
[11679]133        tnb_resize();
[10851]134
135});
136  </script>
137{/literal}
138{/html_head}
139{/if}
Note: See TracBrowser for help on using the repository browser.