[bknr-cvs] hans changed trunk/projects/quickhoney/website/static/javascript.js

BKNR Commits bknr at bknr.net
Fri Sep 12 04:34:22 UTC 2008


Revision: 3893
Author: hans
URL: http://bknr.net/trac/changeset/3893

permalink am image detail

U   trunk/projects/quickhoney/website/static/javascript.js

Modified: trunk/projects/quickhoney/website/static/javascript.js
===================================================================
--- trunk/projects/quickhoney/website/static/javascript.js	2008-09-11 18:11:33 UTC (rev 3892)
+++ trunk/projects/quickhoney/website/static/javascript.js	2008-09-12 04:34:21 UTC (rev 3893)
@@ -249,6 +249,10 @@
   }
 }
 
+function permalink(path) {
+    return A({ href: '/' + path, onclick: function () { document.location.href = '#' + path; return false; } }, 'permalink');
+}
+
 function make_upload_item(item)
 {
     var color = pages[item.category] ? pages[item.category].link_color : '000000';
@@ -260,7 +264,7 @@
                DIV(null,
                    H1(null, item.name),
                    item.date, ' by ', item.owner, ' | ',
-                   A({ href: '/' + path, onclick: function () { jump_to(path) } }, 'permalink'),
+                   permalink(path),
                    BR(),
                    item.description));
 }
@@ -284,7 +288,7 @@
                DIV(null,
                    H1(null, item.title),
                    item.date, ' by ', item.owner, ' | ',
-                   A({ href: 'news/' + item.name }, 'permalink'),
+                   permalink('news/' + item.name),
                    BR(),
                    DIV({ 'class': 'item-text' }, item.text),
                    delete_button));
@@ -1004,15 +1008,18 @@
 
     var image_info = [];
 
-    replaceChildNodes("metadata", "Image name: ", current_image.name, BR());
+    var link = current_directory + '/' + current_subdirectory + '/' + encodeURI(query_result[query_position].name);
+
+    replaceChildNodes("metadata", "Image name: ", current_image.name, " ", permalink(link), BR());
     if (current_image.client != "") {
 	appendChildNodes("metadata", "Client: ", current_image.client, BR());
     }
-    appendChildNodes("metadata", current_image.width + "x" + current_image.height + "px | " + percent + "%");
 
+    appendChildNodes("metadata", current_image.width + "x" + current_image.height
+                     + "px | " + percent + "%");
+
     if (may_enlarge) {
-	replaceChildNodes("full_click", A({ href: '#' + current_directory + '/' + current_subdirectory + '/'
-                                                      + encodeURI(query_result[query_position].name), onclick: enlarge },
+	replaceChildNodes("full_click", A({ href: '#' + link, onclick: enlarge },
                                           "full size"));
     } else {
 	replaceChildNodes("full_click");




More information about the Bknr-cvs mailing list