Kris-B / nanoGALLERY

image gallery simplified - jQuery plugin. Touch enabled, responsive, justified/cascading/grid layout and it supports pulling in Flickr, Google Photos and self hosted images.
https://nanogallery2.nanostudio.org/
439 stars 101 forks source link

Preliminary support for image removal #69

Closed R-II closed 9 years ago

R-II commented 9 years ago

Hi Kris,

Here is my last hack.

Add: 'fresh' property on items Add: show only 'fresh' items Fix: class name on 'light' theme

Enjoy :) Raphaël

Kris-B commented 9 years ago

Hi Raphël, Thanks for this new PR!

Kris-B commented 9 years ago

Hi Raph,

Just some questions/remarks about your last PR:

R-II commented 9 years ago

Hi Kris,

"fresh" items: only fresh items are displayed. On each load/reload of a gallery, every existing items see their "fresh" property set to false, every parsed items in the source JSON are set at fresh = true, the remaining fresh = false are not displayed. This is how I managed to support items removal.

The thumbnailSelectionEnd() method has been created to handle the end of selection. This function adds a "selectable" class on thumbnails that can be selected (making customisation easier) and runs the fnChangeSelectMode when the selection mode is activated or deactivated. For sure, if you can optimize it, do not hesitate :-)

'user-select' and '-webkit-touch-callout' are used because of the iOS devices: on a long touch on an item, it is selected and the context menu appears. "touch-callout" forbid the context menu to open, "user-select" forbid the selection. These are not yet standard properties, but they make the script responsive and does not cause any problems on desktop browsers.

OK for IE8, I'll try to keep that in mind.

Raph

Kris-B commented 9 years ago

Hi Raph,

Thanks for all these details!

I allowed myself to made some changes in the support of items removal in reload... I just set the item.albumID to -1 (means not in any album = orphan). Then on reload, the correct albumID is set again if the item still exists. New version is uploaded.

Kris