Changeset 3881
- Timestamp:
- 09/10/08 17:36:40 (2 months ago)
- Files:
-
- trunk/projects/quickhoney/src (modified) (1 prop)
- trunk/projects/quickhoney/src/config.lisp (modified) (1 diff)
- trunk/projects/quickhoney/src/init.lisp (modified) (1 diff)
- trunk/projects/quickhoney/src/tags.lisp (modified) (6 diffs)
- trunk/projects/quickhoney/src/webserver.lisp (modified) (2 diffs)
- trunk/projects/quickhoney/website/static/frontpage.css (deleted)
- trunk/projects/quickhoney/website/static/image-browse.css (deleted)
- trunk/projects/quickhoney/website/static/index.css (modified) (3 diffs)
- trunk/projects/quickhoney/website/static/javascript.js (modified) (6 diffs)
- trunk/projects/quickhoney/website/templates/frontpage.xml (deleted)
- trunk/projects/quickhoney/website/templates/image-browse.xml (deleted)
- trunk/projects/quickhoney/website/templates/index.xml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/projects/quickhoney/src
- Property svn:ignore set to
site-config.lisp
- Property svn:ignore set to
trunk/projects/quickhoney/src/config.lisp
r2417 r3881 10 10 (defparameter *website-directory* (probe-file (merge-pathnames #p"website/" *root-directory*))) 11 11 12 (defparameter *webserver-port* 808 0)12 (defparameter *webserver-port* 8081) trunk/projects/quickhoney/src/init.lisp
r3473 r3881 32 32 (actor-start (make-instance 'cron-actor)) 33 33 (publish-quickhoney) 34 (when (probe-file "site-config.lisp") 35 (format t "; loading site configuration file~%") 36 (let ((*package* (find-package :quickhoney.config))) 37 (load "site-config.lisp"))) 34 38 (hunchentoot:start-server :port *webserver-port*)) trunk/projects/quickhoney/src/tags.lisp
r3858 r3881 11 11 12 12 (defun image-url (image) 13 (format nil "/ image-browse/~(~A/~A~)/~A"13 (format nil "/~(~A/~A~)/~A" 14 14 (quickhoney-image-category image) 15 15 (quickhoney-image-subcategory image) … … 17 17 18 18 (defun navigation (&key previous up next) 19 (html ((:div :class "nav") 19 (html ((:div :id "logo") 20 ((:img :src "/image/quickhoney-black" :alt "" :id "the_logo"))) 21 ((:div :class "nav") 20 22 (when previous 21 23 (html ((:div :class "previous") … … 30 32 (define-bknr-tag simple-image-browser () 31 33 (tbnl:handle-if-modified-since (last-image-upload-timestamp)) 32 (destructuring-bind (&optional category subcategory image-name) (multiple-value-list (parse-url)) 34 (destructuring-bind (&optional category subcategory image-name) 35 (cdr (mapcar #'hunchentoot:url-decode (cl-ppcre:split "/" (hunchentoot:script-name*)))) 33 36 (cond 34 37 (image-name … … 42 45 (next (cadr (member image images-in-category)))) 43 46 (navigation :previous (and previous (image-url previous)) 44 :up (format nil "/ image-browse/~(~A/~A~)"47 :up (format nil "/~(~A/~A~)" 45 48 (quickhoney-image-category image) 46 49 (quickhoney-image-subcategory image)) 47 50 :next (and next (image-url next))) 48 (html 49 ((:img :src #?"/image/$(image-name)" 50 :class "image" 51 :alt "" 52 :width (bknr.images:store-image-width image) 53 :height (bknr.images:store-image-height image))) 54 ((:div :class "metadata" :style #?"height: $((bknr.images:store-image-height image))px") 55 (:table 56 (:tbody 57 (:tr (:th "name") 58 (:td (:princ image-name))) 59 (:tr (:th "artist") 60 (:td (:princ (bknr.user:user-full-name (or (bknr.user:owned-object-owner image) 61 (bknr.user:find-user "hans")))) 62 ", QuickHoney")) 63 (:tr (:th "date") 64 (:td (:princ (format-date-time (bknr.datastore:blob-timestamp image) :vms-style t :show-time nil)))) 65 (when (and (quickhoney-image-client image) 66 (not (equal "" (quickhoney-image-client image)))) 67 (html (:tr (:th "client") 68 (:td (:princ (quickhoney-image-client image)))))) 69 (when (quickhoney-image-spider-keywords image) 70 (html (:tr (:th "keywords") 71 (:td (:princ (quickhoney-image-spider-keywords image)))))))))))) 51 (html 52 (:h1 (:princ #?"$(category) / $(subcategory)")) 53 ((:img :src #?"/image/$(image-name)" 54 :class "image" 55 :alt "" 56 :width (bknr.images:store-image-width image) 57 :height (bknr.images:store-image-height image))) 58 ((:div :class "metadata" :style #?"height: $((bknr.images:store-image-height image))px") 59 (:table 60 (:tbody 61 (:tr (:th "name") 62 (:td (:princ image-name))) 63 (:tr (:th "artist") 64 (:td (:princ (bknr.user:user-full-name (or (bknr.user:owned-object-owner image) 65 (bknr.user:find-user "hans")))) 66 ", QuickHoney")) 67 (:tr (:th "date") 68 (:td (:princ (format-date-time (bknr.datastore:blob-timestamp image) :vms-style t :show-time nil)))) 69 (when (and (quickhoney-image-client image) 70 (not (equal "" (quickhoney-image-client image)))) 71 (html (:tr (:th "client") 72 (:td (:princ (quickhoney-image-client image)))))) 73 (when (quickhoney-image-spider-keywords image) 74 (html (:tr (:th "keywords") 75 (:td (:princ (quickhoney-image-spider-keywords image)))))))))))) 72 76 (subcategory 73 (navigation :up (format nil "/ image-browse/~(~A~)" category))77 (navigation :up (format nil "/~(~A~)" category)) 74 78 (html 75 79 (:h1 (:princ #?"$(category) / $(subcategory)")) … … 79 83 :key #'bknr.datastore:blob-timestamp)) 80 84 (html 81 (:li ((:a :href #?"/ image-browse/$(category)/$(subcategory)/$((bknr.images:store-image-name image))")85 (:li ((:a :href #?"/$(category)/$(subcategory)/$((bknr.images:store-image-name image))") 82 86 (:princ (bknr.images:store-image-name image))))))))) 83 87 (category 84 (navigation :up "/ image-browse")88 (navigation :up "/") 85 89 (html 86 90 (:h1 (:princ category)) … … 88 92 (dolist (subcategory (subcategories-of (make-keyword-from-string category))) 89 93 (html 90 (:li ((:a :href (format nil "/ image-browse/~A/~(~A~)" category subcategory)))94 (:li ((:a :href (format nil "/~A/~(~A~)" category subcategory))) 91 95 (:princ subcategory))))))) 92 96 (t 93 (html 94 (:h1 ((:a :href "/image-browse/pixel") 95 "Nana Rausch")) 96 (:h1 ((:a :href "/image-browse/vector") "Peter") " " 97 ((:a :href "/image-browse/pen") "Stemmler"))))) 98 (html 99 ((:script :type "text/javascript") 100 (:princ #?"document.location.href = document.location.href.replace(/\\/image-browse\\//, '/index#');"))))) 97 (emit-tag-children))))) 101 98 102 99 (define-bknr-tag login-status () trunk/projects/quickhoney/src/webserver.lisp
r3872 r3881 38 38 ("/json-news-archive" json-news-archive-handler) 39 39 ("/json-news" json-news-handler) 40 ("/" template-handler41 :default-template "frontpage"42 :destination ,(namestring (merge-pathnames "templates/" *website-directory*))43 :command-packages (("http://quickhoney.com/" . :quickhoney.tags)44 ("http://bknr.net/" . :bknr.web)))45 40 user 46 41 images … … 51 46 ("/favicon.ico" file-handler 52 47 :destination ,(merge-pathnames #p"static/favicon.ico" *website-directory*) 53 :content-type "application/x-icon")) 48 :content-type "application/x-icon") 49 ("/" template-handler 50 :default-template "index" 51 :catch-all t 52 :destination ,(namestring (merge-pathnames "templates/" *website-directory*)) 53 :command-packages (("http://quickhoney.com/" . :quickhoney.tags) 54 ("http://bknr.net/" . :bknr.web)))) 54 55 :admin-navigation '(("user" . "/user/") 55 56 ("images" . "/edit-images") trunk/projects/quickhoney/website/static/index.css
r3868 r3881 7 7 a:active { outline: none } 8 8 a:focus { -moz-outline-style: none } 9 10 #logo {11 margin: 290px 0px 305px 105px;12 }13 9 14 10 .page { … … 328 324 #cue { 329 325 position: absolute; 330 visibility: visible;326 visibility: hidden; 331 327 left: 0px; 332 328 background-color: white; … … 617 613 } 618 614 615 #loading #logo { 616 margin: 0px 0px 80px 105px; 617 } 618 619 #loading p { 620 margin: 1em; 621 } 622 #loading div p { 623 margin: 2em; 624 } 625 626 /* styles for the image detail window */ 627 619 628 #loading h1 { 620 text-align: center; 621 margin: 5em 0em 5em 0em; 622 } 629 font-size: 120%; 630 margin-bottom: 20px; 631 } 632 633 #loading th { 634 font-size: 70%; 635 padding: 0px 5px 0px 5px; 636 } 637 638 #loading #logo { 639 position: absolute; 640 right: 10px; 641 top: 10px; 642 z-index: 2; 643 } 644 645 #loading .image { 646 position: absolute; 647 z-index: 5; 648 top: 50px; 649 left: 300px; 650 } 651 652 #loading .nav { 653 position: absolute; 654 top: 80px; 655 left: 8px; 656 } 657 658 #loading .nav .previous { 659 position: absolute; 660 left: 34px; 661 } 662 663 #loading .nav .up { 664 position: absolute; 665 left: 65px; 666 } 667 668 #loading .nav .next { 669 position: absolute; 670 left: 91px; 671 } 672 673 #loading .metadata { 674 z-index: 3; 675 background-color: white; 676 } 677 678 #loading #footer { 679 padding-top: 30px; 680 font-size: 70%; 681 } trunk/projects/quickhoney/website/static/javascript.js
r3872 r3881 252 252 { 253 253 var color = pages[item.category] ? pages[item.category].link_color : '000000'; 254 var link_dest = { href: '/index#' + item.category + '/' + item.subcategory + '/' + encodeURI(item.name), 255 onclick: function () { jump_to(item.category + '/' + item.subcategory + '/' + item.name) } }; 254 var path = item.category + '/' + item.subcategory + '/' + encodeURI(item.name); 256 255 return DIV({ 'class': 'newsentry autonews news_' + item.category }, 257 A( link_dest,256 A({ href: '/#' + path, onclick: function () { jump_to(path) } }, 258 257 IMG({ src: "/image/" + encodeURI(item.name) + '/cutout-button,,' + color + ',98,98,0,' + item.category, 259 258 width: 98, height: 98 })), … … 261 260 H1(null, item.name), 262 261 item.date, ' by ', item.owner, ' | ', 263 A( link_dest, 'permalink'),262 A({ href: '/' + path, onclick: function () { jump_to(path) } }, 'permalink'), 264 263 BR(), 265 264 item.description)); … … 285 284 H1(null, item.title), 286 285 item.date, ' by ', item.owner, ' | ', 287 A({ href: ' #news/' + item.name }, 'permalink'),286 A({ href: 'news/' + item.name }, 'permalink'), 288 287 BR(), 289 288 DIV({ 'class': 'item-text' }, item.text), … … 1118 1117 } 1119 1118 1120 /* open the main browser window */1121 1122 function frontpage() {1123 var index_window = window.open('index', "index", "width=720,height=872,status=no,toolbar=no,menubar=no,resizable=no,scrollbars=yes");1124 index_window.focus();1125 1126 return true;1127 }1128 1129 1119 /* main initialization routine */ 1130 1120 … … 1154 1144 loadJSONDoc('/json-news-archive/quickhoney').addCallbacks(initialize_news_archive, alert); 1155 1145 1156 if (!document.location.href.match(/#/)) { 1157 document.location.href += '#home'; 1158 } 1146 path = 'home'; 1147 if (document.location.pathname != '/') { 1148 path = document.location.pathname.substr(1); 1149 } else if (document.location.href.match(/#./)) { 1150 path = document.location.href.substr(document.location.href.indexOf("#") + 1); 1151 } 1152 document.location.href = "/#" + path; 1159 1153 1160 1154 poll_path(); … … 1203 1197 checkboxes[i].checked = b; 1204 1198 } 1205 }1206 1207 /* robot_check() redirects to the real system if the client is not a robot */1208 1209 function robot_check()1210 {1211 document.location.href = document.location.href.replace(/\/image-browse.*/, "index#");1212 1199 } 1213 1200 trunk/projects/quickhoney/website/templates/index.xml
r3872 r3881 67 67 68 68 <div id="loading" class="page"> 69 <img alt="" src="/image/startscreen" id="logo" border="0" width="438" height="67" /> 69 <quickhoney:simple-image-browser> 70 <img alt="" src="/image/startscreen" id="logo" border="0" width="438" height="67" /> 71 72 <h1>QuickHoney Illustrations</h1> 73 <p>Studio for Illustration, New York</p> 74 <h1>Peter Stemmler</h1> 75 <p>Phone: 646.270.5562<br/>Email: p@quickhoney.com</p> 76 <p>Works: <a href="/vector">vector</a> and <a href="/pen">pen</a></p> 77 <h1>Nana Rausch</h1> 78 <p>Phone 646.270.5592<br/>Email: n@quickhoney.com</p> 79 <p>Works: <a href="/pixel">pixel</a></p> 80 </quickhoney:simple-image-browser> 70 81 </div> 71 82
