/** * Roundcube common js library * * This file is part of the Roundcube Webmail client * * @licstart The following is the entire license notice for the * JavaScript code in this file. * * Copyright (c) 2005-2014, The Roundcube Dev Team * * The JavaScript code in this page is free software: you can * redistribute it and/or modify it under the terms of the GNU * General Public License (GNU GPL) as published by the Free Software * Foundation, either version 3 of the License, or (at your option) * any later version. The code is distributed WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU GPL for more details. * * As additional permission under GNU GPL version 3 section 7, you * may distribute non-source (e.g., minimized or compacted) forms of * that code without the copy of the GNU GPL normally required by * section 4, provided you include this license notice and a URL * through which recipients can access the Corresponding Source. * * @licend The above is the entire license notice * for the JavaScript code in this file. */ var CONTROL_KEY=1,SHIFT_KEY=2,CONTROL_SHIFT_KEY=3; function roundcube_browser(){var a=navigator;this.agent=a.userAgent;this.agent_lc=a.userAgent.toLowerCase();this.name=a.appName;this.vendor=a.vendor?a.vendor:"";this.vendver=a.vendorSub?parseFloat(a.vendorSub):0;this.product=a.product?a.product:"";this.platform=String(a.platform).toLowerCase();this.lang=a.language?a.language.substring(0,2):a.browserLanguage?a.browserLanguage.substring(0,2):a.systemLanguage?a.systemLanguage.substring(0,2):"en";this.win=0<=this.platform.indexOf("win");this.mac=0<=this.platform.indexOf("mac"); this.linux=0<=this.platform.indexOf("linux");this.unix=0<=this.platform.indexOf("unix");this.dom=document.getElementById?!0:!1;this.dom2=document.addEventListener&&document.removeEventListener;this.edge=0=(a.pageY||0)&&!a.clientX&&0>=(a.clientY||0))},keyboard_only:function(a){return rcube_event.is_keyboard(a)?!0:rcube_event.cancel(a)},touchevent:function(a){return{pageX:a.pageX,pageY:a.pageY,offsetX:a.pageX- a.target.offsetLeft,offsetY:a.pageY-a.target.offsetTop,target:a.target,istouch:!0}}};function rcube_event_engine(){this._events={}} rcube_event_engine.prototype={addEventListener:function(a,b,c){this._events||(this._events={});this._events[a]||(this._events[a]=[]);this._events[a].push({func:b,obj:c?c:window});return this},removeEventListener:function(a,b,c){void 0===c&&(c=window);for(var d,e=0;this._events&&this._events[a]&&e|[,;\\s\\n])", c?"ig":"i"):/^((([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40(((\[(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}\])|(\[IPv6:[0-9a-f:.]+\]))|(([^@\x2e]+\x2e)+([^\x00-\x40\x5b-\x60\x7b-\x7f]{2,}|xn--[a-z0-9]{2,}))))|(mailtest\x40(\u0645\u062b\u0627\u0644\x2e\u0625\u062e\u062a\u0628\u0627\u0631|\u4f8b\u5b50\x2e\u6d4b\u8bd5|\u4f8b\u5b50\x2e\u6e2c\u8a66|\u03c0\u03b1\u03c1\u03ac\u03b4\u03b5\u03b9\u03b3\u03bc\u03b1\x2e\u03b4\u03bf\u03ba\u03b9\u03bc\u03ae|\u0909\u0926\u093e\u0939\u0930\u0923\x2e\u092a\u0930\u0940\u0915\u094d\u0937\u093e|\u4f8b\u3048\x2e\u30c6\u30b9\u30c8|\uc2e4\ub840\x2e\ud14c\uc2a4\ud2b8|\u0645\u062b\u0627\u0644\x2e\u0622\u0632\u0645\u0627\u06cc\u0634\u06cc|\u043f\u0440\u0438\u043c\u0435\u0440\x2e\u0438\u0441\u043f\u044b\u0442\u0430\u043d\u0438\u0435|\u0b89\u0ba4\u0bbe\u0bb0\u0ba3\u0bae\u0bcd\x2e\u0baa\u0bb0\u0bbf\u0b9f\u0bcd\u0b9a\u0bc8|\u05d1\u05f2\u05b7\u05e9\u05e4\u05bc\u05d9\u05dc\x2e\u05d8\u05e2\u05e1\u05d8)))$/i; return c?a.match(b).length:b.test(a)}function rcube_clone_object(a){var b={},c;for(c in a)b[c]=a[c]&&"object"===typeof a[c]?rcube_clone_object(a[c]):a[c];return b}function urlencode(a){return window.encodeURIComponent?encodeURIComponent(a).replace("*","%2A"):escape(a).replace("+","%2B").replace("*","%2A").replace("/","%2F").replace("@","%40")} function rcube_find_object(a,b){var c,d;b||(b=document);if(b.getElementById&&(d=b.getElementById(a)))return d;!d&&b.getElementsByName&&(c=b.getElementsByName(a))&&(d=c[0]);!d&&b.all&&(d=b.all[a]);!d&&b.images.length&&(d=b.images[a]);if(!d&&b.forms.length)for(c=0;c=c.left&&a.x=c.top&&a.ye?(d+=String.fromCharCode(e),b++):191e?(f=a.charCodeAt(b+1),d+=String.fromCharCode((e& 31)<<6|f&63),b+=2):(f=a.charCodeAt(b+1),g=a.charCodeAt(b+2),d+=String.fromCharCode((e&15)<<12|(f&63)<<6|g&63),b+=3);return d};return{encode:function(a){a=a.replace(/\r\n/g,"\n");for(var b="",d=0;de?b+=String.fromCharCode(e):(127e?b+=String.fromCharCode(e>>6|192):(b+=String.fromCharCode(e>>12|224),b+=String.fromCharCode(e>>6&63|128)),b+=String.fromCharCode(e&63|128))}a=b;if("function"===typeof window.btoa)try{return btoa(a)}catch(n){}for(var f,g,h, k=0,l="",m=a.length;k>2,f=(f&3)<<4|b>>4,g=(b&15)<<2|d>>6,h=d&63,isNaN(b)?g=h=64:isNaN(d)&&(h=64),l=l+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(e)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(f)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(g)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(h);return l},decode:function(b){if("function"=== typeof window.atob)try{return a(atob(b))}catch(m){}var c,d=0,e="";b=b.replace(/[^A-Za-z0-9\+\/=]/g,"");for(c=b.length;d>4;g=(g&15)<<4|h>>2;var l=(h&3)<<6|k;e+=String.fromCharCode(f);64!=h&&(e+=String.fromCharCode(g));64!=k&&(e+=String.fromCharCode(l))}return a(e)}}}();