Hello Gents
we're developing a Zimlet that needs to do some stuff on the email message body when a draft is loaded into the HTML editor.
What we would need is some kind of callbak that is called when the editor has just finished to load... somewhat like the "ZmHtmlEditor.prototype._onContentInitialized" function.
We saw there's a callback here, "_onContentInitializeCallback", but seems that this function is used internally for other purposes.
We also tried to accomplish our needings overriding the "ZmComposeController.prototype._setView" function, adding some code at the end of this.
This is working fine with Chrome and IE, but seems there's a problem with Firefox related to the "enableDesignMode" function.
In the end, what's the best way to add some content (in our case, the default signature of the logged user) to a draft, when this is opened for editing by the user?
We are using Zimbra 7.2.2.
Thanks in advance for any help.
Roberto
HTML Editor - "content initialized" callback (add content to messages when edited)
-
- Posts: 27
- Joined: Sat Sep 13, 2014 3:13 am
HTML Editor - "content initialized" callback (add content to messages when edited)
Have you tried
ZmHtmlEditor.prototype.onShowView = function(view) {
if (appCtxt.getCurrentViewType() == ZmId.VIEW_COMPOSE) {
// do some stuff here
}
}?
Does this fire too early for you?
Kathy A.
ZmHtmlEditor.prototype.onShowView = function(view) {
if (appCtxt.getCurrentViewType() == ZmId.VIEW_COMPOSE) {
// do some stuff here
}
}?
Does this fire too early for you?
Kathy A.
HTML Editor - "content initialized" callback (add content to messages when edited)
Hello Kathy, that worked for me, thanks!
HTML Editor - "content initialized" callback (add content to messages when edited)
For completeness:
[QUOTE]appCtxt.getCurrentViewType()ZmHtmlEditor.prototype.onShowView = function(view) {
if (appCtxt.getCurrentViewType() == ZmId.VIEW_COMPOSE) {
// do some stuff here
}
}[/QUOTE]
is not working for me (appCtxt.getCurrentViewType() is not defined), but I managed to do what I want in this way:
MyZimlet.prototype.onShowView = function(viewId) {
viewId = viewId || appCtxt.getCurrentViewId();
// if we're not in a COMPOSE view, do nothing
if (!viewId.substring(0, ZmId.VIEW_COMPOSE.length) == ZmId.VIEW_COMPOSE) {
return;
}
// do my stuff
}
[QUOTE]appCtxt.getCurrentViewType()ZmHtmlEditor.prototype.onShowView = function(view) {
if (appCtxt.getCurrentViewType() == ZmId.VIEW_COMPOSE) {
// do some stuff here
}
}[/QUOTE]
is not working for me (appCtxt.getCurrentViewType() is not defined), but I managed to do what I want in this way:
MyZimlet.prototype.onShowView = function(viewId) {
viewId = viewId || appCtxt.getCurrentViewId();
// if we're not in a COMPOSE view, do nothing
if (!viewId.substring(0, ZmId.VIEW_COMPOSE.length) == ZmId.VIEW_COMPOSE) {
return;
}
// do my stuff
}
-
- Posts: 27
- Joined: Sat Sep 13, 2014 3:13 am
HTML Editor - "content initialized" callback (add content to messages when edited)
Keep appCtxt.getCurrentViewType() in mind for when you switch to Zimbra 8.
Glad">http://www.zimbra.com/forums/zimlets/59 ... mlets.html
Glad it worked for you.
Kathy A.
Glad">http://www.zimbra.com/forums/zimlets/59 ... mlets.html
Glad it worked for you.
Kathy A.