Free javascript Hosting


common-min4889.js

Uploaded on Oct 27 2021 05:44 by kayode.adegroupsng

/**
* 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 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<this.agent_lc.indexOf(" edge/");this.webkit=!this.edge&&0<this.agent_lc.indexOf("applewebkit");this.ie=document.all&&!window.opera||this.win&&0<this.agent_lc.indexOf("trident/");window.opera?(this.opera=!0,this.vendver=opera.version()):this.ie||this.edge||(this.chrome=0<this.agent_lc.indexOf("chrome"),
this.opera=this.webkit&&0<this.agent.indexOf(" OPR/"),this.safari=!this.chrome&&!this.opera&&(this.webkit||0<this.agent_lc.indexOf("safari")),this.konq=0<this.agent_lc.indexOf("konqueror"),this.mz=this.dom&&!this.chrome&&!this.safari&&!this.konq&&!this.opera&&0<=this.agent.indexOf("Mozilla"),this.iphone=this.safari&&(0<this.agent_lc.indexOf("iphone")||0<this.agent_lc.indexOf("ipod")||"ipod"==this.platform||"iphone"==this.platform),this.ipad=this.safari&&(0<this.agent_lc.indexOf("ipad")||"ipad"==this.platform));
this.vendver||(this.vendver=/(opera|opr|khtml|chrome|safari|applewebkit|msie)(\s|\/)([0-9\.]+)/.test(this.agent_lc)?parseFloat(RegExp.$3):0,this.vendver||(this.vendver=/rv:([0-9\.]+)/.test(this.agent)?parseFloat(RegExp.$1):0));this.safari&&/;\s+([a-z]{2})-[a-z]{2}\)/.test(this.agent_lc)&&(this.lang=RegExp.$1);this.mobile=/iphone|ipod|blackberry|iemobile|opera mini|opera mobi|mobile/i.test(this.agent_lc);this.tablet=!this.mobile&&/ipad|android|xoom|sch-i800|playbook|tablet|kindle/i.test(this.agent_lc);
this.touch=this.mobile||this.tablet;this.pointer="function"==typeof window.PointerEvent;this.cookies=a.cookieEnabled;this.xmlhttp_test=function(){var a=new Function("try{var o=new ActiveXObject('Microsoft.XMLHTTP');return true;}catch(err){return false;}");return this.xmlhttp=window.XMLHttpRequest||"ActiveXObject"in window&&a()};this.set_html_class=function(){var a=" js";this.ie?a+=" ms ie ie"+parseInt(this.vendver):this.edge?a+=" ms edge":this.opera?a+=" opera":this.konq?a+=" konqueror":this.safari?
a+=" chrome":this.chrome?a+=" chrome":this.mz&&(a+=" mozilla");this.iphone?a+=" iphone":this.ipad?a+=" ipad":this.webkit&&(a+=" webkit");this.mobile&&(a+=" mobile");this.tablet&&(a+=" tablet");document.documentElement&&(document.documentElement.className+=a)}}
var rcube_event={get_target:function(a){return(a=a||window.event)&&a.target?a.target:a.srcElement||document},get_keycode:function(a){return(a=a||window.event)&&a.keyCode?a.keyCode:a&&a.which?a.which:0},get_button:function(a){return(a=a||window.event)&&void 0!==a.button?a.button:a&&a.which?a.which:0},get_modifier:function(a){var b=0;a=a||window.event;bw.mac&&a?b+=(a.metaKey&&CONTROL_KEY)+(a.shiftKey&&SHIFT_KEY):a&&(b+=(a.ctrlKey&&CONTROL_KEY)+(a.shiftKey&&SHIFT_KEY));return b},get_mouse_pos:function(a){a||
(a=window.event);var b=a.pageX?a.pageX:a.clientX,c=a.pageY?a.pageY:a.clientY;document.body&&document.all&&(b+=document.body.scrollLeft,c+=document.body.scrollTop);a._offset&&(b+=a._offset.left,c+=a._offset.top);return{x:b,y:c}},add_listener:function(a){if(a.object&&a.method){a.element||(a.element=document);a.object._rc_events||(a.object._rc_events={});var b=a.event+"*"+a.method;a.object._rc_events[b]||(a.object._rc_events[b]=function(b){return a.object[a.method](b)});a.element.addEventListener?a.element.addEventListener(a.event,
a.object._rc_events[b],!1):a.element.attachEvent?(a.element.detachEvent("on"+a.event,a.object._rc_events[b]),a.element.attachEvent("on"+a.event,a.object._rc_events[b])):a.element["on"+a.event]=a.object._rc_events[b]}},remove_listener:function(a){a.element||(a.element=document);var b=a.event+"*"+a.method;a.object&&a.object._rc_events&&a.object._rc_events[b]&&(a.element.removeEventListener?a.element.removeEventListener(a.event,a.object._rc_events[b],!1):a.element.detachEvent?a.element.detachEvent("on"+
a.event,a.object._rc_events[b]):a.element["on"+a.event]=null)},cancel:function(a){a=a?a:window.event;a.preventDefault?a.preventDefault():a.returnValue=!1;a.stopPropagation&&a.stopPropagation();a.cancelBubble=!0;return!1},is_keyboard:function(a){return a?a.type?!!a.type.match(/^key/)||"click"==a.type&&!a.clientX:!a.pageX&&0>=(a.pageY||0)&&!a.clientX&&0>=(a.clientY||0):!1},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<this._events[a].length;e++)(d=this._events[a][e])&&d.func==b&&d.obj==c&&(this._events[a][e]=null)},triggerEvent:function(a,b){var c,d,e=function(a){try{a&&a.event&&delete a.event}catch(b){}};void 0===b?b=
this:"object"===typeof b&&(b.event=a);this._event_exec||(this._event_exec={});if(this._events&&this._events[a]&&!this._event_exec[a]){this._event_exec[a]=!0;for(var f=0;f<this._events[a].length;f++)if(d=this._events[a][f])if("function"===typeof d.func?c=d.func.call?d.func.call(d.obj,b):d.func(b):"function"===typeof d.obj[d.func]&&(c=d.obj[d.func](b)),void 0!==c&&!c)break;e(c)}delete this._event_exec[a];e(b);return c}};
function rcube_check_email(a,b,c,d){if(!a)return c?0:!1;c&&(b=!0);d=d?"([^\\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)":"[^\\u0000-\\u0020\\u002e\\u00a0\\u0040\\u007f\\u2028\\u2029]+";d="(("+(d+"(\\x2e"+d+")*")+"\\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)))";
b=b?RegExp("(^|<|[,;\\s\\n])"+d+"($|>|[,;\\s\\n])",c?"ig":"i"):RegExp("^"+d+"$","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<b.forms.length;c++)b.forms[c].name==a?d=b.forms[c]:b.forms[c].elements[a]&&(d=b.forms[c].elements[a]);if(!d&&b.layers)for(b.layers[a]&&(d=b.layers[a]),c=0;!d&&c<b.layers.length;c++)d=rcube_find_object(a,b.layers[c].document);return d}
function rcube_mouse_is_over(a,b){var c=rcube_event.get_mouse_pos(a),d=$(b).offset();return c.x>=d.left&&c.x<d.left+b.offsetWidth&&c.y>=d.top&&c.y<d.top+b.offsetHeight}function setCookie(a,b,c,d,e,f){a=a+"="+escape(b)+(c?"; expires="+c.toGMTString():"")+(d?"; path="+d:"")+(e?"; domain="+e:"")+(f?"; secure":"");document.cookie=a}
function getCookie(a){var b=document.cookie;a+="=";var c=b.indexOf("; "+a);if(-1==c){if(c=b.indexOf(a),0!=c)return null}else c+=2;var d=b.indexOf(";",c);-1==d&&(d=b.length);return unescape(b.substring(c+a.length,d))}roundcube_browser.prototype.set_cookie=setCookie;roundcube_browser.prototype.get_cookie=getCookie;var bw=new roundcube_browser;bw.set_html_class();RegExp.escape=function(a){return String(a).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")};
Date.prototype.getStdTimezoneOffset=function(){for(var a=12,b=new Date(null,a,1),c=b.getTimezoneOffset();--a;)if(b.setUTCMonth(a),c!=b.getTimezoneOffset())return Math.max(c,b.getTimezoneOffset());return c};String.prototype.startsWith||(String.prototype.startsWith=function(a,b){return this.slice(b||0,a.length)===a});
String.prototype.endsWith||(String.prototype.endsWith=function(a,b){var c=this.toString();if("number"!==typeof b||!isFinite(b)||Math.floor(b)!==b||b>c.length)b=c.length;b-=a.length;c=c.lastIndexOf(a,b);return-1!==c&&c===b});jQuery.last=function(a){return a&&a.length?a[a.length-1]:void 0};jQuery.fn.placeholder=function(a){return this.each(function(){$(this).prop({title:a,placeholder:a})})};
var rcube_parse_query=function(a){if(!a)return{};var b={},c,d,e=/([^&=]+)=?([^&]*)/g,f=/\+/g;for(a=a.replace(/\?/,"");c=e.exec(a);)d=decodeURIComponent(c[1].replace(f," ")),c=decodeURIComponent(c[2].replace(f," ")),"[]"===d.substring(d.length-2)?(d=d.substring(0,d.length-2),(b[d]||(b[d]=[])).push(c)):b[d]=c;return b},Base64=function(){var a=function(a){for(var c=0,d="",e=0,f=0,g=0;c<a.length;)e=a.charCodeAt(c),128>e?(d+=String.fromCharCode(e),c++):191<e&&224>e?(f=a.charCodeAt(c+1),d+=String.fromCharCode((e&
31)<<6|f&63),c+=2):(f=a.charCodeAt(c+1),g=a.charCodeAt(c+2),d+=String.fromCharCode((e&15)<<12|(f&63)<<6|g&63),c+=3);return d};return{encode:function(a){a=a.replace(/\r\n/g,"\n");for(var c="",d=0;d<a.length;d++){var e=a.charCodeAt(d);128>e?c+=String.fromCharCode(e):(127<e&&2048>e?c+=String.fromCharCode(e>>6|192):(c+=String.fromCharCode(e>>12|224),c+=String.fromCharCode(e>>6&63|128)),c+=String.fromCharCode(e&63|128))}a=c;if("function"===typeof window.btoa)try{return btoa(a)}catch(f){}for(var g,l,m,
k=0,h="",n=a.length;k<n;)g=a.charCodeAt(k++),c=a.charCodeAt(k++),d=a.charCodeAt(k++),e=g>>2,g=(g&3)<<4|c>>4,l=(c&15)<<2|d>>6,m=d&63,isNaN(c)?l=m=64:isNaN(d)&&(m=64),h=h+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(e)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(g)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(l)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(m);return h},decode:function(b){if("function"===
typeof window.atob)try{return a(atob(b))}catch(c){}var d,e,f,g,l,m,k=0,h="";b=b.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(m=b.length;k<m;)d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(k++)),e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(k++)),g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(k++)),l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(b.charAt(k++)),
d=d<<2|e>>4,e=(e&15)<<4|g>>2,f=(g&3)<<6|l,h+=String.fromCharCode(d),64!=g&&(h+=String.fromCharCode(e)),64!=l&&(h+=String.fromCharCode(f));return a(h)}}}();

Back to list