From 1c6789e1fe5f75169db68e4fdc6c314f15042463 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Tue, 5 Jul 2016 23:55:34 +0300 Subject: [PATCH] Update 2016-07-05T20:55:31.720Z --- js/app.js | 27 ++++++++++++++------------- js/background.js | 2 +- js/lib/bin_utils.js | 2 +- js/lib/crypto_worker.js | 2 +- js/locales/de-de.json | 2 ++ js/locales/es-es.json | 4 +++- js/locales/it-it.json | 2 ++ js/locales/nl-nl.json | 2 ++ js/locales/pt-br.json | 2 ++ js/locales/ru-ru.json | 2 ++ manifest.json | 2 +- manifest.webapp | 2 +- service_worker.js | 2 +- webogram.appcache | 4 ++-- 14 files changed, 35 insertions(+), 22 deletions(-) diff --git a/js/app.js b/js/app.js index de79d6a7..a837ea7e 100644 --- a/js/app.js +++ b/js/app.js @@ -2,7 +2,7 @@ function BigInteger(e,t,n){null!=e&&("number"==typeof e?this.fromNumber(e,t,n):n return!1}function cancelEvent(e){return e=e||window.event,e&&(e=e.originalEvent||e,e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault(),e.returnValue=!1,e.cancelBubble=!0),!1}function hasOnlick(e){if(e.onclick||e.getAttribute("ng-click"))return!0;var t=$._data(e,"events");return!(!t||!t.click&&!t.mousedown)}function getScrollWidth(){var e=$("
").css({position:"absolute",width:100,height:100,overflow:"scroll",top:-9999}).appendTo($(document.body)),t=e[0].offsetWidth-e[0].clientWidth;return e.remove(),t}function onCtrlEnter(e,t){$(e).on("keydown",function(e){if(13==e.keyCode&&(e.ctrlKey||e.metaKey))return t(),cancelEvent(e)})}function setFieldSelection(e,t,n){e=$(e)[0];try{if(e.focus(),void 0!==t&&t!==!1||(t=e.value.length),void 0!==n&&n!==!1||(n=t),e.createTextRange){var a=e.createTextRange();a.collapse(!0),a.moveEnd("character",n),a.moveStart("character",t),a.select()}else e.setSelectionRange&&e.setSelectionRange(t,n)}catch(i){}}function getFieldSelection(e){if(e.selectionStart)return e.selectionStart;if(!document.selection)return 0;var t="",n=document.selection.createRange(),a=n.text,i=n.duplicate(),o=0;try{i.moveToElementText(e)}catch(s){return 0}return n.text=a+t,o=i.text.indexOf(t),n.moveStart("character",-1),n.text="",o}function getRichValue(e){if(!e)return"";var t=[],n=[];getRichElementValue(e,t,n),n.length&&t.push(n.join(""));var a=t.join("\n");return a=a.replace(/\u00A0/g," ")}function getRichValueWithCaret(e){if(!e)return[];var t,n,a=[],i=[],o=!!window.getSelection&&window.getSelection();if(o&&o.rangeCount){var s=o.getRangeAt(0);s.startContainer&&s.startContainer==s.endContainer&&s.startOffset==s.endOffset&&(t=s.startContainer,n=s.startOffset)}getRichElementValue(e,a,i,t,n),i.length&&a.push(i.join(""));var r=a.join("\n"),l=r.indexOf("");return l!=-1&&(r=r.substr(0,l)+r.substr(l+1)),r=r.replace(/\u00A0/g," "),[r,l]}function getRichElementValue(e,t,n,a,i){if(3!=e.nodeType){if(1==e.nodeType){var o,s=a===e,r="DIV"==e.tagName||"P"==e.tagName;r&&n.length||"BR"==e.tagName?(t.push(n.join("")),n.splice(0,n.length)):"IMG"==e.tagName&&e.alt&&n.push(e.alt),s&&!i&&n.push("");for(var o=e.firstChild;o;)getRichElementValue(o,t,n,a,i),o=o.nextSibling;s&&i&&n.push(""),r&&n.length&&(t.push(n.join("")),n.splice(0,n.length))}}else if(a===e){var l=e.nodeValue;n.push(l.substr(0,i)+""+l.substr(i))}else n.push(e.nodeValue)}function setRichFocus(e,t,n){if(e.focus(),!t||t.parentNode!=e||t.nextSibling||n||(e.removeChild(t),t=null),window.getSelection&&document.createRange){var a=document.createRange();t?a.selectNode(t):a.selectNodeContents(e),n||a.collapse(!1);var i=window.getSelection();i.removeAllRanges(),i.addRange(a)}else if(void 0!==document.body.createTextRange){var o=document.body.createTextRange();o.moveToElementText(t||e),n||o.collapse(!1),o.select()}}function getSelectedText(){var e=(window.getSelection&&window.getSelection()||document.getSelection&&document.getSelection()||document.selection&&document.selection.createRange().text||"").toString().replace(/^\s+|\s+$/g,"");return e}function scrollToNode(e,t,n){var a=t.offsetTop-15,i=t.offsetHeight+30,o=e.scrollTop,s=e.clientHeight;o>a?(e.scrollTop=a,$(n).nanoScroller({flash:!0})):o/g,">")}function calcImageInBox(e,t,n,a,i){var o=n,s=a;return e/t>n/a?s=parseInt(t*n/e):(o=parseInt(e*a/t),o>n&&(s=parseInt(s*n/o),o=n)),i&&o>=e&&s>=t&&(o=e,s=t),{w:o,h:s}}function versionCompare(e,t){"string"!=typeof e&&(e=""),"string"!=typeof t&&(t=""),e=e.replace(/^\s+|\s+$/g,"").split("."),t=t.replace(/^\s+|\s+$/g,"").split(".");var n,a=Math.max(e.length,t.length);for(n=0;nt[n]?1:-1;return 0}function bigint(e){return new BigInteger(e.toString(16),16)}function bigStringInt(e){return new BigInteger(e,10)}function dHexDump(e){for(var t=[],n=0;n>>t&24),2!==t&&a-o!==1||(n+=String.fromCharCode(uint6ToBase64(i>>>18&63),uint6ToBase64(i>>>12&63),uint6ToBase64(i>>>6&63),uint6ToBase64(63&i)),i=0);return n.replace(/A(?=A$|$)/g,"=")}function uint6ToBase64(e){return e<26?e+65:e<52?e+71:e<62?e-4:62===e?43:63===e?47:65}function base64ToBlob(e,t){for(var n=1024,a=atob(e),i=a.length,o=Math.ceil(i/n),s=new Array(o),r=0;r>>2]|=e[t]<<24-t%4*8;return new CryptoJS.lib.WordArray.init(a,n)}function bytesFromWords(e){for(var t=e.words,n=e.sigBytes,a=[],i=0;i>>2]>>>24-i%4*8&255);return a}function bytesFromBigInt(e,t){var n=e.toByteArray();if(t&&n.lengtht);)n=n.slice(1);return n}function bytesFromLeemonBigInt(e,t){var n=bigInt2str(e,16);return bytesFromHex(n)}function bytesToArrayBuffer(e){return new Uint8Array(e).buffer}function convertToArrayBuffer(e){return e instanceof ArrayBuffer?e:void 0!==e.buffer&&e.buffer.byteLength==e.length*e.BYTES_PER_ELEMENT?e.buffer:bytesToArrayBuffer(e)}function convertToUint8Array(e){return void 0!==e.buffer?e:new Uint8Array(e)}function convertToByteArray(e){if(Array.isArray(e))return e;e=convertToUint8Array(e);for(var t=[],n=0,a=e.length;n2147483647&&(e-=4294967296),e}function sha1HashSync(e){this.rushaInstance=this.rushaInstance||new Rusha(1048576);var t=rushaInstance.rawDigest(e).buffer;return t}function sha1BytesSync(e){return bytesFromArrayBuffer(sha1HashSync(e))}function sha256HashSync(e){var t=CryptoJS.SHA256(bytesToWords(e)),n=bytesFromWords(t);return n}function rsaEncrypt(e,t){t=addPadding(t,255);var n=new BigInteger(e.modulus,16),a=new BigInteger(e.exponent,16),i=new BigInteger(t),o=i.modPowInt(a,n),s=bytesFromBigInt(o,256);return s}function addPadding(e,t,n){t=t||16;var a=e.byteLength||e.length,i=t-a%t;if(i>0&&i0&&(u=u.subtract(e))),c=c.add(c),c.compareTo(e)>0&&(c=c.subtract(e)),d=d.shiftRight(1);o=u.clone();var p=o.compareTo(s)<0?s.subtract(o):o.subtract(s);if(t=p.gcd(e),!t.equals(BigInteger.ONE))break;0==(l&l-1)&&(s=o.clone())}if(t.compareTo(BigInteger.ONE)>0)break}var m,g,h=e.divide(t);return t.compareTo(h)>0?(m=h,g=t):(m=t,g=h),[bytesFromBigInt(m),bytesFromBigInt(g),n]}function gcdLong(e,t){for(;e.notEquals(goog.math.Long.ZERO)&&t.notEquals(goog.math.Long.ZERO);){for(;t.and(goog.math.Long.ONE).equals(goog.math.Long.ZERO);)t=t.shiftRight(1);for(;e.and(goog.math.Long.ONE).equals(goog.math.Long.ZERO);)e=e.shiftRight(1);e.compare(t)>0?e=e.subtract(t):t=t.subtract(e)}return t.equals(goog.math.Long.ZERO)?e:t}function pqPrimeLong(e){for(var t,n=0,a=0;a<3;a++){for(var i=goog.math.Long.fromInt((15&nextRandomInt(128))+17),o=goog.math.Long.fromInt(nextRandomInt(1e9)+1),s=o,r=1<0&&(u=u.subtract(e))),c=c.add(c),c.compare(e)>0&&(c=c.subtract(e)),d=d.shiftRight(1);o=u;var p=o.compare(s)<0?s.subtract(o):o.subtract(s);if(t=gcdLong(p,e),t.notEquals(goog.math.Long.ONE))break;0==(l&l-1)&&(s=o)}if(t.compare(goog.math.Long.ONE)>0)break}var m,g,h=e.div(t);return t.compare(h)>0?(m=h,g=t):(m=t,g=h),[bytesFromHex(m.toString(16)),bytesFromHex(g.toString(16)),n]}function pqPrimeLeemon(e){var t,n,a,i,o,s,r,l=64,c=Math.ceil(l/bpe)+1,d=0,u=new Array(c),p=new Array(c),m=new Array(c),o=new Array(c),g=new Array(c),h=new Array(c),f=new Array(c);for(t=0;t<3;t++){for(n=(15&nextRandomInt(128))+17,copyInt_(h,nextRandomInt(1e9)+1),copy_(f,h),i=1<
').appendTo(document.body);var a=$("
").appendTo(this.autoCompleteWrapEl);t.dropdownDirective(a,function(e,t){n.autoCompleteEl=t,n.autoCompleteScope=e,n.setUpAutoComplete()}),this.isActive=!1,this.onTyping=t.onTyping,this.onMessageSubmit=t.onMessageSubmit,this.getSendOnEnter=t.getSendOnEnter,this.onFilePaste=t.onFilePaste,this.onCommandSend=t.onCommandSend,this.onInlineResultSend=t.onInlineResultSend,this.mentions=t.mentions,this.commands=t.commands}function Scroller(e,t){t=t||{};t.classPrefix||"scroller";this.content=$(e),this.useNano=void 0!==t.nano?t.nano:!Config.Mobile,this.maxHeight=t.maxHeight,this.minHeight=t.minHeight,this.useNano?this.setUpNano():this.setUpNative(),this.updateHeight()}!function(e){"use strict";e.console=e.console||{};for(var t,n,a=e.console,i={},o=function(){},s="memory".split(","),r="assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(",");t=s.pop();)a[t]||(a[t]=i);for(;n=r.pop();)a[n]||(a[n]=o)}("undefined"==typeof window?this:window),Array.prototype.indexOf||(Array.prototype.indexOf=function(e,t){var n;if(null==this)throw new TypeError('"this" is null or not defined');var a=Object(this),i=a.length>>>0;if(0===i)return-1;var o=+t||0;if(Math.abs(o)===1/0&&(o=0),o>=i)return-1;for(n=Math.max(o>=0?o:i-Math.abs(o),0);n1)throw Error("Second argument not supported");if("object"!=typeof t)throw TypeError("Argument must be an object");e.prototype=t;var n={};return e.prototype=null,n}}()),Function.prototype.bind||(Function.prototype.bind=function(e){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var t=Array.prototype.slice.call(arguments,1),n=this,a=function(){},i=function(){return n.apply(this instanceof a&&e?this:e,t.concat(Array.prototype.slice.call(arguments)))};return a.prototype=this.prototype,i.prototype=new a,i}),function(e){function t(t){a.push(t),e.postMessage(i,"*")}function n(t){if(t.source==e&&t.data==i&&(t.stopPropagation(),a.length>0)){var n=a.shift();n()}}var a=[],i="zero-timeout-message";e.addEventListener("message",n,!0);var o=e.setTimeout;e.setTimeout=function(e,n){return!n||n<=5?t(e):o(e,n)},e.setZeroTimeout=t}(this),!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(e){var t=e.length,n=ie.type(e);return"function"!==n&&!ie.isWindow(e)&&(!(1!==e.nodeType||!t)||("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e))}function a(e,t,n){if(ie.isFunction(t))return ie.grep(e,function(e,a){return!!t.call(e,a,e)!==n});if(t.nodeType)return ie.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(pe.test(t))return ie.filter(t,e,n);t=ie.filter(t,e)}return ie.grep(e,function(e){return ie.inArray(e,t)>=0!==n})}function i(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function o(e){var t=be[e]={};return ie.each(e.match(ye)||[],function(e,n){t[n]=!0}),t}function s(){ge.addEventListener?(ge.removeEventListener("DOMContentLoaded",r,!1),e.removeEventListener("load",r,!1)):(ge.detachEvent("onreadystatechange",r),e.detachEvent("onload",r))}function r(){(ge.addEventListener||"load"===event.type||"complete"===ge.readyState)&&(s(),ie.ready())}function l(e,t,n){if(void 0===n&&1===e.nodeType){var a="data-"+t.replace(Se,"-$1").toLowerCase();if(n=e.getAttribute(a),"string"==typeof n){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:Ce.test(n)?ie.parseJSON(n):n)}catch(i){}ie.data(e,t,n)}else n=void 0}return n}function c(e){var t;for(t in e)if(("data"!==t||!ie.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function d(e,t,n,a){if(ie.acceptData(e)){var i,o,s=ie.expando,r=e.nodeType,l=r?ie.cache:e,c=r?e[s]:e[s]&&s;if(c&&l[c]&&(a||l[c].data)||void 0!==n||"string"!=typeof t)return c||(c=r?e[s]=K.pop()||ie.guid++:s),l[c]||(l[c]=r?{}:{toJSON:ie.noop}),("object"==typeof t||"function"==typeof t)&&(a?l[c]=ie.extend(l[c],t):l[c].data=ie.extend(l[c].data,t)),o=l[c],a||(o.data||(o.data={}),o=o.data),void 0!==n&&(o[ie.camelCase(t)]=n),"string"==typeof t?(i=o[t],null==i&&(i=o[ie.camelCase(t)])):i=o,i}}function u(e,t,n){if(ie.acceptData(e)){var a,i,o=e.nodeType,s=o?ie.cache:e,r=o?e[ie.expando]:ie.expando;if(s[r]){if(t&&(a=n?s[r]:s[r].data)){ie.isArray(t)?t=t.concat(ie.map(t,ie.camelCase)):t in a?t=[t]:(t=ie.camelCase(t),t=t in a?[t]:t.split(" ")),i=t.length;for(;i--;)delete a[t[i]];if(n?!c(a):!ie.isEmptyObject(a))return}(n||(delete s[r].data,c(s[r])))&&(o?ie.cleanData([e],!0):ne.deleteExpando||s!=s.window?delete s[r]:s[r]=null)}}}function p(){return!0}function m(){return!1}function g(){try{return ge.activeElement}catch(e){}}function h(e){var t=Re.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function f(e,t){var n,a,i=0,o=typeof e.getElementsByTagName!==$e?e.getElementsByTagName(t||"*"):typeof e.querySelectorAll!==$e?e.querySelectorAll(t||"*"):void 0;if(!o)for(o=[],n=e.childNodes||e;null!=(a=n[i]);i++)!t||ie.nodeName(a,t)?o.push(a):ie.merge(o,f(a,t));return void 0===t||t&&ie.nodeName(e,t)?ie.merge([e],o):o}function _(e){Ee.test(e.type)&&(e.defaultChecked=e.checked)}function v(e,t){return ie.nodeName(e,"table")&&ie.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function y(e){return e.type=(null!==ie.find.attr(e,"type"))+"/"+e.type,e}function b(e){var t=Ge.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function w(e,t){for(var n,a=0;null!=(n=e[a]);a++)ie._data(n,"globalEval",!t||ie._data(t[a],"globalEval"))}function k(e,t){if(1===t.nodeType&&ie.hasData(e)){var n,a,i,o=ie._data(e),s=ie._data(t,o),r=o.events;if(r){delete s.handle,s.events={};for(n in r)for(a=0,i=r[n].length;i>a;a++)ie.event.add(t,n,r[n][a])}s.data&&(s.data=ie.extend({},s.data))}}function $(e,t){var n,a,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!ne.noCloneEvent&&t[ie.expando]){i=ie._data(t);for(a in i.events)ie.removeEvent(t,a,i.handle);t.removeAttribute(ie.expando)}"script"===n&&t.text!==e.text?(y(t).text=e.text,b(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),ne.html5Clone&&e.innerHTML&&!ie.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Ee.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}function C(t,n){var a,i=ie(n.createElement(t)).appendTo(n.body),o=e.getDefaultComputedStyle&&(a=e.getDefaultComputedStyle(i[0]))?a.display:ie.css(i[0],"display");return i.detach(),o}function S(e){var t=ge,n=Qe[e];return n||(n=C(e,t),"none"!==n&&n||(Je=(Je||ie("