Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Edgar Hernández on May 29, 2009 09:51
open dhtmlx forum
libCompiler and Updates

Recently I received an update for dhtmlxEditor. This fixes a little problem. I would like to know where should I throw the updated files in order to use libcompiler to generate a new package with the update included.

The update I received includes the "codebase" folder of the involved updated controls and some samples. Fisrt I overwited (or merged) the codebase folder of the original downloaded package with the update of codebase folder I received. Then I generated the new package with libcompiler but it doesn't contained the update. Then I tried to merge the "sources" folder of the original package with the corresponding updated files. Again, the generated package doesn't include the fix.

What other files or folders I must update in order to get the updated package with libCompiler?

Thanks in advance.
Answer posted by Support on Jun 01, 2009 06:54
libCompiler takes files from sources folder - if it exists, and if file not exists - it takes data related files from codebase folder. 
So to have updates included - you need to 
a) drop new files in sources folder
or
b) drop new file in codebase folder and remove the same file from sources forlder

Please be sure that old version of js file ( which was generated by libCompiler ) not cached by browser 

Answer posted on Jun 01, 2009 16:13
I checked this. I ensured that all files were in place and started adding some lines of code to "get_files.php" of libCompiler in order to be sure that it was grabbing the correct files. I checked too the cache detail. All was correct, but the generated JS was still having some problem, because the fix to the vertical scroll bar not being displayed in Firefox wasn't still there (or that I was thinking). So, I started playing with libCompiler and the generated packages. After some hours of work, I found that the line 163 (approximately) of the code in "get_files.php" is generating a malformed javascript file. This is the line where "replaceWhitespaces" and "replaceComments" functions of the php file are called.

I found that if I comment this line of code (and all the code within the surrounding IF), the generated library becomes correct, and then the Editor control start working correctly. Now that I have isolated the problem I would like to know how to fix this little problem.

For now, I will use the generated library without this lines of code, but I am interested in havin' the compresed library.

It appears that the problem is related to character encoding, because the generated compressed library, when is opened in GVIM, start displaying lots of "^M" characters at the supposed end of line.


Answer posted by Support on Jun 02, 2009 05:10
Which options do you check in libCompiler, while building new js file?
if only dhtmlxEditor was checked - result js file will contains only used elements from toolbar ( it will not include select-button for example - and as result not all updates will be included to the final file ) 
You can directly check dhtmlxToolbar item - to be sure that all elements from that file will be included in final compilation

>>start displaying lots of "^M" characters
Caused by difference between win and unix way of new line marking, it doesn't  cause any problems for the usage in browser
Answer posted by Edgar Hernández on Jun 02, 2009 09:35

For testing, I was checking only dhtmlxEditor and leave the defaults for dhtmlXToolbar. This way, only the core of the toolbar was being included. I noticed this because some buttons of the Editor were not displayed. After checking directly the dhtmlxToolbar item, all icons in Editor were displayed, but the scrollbars of the editor (which was the reported bug) still weren't displayed. However, the final library that I need involves more controls.

I end using YUI compression to generate my custom library. This is doing the job correctly. At least for me, the standar compression method is not working.

Anyway, thanks for your help :)