[bknr-cvs] r1975 - in branches/xml-class-rework/projects/quickhoney: src website/static

bknr at bknr.net bknr at bknr.net
Sun Jul 23 16:07:35 UTC 2006


Author: hhubner
Date: 2006-07-23 12:07:35 -0400 (Sun, 23 Jul 2006)
New Revision: 1975

Modified:
   branches/xml-class-rework/projects/quickhoney/src/image.lisp
   branches/xml-class-rework/projects/quickhoney/website/static/javascript.js
Log:
Add deep link support for RSS


Modified: branches/xml-class-rework/projects/quickhoney/src/image.lisp
===================================================================
--- branches/xml-class-rework/projects/quickhoney/src/image.lisp	2006-07-23 16:07:05 UTC (rev 1974)
+++ branches/xml-class-rework/projects/quickhoney/src/image.lisp	2006-07-23 16:07:35 UTC (rev 1975)
@@ -20,12 +20,6 @@
 	    (store-object-remove-keywords image 'bknr.web::keywords '(:import)))
 	(get-keywords-intersection-store-images '(:import))))
 
-(define-persistent-class quickhoney-animation-image (quickhoney-image)
-  ((animation :update)))
-
-(defmethod destroy-object :before ((image quickhoney-animation-image))
-  (delete-object (quickhoney-animation-image-animation image)))
-
 (defmethod rss-item-channel ((item quickhoney-image))
   "quickhoney")
 
@@ -36,4 +30,24 @@
   (format nil "~A~@[ (Client: ~A)~]" (store-image-name image) (quickhoney-image-client image)))
 
 (defmethod rss-item-link ((image quickhoney-image))
-  (format nil "http://quickhoney.com/image/~A" (store-image-name image)))
\ No newline at end of file
+  (make-image-link image))
+
+(defmethod rss-item-guid ((image quickhoney-image))
+  (make-image-link image))
+
+(defmethod quickhoney-image-category ((image quickhoney-image))
+  (first (intersection (store-image-keywords image) '(:pixel :vector :photo :contact))))
+
+(defmethod quickhoney-image-subcategory ((image quickhoney-image))
+  (first (set-difference (store-image-keywords image) '(:pixel :vector :photo :button :contact :published :upload))))
+
+(defmethod make-image-link ((image quickhoney-image))
+  (format nil "http://quickhoney.com/index?jumpto=~(~A/~A~)/~A"
+	  (quickhoney-image-category image) (quickhoney-image-subcategory image) (store-image-name image)))
+
+(define-persistent-class quickhoney-animation-image (quickhoney-image)
+  ((animation :update)))
+
+(defmethod destroy-object :before ((image quickhoney-animation-image))
+  (delete-object (quickhoney-animation-image-animation image)))
+

Modified: branches/xml-class-rework/projects/quickhoney/website/static/javascript.js
===================================================================
--- branches/xml-class-rework/projects/quickhoney/website/static/javascript.js	2006-07-23 16:07:05 UTC (rev 1974)
+++ branches/xml-class-rework/projects/quickhoney/website/static/javascript.js	2006-07-23 16:07:35 UTC (rev 1975)
@@ -231,7 +231,20 @@
     document.getElementById("browse").style.visibility = 'hidden';
     document.getElementById("results").style.visibility = 'visible';
 
-    display_thumbnail_page();
+    if (document.show_picture) {
+	debug('directly jump to ' + document.show_picture);
+	for (var i = 0; i < query_result.length; i++) {
+	    debug('got: ' + query_result[i].name + ' want ' + document.show_picture);
+	    if (query_result[i].name == document.show_picture) {
+		debug('name: ' + query_result[i].name);
+		display_image(i);
+		break;
+	    }
+	}
+	document.show_picture = null;
+    } else {
+	display_thumbnail_page();
+    }
 
     display_path();
 }
@@ -589,6 +602,14 @@
 
 	document.getElementById("contactimage").src = button_images['contact/contact'];
     }
+
+    if (document.jump_to) {
+	var components = document.jump_to.split("/");
+	document.jump_to = null;
+	show_page(components[0]);
+	subdirectory(components[1]);
+	document.show_picture = components[2];
+    }
 }
 
 function load_button_images() {
@@ -1017,6 +1038,12 @@
 	show_cms_window("login_form");
     }
 
+    if (document.location.href.indexOf("jumpto=") != -1) {
+	var jump_to = document.location.href.replace(/.*jumpto=/, "");
+	jump_to = jump_to.replace(/[&#].*/, "");
+	document.jump_to = jump_to;
+    }
+
     buttons = document.getElementById("directory").getElementsByTagName('img');
     button_links = document.getElementById("directory").getElementsByTagName('a');
 




More information about the Bknr-cvs mailing list