Results 1 to 6 of 6

Thread: JavaScript Modifications

  1. #1
    Join Date
    Jun 2007
    Posts
    2
    Rep Power
    8

    Default JavaScript Modifications

    Hi,

    I was trying to add some code to the javascript files (such as : ZmLogin) but it seems that my modifications to these files doesn't appear .... I mean that ZCS works as there were no any modifications.

    I used firebug to check the lines I have added to the generated HTML code but I didn't find any thing , so I restarted the tomcat and the zimbra server but also nothing happened

    any clue here ....

  2. #2
    Join Date
    Feb 2007
    Posts
    43
    Rep Power
    8

    Default

    Hi,

    I'm having the same Q since I'm working in alot of new JS files to be added to my Ajax client .
    I searched the forums for some thing like that and I had a piece of info to share with you.
    Some one asked the same Q and he had the answer as following :

    You'll need a source tree and run the prod-deploy target. If you just edit the _all.js file then you can just gzip it to get the .zgz file.
    I really want some clarifications of how to get "source tree and run the prod-deploy target" statement because I don't want to modify in the ZimbraMail_all.js my self I want it auto-generated .

    So any idea how to do so ??

    Regards
    Hany

  3. #3
    Join Date
    Nov 2005
    Posts
    477
    Rep Power
    10

    Default

    Quote Originally Posted by hanysys View Post
    Hi,

    I'm having the same Q since I'm working in alot of new JS files to be added to my Ajax client .
    I searched the forums for some thing like that and I had a piece of info to share with you.
    Some one asked the same Q and he had the answer as following :



    I really want some clarifications of how to get "source tree and run the prod-deploy target" statement because I don't want to modify in the ZimbraMail_all.js my self I want it auto-generated .

    So any idea how to do so ??

    Regards
    Hany
    Take a look at the ANT build for ZimbraWebClient.Most of the steps in that deploy and admin-deploy revolve around compressing, cajoling and otherwise compacting the javascript and gif/jpg files to make them more efficent.

    That being said, while I can see some stuff in ZmLogin.js that might not be expandable, most of the rest of the Zimbra code has good solid Object Oriented practices that should allow you to extend rather then replace.

  4. #4
    Join Date
    Jan 2007
    Posts
    26
    Rep Power
    8

    Default

    Another option might be to make sure that you aren't caching the Javascript in your browser. A clear cache and reload might ensure that the new code is there, just not being looked for.

  5. #5
    Join Date
    Feb 2007
    Posts
    43
    Rep Power
    8

    Default

    Hi,

    Thanks monvural for your advice, but I have another problem now.
    I checked the open source version, used ant to deploy; I really don't want to deploy I just need it to generate the new compressed files (ZimbraMail_all.js, Ajax_all.js, ...) for my new modifications to the old code and the new files added in my new app (WFE).

    I found that I must add the new files paths in the file ZimbraMail.jsp found in the public folder in order that they would be compressed with the others, I added them then ran prod-deploy in the ant but this time this operation doesn't complete it stops at :


    rhino-compress:
    [echo] Strip whitespace, comments and debug calls: /root/Desktop/FRANK/ZimbraWebClient/build/WebRoot/js/AjaxNewWindow_all.js
    rhino-compress:
    [echo] Strip whitespace, comments and debug calls: /root/Desktop/FRANK/ZimbraWebClient/build/WebRoot/js/Ajax_all.js
    rhino-compress:
    [echo] Strip whitespace, comments and debug calls: /root/Desktop/FRANK/ZimbraWebClient/build/WebRoot/js/ZimbraAdmin_all.js
    rhino-compress:
    [echo] Strip whitespace, comments and debug calls: /root/Desktop/FRANK/ZimbraWebClient/build/WebRoot/js/ZimbraMail_all.js

    BUILD FAILED
    /root/Desktop/FRANK/ZimbraWebClient/build.xml:361: The following error occurred while executing this line:
    /root/Desktop/FRANK/ZimbraWebClient/build.xml:285: Java returned: 3


    I check the resulted files I see all files there and the ZimbraMail_all.js is there but its comments, nor style were changed; and it wasnot compressed.

    This error happened only when I added my new files (the WFE app folder).

    so is there any files else that I should modify to complete this process ?
    or what Can I do ??

    Regards
    Hany

  6. #6
    Join Date
    Jan 2007
    Posts
    26
    Rep Power
    8

    Default

    So I think to try to understand what's going wrong you should try a couple of things.

    Do an ant clean and then run ant prod-deploy again

    I don't think this will solve it, but I think it's worth trying to see if you have version conflicts.

    I have a sneaking suspicion that prod-deploy is overkill, and you might be able to get away with another target to get the task done. The problem with modifying any of the *_all.js files is that the Jammer target is told to exclude them. They are therefore not recompiled/compressed as a result. If option 1 ends up not working, then try to do:

    ant jam-file

    to see if the *_all.js files that you've modified are now being compressed and pushed to the server. Finally, make sure that you've properly modified your JSP files. The error you're receiving is coming from the jsp file if I understand it correctly, so it's probably worth a double check in that regard.

Similar Threads

  1. zimlet javascript errors IE7
    By danpep in forum Users
    Replies: 8
    Last Post: 08-21-2007, 10:04 PM
  2. A Little Javascript Help
    By plan9 in forum Administrators
    Replies: 1
    Last Post: 04-14-2007, 12:25 AM
  3. Replies: 1
    Last Post: 02-20-2007, 01:49 AM
  4. How do I regenerate the Zimbra javascript files?
    By dwp in forum Administrators
    Replies: 1
    Last Post: 09-20-2006, 09:46 PM
  5. Accessing Zimbra Javascript objects
    By mghaught in forum Developers
    Replies: 6
    Last Post: 03-15-2006, 11:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •