[Chameleon] compress Chameleon javascript

Delfos, Jacob Jacob.Delfos at maunsell.com
Wed May 10 21:27:00 EDT 2006


Bart,

Did you end up applying this only to cwcjsapi? I'm looking into this,
because the main page and all the scripts, are starting to get pretty
huge (especially with a tree legend). I am looking into applying it for
all javascripts, by modifying UIManager.php. On line 401, I replace:

$szJSInclude .= "<!-- javascript include $key -->\n";
$szJSInclude .=  $this->maJSIncludeFunctions[$key];

With:

$jsPath =
str_replace($_SESSION['gszCoreWebPath']."/","getcjs.php?name=",$this->ma
JSIncludeFunctions[$key]);
$jsPath = str_replace(".js","",$jsPath);
$szJSInclude .= $jsPath;


It can probably be cleaner, but I thought I'd try first to see whether
it works at all. It does work, but I think some scripts need cleaning. I
get an error about cwc_line.js, and the keymap becomes a red image. I
couldn't find any missing ';' in cwc_line.js. Which other things did you
find that the script can fail on?

Regards,

Jacob
 

> -----Original Message-----
> From: chameleon-bounces at lists.maptools.org 
> [mailto:chameleon-bounces at lists.maptools.org] On Behalf Of 
> Bart van den Eijnden
> Sent: 20 July 2005 22:32
> To: chameleon at lists.maptools.org; Bart van den Eijnden
> Subject: Re: [Chameleon] compress Chameleon javascript
> 
> Okay, this probably needs fixing in the CWCJSAPI.js file 
> instead of the php script.
> 
> The CWCJSAPI.js file contains stuff like:
> 
>     this.units = 3 //meter
> 
>     this.zoomfactor = 2;
> 
> Which goes okay when there is a return at the end, but not if 
> it is on one line in the compressed js file.
> 
> I will try to update the CVS version of cwcjsapi and add ; 
> consequently everywhere.
> 
> Best regards,
> Bart
> 
> Bart van den Eijnden
> Syncera IT Solutions
> Postbus 270
> 2600 AG  DELFT
> 
> tel.nr.: 015-7512436
> email: BEN at Syncera-ITSolutions.nl
> >>> Bart van den Eijnden 07/20/05 16:27 PM >>>
> Paul,
> 
> just realized I am missing a lot of ; in the cwcjsapi.js file 
> which causes many js errors.
> 
> Do you have an update already of the script which fixes this 
> before I dive into it myself :-) ?
> 
> Best regards,
> Bart
> 
> Bart van den Eijnden
> Syncera IT Solutions
> Postbus 270
> 2600 AG  DELFT
> 
> tel.nr.: 015-7512436
> email: BEN at Syncera-ITSolutions.nl
> >>> "Bart van den Eijnden" <BEN at syncera-itsolutions.nl> 
> 07/20/05 16:14 PM >>>
> Bart van den Eijnden
> Syncera IT Solutions
> Postbus 270
> 2600 AG  DELFT
> 
> tel.nr.: 015-7512436
> email: BEN at Syncera-ITSolutions.nl
> 
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon
> 



More information about the Chameleon mailing list