Fwd: Thumbnail preview in Capture

Boyan Sheytanov boyan.sheytanov at asteasolutions.com
Tue Dec 1 10:58:59 UTC 2009


Forgot to choose the right mail again. Please see below.


---------- Forwarded message ----------
From:  <fluid-work-owner at fluidproject.org>
Date: 2009/12/1
Subject: Thumbnail preview in Capture
To: bsheytanov at gmail.com


Thank you for posting to the fluid-work mailing list. Unfortunately,
we are unable to post your message because you are not a member of the
list. Please join the fluid-work mailing list
(http://fluidproject.org/mailman/listinfo/fluid-work) and repost your
message, or contact the list administrators
fluid-work-owner at fluidproject.org for help.




---------- Forwarded message ----------
From: Boyan Sheytanov <bsheytanov at gmail.com>
To: "Michelle D'Souza" <michelle.dsouza at utoronto.ca>, Jonathan Hung
<jonathan.hung at utoronto.ca>
Date: Tue, 1 Dec 2009 12:43:52 +0200
Subject: Thumbnail preview in Capture
Hi,

I've commited a version of the Capture component that correctly uses
the Reorderer and shows the selected thumbnail in preview. I have a
couple of questions though:

1. Is there a way to prevent the default action of an event without
having the event itself? I am listening for the "onSelect" event of
the Reorderer, which has a single argument - the item selected. I do
not want to follow the link but couldn't find a way to prevent the
default action since I do not have the event object (I had changed the
href to "#" in order to stay on the same page).
2. How do you approach error handling? I receive the item that is
selected in the Reorderer and look for an image tag. What if due to
some reason there is no such tag (or there are two)? I added a check
for that, invoking fluid.fail, but since I didn't see many similar
calls in other components so I am wondering if I have done the right
thing.
3. I am using primarily jQuery to extract and substitute the source
from the image tag. Should I try to use the model of the component
(the list of images instead)? This would require to add some indexing
(probably a hidden input field) and synchronization of the model after
reordering.

Seems like I am behind schedule. What's left from the Capture
component (apart from styling), is making the Take picture button
change the model (add a new thumbnail and select it). I also need to
write some tests. If we are going to have a first deliverable
mid-December, it is probably best to include only the Capture screen
with some basic styling and integration with the CherryPy server. I
might have some additional questions on changing the model pretty
soon.

Greetings,

Boyan



More information about the fluid-work mailing list