Jump to content


Photo

Release: Thumbnails

Module

  • Please log in to reply
225 replies to this topic

#1 apeisa

apeisa

    Hero Member

  • Moderators
  • 2,530 posts
  • 859

  • LocationVihti, Finland

Posted 15 November 2011 - 04:45 PM

https://github.com/apeisa/Thumbnails

Template usage:
echo $page->cropImages->eq(0)->getThumb('thumbnail');

Better docs coming soon.

Development sponsored by: http://stillmovingdesign.com.au/

#2 Soma

Soma

    Hero Member

  • Moderators
  • 3,218 posts
  • 1764

  • LocationSH, Switzerland

Posted 15 November 2011 - 05:12 PM

Wohoooh! What have you done?

Another eastern egg? ;)


Can't wait to try out later if I'm not fallen as sleep...

@somartist | modules created | support me, flattr my work flattr.com


#3 martinluff

martinluff

    Full Member

  • Members
  • PipPipPip
  • 79 posts
  • 2

  • LocationChristchurch NZ

Posted 15 November 2011 - 10:06 PM

Yay, nice work... Yet another practical and very useful addition. Thanks for the work on this.

#4 apeisa

apeisa

    Hero Member

  • Moderators
  • 2,530 posts
  • 859

  • LocationVihti, Finland

Posted 16 November 2011 - 02:31 AM

Just tested this on another site setup, and I have few minor bugs. It's usable, but previews won't show due js-error. I'll do quick fix for that at evening or tomorrow.

#5 ryan

ryan

    Hero Member

  • Administrators
  • 5,781 posts
  • 3125

  • LocationAtlanta, GA

Posted 16 November 2011 - 09:40 AM

Nice work Antti! This is really coming together nicely.

#6 Soma

Soma

    Hero Member

  • Moderators
  • 3,218 posts
  • 1764

  • LocationSH, Switzerland

Posted 16 November 2011 - 09:57 AM

I quickly tried last night, and there's still some things.

- when I have the crop image field in a tab, and upload an image the layout is messed (tabs overlap title). I can't provide more infos ATM (will make screenshot later, but I'm busy)

- I don't like the thumb links... should be better (more clear) . And is it possible to put them inside the "fieldset"?
I would like if it's something like :
thumbnail - edit"
big - edit

- when there is big images, it's impossible or very akward to use it.

- when I upload (html5) an image, I can't use preview fancybox before it's saved.

@somartist | modules created | support me, flattr my work flattr.com


#7 apeisa

apeisa

    Hero Member

  • Moderators
  • 2,530 posts
  • 859

  • LocationVihti, Finland

Posted 16 November 2011 - 05:28 PM

Ok guys, sorry about last version - there was bug in previews that assumed your fieldname was "cropImages"...

This version is actually pretty nice. I commented the modal view out, since it was really annoying with bigger images. You really want all the possible space there. Also added timestamps for image urls in admin to prevent browser cache. It seems to help.

I have few things for the future:

  • Remove thumbnails after actual image is removed
  • Allow resizing thumbnails in your templates.

Attached Thumbnails

  • preview.gif


#8 ryan

ryan

    Hero Member

  • Administrators
  • 5,781 posts
  • 3125

  • LocationAtlanta, GA

Posted 16 November 2011 - 05:40 PM

That preview looks awesome. I can't seem to get it to work here though (FF7). I'm getting a JS error "event is not defined" on this line in InputfieldCropImage.js:
if( event.type === 'mouseover' ) {


#9 apeisa

apeisa

    Hero Member

  • Moderators
  • 2,530 posts
  • 859

  • LocationVihti, Finland

Posted 16 November 2011 - 05:43 PM

Heh, I did test this on Chrome and IE9... And now that I test it on Firefox the preview fails here too. Is FF new IE? :)

Should be quick fix though. Thanks for finding that one Ryan!

#10 apeisa

apeisa

    Hero Member

  • Moderators
  • 2,530 posts
  • 859

  • LocationVihti, Finland

Posted 16 November 2011 - 05:52 PM

And fixed on latest commit. It was this one (again, didn't realize I wasn't using jQuery event object parameter, but native window.event): http://stackoverflow...n-chrome-and-ie

#11 apeisa

apeisa

    Hero Member

  • Moderators
  • 2,530 posts
  • 859

  • LocationVihti, Finland

Posted 16 November 2011 - 06:08 PM

- when I have the crop image field in a tab, and upload an image the layout is messed (tabs overlap title). I can't provide more infos ATM (will make screenshot later, but I'm busy)


