summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2008-12-28 16:44:23 +0100
committerTomas Bzatek <tbzatek@users.sourceforge.net>2008-12-28 16:44:23 +0100
commit19ac3ad3f64350cdcdfe5bd619f219124788522c (patch)
tree3acf5cc762121d5b23300fd662d6b12c3e29a24e /templates
parentc261763c76fb15c1509ee6b88035b604222edc21 (diff)
downloadcataract-19ac3ad3f64350cdcdfe5bd619f219124788522c.tar.xz
Preserve EXIF table visibility
Diffstat (limited to 'templates')
-rw-r--r--templates/scripts-general.js27
-rw-r--r--templates/template-view_photo.tmpl6
2 files changed, 13 insertions, 20 deletions
diff --git a/templates/scripts-general.js b/templates/scripts-general.js
index cf558c0..df53bfc 100644
--- a/templates/scripts-general.js
+++ b/templates/scripts-general.js
@@ -1,22 +1,15 @@
-function readCookie() {
- var theme = document.cookie;
- var theme = unescape(theme);
-
- return theme;
+function read_exif_table_cookie () {
+ var exif_table_cookie = document.cookie;
+ exif_table_cookie = exif_table_cookie.split ("=");
+ set_exif_table_visibility (exif_table_cookie[1]);
}
-function writeCookie(theme) {
- //FIXME - set expires
- var original_cookie = "theme=" + escape(theme);
- document.cookie = original_cookie;
+function write_exif_table_cookie (visible) {
+ var exif_table_cookie = "exif_table_visible=" + visible;
+ document.cookie = exif_table_cookie;
}
-
-function toggle_div(classname) {
- var div = document.getElementById(classname);
- if(div.style.display == 'none') {
- div.style.display = 'block';
- } else {
- div.style.display = 'none';
- }
+function set_exif_table_visibility (visible) {
+ document.getElementById('exif_table').style.display = visible == "yes" ? 'block' : 'none';
+ document.getElementById('exif_line').style.display = visible == "yes" ? 'none' : 'block';
}
diff --git a/templates/template-view_photo.tmpl b/templates/template-view_photo.tmpl
index 8b54c4f..7185492 100644
--- a/templates/template-view_photo.tmpl
+++ b/templates/template-view_photo.tmpl
@@ -8,7 +8,7 @@
<link href="styles.css" type="text/css" rel="stylesheet" media="screen, print" />
<script type="text/javascript" src="scripts-general.js"> </script>
</head>
-<body>
+<body onload="read_exif_table_cookie();">
<!-- ## Navigation bar -->
@@ -41,7 +41,7 @@
<!-- ## EXIF -->
<div id="exif_table" style="display: none;" class="exif">
-:: <a href="javascript:toggle_div('exif_table');toggle_div('exif_line');" class="exif_line_a">Hide EXIF</a>
+:: <a href="javascript: set_exif_table_visibility('no'); write_exif_table_cookie('no');" class="exif_line_a">Hide EXIF</a>
<table class="exif">
<tbody><tr><td align="right">Date: </td><td><b><!-- $(EXIF_DATE) --></b></td></tr>
<tr><td align="right">Camera: </td><td><b><!-- $(EXIF_CAMERA_MODEL) --></b></td></tr>
@@ -53,7 +53,7 @@
</tbody></table>
</div>
<div style="display: block;" id="exif_line" class="exif">
-:: <a href="javascript:toggle_div('exif_table');toggle_div('exif_line');" class="exif_line_a">Show EXIF</a>
+:: <a href="javascript: set_exif_table_visibility('yes'); write_exif_table_cookie('yes');" class="exif_line_a">Show EXIF</a>
</div>
</div>