Forums

load wordtube scripts only when needed (7 posts)

  1. zabdesign
    Member
    Posted 3 months ago #

    Wordtube is great and I am really gratefull that I can use it.

    Is there any way of telling wordtube only to put the js code into the wordpress header when it is really neccessary?
    I don't like to have this:

    '<script type='text/javascript' src='/wp-includes/js/swfobject.js?ver=2.1'></script>
    <script type='text/javascript' src='/wp-includes/js/jquery/jquery.js?ver=1.3.2'></script>
    <script type='text/javascript'>
    /* <![CDATA[ */
    var wordtube = {
    ajaxurl: "/wp-content/plugins/wordtube/lib/statistic.php"
    };
    /* ]]> */
    </script>
    <script type='text/javascript' src='/wp-content/plugins/wordtube/javascript/statistic.js?ver=0.1'></script>
    '
    all the time in the sourcecode.

    Any idea of simply hacking wordtube to do it only when there is a player used?

  2. zabdesign
    Member
    Posted 3 months ago #

    sorry for the ugly code above ... I missed to type in the right backticks

    I found a plugin for wordpress which supports the feature that I am looking for:
    http://wordpress.org/extend/plugins/shadowbox-js/faq/

    the keyword is 'smart loading'

    @ Alex Rabe
    It would be really really cool if wordtube supports this too!
    I think also NextGenGallery should support this.

    Wäre super, wenn du dies bei deinen nächsten Updates berücksichtigen könntest. Es gibt ja schon jede Menge Plugins, die so 'intelligent' sind und daher sollte der Code recht fix zu implementieren sein. Es wäre sehr hiflreich, um Ladezeiten zu verringern.

    Ich benutze ziemlich intensiv mootools und daher ist mir jQuery eigentlich ein Dorn im Auge, aber deine Plugins sind so cool, dass ich einfach nicht darauf verzichten möchte.
    Vielleicht inspiriert dich diese Nachricht zu einer kleinen Verbesserung!

    :)

  3. Rarehero
    Member
    Posted 2 months ago #

    NGG works perfectly with Shadowbox already, although there's no offical support. You don't even have to define a "link code", but if you want to define a "link code" however, you might want to use rel="shadowbox[%GALLERY_NAME%]". This link code contains evereything Shadowbox need, the "activator" and a "gallery indicator".

  4. zabdesign
    Member
    Posted 2 months ago #

    NGG works perfectly with Shadowbox already

    Thanky you for the hint.

    But there was especially one thing I am looking for:

    the keyword is 'smart loading'

    In the end it means the the JS and CSS files of NGG are not loaded always and instead only loaded if really needed on the current page wordpress is loading.

    Do you get what I mean?
    I think this is not implemented in NGG yet.

  5. zabdesign
    Member
    Posted 2 months ago #

    oh ...
    I just realized that the shadow box plugin allows smart loading and that I can tell NGG not to use any lightbox.
    It means when I enable the shadow box to load for every link to an image and in the same time enable smart loading for shadow box, I have all I wanted!

    :)

    a smart solution!

  6. zabdesign
    Member
    Posted 2 months ago #


  7. zabdesign
    Member
    Posted 2 months ago #

    Still I am looking for a way to load the wordtube realted JS-Scrips only when needed and not always.

Reply

You must log in to post.

About this Topic