Support » Plugins » [Plugin: jQuery Colorbox] Stop displaying full javascript code in page source

  • JamesBB

    (@jamesbb)


    Hello,

    I was wondering if there is any way we can remove the following from the page source and put it in an external file?

    <!– jQuery Colorbox 3.4 | by Arne Franken, http://www.techotronic.de/ –>
    <script type=”text/javascript”>
    // <![CDATA[
    jQuery(document).ready(function($) {
    $(“a:has(img):not(.colorbox-off)”).each(function(index, obj) {
    if ($(obj).attr(“href”).match(/\.(?:jpe?g|gif|png|bmp)/i)) {
    var $nestedElement = $(obj).children(0);
    if ($nestedElement.is(“img”)) {
    var $nestedElementClassAttribute = $nestedElement.attr(“class”);
    var $groupId = $nestedElementClassAttribute.match(‘colorbox-[0-9]+’) || $nestedElementClassAttribute.match(‘colorbox-manual’);
    if ($groupId && !$nestedElementClassAttribute.match(‘colorbox-off’)) {
    $groupId = $groupId.toString();
    if ($groupId == “colorbox-manual”) {
    $groupId = “nofollow”;
    }
    $(obj).colorbox({
    rel:$groupId,
    title:$nestedElement.attr(“title”),
    maxWidth:”95%”,maxHeight:”100%”,slideshow:true, opacity:”0.85″,
    transition:”elastic”,
    speed:650,
    slideshowSpeed:2500,
    close:”close”,
    next:”next”,
    previous:”previous”,
    slideshowStart:”start slideshow”,
    slideshowStop:”stop slideshow”,
    current:”{current} of {total} images”
    });
    }
    }
    }
    });
    });
    // ]]>
    </script> <!– jQuery Colorbox 3.4 | by Arne Franken, http://www.techotronic.de/ –>

    Thank you!
    Jamy

    http://wordpress.org/extend/plugins/jquery-colorbox/

Viewing 2 replies - 1 through 2 (of 2 total)
  • techotronic

    (@techotronic)

    Hi James,

    yeah, I thought about that a few times already… I also do not like to put the CSS for the Internet Explorer workarounds directly into the HTML.

    I’ll change all that in one of the next versions.

    Caveat: for that to work, every user has to set a subdirectory of the plugin to be writable by the plugin…

    Cheers,
    Arne

    JamesBB

    (@jamesbb)

    THANK YOU very much Arne for your quick answer!

    You always react very quickly and it is much appreciated.
    Will contact you soon for donation.
    Thanks again,

    James

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: jQuery Colorbox] Stop displaying full javascript code in page source’ is closed to new replies.