I didn't understand this. If this still occurs in latest version, I would really appreciate screenshot or more description about how to produce this one.


- when I upload (html5) an image, I can't use preview fancybox before it's saved.


This is fixed in latest commit, thanks for finding & reporting Soma.

#12 apeisa

apeisa

    Hero Member

  • Moderators
  • 2,530 posts
  • 859

  • LocationVihti, Finland

Posted 17 November 2011 - 05:09 AM

I found one bug. I give aspect ratio in wrong format to Jcrop, so it fails when having more complicated aspect ratios. Quick fix that I will push at the evening.

EDIT: Fixed.

#13 Soma

Soma

    Hero Member

  • Moderators
  • 3,218 posts
  • 1764

  • LocationSH, Switzerland

Posted 17 November 2011 - 04:13 PM

Thanks for the update! I just trying it out and its awesome! Also the strange messing up is gone now.

Also like how you solved it with the thumb links and the preview is awesome!

I think it's an ok solution to make a popup, and it's well done I think, just the order and preview I still don't like it with big images. What if there would be no preview just the big image and the "crop" button on top left or so? After cropping we already have a preview, and it already can be edited again. I think it's hard to see there's a button on bottom hidden, just thinking.

---
Somehow the crop button is at a strange place for me, is that only my theme? (see screen)

Attached Thumbnails

  • cropimage.jpg

@somartist | modules created | support me, flattr my work flattr.com


#14 apeisa

apeisa

    Hero Member

  • Moderators
  • 2,530 posts
  • 859

  • LocationVihti, Finland

Posted 18 November 2011 - 03:53 AM

Thanks for your feedback Soma. Glad it is working! That is default position fur button. It is clumsy, specially if image and thumbnail are large (like in your example).

I have good idea for cropping UI. Description text, cropping button and thumbnail preview toggle on fixed top bar. Optional preview image on top right corner, on top of the original image (depends of course how large original image and preview thumbnail are).

I will implement this during weekend.

#15 Soma

Soma

    Hero Member

  • Moderators
  • 3,218 posts
  • 1764

  • LocationSH, Switzerland

Posted 18 November 2011 - 04:08 AM

Thank you Apeisa for the infos.

I have another thing we might should look at. There seems to be problems with floats not cleared in the PW admin (default), like I do normally use clearfix class. I've experienced this while creating themes. For example also you redirects module, the buttons overlap the container (form) on bottom. I think there should be some solution to make this working better and consistent. I had to implement a clearfix over script to some containers so I can add inline/floated stuff. I sense that there we will have problem when there's modules and custom theme's that do thing differently. What is everones experience about this?

@somartist | modules created | support me, flattr my work flattr.com


#16 ryan

ryan

    Hero Member

  • Administrators
  • 5,781 posts
  • 3125

  • LocationAtlanta, GA

Posted 18 November 2011 - 11:11 AM

We can probably just use the :after trick? http://www.positioni...syclearing.html

#17 Soma

Soma

    Hero Member

  • Moderators
  • 3,218 posts
  • 1764

  • LocationSH, Switzerland

Posted 18 November 2011 - 11:27 AM

We can probably just use the :after trick? http://www.positioni...syclearing.html



That's what I'm using since years. clearfix class that does all this.
A latest variation of ti is in html5 boilerplate too.

@somartist | modules created | support me, flattr my work flattr.com


#18 apeisa

apeisa

    Hero Member

  • Moderators
  • 2,530 posts
  • 859

  • LocationVihti, Finland

Posted 18 November 2011 - 04:09 PM

I changed the name of the module from CropImage to Thumbnails. If you have used git you need to update your origin repo (or simply just clone it again from new address).

#19 apeisa

apeisa

    Hero Member

  • Moderators
  • 2,530 posts
  • 859

  • LocationVihti, Finland

Posted 18 November 2011 - 04:55 PM

I have another thing we might should look at. There seems to be problems with floats not cleared in the PW admin (default), like I do normally use clearfix class. I've experienced this while creating themes. For example also you redirects module, the buttons overlap the container (form) on bottom. I think there should be some solution to make this working better and consistent. I had to implement a clearfix over script to some containers so I can add inline/floated stuff. I sense that there we will have problem when there's modules and custom theme's that do thing differently. What is everones experience about this?


I usually go with just overflow: hidden or auto;

#20 apeisa

apeisa

    Hero Member

  • Moderators
  • 2,530 posts
  • 859

  • LocationVihti, Finland

Posted 18 November 2011 - 05:01 PM

Just pushed new UI for cropping.

Attached Thumbnails

  • pwcrop.jpg






Also tagged with one or more of these keywords: Module

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users