Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

javascript and css optimization
 
lisali
Enthusiast
 
Avatar
Total Posts:  889
Joined:  2008-04-28
London, UK
 

Guys - regarding the validation.jsproblem - in the original js file supplied by Magento, the line that’s causing the problem - if you have a look BEFORE that line, there are two other regex codes that are commented out - they seem to work just fine with Minify, and they also validate all emails properly. So the solution would be to comment out the existing regex and use one of the alternatives already there.

HTH.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Andrey666
Member
 
Total Posts:  58
Joined:  2008-04-16
 

I USE LATEST VERSION installed through magento connect
and can confirm this error PHP Fatal error:  Uncaught exception ‘JSMinException’ with message ‘Unterminated string literal.’ in \wwwroot\mydomain.com\lib\minify\lib\JSMin.php:99 when try to access url of js file and need to use validation-4min.js to solve it

that is probably reason why JS not working for you Purplemine

other very intersting thing is that jsminify replaces relative to absolute paths correctly but css images still wont load… when i figure this out i’ll post results…

still very usefull extension… thanx FOOMAN and the rest

 
Magento Community Magento Community
Magento Community
Magento Community
 
FOOMAN
Guru
 
Avatar
Total Posts:  669
Joined:  2007-12-13
Auckland, New Zealand
 

Hi all,

version 0.7.7 unfortunately didn’t work out as intended - please update to version 0.7.8. It reintroduces a modified version of validation.js but it is not required any more to change your layout/page.xml.

Please let me know how it works for you. I am still trying to understand why the CSS on-the-fly image replacement seems to work for some while not for others.

 
Magento Community Magento Community
Magento Community
Magento Community
 
i960
Guru
 
Avatar
Total Posts:  633
Joined:  2007-10-01
Bakersfield, CA
 

Thanks FOOMAN.  Latest version works perfectly.  cool smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
Andrey666
Member
 
Total Posts:  58
Joined:  2008-04-16
 

yep 0.7.8 solved JS problem, CSS images not working…

 
Magento Community Magento Community
Magento Community
Magento Community
 
FOOMAN
Guru
 
Avatar
Total Posts:  669
Joined:  2007-12-13
Auckland, New Zealand
 

hey Andrey666,

thanks for your feedback. To force the CSS images to load you could change all relative urls in the CSS files to absolute ones.

Is your server running on IIS / Windows by any chance? If so I just uploaded version 0.7.9 which could potentially solve the image issue.

Can you also please let me know: what is the original CSS url for the image vs. what is in the minified CSS for the same images?

 
Magento Community Magento Community
Magento Community
Magento Community
 
purplemine
Sr. Member
 
Total Posts:  143
Joined:  2008-05-20
London
 

Hi,

I’ve got the latest version installed from today 0.7.9 and still no improvement with the zoom tool or the tabs on the product page, the dropdown menus are back though.

You can see what I mean here http://www.deadseaskincare.co.uk/biox-advanced-anti-ageing-serum.html

Thanks,

John

 
Magento Community Magento Community
Magento Community
Magento Community
 
FOOMAN
Guru
 
Avatar
Total Posts:  669
Joined:  2007-12-13
Auckland, New Zealand
 

Cheers for your feedback - I’ve responded over in the bugs forum http://www.magentocommerce.com/boards/viewthread/22855/

 
Magento Community Magento Community
Magento Community
Magento Community
 
Vevelt
Jr. Member
 
Total Posts:  19
Joined:  2008-08-05
Itzehoe in Germany
 

Here also problems with urls in CSS:

Original: #nextLink:visited:hover { background: url(../images/lightbox/nextlabel.gif) right 15% no-repeat; }
Minified-Version: #nextLink:visited:hover{background:url(rontend/default/petfun/images/lightbox/nextlabel.gif) right 15% no-repeat}
Correct would be also: #nextLink:visited:hover { background: url(/skin/frontend/default/petfun/images/lightbox/nextlabel.gif) right 15% no-repeat; }

Is there any hint howto solve the problem without changing all urls in CSS?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Vevelt
Jr. Member
 
Total Posts:  19
Joined:  2008-08-05
Itzehoe in Germany
 
Vevelt - 12 November 2008 12:01 PM

Here also problems with urls in CSS:

Original: #nextLink:visited:hover { background: url(../images/lightbox/nextlabel.gif) right 15% no-repeat; }
Minified-Version: #nextLink:visited:hover{background:url(rontend/default/petfun/images/lightbox/nextlabel.gif) right 15% no-repeat}
Correct would be also: #nextLink:visited:hover { background: url(/skin/frontend/default/petfun/images/lightbox/nextlabel.gif) right 15% no-repeat; }

Is there any hint howto solve the problem without changing all urls in CSS?

Just a suggest: there are exactly 7 chars missing at the beginning. “http://” has 7 chars…
I haven’t reviewed the speedster code yet if there is such a string-manipulation.

 
Magento Community Magento Community
Magento Community
Magento Community
 
davidn
Jr. Member
 
Total Posts:  24
Joined:  2008-08-14
 

I cannot seen to get this to work. All my css is not loading and the default template that I changed the css on really has not changed that much. 

