source: extensions/stripped_black_bloc/local_head.tpl @ 11709

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

adding a round border
changed the way to recognize album : clear border
thumbnails caption = false compatible
bar removed
pwg stuff witdh restricted to 2width except for stuff_thumbnail
thumbnails generation based on file first

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