Tag Archives: highslide.js

New highslide-integration plugin

Yaay! After months years of waiting, the highslide-integration plugin I’m using here finally got a major update. The new unobtrusive way the JavaScript magic is now done rocks!

The old version hooked into the image uploading dialog of the post creation page to apply the “highslide” CSS class and the JavaScript onclick event to all thumbnails in content. That automatically lead to the unattractive situation that this purely technical, not-content-related class=”highslide” onclick=”hs.expand(this); return false;” got saved to the database instead of applying the class dynamically via jQery when the document loaded in the browser. That had the big drawback that this information would stay inside the content – even if I decided to exchange the plugin or maybe the JavaScript library itself! Another issue was that this hook only worked for single images but not for galleries because they are generated from a magic tag… I worked around this by writing my own small hack that actually used jQuery and Marc’s header-include plugin to attach the stuff from above to each image in the generated gallery. Back then, I contacted Christoph, the creator of the highslide-integration plugin, and proposed my way of doing it as a completely new approach for the whole plugin and that he could get rid of all that hooking into the actual blogging / content thing. He reacted really cool and friendly and thanked me for this idea. Unfortunately, he seems to be busy as hell, too, so the release of the new version with the new way of doing it was nowhere to be seen. 😉

However, since highslide.js has cool gallery features, I always wanted to improve or re-write my hack so that the viewer can navigate through all images of a given post at once (and also preloading speeds up the experience!!) I knew all along that it might not be a big deal, frankly, but I just never found the damn time to actually DO IT. Anyways, the new plugin is now out and all’s well, finally 😀 But still I had to customize it, again, mostly because I’m a dumb fuck that enjoys coding more than sleeping… :mrgreen: