CoreCommunity ExtensionsIncubatorDistributionsTYPO3 4.5 ProjectsTYPO3 4.6 ProjectsTYPO3 4.7 ProjectsTYPO3 6.0 ProjectsTYPO3 6.1 ProjectsTYPO3 6.2 Projects (+)

Bug #37100

Minified jquery.colorbox.js incompatible with minify extension

Added by Philipp Kitzberger about 1 year ago. Updated about 1 year ago.

Status:Accepted Start date:2012-05-11
Priority:Could have Due date:
Assignee:Raphael Zschorsch % Done:

0%

Category:Frontend Spent time: -
Target version:- Estimated time:1.00 hour
Branch:v4
Votes: 0

Description

when trying to minify all js files that are included for one page with the typo3 extension 'minify' the jquery.colorbox.js from this extension has to be excluded since it results in a syntactically invalid js file.

i'm not exactly sure who's responsible for that behavior, so i start here ;-)

the original jquery.colorbox.js from the authors github is not minified, so i assume you minified it yourself, right?

i tracked the "bad" code down to a white space that must not be removed, i guess.

https://github.com/jackmoore/colorbox/blob/master/colorbox/jquery.colorbox.js

    // give the iframe a unique name to prevent caching
    iframe.name = prefix + (+new Date());
    if (settings.fastIframe) {
        complete();
    } else {
        $(iframe).one('load', complete);
    }

typo3conf/ext/rzcolorbox/res/js/jquery.colorbox.js
h.name=f+ +(new Date),K.fastIframe?l():a(h).one("load",l)

minified version of your already minified jquery.colorbox.js
h.name=f++(new Date),K.fastIframe?l():a(h).one("load",l)

the now missing white space between + and + is causing the syntax trouble, because of which i had to exclude the file from the minification and concatination process entirely via:

plugin.tx_minify.skipFiles = typo3conf/ext/rzcolorbox/res/js/jquery.colorbox.js

History

Updated by Raphael Zschorsch about 1 year ago

  • Category set to Frontend
  • Status changed from New to Accepted
  • Assignee set to Raphael Zschorsch
  • Priority changed from Should have to Could have
  • Estimated time set to 1.00
  • Branch set to v4

My extension uses the minified JS file from this package: http://www.jacklmoore.com/colorbox/colorbox.zip
I'm sorry, but I won't change the original ColorBox code, as I'm not the author of the jQuery plugin.

I will add an option to either include the minified or the not minified JS file in the next version of the extension.

Updated by Philipp Kitzberger about 1 year ago

thanks a lot!

Also available in: Atom PDF