/** * 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) 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 e=navigator;this.agent=e.userAgent,this.agent_lc=e.userAgent.toLowerCase(),this.name=e.appName,this.vendor=e.vendor||"",this.vendver=e.vendorSub?parseFloat(e.vendorSub):0,this.product=e.product||"",this.platform=String(e.platform).toLowerCase(),this.lang=e.language?e.language.substring(0,2):e.browserLanguage?e.browserLanguage.substring(0,2):e.systemLanguage?e.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,this.dom2=document.addEventListener&&document.removeEventListener,this.edge=0|"+o+")",n?"ig":"i"):new RegExp("^"+i+"$","i");return n?(o=e.match(t))?o.length:0:t.test(e)}function rcube_clone_object(e){var t,n={};for(t in e)e[t]&&"object"==typeof e[t]?n[t]=rcube_clone_object(e[t]):n[t]=e[t];return n}function urlencode(e){return window.encodeURIComponent?encodeURIComponent(e).replace("*","%2A"):escape(e).replace("+","%2B").replace("*","%2A").replace("/","%2F").replace("@","%40")}function rcube_find_object(e,t){var n,i,o,r;if(!(t=t||document).getElementById||!(o=t.getElementById(e))){if(!(o=!(o=!(o=!o&&t.getElementsByName&&(r=t.getElementsByName(e))?r[0]:o)&&t.all?t.all[e]:o)&&t.images.length?t.images[e]:o)&&t.forms.length)for(i=0;i=n.left&&e.x=n.top&&e.yn.length)&&(t=n.length),t-=e.length,n.lastIndexOf(e,t));return-1!==n&&n===t}),jQuery.last=function(e){return e&&e.length?e[e.length-1]:void 0},jQuery.fn.placeholder=function(e){return this.each(function(){$(this).prop({title:e,placeholder:e})})},function(e){if(!e)return{};function t(e){return decodeURIComponent(e.replace(s," "))}var n,i,o={},r=/([^&=]+)=?([^&]*)/g,s=/\+/g;for(e=e.replace(/\?/,"");i=r.exec(e);)n=t(i[1]),i=t(i[2]),"[]"===n.substring(n.length-2)?(o[n=n.substring(0,n.length-2)]||(o[n]=[])).push(i):o[n]=i;return o}),Base64=function(){function h(e){for(var t,n,i=0,o="",r=0;i>6|192))+String.fromCharCode(63&i|128):(t=(t+=String.fromCharCode(i>>12|224))+String.fromCharCode(i>>6&63|128))+String.fromCharCode(63&i|128)}return t}(e),"function"==typeof window.btoa)try{return btoa(e)}catch(e){}for(var t,n,i,o,r,s,u=0,a="",c=e.length;u>2,o=(3&t)<<4|(t=e.charCodeAt(u++))>>4,r=(15&t)<<2|(n=e.charCodeAt(u++))>>6,s=63&n,isNaN(t)?r=s=64:isNaN(n)&&(s=64),a=a+f.charAt(i)+f.charAt(o)+f.charAt(r)+f.charAt(s);return a},decode:function(e){if("function"==typeof window.atob)try{return h(atob(e))}catch(e){}for(var t,n,i,o,r,s,u=0,a="",c=(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length;u>2,n=(3&r)<<6|(s=f.indexOf(e.charAt(u++))),a+=String.fromCharCode(i<<2|o>>4),64!=r&&(a+=String.fromCharCode(t)),64!=s&&(a+=String.fromCharCode(n));return h(a)}}}();