alecpl
2010-02-23 1617dbb6a45ccd1fa6fc74ab6c47026804c7a1e0
program/js/common.js
@@ -48,8 +48,9 @@
  this.ie = (document.all) ? true : false;
  this.ie4 = (this.ie && !this.dom);
  this.ie5 = (this.dom && this.appver.indexOf('MSIE 5')>0);
  this.ie6 = (this.dom && this.appver.indexOf('MSIE 6')>0);
  this.ie8 = (this.dom && this.appver.indexOf('MSIE 8')>0);
  this.ie7 = (this.dom && this.appver.indexOf('MSIE 7')>0);
  this.ie6 = (this.dom && !this.ie8 && !this.ie7 && this.appver.indexOf('MSIE 6')>0);
  this.mz = (this.dom && this.ver>=5);  // (this.dom && this.product=='Gecko')
  this.ns = ((this.ver<5 && this.name=='Netscape') || (this.ver>=5 && this.vendor.indexOf('Netscape')>=0));
@@ -288,8 +289,8 @@
{
  var ret, h;
  if (typeof e == 'undefined')
    e = {};
  if (typeof e == 'object')
    e = this;
  else if (typeof e == 'object')
    e.event = evt;
  
  if (this._events && this._events[evt] && !this._event_exec) {
@@ -297,9 +298,9 @@
    for (var i=0; i < this._events[evt].length; i++) {
      if ((h = this._events[evt][i])) {
        if (typeof h.func == 'function')
          ret = h.func.call ? h.func.call(h.obj, this, e) : h.func(this, e);
          ret = h.func.call ? h.func.call(h.obj, e) : h.func(e);
        else if (typeof h.obj[h.func] == 'function')
          ret = h.obj[h.func](this, e);
          ret = h.obj[h.func](e);
              
        // cancel event execution
        if (typeof ret != 'undefined' && !ret)
@@ -580,7 +581,7 @@
{
  this.log = function(msg)
  {
    var box = rcube_find_object('console');
    var box = rcube_find_object('dbgconsole');
    if (box) {
      if (msg.charAt(msg.length-1)=='\n')
@@ -599,7 +600,7 @@
  this.reset = function()
  {
    var box = rcube_find_object('console');
    var box = rcube_find_object('dbgconsole');
    if (box)
      box.innerText = box.value = '';
  };
@@ -634,20 +635,3 @@
    return o;
    }
  }
// Fire event on specified element
function exec_event(element,event)
{
  if (document.createEventObject) {
    // dispatch for IE
    var evt = document.createEventObject();
    return element.fireEvent('on'+event,evt)
  }
  else {
    // dispatch for firefox + others
    var evt = document.createEvent("HTMLEvents");
    evt.initEvent(event, true, true); // event type,bubbling,cancelable
    return !element.dispatchEvent(evt);
   }
}