Maybe someone can clarify if I’m doing these steps correctly. I have my 1.1.6 installation in a folder named purchase in my public_html, so my path would be:

RewriteRule ^minify/([^/]+)(/.*\.js)$ purchase/lib/minify/m.php?f=$2&$1
RewriteRule ^index.php/minify/([^/]+)(/.*\.js)$ purchase/lib/minify/m.php?f=$2&$1

RewriteRule ^minify/([^/]+)(/.*\.css)$ lib/minify/m.php?f=$2&$1
RewriteRule ^index.php/minify/([^/]+)(/.*\.css)$ purchase/lib/minify/m.php?f=$2&$1

Correct so far?

Here is what my source looks like on my home page.

<link type="text/css" rel="stylesheet" href="http://cakecraft.net/purchase/minify/1227458666/skin/frontend/default/cakecraft/css/reset.css,/skin/frontend/default/cakecraft/css/boxes.css,/skin/frontend/default/cakecraft/css/clears.css,/skin/frontend/default/cakecraft/css/menu.css" media="all"></link>
<script type="text/javascript\" src="http://cakecraft.net/purchase/minify/1221745798/js/prototype/prototype.js,/js/prototype/validation.js,/js/scriptaculous/builder.js,/js/scriptaculous/effects.js,/js/scriptaculous/dragdrop.js,/js/scriptaculous/controls.js,/js/scriptaculous/slider.js,/js/varien/js.js,/js/varien/form.js,/js/varien/menu.js,/js/mage/translate.js,/js/mage/cookies.js" ></script>
<link type="text/css" rel="stylesheet" href="http://cakecraft.net/purchase/skin/frontend/default/cakecraft/css/print.css" media="print"></link>
<!--[if IE]>
<link type="text/css" rel="stylesheet" href="http://cakecraft.net/purchase/minify/1220451303/skin/frontend/default/cakecraft/css/iestyles.css" media="all"></link>
<![endif]-->
<!--[if IE 7]>
<link type="text/css" rel="stylesheet" href="http://cakecraft.net/purchase/minify/1220451302/skin/frontend/default/cakecraft/css/ie7.css" media="all"></link>
<![endif]-->
<!--[if lt IE 7]>
<link type="text/css" rel="stylesheet" href="http://cakecraft.net/purchase/minify/1220451303/skin/frontend/default/cakecraft/css/ie7minus.css" media="all"></link>
<script type="text/javascript\" src="http://cakecraft.net/purchase/minify/1221745798/js/lib/ds-sleight.js,/js/varien/iehover-fix.js" ></script>

Can anyone give any guidance?

 
Magento Community Magento Community
Magento Community
Magento Community
 
FOOMAN
Guru
 
Avatar
Total Posts:  669
Joined:  2007-12-13
Auckland, New Zealand
 

hi davidn,

I think you might have missed changing one rewrite rule. See if this helps:

RewriteRule ^minify/([^/]+)(/.*\.js)$ purchase/lib/minify/m.php?f=$2&$1
RewriteRule ^index.php/minify/([^/]+)(/.*\.js)$ purchase/lib/minify/m.php?f=$2&$1

RewriteRule ^minify/([^/]+)(/.*\.css)$ purchase/lib/minify/m.php?f=$2&$1
RewriteRule ^index.php/minify/([^/]+)(/.*\.css)$ purchase/lib/minify/m.php?f=$2&$1

 
Magento Community Magento Community
Magento Community
Magento Community
 
davidn
Jr. Member
 
Total Posts:  24
Joined:  2008-08-14
 

Yes I saw that a little earlier and fixed it, But its still not working.
It looks like I’m getting some cache files in the var/minifycache folder but my
site front end and back end is not working at all.  permissions are set 775 on
the lib/minify folder and the lib/minify/m.php and the var/minifycache

 
Magento Community Magento Community
Magento Community
Magento Community
 
FOOMAN
Guru
 
Avatar
Total Posts:  669
Joined:  2007-12-13
Auckland, New Zealand
 

Hi David,

I just had another look at your site, while my extension was enabled.

When you check http://cakecraft.net/purchase/lib/minify/m.php?f=/skin/frontend/default/cakecraft/css/boxes.css you can see that the output is all messed up. This is usually caused when compressed output gets compressed again (often by php’s zlib.compression). See if disabling it by uncommenting the last line in /lib/minify/.htacess helps. Make sure to delete the files under /var/minifycache/ as well.

good luck

 
Magento Community Magento Community
Magento Community
Magento Community
 
davidn
Jr. Member
 
Total Posts:  24
Joined:  2008-08-14
 

Still messed up. I set the path to lib/minify/m.php? instead of purchase/lib/minify/m.php?
and it seems to fill the var/minifycache but that doesn’t help either. I also changed the lib/minify .htaccess to

############################################
## By default allow all access

Order allow,deny
Allow from all

## uncomment to turn off zlib compression, double compression of files results in garbage output
## depending on server setup, alternatively you might need to create a php.ini in this folder with zlib.output_compression = off

php_flag zlib.output_compression off

I just tried the php.ini file with zlib.output_compression = off in the lib/minify, did not work.
and that doesn’t help either. still a mess.  Any other ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top