diff options
author | Zaphod <zaphod@piwigo.org> | 2012-03-04 21:45:11 +0000 |
---|---|---|
committer | Zaphod <zaphod@piwigo.org> | 2012-03-04 21:45:11 +0000 |
commit | 6c5a97c6acd399717865e29ca1a0281315ff90d5 (patch) | |
tree | fde436e19781dd977e3b1570f8b3836b9da75544 /themes/elegant/scripts.js | |
parent | 27e26d5080edc9e15f0b30c0cdcb08bb7c52b1d5 (diff) |
feature 2587: theme elegant, script & theme update
git-svn-id: http://piwigo.org/svn/trunk@13479 68402e56-0260-453c-a942-63ccdbb3a9ee
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);
}
-
+
});
|