Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-05-2007, 03:27 AM
Starter Member
 
Posts: 1
Default How can i add buttons to the compose toolbar?

I am experiencing problems with adding buttons to the Compose toolbar. I have read other threads but nothing seems to work. So far i have done that:

- ZmMailApp: create an operation for it via ZmOperation.registerOp
- ZmComposeController: add it to the toolbar (_initializeToolBar)
- ZmComposeController: add a listener for it (constructor)
- ZmComposeController: write the listener, have it do what you want

When i add my buttons in the upper files, make these changes to ZimbraMail_all.js.zgz the mail crashes with a "ZmZimbraMail is not defined" error.

My questions are:
1. Does zimbra work only with ZimbraMail_all.js.zgz?
2. Is there any way i can change the content of the files in /webapps/zimbra/h directory so that they take effect? (Is compiling needed for these files?)
3. In the ZmMailApp.js the existing operation for the Compose toolbar is already defined. Should i define a new one or i can use the existing one.
Reply With Quote
  #2 (permalink)  
Old 10-05-2007, 09:08 AM
Zimlet Guru & Moderator
 
Posts: 467
Default

Quote:
Originally Posted by MyMoon View Post
I am experiencing problems with adding buttons to the Compose toolbar. I have read other threads but nothing seems to work. So far i have done that:

- ZmMailApp: create an operation for it via ZmOperation.registerOp
- ZmComposeController: add it to the toolbar (_initializeToolBar)
- ZmComposeController: add a listener for it (constructor)
- ZmComposeController: write the listener, have it do what you want

When i add my buttons in the upper files, make these changes to ZimbraMail_all.js.zgz the mail crashes with a "ZmZimbraMail is not defined" error.

My questions are:
1. Does zimbra work only with ZimbraMail_all.js.zgz?
2. Is there any way i can change the content of the files in /webapps/zimbra/h directory so that they take effect? (Is compiling needed for these files?)
3. In the ZmMailApp.js the existing operation for the Compose toolbar is already defined. Should i define a new one or i can use the existing one.
Not to be a horrible tease, but I just finished up a code example for a upcoming O'Reilly book. It has this, and a lot more details.

1. ZimbraMail_all.js.zgz is the default compressed representation. For whatever reason b1-b3 do not update zimlet code correctly when you do a deploy. Slap a &dev=1 at the end of the URL to load the newest code.

2. You should be using a zimlet for this, instead of modifying the core code. You should also not be using anything with underscore in the name, because that means private. I have found that the easiest way to handle buttons is to listen for Toolbarinitilized, and then checked to see if it was a instance of the view I wanted.

Hope this helps!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.