Ignore:
Timestamp:
Mar 4, 2012, 10:45:11 PM (12 years ago)
Author:
Zaphod
Message:

feature 2587: theme elegant, script & theme update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/themes/elegant/scripts.js

    r13464 r13479  
    33        var menubar=jQuery("#menubar");
    44        var content=jQuery("#content");
    5        
     5
    66        if ( (menubar.length == 1) && (content.length ==1)) {
    77                menubar.after("<div id=\"menuswitcher\">«</div>");
    8 /*              if (!content.hasClass('content')) content.addClass('content');*/
     8       
     9                jQuery("#menuswitcher").click(function(){
     10                        if (jQuery("#menubar").is(":hidden")) {
     11                                showMenu(0);
     12                                return false;
     13                        } else {
     14                                hideMenu(0);
     15                                return false;
     16                        }
     17                });
     18
     19                // creates a variable with the contents of the cookie side-menu
     20                var sidemenu = jQuery.cookie('side-menu');
     21               
     22                // if cookie says the menu is hiding, keep it hidden!
     23                if (sidemenu == 'hiding') {
     24                        hideMenu(0);
     25                } else {
     26                        showMenu(0);
     27                }
     28
    929        }
    10         /*»*/
    1130       
    12         jQuery("#menuswitcher").click(function(){
    13                 if (jQuery("#menubar").is(":hidden")) {
    14                         showMenu(0);
    15                         return false;
     31        var comments=jQuery("#thePicturePage #comments");
     32        if (comments.length == 1) {
     33                var comments_button=jQuery("#comments h3");
     34
     35                if (comments_button.length == 0) {
     36                        jQuery("#addComment").before("<h3>Comments</h3>");
     37                        comments_button=jQuery("#comments h3");
     38                }
     39       
     40                if (jQuery.cookie('comments') == 'visible') {
     41                        comments_button.addClass("comments_toggle").addClass("comments_toggle_off");
    1642                } else {
    17                         hideMenu(0);
    18                         return false;
     43                        comments.addClass("comments_hidden");
     44                        comments_button.addClass("comments_toggle").addClass("comments_toggle_on");
    1945                }
    20         });
     46               
     47                comments_button.click(function() {
    2148
    22         // creates a variable with the contents of the cookie side-menu
    23         var sidemenu = jQuery.cookie('side-menu');
     49                        var comments=jQuery("#thePicturePage #comments");
     50                        if (comments.hasClass("comments_hidden")) {
     51                                        comments.removeClass("comments_hidden");
     52                                        comments_button.addClass("comments_toggle_off").removeClass("comments_toggle_on");;
     53                                        jQuery.cookie('comments', 'visible', {path: "/"});
     54                                } else {
     55                                        comments.addClass("comments_hidden");
     56                                        comments_button.addClass("comments_toggle_on").removeClass("comments_toggle_off");;
     57                                        jQuery.cookie('comments', 'hidden', {path: "/"});
     58                                }
     59                       
     60                });
    2461       
    25         // if cookie says the menu is hiding, keep it hidden!
    26         if (sidemenu == 'hiding') {
    27                 hideMenu(0);
    28         } else {
    29                 showMenu(0);
    3062        }
    31 
     63       
    3264       
    3365});
Note: See TracChangeset for help on using the changeset viewer.