source: extensions/stripped_black_bloc/local_head.tpl @ 11679

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

custom navigation bar
menu switch works according to the config and at the first run
custom album tittle color

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