diff -urN ../roundcubemail-1.4.10.orig/program/js/common.js ./program/js/common.js --- ../roundcubemail-1.4.10.orig/program/js/common.js 2020-12-27 23:42:19.000000000 +0200 +++ ./program/js/common.js 2021-01-17 21:58:40.819422000 +0200 @@ -211,6 +211,28 @@ }, /** + * Return absolute touch position of an event + */ +get_touch_pos: function(e) +{ + if (!e) e = window.event; + var mX = (e.touches[0].pageX) ? e.touches[0].pageX : e.touches[0].clientX, + mY = (e.touches[0].pageY) ? e.touches[0].pageY : e.touches[0].clientY; + + if (document.body && document.all) { + mX += document.body.scrollLeft; + mY += document.body.scrollTop; + } + + if (e._offset) { + mX += e._offset.left; + mY += e._offset.top; + } + + return { x:mX, y:mY }; +}, + +/** * Add an object method as event listener to a certain element */ add_listener: function(p) diff -urN ../roundcubemail-1.4.10.orig/program/js/common.min.js ./program/js/common.min.js --- ../roundcubemail-1.4.10.orig/program/js/common.min.js 2020-12-27 23:42:19.000000000 +0200 +++ ./program/js/common.min.js 2021-01-18 03:29:39.631509000 +0200 @@ -1,53 +1 @@ -/** - * 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=(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|[,;\\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=d.left&&c.x=d.top&&c.yc.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;ce?(d+=String.fromCharCode(e),c++):191e?(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;de?c+=String.fromCharCode(e):(127e?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>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>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)}}}(); +var CONTROL_KEY=1;var SHIFT_KEY=2;var CONTROL_SHIFT_KEY=3;function roundcube_browser(){var n=navigator;this.agent=n.userAgent;this.agent_lc=n.userAgent.toLowerCase();this.name=n.appName;this.vendor=n.vendor?n.vendor:"";this.vendver=n.vendorSub?parseFloat(n.vendorSub):0;this.product=n.product?n.product:"";this.platform=String(n.platform).toLowerCase();this.lang=n.language?n.language.substring(0,2):n.browserLanguage?n.browserLanguage.substring(0,2):n.systemLanguage?n.systemLanguage.substring(0,2):"en";this.win=this.platform.indexOf("win")>=0;this.mac=this.platform.indexOf("mac")>=0;this.linux=this.platform.indexOf("linux")>=0;this.unix=this.platform.indexOf("unix")>=0;this.dom=document.getElementById?true:false;this.dom2=document.addEventListener&&document.removeEventListener;this.edge=this.agent_lc.indexOf(" edge/")>0;this.webkit=!this.edge&&this.agent_lc.indexOf("applewebkit")>0;this.ie=document.all&&!window.opera||this.win&&this.agent_lc.indexOf("trident/")>0;if(window.opera){this.opera=true;this.vendver=opera.version()}else if(!this.ie&&!this.edge){this.chrome=this.agent_lc.indexOf("chrome")>0;this.opera=this.webkit&&this.agent.indexOf(" OPR/")>0;this.safari=!this.chrome&&!this.opera&&(this.webkit||this.agent_lc.indexOf("safari")>0);this.konq=this.agent_lc.indexOf("konqueror")>0;this.mz=this.dom&&!this.chrome&&!this.safari&&!this.konq&&!this.opera&&this.agent.indexOf("Mozilla")>=0;this.iphone=this.safari&&(this.agent_lc.indexOf("iphone")>0||this.agent_lc.indexOf("ipod")>0||this.platform=="ipod"||this.platform=="iphone");this.ipad=this.safari&&(this.agent_lc.indexOf("ipad")>0||this.platform=="ipad")}if(!this.vendver){this.vendver=/(opera|opr|khtml|chrome|safari|applewebkit|msie)(\s|\/)([0-9\.]+)/.test(this.agent_lc)?parseFloat(RegExp.$3):0;if(!this.vendver)this.vendver=/rv:([0-9\.]+)/.test(this.agent)?parseFloat(RegExp.$1):0}if(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=typeof window.PointerEvent=="function";this.cookies=n.cookieEnabled;this.xmlhttp_test=function(){var activeX_test=new Function("try{var o=new ActiveXObject('Microsoft.XMLHTTP');return true;}catch(err){return false;}");this.xmlhttp=window.XMLHttpRequest||"ActiveXObject"in window&&activeX_test();return this.xmlhttp};this.set_html_class=function(){var classname=" js";if(this.ie)classname+=" ms ie ie"+parseInt(this.vendver);else if(this.edge)classname+=" ms edge";else if(this.opera)classname+=" opera";else if(this.konq)classname+=" konqueror";else if(this.safari)classname+=" chrome";else if(this.chrome)classname+=" chrome";else if(this.mz)classname+=" mozilla";if(this.iphone)classname+=" iphone";else if(this.ipad)classname+=" ipad";else if(this.webkit)classname+=" webkit";if(this.mobile)classname+=" mobile";if(this.tablet)classname+=" tablet";if(document.documentElement)document.documentElement.className+=classname}}var rcube_event={get_target:function(e){e=e||window.event;return e&&e.target?e.target:e.srcElement||document},get_keycode:function(e){e=e||window.event;return e&&e.keyCode?e.keyCode:e&&e.which?e.which:0},get_button:function(e){e=e||window.event;return e&&e.button!==undefined?e.button:e&&e.which?e.which:0},get_modifier:function(e){var opcode=0;e=e||window.event;if(bw.mac&&e)opcode+=(e.metaKey&&CONTROL_KEY)+(e.shiftKey&&SHIFT_KEY);else if(e)opcode+=(e.ctrlKey&&CONTROL_KEY)+(e.shiftKey&&SHIFT_KEY);return opcode},get_mouse_pos:function(e){if(!e)e=window.event;var mX=e.pageX?e.pageX:e.clientX,mY=e.pageY?e.pageY:e.clientY;if(document.body&&document.all){mX+=document.body.scrollLeft;mY+=document.body.scrollTop}if(e._offset){mX+=e._offset.left;mY+=e._offset.top}return{x:mX,y:mY}},get_touch_pos:function(e){if(!e)e=window.event;var mX=e.touches[0].pageX?e.touches[0].pageX:e.touches[0].clientX,mY=e.touches[0].pageY?e.touches[0].pageY:e.touches[0].clientY;if(document.body&&document.all){mX+=document.body.scrollLeft;mY+=document.body.scrollTop}if(e._offset){mX+=e._offset.left;mY+=e._offset.top}return{x:mX,y:mY}},add_listener:function(p){if(!p.object||!p.method)return;if(!p.element)p.element=document;if(!p.object._rc_events)p.object._rc_events={};var key=p.event+"*"+p.method;if(!p.object._rc_events[key])p.object._rc_events[key]=function(e){return p.object[p.method](e)};if(p.element.addEventListener)p.element.addEventListener(p.event,p.object._rc_events[key],false);else if(p.element.attachEvent){p.element.detachEvent("on"+p.event,p.object._rc_events[key]);p.element.attachEvent("on"+p.event,p.object._rc_events[key])}else p.element["on"+p.event]=p.object._rc_events[key]},remove_listener:function(p){if(!p.element)p.element=document;var key=p.event+"*"+p.method;if(p.object&&p.object._rc_events&&p.object._rc_events[key]){if(p.element.removeEventListener)p.element.removeEventListener(p.event,p.object._rc_events[key],false);else if(p.element.detachEvent)p.element.detachEvent("on"+p.event,p.object._rc_events[key]);else p.element["on"+p.event]=null}},cancel:function(evt){var e=evt?evt:window.event;if(e.preventDefault)e.preventDefault();else e.returnValue=false;if(e.stopPropagation)e.stopPropagation();e.cancelBubble=true;return false},is_keyboard:function(e){if(!e)return false;if(e.type)return!!e.type.match(/^key/)||e.type=="click"&&!e.clientX;return!e.pageX&&(e.pageY||0)<=0&&!e.clientX&&(e.clientY||0)<=0},keyboard_only:function(e){return rcube_event.is_keyboard(e)?true:rcube_event.cancel(e)},touchevent:function(e){return{pageX:e.pageX,pageY:e.pageY,offsetX:e.pageX-e.target.offsetLeft,offsetY:e.pageY-e.target.offsetTop,target:e.target,istouch:true}}};function rcube_event_engine(){this._events={}}rcube_event_engine.prototype={addEventListener:function(evt,func,obj){if(!this._events)this._events={};if(!this._events[evt])this._events[evt]=[];this._events[evt].push({func:func,obj:obj?obj:window});return this},removeEventListener:function(evt,func,obj){if(obj===undefined)obj=window;for(var h,i=0;this._events&&this._events[evt]&&i|"+delim+")",rx_flag):new RegExp("^"+addr_spec+"$","i");if(count)return input.match(rx).length;return rx.test(input)}function rcube_clone_object(obj){var out={};for(var key in obj){if(obj[key]&&typeof obj[key]==="object")out[key]=rcube_clone_object(obj[key]);else out[key]=obj[key]}return out}function urlencode(str){if(window.encodeURIComponent)return encodeURIComponent(str).replace("*","%2A");return escape(str).replace("+","%2B").replace("*","%2A").replace("/","%2F").replace("@","%40")}function rcube_find_object(id,d){var n,f,obj,e;if(!d)d=document;if(d.getElementById)if(obj=d.getElementById(id))return obj;if(!obj&&d.getElementsByName&&(e=d.getElementsByName(id)))obj=e[0];if(!obj&&d.all)obj=d.all[id];if(!obj&&d.images.length)obj=d.images[id];if(!obj&&d.forms.length){for(f=0;f=pos.left&&mouse.x=pos.top&&mouse.ysubjectString.length){position=subjectString.length}position-=searchString.length;var lastIndex=subjectString.lastIndexOf(searchString,position);return lastIndex!==-1&&lastIndex===position}}jQuery.last=function(arr){return arr&&arr.length?arr[arr.length-1]:undefined};jQuery.fn.placeholder=function(text){return this.each(function(){$(this).prop({title:text,placeholder:text})})};var rcube_parse_query=function(query){if(!query)return{};var params={},e,k,v,re=/([^&=]+)=?([^&]*)/g,decodeRE=/\+/g,decode=function(str){return decodeURIComponent(str.replace(decodeRE," "))};query=query.replace(/\?/,"");while(e=re.exec(query)){k=decode(e[1]);v=decode(e[2]);if(k.substring(k.length-2)==="[]"){k=k.substring(0,k.length-2);(params[k]||(params[k]=[])).push(v)}else params[k]=v}return params};var Base64=function(){var keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var utf8_encode=function(string){string=string.replace(/\r\n/g,"\n");var utftext="";for(var n=0;n127&&c<2048){utftext+=String.fromCharCode(c>>6|192);utftext+=String.fromCharCode(c&63|128)}else{utftext+=String.fromCharCode(c>>12|224);utftext+=String.fromCharCode(c>>6&63|128);utftext+=String.fromCharCode(c&63|128)}}return utftext};var utf8_decode=function(utftext){var i=0,string="",c=0,c2=0,c3=0;while(i191&&c<224){c2=utftext.charCodeAt(i+1);string+=String.fromCharCode((c&31)<<6|c2&63);i+=2}else{c2=utftext.charCodeAt(i+1);c3=utftext.charCodeAt(i+2);string+=String.fromCharCode((c&15)<<12|(c2&63)<<6|c3&63);i+=3}}return string};var obj={encode:function(input){input=utf8_encode(input);if(typeof window.btoa==="function"){try{return btoa(input)}catch(e){}}var chr1,chr2,chr3,enc1,enc2,enc3,enc4,i=0,output="",len=input.length;while(i>2;enc2=(chr1&3)<<4|chr2>>4;enc3=(chr2&15)<<2|chr3>>6;enc4=chr3&63;if(isNaN(chr2))enc3=enc4=64;else if(isNaN(chr3))enc4=64;output=output+keyStr.charAt(enc1)+keyStr.charAt(enc2)+keyStr.charAt(enc3)+keyStr.charAt(enc4)}return output},decode:function(input){if(typeof window.atob==="function"){try{return utf8_decode(atob(input))}catch(e){}}var chr1,chr2,chr3,enc1,enc2,enc3,enc4,len,i=0,output="";input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");len=input.length;while(i>4;chr2=(enc2&15)<<4|enc3>>2;chr3=(enc3&3)<<6|enc4;output=output+String.fromCharCode(chr1);if(enc3!=64)output=output+String.fromCharCode(chr2);if(enc4!=64)output=output+String.fromCharCode(chr3)}return utf8_decode(output)}};return obj}();