/** * 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.webkit=0=(a.pageY||0)&&!a.clientX&&0>=(a.clientY||0)||bw.ie&&rcube_event._last_keyboard_event&&rcube_event._last_keyboard_event.target== a.target)},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,c,b){this._events||(this._events={});this._events[a]||(this._events[a]=[]);this._events[a].push({func:c,obj:b?b:window});return this},removeEventListener:function(a,c,b){void 0===b&&(b=window);for(var d,e=0;this._events&&this._events[a]&&e|[,;\\s\\n])", "i"):RegExp("^((([^\\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")).test(a)?!0:!1:!1}function rcube_clone_object(a){var c={},b;for(b in a)c[b]=a[b]&&"object"===typeof a[b]?rcube_clone_object(a[b]):a[b];return c}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,c){var b,d;c||(c=document);if(c.getElementById&&(d=c.getElementById(a)))return d;!d&&c.getElementsByName&&(b=c.getElementsByName(a))&&(d=b[0]);!d&&c.all&&(d=c.all[a]);!d&&c.images.length&&(d=c.images[a]);if(!d&&c.forms.length)for(b=0;b=d.left&&b.x=d.top&&b.ye?(d+=String.fromCharCode(e),b++):191e?(c2=a.charCodeAt(b+1),d+=String.fromCharCode((e&31)<<6|c2&63),b+=2):(c2=a.charCodeAt(b+1),c3=a.charCodeAt(b+2),d+=String.fromCharCode((e&15)<<12|(c2&63)<<6|c3&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(k){}for(var f,l,m,h=0,g="",n=a.length;h>2,f=(f&3)<<4|b>>4,l=(b&15)<<2|d>>6,m=d&63,isNaN(b)?l=m=64:isNaN(d)&&(m=64),g=g+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(e)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(f)+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(l)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(m);return g},decode:function(c){if("function"===typeof window.atob)try{return a(atob(c))}catch(b){}var d,e,k,f,l,m,h=0,g="";c=c.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(m=c.length;h>4,e=(e&15)<<4|f>>2,k=(f&3)<<6|l,g+=String.fromCharCode(d),64!=f&&(g+=String.fromCharCode(e)),64!=l&&(g+=String.fromCharCode(k));return a(g)}}}();