1 of 6
1
SL Combinator : Combine and Compress JavaScript and CSS on-the-fly : Version Update (2.1.0) 1st April, 2009
Posted: 09 November 2008 05:14 PM   [ Ignore ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  449
Joined  03-21-2006

Version 2.1.0 : Released 1st April, 2009
* Implemented LG Addon Updater functionality, to automatically check for updates.

Version 2.0.1 : Released 1st April, 2009
* Finally got around to adding a changelog, huzzah!
* Made minor change to minify path to explicitly include index.php. Prevents problems on some servers that use the “Include” method for removing index.php from URLs.

Hello all,

SL Combinator is a plugin and extension that combines and compresses JavaScript files on the fly, reducing page size and minimising HTTP requests. Combined files are saved for later use, and the plugin is smart enough to check for an up-to-date cache file before deciding to create a new one.

The plugin eliminates the hassle of manually combining and compressing multiple JS files for use on a live site. You can have multiple separate JavaScript files for easy editing and debugging, without wasting time combining and compressing files for use on the live site (or forcing your visitors to download uncompressed files).

Head on over to the Resources section of my site to read the full documentation, and download the add-on.

If you have any questions or problems, just post them to this thread and I’ll do my best to answer them.

Cheers,
Stephen

 Signature 

Stephen Lewis |  EE Addons  |  Twitter  |  Custom EE Addon Development

Profile
 
 
Posted: 09 November 2008 06:00 PM   [ Ignore ]   [ # 1 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1881
Joined  10-22-2006
Stephen Lewis - 09 November 2008 05:14 PM

AFAIK, there is no known fix, but if you have information to the contrary, please let me know.

There is a fix but it’s not for the faint of heart and involves potentially black magic.

 

 

 

 

Have no “_pi” in the filename raspberry

 Signature 

utilitEEs - Addons for EE

Profile
 
 
Posted: 09 November 2008 09:13 PM   [ Ignore ]   [ # 2 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  449
Joined  03-21-2006

There is a fix but it’s not for the faint of heart and involves potentially black magic… Have no “_pi” in the filename

Sorry silenz, close but no cigar. That just causes an error on the page using the plugin, because the plugin filename doesn’t match the plugin class name.

In case you’re wondering, the reason the plugin class has “_pi” at the end is to avoid a conflict with the extension class.

Stephen

 Signature 

Stephen Lewis |  EE Addons  |  Twitter  |  Custom EE Addon Development

Profile
 
 
Posted: 10 November 2008 01:23 AM   [ Ignore ]   [ # 3 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  523
Joined  03-18-2007

This is really useful, thanks Stephen. Can’t wait to try it out.

 Signature 

Follow me on Twitter: twitter.com/mrw

Profile
 
 
Posted: 10 November 2008 03:41 AM   [ Ignore ]   [ # 4 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1881
Joined  10-22-2006
Stephen Lewis - 09 November 2008 09:13 PM

Sorry silenz, close but no cigar. That just causes an error on the page using the plugin, because the plugin filename doesn’t match the plugin class name.

Not for me. Anyway, the solution is still to avoid the “_pi”. Rename the class accordingliy.

Image Attachments
sl.gif
Click thumbnail to see full-size image
 Signature 

utilitEEs - Addons for EE

Profile
 
 
Posted: 10 November 2008 05:46 AM   [ Ignore ]   [ # 5 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  449
Joined  03-21-2006

Not for me. Anyway, the solution is still to avoid the “_pi”. Rename the class accordingliy.

The problem comes when you actually use the plugin (as opposed to just viewing it in the CP); it throws an error on the page.

As for renaming the class, that would cause a conflict in the code with the extension class. I may try renaming the extension class instead, so the plugin can function without the “_pi” suffix.

Thanks for the suggestions.

Stephen

 Signature 

Stephen Lewis |  EE Addons  |  Twitter  |  Custom EE Addon Development

Profile
 
 
Posted: 10 November 2008 05:47 AM   [ Ignore ]   [ # 6 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  449
Joined  03-21-2006

This is really useful, thanks Stephen. Can’t wait to try it out.

No problem, let me know how you get on.

Cheers,
Stephen

 Signature 

Stephen Lewis |  EE Addons  |  Twitter  |  Custom EE Addon Development

Profile
 
 
Posted: 03 December 2008 07:27 PM   [ Ignore ]   [ # 7 ]  
Lab Assistant
RankRank
Total Posts:  140
Joined  04-23-2007

I seem to get the following error.  Anyone know what’s going on?

Parse error: syntax error, unexpected T_CONST, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /nfs/c03/h03/mnt/55445/domains/mydomain.com/html/combine/jsmin-1.1.1.php on line 49
Profile
 
 
Posted: 04 December 2008 03:06 AM   [ Ignore ]   [ # 8 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  449
Joined  03-21-2006

Hi eclectiv,

That looks like a problem with the JSMin script (which I utilised for this plugin, rather than wrote), as opposed to the plugin itself. The usual suspect is that your server is using PHP4, not PHP5; is that the case?

If everything goes to plan, I’ll be releasing a new version early next week, which addresses a lot of niggling problems I’ve encountered whilst using JSMin. Assuming the version of PHP isn’t the issue, if you can wait a few days the new version will hopefully solve your problem.

Regards,
Stephen

 Signature 

Stephen Lewis |  EE Addons  |  Twitter  |  Custom EE Addon Development

Profile
 
 
Posted: 04 December 2008 01:15 PM   [ Ignore ]   [ # 9 ]  
Lab Assistant
RankRank
Total Posts:  140
Joined  04-23-2007

Perfect!  It was what you expected—the PHP version was 4.  I changed that and it’s all working now.  Thanks, Stephen!

Profile
 
 
Posted: 04 December 2008 01:45 PM   [ Ignore ]   [ # 10 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  449
Joined  03-21-2006

Perfect!  It was what you expected—the PHP version was 4.  I changed that and it’s all working now.

Good news, thanks for letting me know electiv.

Cheers,
Stephen

 Signature 

Stephen Lewis |  EE Addons  |  Twitter  |  Custom EE Addon Development

Profile
 
 
Posted: 05 December 2008 12:14 PM   [ Ignore ]   [ # 11 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  449
Joined  03-21-2006

Hello all,

I’ve just rolled out version 2 of this plugin / extension (attached to the first message in this thread). It’s a complete rewrite that now makes use of the spiffy Minify application for all the combining, compressing, and caching.

Here are the highlights:

* Support for CSS! Now you can compress and combine your CSS files on the fly too.
* Less troublesome compression — particularly of jQuery plugins and sIFR — thanks to Minify’s enhanced version of JSMin.
* Greatly improved client-side caching, with HTTP encoding and headers (once again, thanks to Minify).

The new version brings with it some changes to both the filenames, and the plugin syntax, so it’s not a straight “replace old files” upgrade. Apologies for any inconvenience this causes, but hopefully you’ll find that it’s worth the (small) effort.

I’ve posted full instructions for upgrading, installing, and using the plugin / extension to my blog. And of course, if you have any questions, just leave a message on this thread and I’ll do my best to answer it.

Cheers,
Stephen

P.S. Oh yes, and I fixed the inconsequential bug.

 Signature 

Stephen Lewis |  EE Addons  |  Twitter  |  Custom EE Addon Development

Profile
 
 
Posted: 06 December 2008 03:16 PM   [ Ignore ]   [ # 12 ]  
Summer Student
Total Posts:  21
Joined  06-27-2007

Hi Stephen

This looks to be a fabulous plugin. Unfortunately, I attempted to use the 2.0 release and encountered an HTTP 400 Bad Request error with every execution. I reviewed your installation instructions closely, but remain stumped about the error.

I am using Expression Engine 1.6.6 on PHP Version 5.2.6, Apache 2.

Thanks!

Profile
 
 
Posted: 06 December 2008 09:43 PM   [ Ignore ]   [ # 13 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  449
Joined  03-21-2006

Hi pwenzel,

Unfortunately, I attempted to use the 2.0 release and encountered an HTTP 400 Bad Request error with every execution. I reviewed your installation instructions closely, but remain stumped about the error.

I’m a bit confused; where and when is the HTTP error appearing? Could you show me the code you’re using please?

Thanks,
Stephen

 Signature 

Stephen Lewis |  EE Addons  |  Twitter  |  Custom EE Addon Development

Profile
 
 
Posted: 08 December 2008 06:12 PM   [ Ignore ]   [ # 14 ]  
Lab Assistant
RankRank
Total Posts:  140
Joined  04-23-2007

The new version works great for the JS, but when I use the SL Combinator for the CSS, it doesn’t work.  The CSS just doesn’t load.  When I go to the direct URL for the CSS that’s published by the SL Combinator for the CSS, I get a HTTP 400 Bad Request error.

Profile
 
 
Posted: 09 December 2008 03:07 PM   [ Ignore ]   [ # 15 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  449
Joined  03-21-2006

Hi electiv,

The new version works great for the JS, but when I use the SL Combinator for the CSS, it doesn’t work.  The CSS just doesn’t load.  When I go to the direct URL for the CSS that’s published by the SL Combinator for the CSS, I get a HTTP 400 Bad Request error.

I’m guessing that after our previous conversation it’s not a PHP-version issue wink

Nothing springs to mind immediately, which means I’ll need to do some digging, and try to replicate the problem. I’ll get back to you with a more informed response as soon as I can.

Cheers,
Stephen

 Signature 

Stephen Lewis |  EE Addons  |  Twitter  |  Custom EE Addon Development

Profile
 
 
Posted: 09 December 2008 05:22 PM   [ Ignore ]   [ # 16 ]  
Lab Assistant
RankRank
Total Posts:  140
Joined  04-23-2007

Hi Stephen,

I think I figured out what the problem is.  I had my CSS files located in a subdomain, which seems to have been the issue.  When I moved the CSS files to root level, everything worked fine.  Hope that helps!  Thanks so much for the fantastic work!

Profile
 
 
Posted: 09 December 2008 06:59 PM   [ Ignore ]   [ # 17 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  449
Joined  03-21-2006

Hi eclectiv,

I think I figured out what the problem is.  I had my CSS files located in a subdomain, which seems to have been the issue.  When I moved the CSS files to root level, everything worked fine.

Aha, that would be a problem, yes. The plugin can handle files in subdirectories just fine, but not subdomains.

Hope that helps!  Thanks so much for the fantastic work!

Good to know you’ve got it sorted, and you’re welcome smile

Cheers,
Stephen

 Signature 

Stephen Lewis |  EE Addons  |  Twitter  |  Custom EE Addon Development

Profile
 
 
Posted: 13 December 2008 01:46 PM   [ Ignore ]   [ # 18 ]  
Research Assistant
RankRankRank
Total Posts:  357
Joined  09-18-2007

hi stephen,

the code below shows a 403 forbidden error in firebug. the min and min/cache folders have 777 rights, plugin V2, PHP5. any idea what im doing wrong?

{exp:sl_combinator:combine_js disable="no" debug="yes"}
[removed][removed]    
[removed][removed]
{
/exp:sl_combinator:combine_js}

edit - it wont list the script tags inside the sl_combinator tags, but they are normal js include script tags that work fine outside of the tags.

 Signature 

Attended EECI2009

Profile
 
 
   
1 of 6
1
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1743, on December 02, 2009 03:47 PM
Total Registered Members: 119902 Total Logged-in Users: 54
Total Topics: 126052 Total Anonymous Users: 36
Total Replies: 663091 Total Guests: 381
Total Posts: 789143    
Members ( View Memberlist )