diff options
Diffstat (limited to '')
-rw-r--r-- | themes/elegant/scripts.js | 68 |
1 files changed, 50 insertions, 18 deletions
diff --git a/themes/elegant/scripts.js b/themes/elegant/scripts.js index e83dfd4f3..d6e9d7cc5 100644 --- a/themes/elegant/scripts.js +++ b/themes/elegant/scripts.js @@ -2,33 +2,65 @@ var menubar=jQuery("#menubar");
var content=jQuery("#content");
-
+
if ( (menubar.length == 1) && (content.length ==1)) {
menubar.after("<div id=\"menuswitcher\">«</div>");
-/* if (!content.hasClass('content')) content.addClass('content');*/
- }
- /*»*/
- jQuery("#menuswitcher").click(function(){
- if (jQuery("#menubar").is(":hidden")) {
+ jQuery("#menuswitcher").click(function(){
+ if (jQuery("#menubar").is(":hidden")) {
+ showMenu(0);
+ return false;
+ } else {
+ hideMenu(0);
+ return false;
+ }
+ });
+
+ // creates a variable with the contents of the cookie side-menu
+ var sidemenu = jQuery.cookie('side-menu');
+
+ // if cookie says the menu is hiding, keep it hidden!
+ if (sidemenu == 'hiding') {
+ hideMenu(0);
+ } else {
showMenu(0);
- return false;
+ }
+
+ }
+
+ var comments=jQuery("#thePicturePage #comments");
+ if (comments.length == 1) {
+ var comments_button=jQuery("#comments h3");
+
+ if (comments_button.length == 0) {
+ jQuery("#addComment").before("<h3>Comments</h3>");
+ comments_button=jQuery("#comments h3");
+ }
+
+ if (jQuery.cookie('comments') == 'visible') {
+ comments_button.addClass("comments_toggle").addClass("comments_toggle_off");
} else {
- hideMenu(0);
- return false;
+ comments.addClass("comments_hidden");
+ comments_button.addClass("comments_toggle").addClass("comments_toggle_on");
}
- });
+
+ comments_button.click(function() {
- // creates a variable with the contents of the cookie side-menu
- var sidemenu = jQuery.cookie('side-menu');
+ var comments=jQuery("#thePicturePage #comments");
+ if (comments.hasClass("comments_hidden")) {
+ comments.removeClass("comments_hidden");
+ comments_button.addClass("comments_toggle_off").removeClass("comments_toggle_on");;
+ jQuery.cookie('comments', 'visible', {path: "/"});
+ } else {
+ comments.addClass("comments_hidden");
+ comments_button.addClass("comments_toggle_on").removeClass("comments_toggle_off");;
+ jQuery.cookie('comments', 'hidden', {path: "/"});
+ }
+
+ });
- // if cookie says the menu is hiding, keep it hidden!
- if (sidemenu == 'hiding') {
- hideMenu(0);
- } else {
- showMenu(0);
}
-
+
});
|