| | |
| | | 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.ie7 = (this.dom && this.appver.indexOf('MSIE 7')>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)); |
| | |
| | | { |
| | | mX += document.body.scrollLeft; |
| | | mY += document.body.scrollTop; |
| | | } |
| | | |
| | | if (e._offset) { |
| | | mX += e._offset.x; |
| | | mY += e._offset.y; |
| | | } |
| | | |
| | | return { x:mX, y:mY }; |
| | |
| | | |
| | | roundcube_browser.prototype.get_cookie = getCookie; |
| | | |
| | | |
| | | // tiny replacement for Firebox functionality |
| | | function rcube_console() |
| | | { |
| | | this.log = function(msg) |
| | | { |
| | | box = rcube_find_object('console'); |
| | | var box = rcube_find_object('console'); |
| | | |
| | | if (box) |
| | | if (box) { |
| | | if (msg.charAt(msg.length-1)=='\n') |
| | | box.value += msg+'--------------------------------------\n'; |
| | | msg += '--------------------------------------\n'; |
| | | else |
| | | box.value += msg+'\n--------------------------------------\n'; |
| | | msg += '\n--------------------------------------\n'; |
| | | |
| | | // Konqueror doesn't allows to just change value of hidden element |
| | | if (bw.konq) { |
| | | box.innerText += msg; |
| | | box.value = box.innerText; |
| | | } else |
| | | box.value += msg; |
| | | } |
| | | }; |
| | | |
| | | this.reset = function() |
| | | { |
| | | box = rcube_find_object('console'); |
| | | var box = rcube_find_object('console'); |
| | | if (box) |
| | | box.value = ''; |
| | | box.innerText = box.value = ''; |
| | | }; |
| | | } |
| | | |
| | | var bw = new roundcube_browser(); |
| | | |
| | | if (!window.console) |
| | | console = new rcube_console(); |
| | | var console = new rcube_console(); |
| | | |
| | | |
| | | // Add escape() method to RegExp object |
| | |
| | | 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); |
| | | } |
| | | } |