Support » Plugin: SyntaxHighlighter Evolved » [Plugin: SyntaxHighlighter Evolved] [Feature Request] on-demand javascript incl

  • Hi,
    i looked at the code and i think there is the possibility to improve the load-behavior of the scripts.
    The adding of scripts is momentary done in the constructor of SyntaxHighlighter. If its done in (i think) “shortcode_callback” it should only loads on the sites that really use the syntaxhighlighting feature.

    It also would be nice to have an option to choose the brushes that are really needed (i for myself only use the php-brush).

    I know, so many wishes and so less time ;-). If you need any help, feel free to ask.

    http://wordpress.org/extend/plugins/syntaxhighlighter/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Alex Mills

    (@viper007bond)

    If you take a look at the HTML source of your site, you’ll find my plugin already does this. 😉

    wp_register_script() is not the same thing as wp_enqueue_script(). The register one only declares it’s existence, it does not queue it up for outputting.

    The shortcode callback logs which languages are used into an internal variable and then a function hooked into the footer if your site outputs any needed Javascript files based on the content of that internal variable.

    Thread Starter Volly

    (@volly)

    Thanks for the response,
    seems i skipped that while reading the code.

    In my theme the code is included on all sites – but the plugin proplably working correct. I load the last blog-posts in an footerarea and even the code is not rendered, i think the shortcode will be applied.

    Plugin Contributor Alex Mills

    (@viper007bond)

    As long as the shortcode filter runs, the JS/CSS will get outputted. My plugin can’t know that you don’t end up displaying it. 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: SyntaxHighlighter Evolved] [Feature Request] on-demand javascript incl’ is closed to new replies.