making images in a set unique

Forums Forums Slimbox2 plugin making images in a set unique

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #544
    Anonymous
    Member

    According to http://transientmonkey.com/wp-slimbox2/ … omment-148 I mangaged to get all image links of a single post collected into on image set.

    Now I’d like to make them unique, so that if an image link occurs repeatedly across the post, the image appears only once in the image set displayed by slimbox.

    Any ideas how to do that?

    #4686
    malcalevak
    Moderator

    The feature to collect all images into a set by post was actually implemented in the release that came out shortly before your post.

    Regarding your request, I honestly don’t have a clue how to do it, and it may actually fit better as a question for the Slimbox creator, Christophe Beyls at http://groups.google.com/group/slimbox-support though I’m not sure you’ll get any luck there.

    Thinking about it myself, though, it seems likely that doing so would involve a great deal of overhead (though I could be mistaken).

    If you do find a way to do it, I be very interested in seeing it, preferably it would be written to utilize jQuery.

    #4687
    Anonymous
    Member

    Hi,

    I manged by modifying slimbox.js myself:
    Here’s the code snippet I inserted into slimbox.js
    [code:3oxbzxu5]
        // (Zellner, 2009-01-27) make images unique:
        // leave only the first occurence of an image in _images.
        //
        for (var i = _images.length – 1; i >= 0; i–) {
    var i1_url = _images[i][0];
    for (var j = i – 1; j >= 0; j–) {
        if (_images[j][0] == i1_url) {
    if (startImage == i)
        startImage = j;
    _images.splice(i, 1);
    break;
        }
    }
        }
    [/code:3oxbzxu5]
    I’ll also attach the complete file.

    I’d suggest to make this an option.
    I’ll also post this to http://groups.google.com/group/slimbox-support

    #4688
    malcalevak
    Moderator

    I added code tags to make that easier to read.

    I’ll have to take some time to look at it later to figured out exactly what it’s doing and possibly rewrite it using jQuery, but we’ll see.

    Could you provide an example of where this is being used?

    #4689
    malcalevak
    Moderator

    Dr. Zellner,

    Could you show a demo of this in action, to better help me visualize what it’s doing? I think I know, but a demo would help a lot.

    Also, are you doing to insist on the credit comment being with the code portion, or would you be content with credit being listed in the thanks area – specifically stating why – where I typically put credit for assistance such as this?

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.