Hi Mohammad,
what params does it require: all image urls or just the folder url. It would be interesting if it could display all images in a folder even if they were unknown to the tw-instance. My way to solve this would be Iframe and … php because i am still unfamiliar with node.js.
Jan
A lightbox style implementation for presenting images has been on my to do list for a long time. However my instinct is to create a native solution rather than integrate a third party library - unless I can find one that perfectly meets my requirements.
I keep delaying working on this because there is actually a lot of complexity to it and I have never have a large enough chunk of time to devote to it. For instance it isn’t clear if this library - which I have saved amongst many other lightbox implementatons in my Github stars - supports:
image pre-loading on demand. That is, don’t load all the images in advance but do load the next and previous
mixing different aspect ratios of images and resizing them for best fit
it does have support for responsive images but I want to add native support for this in TW
the ability to use the same mechanism for an inline slider of images, that is not in a lightbox
None of this is meant as criticism of the library you mentioned, rather just meant to illustrate some of the complexity involved.
The last time I worked on this - which I believe was last summer - I got as far as handling different aspect ratios in a complete wikitext implementation which relies on this tiny library from Streams for swipe support. The user experience was decent but cross browser CSS needed work. Since then I have had ideas for how we might possibly even avoid that need to resort to JavaScript, but alas simply no time to revisit that work.
I do hope to make more time to work on my own projects in the coming year, rather than devoting the entirety of my TW time to work on the core. So with any luck I will get back to this in the near future.
The way I would approach this is a startup action in TW that sends a requests to the server for a list of images and then saves that. On the server you could have a php script that responds to the request and returns a list of image URLs. This is the same technique that my WebDAV wikifarm uses.
@saqimtiaz I know this is a different subject but since you are talking on multi-user setup in the video:
Do you think you could produce and manage a sort of multiuser-stream with that setting?
That would be incredibly usefull for educational use.
@Mohammad no there is no public demo or code available. As mentioned in that write up, I am very unlikely to publish any of that setup due to a lack of opportunity.
@JanJo the interesting thing is that you could do most of this with a php backend as well, but yes someone would need to write that backend. It may be simpler to just use WebDAV directly.
Regarding multi-user streams, sadly not. You would run into the same problem with users overwriting each others work and merge conflicts, unless you accept that only one person can edit a wiki at once. That is what the lock mechanism mentioned in the video enforces. If a second user opens the wiki while it is being edited, they get a read only wiki.
For multi-user wikis, the work that @joshuafontany is doing is very exciting. We were able to use Streams simultaneously to add nodes to the same tiddler and it all synchronized without any issues.
1 - I tested on phone and it works too! Robustness cross-platform really matters for this kind of app so its neat it seems to work well!
2 - Longer term it might be interesting to allow for “Captions”. For instance if you showing art works it is good to be able to show (via overlay) the Title, Year, and Medium (e.g. “acrylic on canvas”) as an optional element.
3 - You, yourself, mention potential for activation from a “gallery” (i.e. a matrix of image thumbnails) . IMO that would allow much wider usages I think?
4 - Regarding navigation of galleries there is a convention (quite a good one) of left and right arrows (on hover) for step-forward and step-back.
These are just thoughts! Basically, visually, it seems much in the right direction.