forum.coppermine-gallery.net
Support => cpg1.5 plugins => cpg1.5.x Support => cpg1.5 plugin contributions => Topic started by: Timos-Welt on January 14, 2010, 12:31:01 pm
-
What's this?
This plugin compresses javascript files and reduces their number without affecting functionality. The compressed files will be cached. Normally this plugin will make your gallery access faster for visitors. If you update your gallery or any plugins that add javascript stuff, it is very important to manually clear the cache using the button in plugin manager.
Using cpg1.5.x, many javascript files will be loaded by the visitor's browser. There are four files that will always be loaded on every page (jquery-1.3.2.js, scripts.js, jquery.greybox.js, jquery.elastic.js). More files will be loaded depending on the actual page and the plugins you have installed. As long as you're not logged in as administrator, this plugin does the following:
- Step 1:
- merge the four files that will always be loaded on every page to one javascript file (reduces number of HTTP requests to 1)
- compress it using JSmin to remove comments and disposable spaces (reduces size by 10-15%)
- if browser supports it and PHP with zlib support, compress it with gzip (reduces size by 50-70%)
- cache the resulting file so compression has only to be done once (in folder plugins/jsmin/cache)
- Step 2:
- if exist, merge the rest of the javascript files on the current page to another file (reduces number of HTTP requests to 0 or 1)
- compress this one using JSmin to remove comments and disposable spaces (reduces size by 10-15%)
- if browser supports it and PHP with zlib support, compress it with gzip (reduces size by 50-70%)
- cache the resulting file so compression has only to be done once (max cache size 500 KByte / 40 files)
How to install
1. Upload folder jsmin to your plugins folder.
2. The folder plugins/jsmin/cache must be readable by visitors via http, and it must be writable by php (usually chmod to 755).
3. Install via plugin manager.
How to uninstall
1. Uninstall via plugin manager.
2. Remove folder jsmin from your plugins folder.
Maintenance
If you ever update your gallery or any plugins that add javascript stuff, it is very important to manually clear the cache using the button in plugin manager.
Download
http://sourceforge.net/projects/coppermine/files/Plugins/1.5.x/cpg1.5.x_plugin_jsmin_v1.2.zip/download
=========================================================================
Change log:
-----------
v1.1 (2010/01/19)
-----------------
code clean up
v1.0 (2010/01/18)
-----------------
added new algorithm that has the optimal balance between
- few http requests (always exactly 2 per page)
- optimal compression
added docs
stable release
v0.4 (2010/01/16)
-----------------
Using new plugin hook (thanks Andre)
Added check if zlib is available in php for algo 5 + 6
v0.3 (2010/01/16)
-----------------
Added check if browser supports gzip encoding for algorithm 5 + 6
v0.2 (2010/01/15)
-----------------
added two new algorithms with gzip compression for browsers that support it
v0.1 (2010/01/14)
-----------------
First release.
-
Released v0.2.
-
Released v0.3.
-
released v1.0
-
This plugin sounds promising but it removes the navigation arrows from the filmstrip. I can't post a link because I tested this with my local lamp. I removed all plugins except this one before testing and used the classic theme.
-
Unfortunately this plugin does not work correctly with Lighbox. When activated the lightbox will not show up when clicking the image.
When disabled or removed everything works fine again.
-
It makes image manipulation plugin doesn't work at all. :-[
-
Works perfectly here. Please post links to your galleries with installed plugin, then I'll have a look at it.
-
Here's a link (http://mcguardians.byethost14.com/displayimage.php?album=1&pid=5#top_display_media) to my gallery. As you can see, there is now navigation arrows. I doubt if any of the javascript is working. The only installed plugin is your jsmin plugin, but all the default plugins are uploaded to the server.
My gallery is using rev 7558. The server automatically sends every ASCII mode file as compressed, but I tested with my local lamp that disabling automatic compression doesn't solve this issue.
-
Open codebase.php with a text editor and find this:
// zlib there and browser supports it => suffix is now .js.gz
$jsmin_suffix = '.js.gz';
and change to
// zlib there and browser supports it => suffix is now .js.gz
// $jsmin_suffix = '.js.gz';
Don't forget to clear the cache. This should make it work correctly.
regards
Timo
-
Thanks. It's working now :)
-
A user has reported issues with this plugin in relation to a core functionality in the thread "Registed Users Creating albums (http://forum.coppermine-gallery.net/index.php/topic,65526.0.html)".
-
Hi,
I've found a probleme :) when this plugin is active Members can't upload with swfuploader but administator can upload.
-
I installed this plugin, and everything appeared to work. But then I find the following:
I have high resolution, 640x480 resolution and thumbnails. I can see original resolution images, when I click on the picture itself. This is broken with this plugin:(
I uninstalled the plugin, or when I am logged in as admin - everything is normal.
Thanks
-
Timos, I am planning on using your plug-in on the new version of our beats (http://www.worldhiphopbeats.com) website, and am wondering if running my jscript in "noconflict" mode will cause any problems. Thanks in advance.
-
This plugin sounds promising but it removes the navigation arrows from the filmstrip. I can't post a link because I tested this with my local lamp. I removed all plugins except this one before testing and used the classic theme.
-
Unfortunately this plugin does not work correctly with Lighbox. When activated the lightbox will not show up when clicking the image.
When disabled or removed everything works fine again.
-
Did you try this (http://forum.coppermine-gallery.net/index.php/topic,63223.msg323209.html#msg323209)?
-
Gesundheit!
I don't speak french, sorry.
-
Great plugin! I'm loving it. Thanks :)
-
Really nice Tutorial! Thanks for
-
Yes, this plugin is really great, I've used it a lot.