summaryrefslogtreecommitdiff
path: root/roundcubemail/program/js/app.js
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-05-21 08:42:59 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-05-21 08:42:59 +0000
commitd1ef17e0ce0a341b2e68c0b28fcb21c94b4a100b (patch)
tree36adc73e53837bea7dc64c75e4de3e18e5d83630 /roundcubemail/program/js/app.js
parent21e5e3d5bc33159c2c5ad9b8e1e19ceffd67d212 (diff)
- Added 'actionbefore', 'actionafter', 'responsebefore', 'responseafter' events
- Removed response.callbacks feature git-svn-id: https://svn.roundcube.net/trunk@3650 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/js/app.js')
-rw-r--r--roundcubemail/program/js/app.js22
1 files changed, 12 insertions, 10 deletions
diff --git a/roundcubemail/program/js/app.js b/roundcubemail/program/js/app.js
index 5e081d9a3..991ba0385 100644
--- a/roundcubemail/program/js/app.js
+++ b/roundcubemail/program/js/app.js
@@ -439,7 +439,8 @@ function rcube_webmail()
return ret !== null ? ret : (obj ? false : true);
}
- // trigger plugin hook
+ // trigger plugin hooks
+ this.triggerEvent('actionbefore', {props:props, action:command});
var event_ret = this.triggerEvent('before'+command, props);
if (typeof event_ret != 'undefined') {
// abort if one the handlers returned false
@@ -865,7 +866,7 @@ function rcube_webmail()
// all checks passed, send message
this.set_busy(true, 'sendingmessage');
var form = this.gui_objects.messageform;
- form.target = "savetarget";
+ form.target = 'savetarget';
form._draft.value = '';
form.submit();
@@ -880,7 +881,7 @@ function rcube_webmail()
// Reset the auto-save timer
self.clearTimeout(this.save_timer);
- this.upload_file(props)
+ this.upload_file(props)
break;
case 'remove-attachment':
@@ -896,7 +897,7 @@ function rcube_webmail()
var uid;
if (uid = this.get_single_uid())
this.goto_url('compose', '_reply_uid='+uid+'&_mbox='+urlencode(this.env.mailbox)+(command=='reply-all' ? '&_all=1' : ''), true);
- break;
+ break;
case 'forward':
var uid;
@@ -1045,6 +1046,7 @@ function rcube_webmail()
}
this.triggerEvent('after'+command, props);
+ this.triggerEvent('actionafter', {props:props, action:command});
return obj ? false : true;
};
@@ -4908,6 +4910,9 @@ function rcube_webmail()
if (response.unlock)
this.set_busy(false);
+ this.triggerEvent('responsebefore', {response: response});
+ this.triggerEvent('responsebefore'+response.action, {response: response});
+
// set env vars
if (response.env)
this.set_env(response.env);
@@ -4925,12 +4930,6 @@ function rcube_webmail()
eval(response.exec);
}
- // execute callback functions of plugins
- if (response.callbacks && response.callbacks.length) {
- for (var i=0; i < response.callbacks.length; i++)
- this.triggerEvent(response.callbacks[i][0], response.callbacks[i][1]);
- }
-
// process the response data according to the sent action
switch (response.action) {
case 'delete':
@@ -4989,6 +4988,9 @@ function rcube_webmail()
}
break;
}
+
+ this.triggerEvent('responseafter', {response: response});
+ this.triggerEvent('responseafter'+response.action, {response: response});
};
// handle HTTP request errors