[bknr-cvs] hans changed trunk/projects/quickhoney/
BKNR Commits
bknr at bknr.net
Tue Sep 9 15:25:03 UTC 2008
Revision: 3868
Author: hans
URL: http://bknr.net/trac/changeset/3868
Fix space between buttons.
Repair "full image" display window.
Automatically download iPhone pictures.
U trunk/projects/quickhoney/src/imageproc.lisp
A trunk/projects/quickhoney/website/static/image-full.css
A trunk/projects/quickhoney/website/static/image-full.js
U trunk/projects/quickhoney/website/static/index.css
U trunk/projects/quickhoney/website/static/javascript.js
U trunk/projects/quickhoney/website/templates/image-full.xml
Modified: trunk/projects/quickhoney/src/imageproc.lisp
===================================================================
--- trunk/projects/quickhoney/src/imageproc.lisp 2008-09-09 13:21:02 UTC (rev 3867)
+++ trunk/projects/quickhoney/src/imageproc.lisp 2008-09-09 15:25:03 UTC (rev 3868)
@@ -3,6 +3,8 @@
(defparameter *button-size* 208)
(defparameter *big-button-size* 318)
+(cl-interpol:enable-interpol-syntax)
+
(defun corner-cutout-coords (image-width image-height radius)
"Return a list of coordinates that need to be made transparent or
colored in background color to get a rounded corner effect.
@@ -127,4 +129,8 @@
(corner-image :image output-image
:radius +news-image-corner-radius+
:corner-color (allocate-color 255 255 255 :image output-image))
- output-image))
\ No newline at end of file
+ output-image))
+
+(define-imageproc-handler download (input-image filename)
+ (setf (tbnl:header-out :content-disposition) #?"attachment; filename=$(filename)")
+ input-image)
\ No newline at end of file
Added: trunk/projects/quickhoney/website/static/image-full.css
===================================================================
--- trunk/projects/quickhoney/website/static/image-full.css (rev 0)
+++ trunk/projects/quickhoney/website/static/image-full.css 2008-09-09 15:25:03 UTC (rev 3868)
@@ -0,0 +1,7 @@
+/* styles for the full image display window */
+
+#logo {
+ position: absolute;
+ bottom: 18px;
+ left: 18px;
+}
\ No newline at end of file
Added: trunk/projects/quickhoney/website/static/image-full.js
===================================================================
--- trunk/projects/quickhoney/website/static/image-full.js (rev 0)
+++ trunk/projects/quickhoney/website/static/image-full.js 2008-09-09 15:25:03 UTC (rev 3868)
@@ -0,0 +1,15 @@
+/* Used from image-full to load the current image */
+
+function load_image() {
+ var hash_index = document.location.href.indexOf('#');
+
+ if (hash_index != -1) {
+ // safari does not seem to support split, ie5mac does not have encodeURI and decodeURI. oh my!
+ var argument = unescape(document.location.href.substr(hash_index + 1));
+
+ document.getElementById("the_image").src = "/image/" + argument;
+ } else {
+ alert('missing image name');
+ }
+}
+
Modified: trunk/projects/quickhoney/website/static/index.css
===================================================================
--- trunk/projects/quickhoney/website/static/index.css 2008-09-09 13:21:02 UTC (rev 3867)
+++ trunk/projects/quickhoney/website/static/index.css 2008-09-09 15:25:03 UTC (rev 3868)
@@ -277,34 +277,42 @@
a.home_button {
visibility: inherit;
- margin: 0px 7px 0px 0px;
border-width: 0px;
}
a.home_button img {
+ margin-left: 12px;
width: 318px;
height: 318px;
}
+a.home_button:first-child img {
+ margin-left: 0px;
+}
+
#home div {
- padding-bottom: 10px;
+ padding-bottom: 12px;
}
/* directory */
a.button {
visibility: inherit;
- margin: 0px 7px 0px 0px;
border-width: 0px;
}
a.button img {
+ margin-left: 12px;
width: 208px;
height: 208px;
}
+a.button:first-child img {
+ margin-left: 0px;
+}
+
#directory div {
- padding-bottom: 10px;
+ padding-bottom: 12px;
}
/* footer */
Modified: trunk/projects/quickhoney/website/static/javascript.js
===================================================================
--- trunk/projects/quickhoney/website/static/javascript.js 2008-09-09 13:21:02 UTC (rev 3867)
+++ trunk/projects/quickhoney/website/static/javascript.js 2008-09-09 15:25:03 UTC (rev 3868)
@@ -621,6 +621,7 @@
return A({ href: '#' + category, 'class': 'home_button'},
IMG({ id: 'home_' + category,
'class': 'button-image',
+ width: 318, height: 318,
src: random_button_image('home', category, 318, 318, category),
style: 'visibility: hidden' }));
}
@@ -1038,21 +1039,6 @@
detail_window.focus();
}
-/* Used from image-full to load the current image */
-
-function load_image() {
- var hash_index = document.location.href.indexOf('#');
-
- if (hash_index != -1) {
- // safari does not seem to support split, ie5mac does not have encodeURI and decodeURI. oh my!
- var argument = unescape(document.location.href.substr(hash_index + 1));
-
- $("the_image").src = "/image/" + argument;
- } else {
- alert('missing image name');
- }
-}
-
/* open the upload window */
function do_upload(target) {
@@ -1231,7 +1217,7 @@
}
function make_ipod_image() {
- window.open('/image/' + encodeURI(current_image.name) + '/cell,,320,480');
+ window.open('/image/' + encodeURI(current_image.name) + '/cell,,320,480/download,' + encodeURI(current_image.name) + '.jpg');
}
NOTICE = partial(SPAN, { 'class': 'notice' });
Modified: trunk/projects/quickhoney/website/templates/image-full.xml
===================================================================
--- trunk/projects/quickhoney/website/templates/image-full.xml 2008-09-09 13:21:02 UTC (rev 3867)
+++ trunk/projects/quickhoney/website/templates/image-full.xml 2008-09-09 15:25:03 UTC (rev 3868)
@@ -1,30 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
- xmlns="http://www.w3.org/1999/xhtml"
- xmlns:bknr="http://bknr.net"
- >
- <head>
- <link rel="stylesheet" href="/static/styles.css" />
- <script src="/MochiKit/MochiKit.js" type="text/javascript"> </script>
- <script src="/static/javascript.js" type="text/javascript"> </script>
- <title>QuickHoney image</title>
- </head>
- <body id="imagedetail">
- <div id="logo">
- <a href="javascript:window.close()">
- <img src="/image/quickhoney-black" id="the_logo" name="logo" border="0" />
- </a>
- </div>
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:bknr="http://bknr.net"
+ >
+ <head>
+ <link rel="stylesheet" href="/static/yui/reset-fonts/reset-fonts.css" />
+ <link rel="stylesheet" href="/static/image-full.css" />
+ <script src="/static/image-full.js" type="text/javascript"> </script>
+ <title>QuickHoney image</title>
+ </head>
+ <body id="imagedetail">
+ <div id="logo">
+ <a href="javascript:window.close()">
+ <img src="/image/quickhoney-black" id="the_logo" name="logo" border="0" />
+ </a>
+ </div>
- <div id="image">
- <a href="javascript:window.close()">
- <img src="/image/trans" id="the_image" name="image" border="0" />
- </a>
- </div>
- </body>
- <script language="javascript">
- load_image();
- </script>
+ <div id="image">
+ <a href="javascript:window.close()">
+ <img src="/image/trans" id="the_image" name="image" border="0" />
+ </a>
+ </div>
+ </body>
+ <script language="javascript">
+ load_image();
+ </script>
</html>
More information about the Bknr-cvs
mailing list