Jump to content

Disable minimizing JS


goldmorphin

Recommended Posts

Hello!

Possible do it? When i compiling my JS, IPS remove comments and spacers and for highcharts.js it's do broke script.

I don't want minimize JS why IPS do it for me?
Any ideas how i can disable it or maybe any ideas how i can use highchart with CDN, now i include it like this:

\IPS\Output::i()->jsFiles = array_merge(\IPS\Output::i()->jsFiles, \IPS\Output::i()->js('admin_highcharts.js', 'observer', 'admin'));

 

Link to comment
Share on other sites

Hello Fosters!
Thanks for reply.

I see Interface directory in /var/www/NAME/data/www/MYWEB/applications/observer/interface 

it's correct? If yes, can you say how i can include JS files from this directory? 

Now i use this: 

\IPS\Output::i()->jsFiles = array_merge(\IPS\Output::i()->jsFiles, \IPS\Output::i()->js('admin_highcharts.js', 'observer', 'admin'));

and it's including files from /dev/js/*

Link to comment
Share on other sites

Not good solution, but may be it will solve you task (i believe it needed as temporary check and for futher work you'll use minefied version of highcharts js). So, you can upload your js to theme resources and put calling this js template from your template place (or in globaltemplate in header). This way didn't make you js minefied.

Moreover, i think it is good point to create support ticket about that situation. Minefied script must make correct result, not broke it. So in this ticket IPS can find error and fix it - it will be most correct way (and if you need to do some checks with console - you can use chrome pretty print from minefied version for do any js checks)

Link to comment
Share on other sites

8 hours ago, goldmorphin said:

Hello Fosters!
Thanks for reply.

I see Interface directory in /var/www/NAME/data/www/MYWEB/applications/observer/interface 

it's correct? If yes, can you say how i can include JS files from this directory? 

Now i use this: 


\IPS\Output::i()->jsFiles = array_merge(\IPS\Output::i()->jsFiles, \IPS\Output::i()->js('admin_highcharts.js', 'observer', 'admin'));

and it's including files from /dev/js/*

 

You can take a look at the existing files in IPS4 to see how they include jquery ui, ckeditor & co :)

\IPS\Output::i()->jsFiles = array_merge( \IPS\Output::i()->jsFiles, \IPS\Output::i()->js( 'jquery/jquery-ui.js', 'core', 'interface' ) );

In your case it should be:

\IPS\Output::i()->jsFiles = array_merge(\IPS\Output::i()->jsFiles, \IPS\Output::i()->js('admin_highcharts.js', 'observer', 'interface'));
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...