}
},
- clickHandler: function(e, dblclick)
+ dblclickHandler: function(e)
{
if (e.isRightClick()) {
return;
}
- var elt = e.element(),
- orig = e.element(),
- id, mbox, tmp;
+ var elt = orig = e.element(),
+ tmp;
while (Object.isElement(elt)) {
id = elt.readAttribute('id');
switch (id) {
case 'msgList':
- if (dblclick) {
- if (!orig.hasClassName('msgRow')) {
- orig = orig.up('.msgRow');
- }
- if (orig) {
- tmp = this.viewport.createSelection('domid', orig.identify()).get('dataob').first();
- tmp.draft ? DimpCore.compose('resume', { folder: tmp.view, uid: tmp.imapuid }) : this.msgWindow(tmp);
- }
- e.stop();
- return;
+ if (!orig.hasClassName('msgRow')) {
+ orig = orig.up('.msgRow');
}
- break;
+ if (orig) {
+ tmp = this.viewport.createSelection('domid', orig.identify()).get('dataob').first();
+ tmp.draft ? DimpCore.compose('resume', { folder: tmp.view, uid: tmp.imapuid }) : this.msgWindow(tmp);
+ }
+ e.stop();
+ return;
+ }
+
+ elt = elt.up();
+ }
+ },
+ clickHandler: function(parentfunc, e)
+ {
+ if (e.isRightClick()) {
+ return;
+ }
+
+ var elt = e.element(),
+ id, mbox, tmp;
+
+ while (Object.isElement(elt)) {
+ id = elt.readAttribute('id');
+
+ switch (id) {
case 'RB_Folder_ok':
this.cfolderaction(e);
e.stop();
elt = elt.up();
}
+
+ parentfunc(e);
},
mouseHandler: function(e, type)
var DM = DimpCore.DMenu;
+ /* Register global handlers now. */
+ document.observe('keydown', this.keydownHandler.bindAsEventListener(this));
+ document.observe('keyup', this.keyupHandler.bindAsEventListener(this));
+ document.observe('mouseover', this.mouseHandler.bindAsEventListener(this, 'over'));
+ document.observe('dblclick', this.dblclickHandler.bindAsEventListener(this));
+ Event.observe(window, 'resize', this.onResize.bind(this));
+
$('dimpLoading').hide();
$('dimpPage').show();
}
};
+/* Click handler. */
+DimpCore.clickHandler = DimpCore.clickHandler.wrap(DimpBase.clickHandler.bind(DimpBase));
+
/* ContextSensitive functions. */
DimpCore.contextOnClick = DimpCore.contextOnClick.wrap(DimpBase.contextOnClick.bind(DimpBase));
DimpCore.contextOnShow = DimpCore.contextOnShow.wrap(DimpBase.contextOnShow.bind(DimpBase));
/* Initialize global event handlers. */
document.observe('dom:loaded', DimpBase.onDomLoad.bind(DimpBase));
-document.observe('keydown', DimpBase.keydownHandler.bindAsEventListener(DimpBase));
-document.observe('keyup', DimpBase.keyupHandler.bindAsEventListener(DimpBase));
-document.observe('click', DimpBase.clickHandler.bindAsEventListener(DimpBase));
-document.observe('dblclick', DimpBase.clickHandler.bindAsEventListener(DimpBase, true));
-document.observe('mouseover', DimpBase.mouseHandler.bindAsEventListener(DimpBase, 'over'));
-Event.observe(window, 'resize', DimpBase.onResize.bind(DimpBase));
},
/* Mouse click handler. */
- _clickHandler: function(e)
+ clickHandler: function(e)
{
if (e.isRightClick()) {
return;
if (!DIMP.conf.ham_reporting) {
this.buttons = this.buttons.without('button_ham');
}
+
+ /* Add click handler. */
+ document.observe('click', DimpCore.clickHandler.bindAsEventListener(DimpCore));
}
};
-/* Add click handler. */
-document.observe('click', DimpCore._clickHandler.bindAsEventListener(DimpCore));
-
/* Helper methods for setting/getting element text without mucking
* around with multiple TextNodes. */
Element.addMethods({
if (DIMP.conf_compose.auto_save_interval_val) {
DimpCore.doAction('DeleteDraft', { index: $F('index') });
}
- return this._closeCompose();
+ return this.closeCompose();
}
},
- _closeCompose: function()
+ closeCompose: function()
{
if (DIMP.conf_compose.qreply) {
this.closeQReply();
DIMP.baseWindow.DimpCore.showNotifications(r.msgs);
}
if (DIMP.conf_compose.close_draft) {
- return this._closeCompose();
+ return this.closeCompose();
}
break;
DIMP.baseWindow.DimpCore.showNotifications(r.msgs);
}
- return this._closeCompose();
+ return this.closeCompose();
case 'add_attachment':
this.uploading = false;
$('messageParent').childElements().invoke('show');
$('message').hide();
} catch (e) {
- this._RTELoading('show');
- FCKeditor_OnComplete = this._RTELoading.curry('hide');
+ this.RTELoading('show');
+ FCKeditor_OnComplete = this.RTELoading.curry('hide');
oFCKeditor.ReplaceTextarea();
}
}
$('html').setValue(this.editor_on ? 1 : 0);
},
- _RTELoading: function(cmd)
+ RTELoading: function(cmd)
{
var o, r;
if (!$('rteloading')) {
},
/* Click observe handler. */
- clickHandler: function(e)
+ clickHandler: function(parentfunc, e)
{
if (e.isRightClick()) {
return;
}
- var elt = orig = e.element(), atc_num, id;
+ var elt = orig = e.element(),
+ atc_num, id;
while (Object.isElement(elt)) {
id = elt.readAttribute('id');
elt = elt.up();
}
+
+ parentfunc(e);
},
changeHandler: function(e)
DimpCore.init();
+ /* Attach event handlers. */
+ document.observe('change', this.changeHandler.bindAsEventListener(this));
+ Event.observe(window, 'resize', this.resizeMsgArea.bind(this));
+ $('compose').observe('submit', Event.stop);
+ $('submit_frame').observe('load', this.attachmentComplete.bind(this));
+
this.resizeMsgArea();
this.initializeSpellChecker();
/* Attach event handlers. */
document.observe('dom:loaded', DimpCompose.onDomLoad.bind(DimpCompose));
-document.observe('change', DimpCompose.changeHandler.bindAsEventListener(DimpCompose));
-document.observe('click', DimpCompose.clickHandler.bindAsEventListener(DimpCompose));
-Event.observe(window, 'resize', DimpCompose.resizeMsgArea.bind(DimpCompose));
-$('compose').observe('submit', Event.stop);
-$('submit_frame').observe('load', DimpCompose.attachmentComplete.bind(DimpCompose));
+
+/* Click handler. */
+DimpCore.clickHandler = DimpCore.clickHandler.wrap(DimpCompose.clickHandler.bind(DimpCompose));
},
/* Click handlers. */
- clickHandler: function(e)
+ clickHandler: function(parentfunc, e)
{
if (e.isRightClick()) {
return;
elt = elt.up();
}
+
+ parentfunc(e);
},
contextOnClick: function(parentfunc, id, elt)
},
/* Add a popdown menu to a dimpactions button. */
- _addPopdown: function(bid, ctx)
+ addPopdown: function(bid, ctx)
{
var bidelt = $(bid);
bidelt.insert({ after: new Element('SPAN', { className: 'iconImg popdownImg popdown', id: bid + '_img' }) });
{
DimpCore.init();
- this._addPopdown('reply_link', 'replypopdown');
- this._addPopdown('forward_link', 'fwdpopdown');
+ this.addPopdown('reply_link', 'replypopdown');
+ this.addPopdown('forward_link', 'fwdpopdown');
/* Set up address linking. */
[ 'from', 'to', 'cc', 'bcc', 'replyTo' ].each(function(a) {
/* ContextSensitive functions. */
DimpCore.contextOnClick = DimpCore.contextOnClick.wrap(DimpFullmessage.contextOnClick.bind(DimpFullmessage));
+/* Click handler. */
+DimpCore.clickHandler = DimpCore.clickHandler.wrap(DimpFullmessage.clickHandler.bind(DimpFullmessage));
+
/* Attach event handlers. */
document.observe('dom:loaded', DimpFullmessage.onDomLoad.bind(DimpFullmessage));
-document.observe('click', DimpFullmessage.clickHandler.bindAsEventListener(DimpFullmessage));