I want a function to be executed every time the compose window loads up..
I am using the following code but unable to link it to the desired event..
Kindly guide which event to hook up to..??
// In the Plugin
public $task = 'mail';
function init() {
$rcmail = rcmail::get_instance();
if (($rcmail->task == 'mail') && ($rcmail->action == 'compose')) {
$this->include_script('myscript.js');
}
}
document.onLoad = myfunc();
function myfunc()
{
alert('works');
var link = document.createElement('a');
link.setAttribute('href', '#');
link.setAttribute('title','Something');
document.getElementById('messagetoolbar').appendChild(link);
}
This is just coz i am not sure which event to call up..
I tried with 'init' but that didn't worked..
I am looking to add a label or button in the toolbar..
Any help is appreciated..
Thanks and Regards,
Pratik