Options

1337Box

bluereefbluereef Registered Users Posts: 16 Big grins
The 1337Box (http://www.dgrin.com/showthread.php?t=32708&highlight=1337Box) for the Lightbox works really well on my site (www.bluereefphoto.net) with the traditional style view.

Anyone have an idea on what to change to force a “large” viewing image over the default “medium”?

bluereef

Comments

  • Options
    bluereefbluereef Registered Users Posts: 16 Big grins
    edited July 29, 2007
    Has anyone hacked the 1337Box (lightbox) code to force a large image?
    I tried the following two java scripts without success:
    resizeLarge();

    function resizeLarge()
    {
    var objForm = document.photosize_chooser;

    if ((objForm) && (objForm.Size.value != 'Large'))
    {
    objForm.Size.value = 'Large';
    objForm.submit();
    }
    }

    and

    resizeLarge();

    function resizeLarge() {
    var url = window.location.href;

    if (url.indexOf("/Small") + url.indexOf("/Medium") + url.indexOf("/Original") > -3) {
    window.location.replace(url.substr(0, url.lastIndexOf("/")) + "/Large")
    }
    }
    Anyone?
  • Options
    claudermilkclaudermilk Registered Users Posts: 2,756 Major grins
    edited July 30, 2007
    IIRC, 1337box functionality was rolled into the default Smugmug functionality. I used to use it, but ran into some issues, was told this, and removed it from my customization. Still have all the cool lightbox stuff.
  • Options
    bluereefbluereef Registered Users Posts: 16 Big grins
    edited July 31, 2007
    IIRC, 1337box functionality was rolled into the default Smugmug functionality. I used to use it, but ran into some issues, was told this, and removed it from my customization. Still have all the cool lightbox stuff.

    I use all thumbs and traditional views. When I remove the 1337box hack, clicking on the thumbs does not open the lightbox.
    I have been able to force large simply by
    setting the default size to large (DefaultSize = Large). Everything works but the page loads with errors.

    I like the lightbox and want it to pop up when I click on thumbnails so have to use the 1337 hack. The problem is the customization codes available on this forum for the default lightbox (background color, default size, border width, padding) don't work with the 1337box hack.
    Too bad because the lightbox is one of the cleanest ways of viewing pictures. I'm not a programmer so hacking the 1337 code is not an option.
  • Options
    bluereefbluereef Registered Users Posts: 16 Big grins
    edited August 24, 2007
    Found code to force large in Lightbox...at last. FYI:
    After multiple hours of trying/altering different codes I finally found a code that forces larges in lightbox in traditional/all thumbs views:
    function forceLargeBoxThumbs() {
    if (!YD.hasClass(document.body, 'allthumbs'))
    return;

    var photos = YD.getElementsByClassName('photo', 'div', YD.get('photos'));
    var re = /\/Medium/;

    for (var i = 0; i < photos.length; i++) {
    if (re.test(photos.firstChild.href))
    photos.firstChild.href = photos.firstChild.href.replace(re,'/Medium');
    }

    }
    YE.on(window, "load", forceLargeBoxThumbs);

    This was modified from the following thread:

    http://www.dgrin.com/showthread.php?t=49634&highlight=preferred+size
    wings.gif
Sign In or Register to comment.