[bknr-cvs] hans changed trunk/projects/quickhoney/

BKNR Commits bknr at bknr.net
Sun Sep 7 19:17:25 UTC 2008


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

Finishing touches before calling it "beta".

U   trunk/projects/quickhoney/src/handlers.lisp
U   trunk/projects/quickhoney/src/imageproc.lisp
U   trunk/projects/quickhoney/upgrade-stuff/import.lisp
U   trunk/projects/quickhoney/website/static/index.css
U   trunk/projects/quickhoney/website/static/javascript.js
U   trunk/projects/quickhoney/website/templates/index.xml

Modified: trunk/projects/quickhoney/src/handlers.lisp
===================================================================
--- trunk/projects/quickhoney/src/handlers.lisp	2008-09-07 16:10:38 UTC (rev 3832)
+++ trunk/projects/quickhoney/src/handlers.lisp	2008-09-07 19:17:25 UTC (rev 3833)
@@ -2,6 +2,9 @@
 
 (enable-interpol-syntax)
 
+(defparameter *editable-keywords* '(:explicit :buy-file :buy-print :buy-t-shirt)
+  "List of keywords that are image keywords which can be edited through the CMS")
+
 (defclass quickhoney-image-handler (page-handler)
   ()
   (:documentation "Mixin for handlers whose response only depend on
@@ -72,9 +75,6 @@
 (defclass json-image-query-handler (object-handler quickhoney-image-handler)
   ())
 
-(defparameter *editable-keywords* '(:explicit :buy-file :buy-print :buy-t-shirt)
-  "List of keywords that are image keywords which can be edited through the CMS")
-
 (defun images-in-category-sorted-by-time (cat-sub)
   (sort (copy-list (images-in-category cat-sub))
         #'> :key #'blob-timestamp))
@@ -255,7 +255,8 @@
                               (newest-images category subcategory)
                               (warn "No images for ~A ~A found" category subcategory))
                         (encode-array-element type)
-                        (dolist (image images)
+                        (dolist (image (or images
+                                           (list (store-image-with-name "trans"))))
                           (encode-array-element (store-object-id image))
                           (when (zerop (decf count))
                             (return)))))))))))))

Modified: trunk/projects/quickhoney/src/imageproc.lisp
===================================================================
--- trunk/projects/quickhoney/src/imageproc.lisp	2008-09-07 16:10:38 UTC (rev 3832)
+++ trunk/projects/quickhoney/src/imageproc.lisp	2008-09-07 19:17:25 UTC (rev 3833)
@@ -36,9 +36,9 @@
     (unless corner-color
       (setf (save-alpha-p) t
             corner-color (if (true-color-p) #x7f000000
-                                 (or (transparent-color)
-                                     (allocate-color 255 255 255 :alpha 127)
-                                     (error "can't allocate transparent color for button")))
+                             (or (transparent-color)
+                                 (allocate-color 255 255 255 :alpha 127)
+                                 (error "can't allocate transparent color for button")))
             (transparent-color) corner-color))
     (let ((coords (corner-cutout-coords (image-width) (image-height) radius)))
       (destructuring-bind (x-tx y-tx) (car coords)
@@ -59,7 +59,6 @@
                                                    (button-height "208")
                                                    (radius "8")
                                                    category)
-  (declare (ignore background-color))
   (let* ((button-width (parse-integer button-width))
          (button-height (parse-integer button-height))
          (button-image (create-image button-width button-height t))
@@ -92,7 +91,9 @@
                       0 0
                       (image-width type-image) (image-height type-image)))))
     (unless (zerop radius)
-      (corner-image :image button-image :radius radius))
+      (corner-image :image button-image
+                    :radius radius
+                    :corner-color (parse-color background-color :image button-image)))
     button-image))
 
 (define-imageproc-handler center-thumbnail (input-image width height)

Modified: trunk/projects/quickhoney/upgrade-stuff/import.lisp
===================================================================
--- trunk/projects/quickhoney/upgrade-stuff/import.lisp	2008-09-07 16:10:38 UTC (rev 3832)
+++ trunk/projects/quickhoney/upgrade-stuff/import.lisp	2008-09-07 19:17:25 UTC (rev 3833)
@@ -65,6 +65,10 @@
             (:pixel (find-user "n"))
             (t (find-user "hans"))))))
 
+(with-transaction (:initialize-shop)
+  (dolist (image (images-in-category '(:shop)))
+    (setf (slot-value image 'cat-sub) '(:shop :shop))))
+
 (with-transaction (:initialize-news)
   (setf (slot-value (find-rss-channel "quickhoney") 'bknr.rss::items)
         (sort (remove-if (lambda (image)
@@ -73,8 +77,3 @@
               #'>
               :key #'blob-timestamp)))
 
-(dolist (image (class-instances 'quickhoney-image))
-  (unless (and (quickhoney-image-category image)
-               (quickhoney-image-subcategory image))
-    (format t "~A ~A~%" (store-image-name image) (store-image-keywords image))))
-

Modified: trunk/projects/quickhoney/website/static/index.css
===================================================================
--- trunk/projects/quickhoney/website/static/index.css	2008-09-07 16:10:38 UTC (rev 3832)
+++ trunk/projects/quickhoney/website/static/index.css	2008-09-07 19:17:25 UTC (rev 3833)
@@ -14,6 +14,11 @@
         padding-top: 116px;
 }
 
+body.loading #loading {
+        display: block;
+	visibility: inherit;
+}
+
 body.home #home {
         display: block;
 	visibility: inherit;
@@ -605,3 +610,7 @@
 	float: left;
 }
 
+#loading h1 {
+	text-align: center;
+	margin: 5em 0em 5em 0em;
+}
\ No newline at end of file

Modified: trunk/projects/quickhoney/website/static/javascript.js
===================================================================
--- trunk/projects/quickhoney/website/static/javascript.js	2008-09-07 16:10:38 UTC (rev 3832)
+++ trunk/projects/quickhoney/website/static/javascript.js	2008-09-07 19:17:25 UTC (rev 3833)
@@ -1166,6 +1166,8 @@
 }
 
 function init() {
+    $('loading').style.display = 'none';
+
     if (navigator.userAgent.indexOf("Safari") != -1) {
 	safari = true;
 	safari_compatibility_hack();

Modified: trunk/projects/quickhoney/website/templates/index.xml
===================================================================
--- trunk/projects/quickhoney/website/templates/index.xml	2008-09-07 16:10:38 UTC (rev 3832)
+++ trunk/projects/quickhoney/website/templates/index.xml	2008-09-07 19:17:25 UTC (rev 3833)
@@ -22,7 +22,7 @@
     <title>QuickHoney</title>
   </head>
 
-  <body id="body">
+  <body id="body" class="loading">
 
     <div id="overlay" class="page">
     </div>
@@ -60,6 +60,10 @@
       <div id="version" class="text"><quickhoney:version-and-last-change /></div>
     </div>
 
+    <div id="loading" class="page">
+      <h1>Loading site...</h1>
+    </div>
+
     <div id="home" class="page">
       <div>
         <a href="#pixel" class="home_button">




More information about the Bknr-cvs mailing list