From 8c980df660648f2c96008eb5809e1662a75c4afd Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 21 Oct 2020 13:11:29 +0530 Subject: [PATCH 01/14] tell clients not to cache their outer html --- docs/example.nginx.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/example.nginx.conf b/docs/example.nginx.conf index 0c514e1ef..117eb2cc4 100644 --- a/docs/example.nginx.conf +++ b/docs/example.nginx.conf @@ -71,6 +71,9 @@ server { if ($args ~ ver=) { set $cacheControl max-age=31536000; } + if ($uri ~ ^/.*(\/|\.html)$) { + set $cacheControl no-cache; + } # Will not set any header if it is emptystring add_header Cache-Control $cacheControl; From 06e9c818790f3a676f7606de95f0645ded3bc305 Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 21 Oct 2020 14:48:47 +0530 Subject: [PATCH 02/14] correct a typo --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 746ad365e..30661d523 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,7 +23,7 @@ To update from 3.23.0 to 3.23.1: 0. Read the 3.23.0 release notes carefully and apply all configuration changes if you haven't already done so. 1. Stop your server -2. Get the latest code with `git checkout 3.20.1` +2. Get the latest code with `git checkout 3.23.1` 3. Install the latest dependencies with `bower update` and `npm i` 4. Restart your server From b74c312f3c53fb0543fbc069defaea12916fa057 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 21 Oct 2020 12:24:59 +0200 Subject: [PATCH 03/14] Use the new public key format in config.example.js #626 --- config/config.example.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/config.example.js b/config/config.example.js index f9702b6d0..32bcb20cf 100644 --- a/config/config.example.js +++ b/config/config.example.js @@ -104,13 +104,13 @@ module.exports = { /* * CryptPad contains an administration panel. Its access is restricted to specific * users using the following list. - * To give access to the admin panel to a user account, just add their user id, - * which can be found on the settings page for registered users. + * To give access to the admin panel to a user account, just add their public signing + * key, which can be found on the settings page for registered users. * Entries should be strings separated by a comma. */ /* adminKeys: [ - //"https://my.awesome.website/user/#/1/cryptpad-user1/YZgXQxKR0Rcb6r6CmxHPdAGLVludrAF2lEnkbx1vVOo=", + //"[cryptpad-user1@my.awesome.website/YZgXQxKR0Rcb6r6CmxHPdAGLVludrAF2lEnkbx1vVOo=]", ], */ From d7d25c0a71a62144c443a0f65b02ba1e1ec970da Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 21 Oct 2020 13:41:36 +0200 Subject: [PATCH 04/14] Use correct version string for ckeditor icons --- www/pad/csp.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/www/pad/csp.js b/www/pad/csp.js index 3f401eb8f..02f21f883 100644 --- a/www/pad/csp.js +++ b/www/pad/csp.js @@ -19,6 +19,16 @@ define(['jquery'], function ($) { var $a = $('.cke_toolbox_main').find('.cke_button, .cke_combo_button'); $a.each(function (i, el) { var $el = $(el); + var $icon = $el.find('span.cke_button_icon'); + if ($icon.length) { + try { + var url = $icon[0].style['background-image']; + var bgImg = url.replace(/ !important$/, ''); + if (bgImg) { + $icon[0].style.setProperty('background-image', bgImg, 'important'); + } + catch (e) { console.error(e); } + } $el.on('keydown blur focus click dragstart', function (e) { e.preventDefault(); var attr = $(el).attr('oon'+e.type); From e8428a2a732fe9754acd8f23653c7f1971d8ab83 Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 21 Oct 2020 18:13:10 +0530 Subject: [PATCH 05/14] prevent a case of multiple callbacks --- lib/storage/blob.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/storage/blob.js b/lib/storage/blob.js index 21f38a73a..dfbc802b4 100644 --- a/lib/storage/blob.js +++ b/lib/storage/blob.js @@ -378,7 +378,10 @@ var makeWalker = function (n, handleChild, done) { nThen(function (w) { // check if the path is a directory... Fs.stat(path, w(function (err, stats) { - if (err) { return next(); } + if (err) { + w.abort(); + return next(); + } if (!stats.isDirectory()) { w.abort(); return void handleChild(void 0, path, next); From 100b4176462fe93db8daf109b88fe8195c45bac2 Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 21 Oct 2020 18:23:59 +0530 Subject: [PATCH 06/14] guard against several serverside typeErrors and warn in cases where they would have occurred --- lib/workers/index.js | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/lib/workers/index.js b/lib/workers/index.js index d0a9a66f5..4ca1996d0 100644 --- a/lib/workers/index.js +++ b/lib/workers/index.js @@ -82,6 +82,13 @@ Workers.initialize = function (Env, config, _cb) { var drained = true; var sendCommand = function (msg, _cb, opt) { + if (!_cb) { + return void Log.error('WORKER_COMMAND_MISSING_CB', { + msg: msg, + opt: opt, + }); + } + opt = opt || {}; var index = getAvailableWorkerIndex(); @@ -95,7 +102,7 @@ Workers.initialize = function (Env, config, _cb) { }); if (drained) { drained = false; - Log.debug('WORKER_QUEUE_BACKLOG', { + Log.error('WORKER_QUEUE_BACKLOG', { workers: workers.length, }); } @@ -103,13 +110,6 @@ Workers.initialize = function (Env, config, _cb) { return; } - const txid = guid(); - msg.txid = txid; - msg.pid = PID; - - // track which worker is doing which jobs - state.tasks[txid] = msg; - var cb = Util.once(Util.mkAsync(Util.both(_cb, function (err /*, value */) { if (err !== 'TIMEOUT') { return; } // in the event of a timeout the user will receive an error @@ -120,6 +120,17 @@ Workers.initialize = function (Env, config, _cb) { delete state.tasks[txid]; }))); + if (!msg) { + return void cb('ESERVERERR'); + } + + const txid = guid(); + msg.txid = txid; + msg.pid = PID; + + // track which worker is doing which jobs + state.tasks[txid] = msg; + // default to timing out affter 180s if no explicit timeout is passed var timeout = typeof(opt.timeout) !== 'undefined'? opt.timeout: 180000; response.expect(txid, cb, timeout); @@ -153,6 +164,13 @@ Workers.initialize = function (Env, config, _cb) { } var nextMsg = queue.shift(); + + if (!nextMsg || !nextMsg.msg) { + return void Log.error('WORKER_QUEUE_EMPTY_MESSAGE', { + item: nextMsg, + }); + } + /* `nextMsg` was at the top of the queue. We know that a job just finished and all of this code is synchronous, so calling `sendCommand` should take the worker @@ -200,7 +218,7 @@ Workers.initialize = function (Env, config, _cb) { const cb = response.expectation(txid); if (typeof(cb) !== 'function') { return; } const task = state.tasks[txid]; - if (!task && task.msg) { return; } + if (!(task && task.msg)) { return; } response.clear(txid); Log.info('DB_WORKER_RESEND', task.msg); sendCommand(task.msg, cb); From 070696c7e35afca7d8cd3eab997e604d22560f80 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 21 Oct 2020 15:29:13 +0200 Subject: [PATCH 07/14] New OO build --- www/common/onlyoffice/inner.js | 3 +- .../onlyoffice/v2b/sdkjs/cell/sdk-all-min.js | 110 +++++++++--------- .../onlyoffice/v2b/sdkjs/cell/sdk-all.js | 4 +- .../onlyoffice/v2b/sdkjs/slide/sdk-all-min.js | 110 +++++++++--------- .../onlyoffice/v2b/sdkjs/slide/sdk-all.js | 4 +- .../onlyoffice/v2b/sdkjs/word/sdk-all-min.js | 110 +++++++++--------- .../onlyoffice/v2b/sdkjs/word/sdk-all.js | 4 +- .../v2b/web-apps/apps/api/documents/api.js | 4 + .../web-apps/apps/documenteditor/main/app.js | 10 +- .../apps/documenteditor/main/index.html | 8 +- .../apps/presentationeditor/main/app.js | 8 +- .../apps/presentationeditor/main/index.html | 8 +- .../apps/spreadsheeteditor/main/app.js | 24 ++-- .../apps/spreadsheeteditor/main/index.html | 9 +- 14 files changed, 220 insertions(+), 196 deletions(-) diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index d3d2461a1..103381f62 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -53,7 +53,8 @@ define([ var Nacl = window.nacl; var APP = window.APP = { - $: $ + $: $, + urlArgs: Util.find(ApiConfig, ['requireConf', 'urlArgs']) }; var CHECKPOINT_INTERVAL = 100; diff --git a/www/common/onlyoffice/v2b/sdkjs/cell/sdk-all-min.js b/www/common/onlyoffice/v2b/sdkjs/cell/sdk-all-min.js index 32aeb5823..d4efcfc07 100644 --- a/www/common/onlyoffice/v2b/sdkjs/cell/sdk-all-min.js +++ b/www/common/onlyoffice/v2b/sdkjs/cell/sdk-all-min.js @@ -700,58 +700,58 @@ isDark?res.Dark:res.Light;return true===isNumericValue?oColor.r<<16&16711680|oCo getNumFromXml(vals["tint"]));else if(null!=vals["rgb"])return new AscCommonExcel.RgbColor(16777215&getNumFromXml(vals["rgb"]))}return null}function getBoolFromXml(val){return"0"!==val&&"false"!==val&&"off"!==val}function CUserCacheColor(nColor){this.Light=null;this.Dark=null;this.init(nColor)}CUserCacheColor.prototype.init=function(nColor){var r=nColor>>16&255;var g=nColor>>8&255;var b=nColor&255;var Y=Math.max(0,Math.min(255,.299*r+.587*g+.114*b));var Cb=Math.max(0,Math.min(255,128-.168736*r-.331264* g+.5*b));var Cr=Math.max(0,Math.min(255,128+.5*r-.418688*g-.081312*b));if(Y>63)Y=63;var R=Math.max(0,Math.min(255,Y+1.402*(Cr-128)))|0;var G=Math.max(0,Math.min(255,Y-.34414*(Cb-128)-.71414*(Cr-128)))|0;var B=Math.max(0,Math.min(255,Y+1.772*(Cb-128)))|0;this.Light=new CColor(r,g,b,255);this.Dark=new CColor(R,G,B,255)};function loadScript(url,onSuccess,onError){if(window["NATIVE_EDITOR_ENJINE"]===true||window["Native"]!==undefined){onSuccess();return}if(window["AscDesktopEditor"]&&window["local_load_add"]){var _context= {"completeLoad":function(){return onSuccess()}};window["local_load_add"](_context,"sdk-all-from-min",url);var _ret_param=window["AscDesktopEditor"]["LoadJS"](url);if(2!=_ret_param)window["local_load_remove"](url);if(_ret_param==1){setTimeout(onSuccess,1);return}else if(_ret_param==2)return}var script=document.createElement("script");script.type="text/javascript";script.src=url;script.onload=onSuccess;script.onerror=onError;document.head.appendChild(script)}function loadSdk(sdkName,onSuccess,onError){if(window["AscNotLoadAllScript"])onSuccess(); -else loadScript("./../../../../sdkjs/"+sdkName+"/sdk-all.js",onSuccess,onError)}function getAltGr(e){var ctrlKey=e.metaKey||e.ctrlKey;var altKey=e.altKey;return altKey&&(AscBrowser.isMacOs?!ctrlKey:ctrlKey)}function getColorSchemeByName(sName){for(var i=0;ikoef2){_h=h;_w=koef2*_h>>0;_y=0;_x=w-_w>>1}else{_w=w;_h=_w/koef2>>0;_x=0;_y=h-_h>>1}_ctx.drawImage(this.ImageHtml,_x,_y,_w,_h)};CSignatureDrawer.prototype.selectImage=CSignatureDrawer.prototype["selectImage"]=function(){this.Text="";window["AscDesktopEditor"]["OpenFilenameDialog"]("images",false,function(_file){var file=_file;if(Array.isArray(file))file=file[0];if(file=="")return;var _drawer= -window.Asc.g_signature_drawer;_drawer.Image=window["AscDesktopEditor"]["GetImageBase64"](file);_drawer.ImageHtml=new Image;_drawer.ImageHtml.onload=function(){window.Asc.g_signature_drawer.drawImage()};_drawer.ImageHtml.src=_drawer.Image;_drawer=null})};CSignatureDrawer.prototype.isValid=function(){return this.Image!=""||this.Text!=""};CSignatureDrawer.prototype.destroy=function(){window.Asc.g_signature_drawer.CanvasParent.removeChild(this.Canvas);delete window.Asc.g_signature_drawer};function CSignatureImage(){this.ImageValidBase64= -"";this.ImageInvalidBase64="";this.ImageValid=null;this.ImageInvalid=null;this.Valid=false;this.Loading=0;this.Remove=function(){this.ImageValidBase64="";this.ImageInvalidBase64="";this.ImageValid=null;this.ImageInvalid=null;this.Valid=false;this.Loading=0};this.Register=function(_api,_guid){if(_api.ImageLoader.map_image_index[_guid])return;var _obj={Image:this.Valid?this.ImageValid:this.ImageInvalid,Status:AscFonts.ImageLoadStatus.Complete,src:_guid};_api.ImageLoader.map_image_index[_guid]=_obj}; -this.Unregister=function(_api,_guid){if(_api.ImageLoader.map_image_index[_guid])delete _api.ImageLoader.map_image_index[_guid]}}AscCommon.EncryptionMessageType={Encrypt:0,Decrypt:1};function CEncryptionData(){this._init=false;this.arrData=[];this.arrImages=[];this.handleChangesCallback=null;this.isChangesHandled=false;this.cryptoMode=0;this.isChartEditor=false;this.isExistDecryptedChanges=false;this.cryptoPrefix=window["AscDesktopEditor"]&&window["AscDesktopEditor"]["GetEncryptedHeader"]?window["AscDesktopEditor"]["GetEncryptedHeader"](): -"ENCRYPTED;";this.cryptoPrefixLen=this.cryptoPrefix.length;this.editorId=null;this.nextChangesTimeoutId=-1;this.isPasswordCryptoPresent=false;this.init=function(){this._init=true};this.isInit=function(){return this._init};this.isNeedCrypt=function(){if(window.g_asc_plugins)if(!window.g_asc_plugins.isRunnedEncryption())return false;if(!window["AscDesktopEditor"])return false;if(this.isChartEditor)return false;if(2==this.cryptoMode)return true;if(0===window["AscDesktopEditor"]["CryptoMode"])return false; -return true};this.isCryptoImages=function(){return this.isNeedCrypt()&&this.isPasswordCryptoPresent};this.addCryproImagesFromDialog=function(callback){var _this=this;window["AscDesktopEditor"]["OpenFilenameDialog"]("images",true,function(files){if(!Array.isArray(files))files=[files];if(0==files.length)return;var _files=[];var _options={isImageCrypt:true,callback:callback,ext:[]};for(var i=0;i=0;i--)this.handleChangesCallback.changesBase[i]=data[i];else for(var i=data.length-1;i>=0;i--)this.handleChangesCallback.changesBase[i].m_pData=data[i];this.isChangesHandled=true;this.handleChangesCallback.callback.call(this.handleChangesCallback.sender);this.handleChangesCallback=null;this.nextChanges();return}var obj=this.arrData[0];this.arrData.splice(0,1);if(AscCommon.EncryptionMessageType.Encrypt== -obj.type)if(obj.options&&obj.options.isImageCrypt){for(var i=0;i=0;i--)if(_array[i]["change"].length>_checkPrefixLen){_prefix=_array[i]["change"].substr(0,_checkPrefixLen);if(-1!=_prefix.indexOf(this.cryptoPrefix)){isCrypted=true;break}}return isCrypted}var isCrypted=false;if(this.editorId==AscCommon.c_oEditorId.Spreadsheet)for(var i=_array.length- -1;i>=0;i--){if(_array[i].length>_checkPrefixLen){_prefix=_array[i].substr(0,_checkPrefixLen);if(-1!=_prefix.indexOf(this.cryptoPrefix)){isCrypted=true;break}}}else for(var i=_array.length-1;i>=0;i--)if(_array[i].m_pData.length>_checkPrefixLen){_prefix=_array[i].m_pData.substr(0,_checkPrefixLen);if(-1!=_prefix.indexOf(this.cryptoPrefix)){isCrypted=true;break}}return isCrypted};this.handleChanges=function(_array,_sender,_callback){if(0==_array.length||!this.isNeedCrypt()){if(this.isExistEncryptedChanges(_array)){this.onDecodeError(); -return}this.isChangesHandled=true;_callback.call(_sender);return}this.handleChangesCallback={changesBase:_array,changes:[],sender:_sender,callback:_callback};this.checkEditorId();if(this.editorId==AscCommon.c_oEditorId.Spreadsheet)for(var i=_array.length-1;i>=0;i--)this.handleChangesCallback.changes[i]=_array[i];else for(var i=_array.length-1;i>=0;i--)this.handleChangesCallback.changes[i]=_array[i].m_pData;window.g_asc_plugins.sendToEncryption({"type":"decryptData","data":this.handleChangesCallback.changes})}; -this.asc_setAdvancedOptions=function(api,idOption,option){if(window.isNativeOpenPassword){window["AscDesktopEditor"]["NativeViewerOpen"](option.asc_getPassword());return}if(window.isCloudCryptoDownloadAs)return false;if(!this.isNeedCrypt())return false;window.checkPasswordFromPlugin=true;if(window["Asc"].c_oAscAdvancedOptionsID.TXT===idOption){var _param=""+option.asc_getCodePage()+"";window["AscDesktopEditor"]["SetAdvancedOptions"](_param)}else if(window["Asc"].c_oAscAdvancedOptionsID.CSV=== -idOption){var delimiter=option.asc_getDelimiter();var delimiterChar=option.asc_getDelimiterChar();var _param="";_param+=""+option.asc_getCodePage()+"";if(null!=delimiter)_param+=""+delimiter+"";if(null!=delimiterChar)_param+=""+delimiterChar+"";window["AscDesktopEditor"]["SetAdvancedOptions"](_param)}else if(window["Asc"].c_oAscAdvancedOptionsID.DRM===idOption){var _param=""+ -AscCommon.CopyPasteCorrectString(option.asc_getPassword())+"";api.currentPassword=option.asc_getPassword();window["AscDesktopEditor"]["SetAdvancedOptions"](_param)}return true}}AscCommon.EncryptionWorker=new CEncryptionData;function CMouseSmoothWheelCorrector(t,scrollFunction){this._deltaX=0;this._deltaY=0;this._isBreakX=false;this._isBreakY=false;this._timeoutCorrector=-1;this._api=t;this._scrollFunction=scrollFunction;this._normalDelta=120;this._isNormalDeltaActive=false;this.setNormalDeltaActive= -function(value){this._isNormalDeltaActive=true;this._normalDelta=value};this.isBreakX=function(){return this._isBreakX};this.isBreakY=function(){return this._isBreakY};this.get_DeltaX=function(wheelDeltaX){this._isBreakX=false;if(!AscCommon.AscBrowser.isMacOs)return wheelDeltaX;this._deltaX+=wheelDeltaX;if(Math.abs(this._deltaX)>=this._normalDelta)return this._isNormalDeltaActive?this._deltaX>0?this._normalDelta:-this._normalDelta:this._deltaX;this._isBreakX=true;return 0};this.get_DeltaY=function(wheelDeltaY){this._isBreakY= -false;if(!AscCommon.AscBrowser.isMacOs)return wheelDeltaY;this._deltaY+=wheelDeltaY;if(Math.abs(this._deltaY)>=this._normalDelta)return this._isNormalDeltaActive?this._deltaY>0?this._normalDelta:-this._normalDelta:this._deltaY;this._isBreakY=true;return 0};this.checkBreak=function(){if(-1!=this._timeoutCorrector){clearTimeout(this._timeoutCorrector);this._timeoutCorrector=-1}if((this._isBreakX||this._isBreakY)&&this._scrollFunction){var obj={t:this,x:this._isBreakX?this._deltaX:0,y:this._isBreakY? -this._deltaY:0};this._timeoutCorrector=setTimeout(function(){var t=obj.t;t._scrollFunction.call(t._api,obj.x,obj.y);t._timeoutCorrector=-1;t._deltaX=0;t._deltaY=0},100)}if(!this._isBreakX)this._deltaX=0;if(!this._isBreakY)this._deltaY=0;this._isBreakX=false;this._isBreakY=false}}AscCommon.CMouseSmoothWheelCorrector=CMouseSmoothWheelCorrector;function CTranslateManager(){this.mapTranslate={}}CTranslateManager.prototype.init=function(map){this.mapTranslate=map||{}};CTranslateManager.prototype.getValue= -function(key){return this.mapTranslate.hasOwnProperty(key)?this.mapTranslate[key]:key};if(!Array.prototype.fill)Object.defineProperty(Array.prototype,"fill",{value:function(value){if(this==null)throw new TypeError("this is null or not defined");var O=Object(this);var len=O.length>>>0;var start=arguments[1];var relativeStart=start>>0;var k=relativeStart<0?Math.max(len+relativeStart,0):Math.min(relativeStart,len);var end=arguments[2];var relativeEnd=end===undefined?len:end>>0;var final=relativeEnd< -0?Math.max(len+relativeEnd,0):Math.min(relativeEnd,len);while(kkoef2){_h=h;_w=koef2*_h>>0;_y=0;_x=w-_w>>1}else{_w=w;_h=_w/koef2>>0;_x=0;_y=h-_h>>1}_ctx.drawImage(this.ImageHtml,_x,_y,_w,_h)};CSignatureDrawer.prototype.selectImage=CSignatureDrawer.prototype["selectImage"]=function(){this.Text="";window["AscDesktopEditor"]["OpenFilenameDialog"]("images",false,function(_file){var file= +_file;if(Array.isArray(file))file=file[0];if(file=="")return;var _drawer=window.Asc.g_signature_drawer;_drawer.Image=window["AscDesktopEditor"]["GetImageBase64"](file);_drawer.ImageHtml=new Image;_drawer.ImageHtml.onload=function(){window.Asc.g_signature_drawer.drawImage()};_drawer.ImageHtml.src=_drawer.Image;_drawer=null})};CSignatureDrawer.prototype.isValid=function(){return this.Image!=""||this.Text!=""};CSignatureDrawer.prototype.destroy=function(){window.Asc.g_signature_drawer.CanvasParent.removeChild(this.Canvas); +delete window.Asc.g_signature_drawer};function CSignatureImage(){this.ImageValidBase64="";this.ImageInvalidBase64="";this.ImageValid=null;this.ImageInvalid=null;this.Valid=false;this.Loading=0;this.Remove=function(){this.ImageValidBase64="";this.ImageInvalidBase64="";this.ImageValid=null;this.ImageInvalid=null;this.Valid=false;this.Loading=0};this.Register=function(_api,_guid){if(_api.ImageLoader.map_image_index[_guid])return;var _obj={Image:this.Valid?this.ImageValid:this.ImageInvalid,Status:AscFonts.ImageLoadStatus.Complete, +src:_guid};_api.ImageLoader.map_image_index[_guid]=_obj};this.Unregister=function(_api,_guid){if(_api.ImageLoader.map_image_index[_guid])delete _api.ImageLoader.map_image_index[_guid]}}AscCommon.EncryptionMessageType={Encrypt:0,Decrypt:1};function CEncryptionData(){this._init=false;this.arrData=[];this.arrImages=[];this.handleChangesCallback=null;this.isChangesHandled=false;this.cryptoMode=0;this.isChartEditor=false;this.isExistDecryptedChanges=false;this.cryptoPrefix=window["AscDesktopEditor"]&& +window["AscDesktopEditor"]["GetEncryptedHeader"]?window["AscDesktopEditor"]["GetEncryptedHeader"]():"ENCRYPTED;";this.cryptoPrefixLen=this.cryptoPrefix.length;this.editorId=null;this.nextChangesTimeoutId=-1;this.isPasswordCryptoPresent=false;this.init=function(){this._init=true};this.isInit=function(){return this._init};this.isNeedCrypt=function(){if(window.g_asc_plugins)if(!window.g_asc_plugins.isRunnedEncryption())return false;if(!window["AscDesktopEditor"])return false;if(this.isChartEditor)return false; +if(2==this.cryptoMode)return true;if(0===window["AscDesktopEditor"]["CryptoMode"])return false;return true};this.isCryptoImages=function(){return this.isNeedCrypt()&&this.isPasswordCryptoPresent};this.addCryproImagesFromDialog=function(callback){var _this=this;window["AscDesktopEditor"]["OpenFilenameDialog"]("images",true,function(files){if(!Array.isArray(files))files=[files];if(0==files.length)return;var _files=[];var _options={isImageCrypt:true,callback:callback,ext:[]};for(var i=0;i=0;i--)this.handleChangesCallback.changesBase[i]=data[i];else for(var i=data.length-1;i>=0;i--)this.handleChangesCallback.changesBase[i].m_pData=data[i];this.isChangesHandled=true;this.handleChangesCallback.callback.call(this.handleChangesCallback.sender);this.handleChangesCallback= +null;this.nextChanges();return}var obj=this.arrData[0];this.arrData.splice(0,1);if(AscCommon.EncryptionMessageType.Encrypt==obj.type)if(obj.options&&obj.options.isImageCrypt){for(var i=0;i=0;i--)if(_array[i]["change"].length>_checkPrefixLen){_prefix=_array[i]["change"].substr(0,_checkPrefixLen);if(-1!=_prefix.indexOf(this.cryptoPrefix)){isCrypted= +true;break}}return isCrypted}var isCrypted=false;if(this.editorId==AscCommon.c_oEditorId.Spreadsheet)for(var i=_array.length-1;i>=0;i--){if(_array[i].length>_checkPrefixLen){_prefix=_array[i].substr(0,_checkPrefixLen);if(-1!=_prefix.indexOf(this.cryptoPrefix)){isCrypted=true;break}}}else for(var i=_array.length-1;i>=0;i--)if(_array[i].m_pData.length>_checkPrefixLen){_prefix=_array[i].m_pData.substr(0,_checkPrefixLen);if(-1!=_prefix.indexOf(this.cryptoPrefix)){isCrypted=true;break}}return isCrypted}; +this.handleChanges=function(_array,_sender,_callback){if(0==_array.length||!this.isNeedCrypt()){if(this.isExistEncryptedChanges(_array)){this.onDecodeError();return}this.isChangesHandled=true;_callback.call(_sender);return}this.handleChangesCallback={changesBase:_array,changes:[],sender:_sender,callback:_callback};this.checkEditorId();if(this.editorId==AscCommon.c_oEditorId.Spreadsheet)for(var i=_array.length-1;i>=0;i--)this.handleChangesCallback.changes[i]=_array[i];else for(var i=_array.length- +1;i>=0;i--)this.handleChangesCallback.changes[i]=_array[i].m_pData;window.g_asc_plugins.sendToEncryption({"type":"decryptData","data":this.handleChangesCallback.changes})};this.asc_setAdvancedOptions=function(api,idOption,option){if(window.isNativeOpenPassword){window["AscDesktopEditor"]["NativeViewerOpen"](option.asc_getPassword());return}if(window.isCloudCryptoDownloadAs)return false;if(!this.isNeedCrypt())return false;window.checkPasswordFromPlugin=true;if(window["Asc"].c_oAscAdvancedOptionsID.TXT=== +idOption){var _param=""+option.asc_getCodePage()+"";window["AscDesktopEditor"]["SetAdvancedOptions"](_param)}else if(window["Asc"].c_oAscAdvancedOptionsID.CSV===idOption){var delimiter=option.asc_getDelimiter();var delimiterChar=option.asc_getDelimiterChar();var _param="";_param+=""+option.asc_getCodePage()+"";if(null!=delimiter)_param+=""+delimiter+"";if(null!=delimiterChar)_param+=""+ +delimiterChar+"";window["AscDesktopEditor"]["SetAdvancedOptions"](_param)}else if(window["Asc"].c_oAscAdvancedOptionsID.DRM===idOption){var _param=""+AscCommon.CopyPasteCorrectString(option.asc_getPassword())+"";api.currentPassword=option.asc_getPassword();window["AscDesktopEditor"]["SetAdvancedOptions"](_param)}return true}}AscCommon.EncryptionWorker=new CEncryptionData;function CMouseSmoothWheelCorrector(t,scrollFunction){this._deltaX=0;this._deltaY= +0;this._isBreakX=false;this._isBreakY=false;this._timeoutCorrector=-1;this._api=t;this._scrollFunction=scrollFunction;this._normalDelta=120;this._isNormalDeltaActive=false;this.setNormalDeltaActive=function(value){this._isNormalDeltaActive=true;this._normalDelta=value};this.isBreakX=function(){return this._isBreakX};this.isBreakY=function(){return this._isBreakY};this.get_DeltaX=function(wheelDeltaX){this._isBreakX=false;if(!AscCommon.AscBrowser.isMacOs)return wheelDeltaX;this._deltaX+=wheelDeltaX; +if(Math.abs(this._deltaX)>=this._normalDelta)return this._isNormalDeltaActive?this._deltaX>0?this._normalDelta:-this._normalDelta:this._deltaX;this._isBreakX=true;return 0};this.get_DeltaY=function(wheelDeltaY){this._isBreakY=false;if(!AscCommon.AscBrowser.isMacOs)return wheelDeltaY;this._deltaY+=wheelDeltaY;if(Math.abs(this._deltaY)>=this._normalDelta)return this._isNormalDeltaActive?this._deltaY>0?this._normalDelta:-this._normalDelta:this._deltaY;this._isBreakY=true;return 0};this.checkBreak=function(){if(-1!= +this._timeoutCorrector){clearTimeout(this._timeoutCorrector);this._timeoutCorrector=-1}if((this._isBreakX||this._isBreakY)&&this._scrollFunction){var obj={t:this,x:this._isBreakX?this._deltaX:0,y:this._isBreakY?this._deltaY:0};this._timeoutCorrector=setTimeout(function(){var t=obj.t;t._scrollFunction.call(t._api,obj.x,obj.y);t._timeoutCorrector=-1;t._deltaX=0;t._deltaY=0},100)}if(!this._isBreakX)this._deltaX=0;if(!this._isBreakY)this._deltaY=0;this._isBreakX=false;this._isBreakY=false}}AscCommon.CMouseSmoothWheelCorrector= +CMouseSmoothWheelCorrector;function CTranslateManager(){this.mapTranslate={}}CTranslateManager.prototype.init=function(map){this.mapTranslate=map||{}};CTranslateManager.prototype.getValue=function(key){return this.mapTranslate.hasOwnProperty(key)?this.mapTranslate[key]:key};if(!Array.prototype.fill)Object.defineProperty(Array.prototype,"fill",{value:function(value){if(this==null)throw new TypeError("this is null or not defined");var O=Object(this);var len=O.length>>>0;var start=arguments[1];var relativeStart= +start>>0;var k=relativeStart<0?Math.max(len+relativeStart,0):Math.min(relativeStart,len);var end=arguments[2];var relativeEnd=end===undefined?len:end>>0;var final=relativeEnd<0?Math.max(len+relativeEnd,0):Math.min(relativeEnd,len);while(k=_usersCount?true:false; @@ -1200,9 +1200,9 @@ prot.asc_getGroupName;prot["asc_getFormulasArray"]=prot.asc_getFormulasArray;pro window["AscFonts"].onLoadModule=function(){if(window["AscFonts"].isEngineReady)return;++window["AscFonts"].curLoadingIndex;if(window["AscFonts"].curLoadingIndex==window["AscFonts"].maxLoadingIndex){if(window["AscFonts"].api){window["AscFonts"].isEngineReady=true;window["AscFonts"].onSuccess.call(window["AscFonts"].api)}delete window["AscFonts"].curLoadingIndex;delete window["AscFonts"].maxLoadingIndex;delete window["AscFonts"].api;delete window["AscFonts"].onSuccess;delete window["AscFonts"].onError}}; window["AscFonts"].load=function(api,onSuccess,onError){window["AscFonts"].api=api;window["AscFonts"].onSuccess=onSuccess;window["AscFonts"].onError=onError;if(window["NATIVE_EDITOR_ENJINE"]===true||window["IS_NATIVE_EDITOR"]===true||window["Native"]!==undefined){window["AscFonts"].isEngineReady=true;window["AscFonts"].onSuccess.call(window["AscFonts"].api);delete window["AscFonts"].curLoadingIndex;delete window["AscFonts"].maxLoadingIndex;delete window["AscFonts"].api;delete window["AscFonts"].onSuccess; delete window["AscFonts"].onError;return}var url="../../../../sdkjs/common/libfont";var useWasm=false;var webAsmObj=window["WebAssembly"];if(typeof webAsmObj==="object")if(typeof webAsmObj["Memory"]==="function")if(typeof webAsmObj["instantiateStreaming"]==="function"||typeof webAsmObj["instantiate"]==="function")useWasm=true;useWasm?url+="/wasm":url+="/js";if(!useWasm)window["AscFonts"].onLoadModule();var _onSuccess=function(){};var _onError=function(){window["AscFonts"].onError()};if(window["AscNotLoadAllScript"]){AscCommon.loadScript(url+ -"/engine.js",_onSuccess,_onError);AscCommon.loadScript(url+"/file.js",_onSuccess,_onError);AscCommon.loadScript(url+"/manager.js",_onSuccess,_onError)}else AscCommon.loadScript(url+"/fonts.js",_onSuccess,_onError)};function FontStream(data,size){this.data=data;this.size=size}window["AscFonts"].FontStream=FontStream;window["AscFonts"].FT_Common={UintToInt:function(v){return v>2147483647?v-4294967296:v},UShort_To_Short:function(v){return v>32767?v-65536:v},IntToUInt:function(v){return v<0?v+4294967296: -v},Short_To_UShort:function(v){return v<0?v+65536:v},memset:function(d,v,s){for(var i=0;i2147483647?v-4294967296:v},UShort_To_Short:function(v){return v>32767?v-65536:v},IntToUInt:function(v){return v< +0?v+4294967296:v},Short_To_UShort:function(v){return v<0?v+65536:v},memset:function(d,v,s){for(var i=0;i>24&63);result.push(128|code>>18&63);result.push(128|code>>12&63);result.pu 5;while(bitCount>=8){var _del=Math.pow(2,bitCount-8);var _res=buffer/_del&255;result.push(_res);bitCount-=8}}this.GetUTF16_fromUTF8(result)};this.CreateIndexByOctetAndMovePosition=function(obj,currentPosition){var j=0;while(j<8){if(currentPosition>=obj.data.length){obj.index[j++]=-1;continue}if(this.IgnoredSymbol(obj.data.charCodeAt(currentPosition))){currentPosition++;continue}obj.index[j]=obj.data[currentPosition];j++;currentPosition++}return currentPosition};this.IgnoredSymbol=function(checkedSymbol){return checkedSymbol>= 128||this.DecodingTable[checkedSymbol]==255}}var bIsLocalFontsUse=false;function _is_support_cors(){if(window["NATIVE_EDITOR_ENJINE"]===true)return false;var xhrSupported=new XMLHttpRequest;return!!xhrSupported&&"withCredentials"in xhrSupported}var bIsSupportOriginalFormatFonts=_is_support_cors();function postLoadScript(scriptName){window.postMessage({type:"FROM_PAGE_LOAD_SCRIPT",text:scriptName},"*")}function CFontFileLoader(id){this.LoadingCounter=0;this.Id=id;this.Status=-1;this.stream_index=-1; this.callback=null;this.IsNeedAddJSToFontPath=true;this.CanUseOriginalFormat=true;var oThis=this;this.CheckLoaded=function(){return 0==this.Status||1==this.Status};this._callback_font_load=function(){if(!window[oThis.Id]){oThis.LoadingCounter++;if(oThis.LoadingCounter>16&255;var g=nColor>>8&255;var b=nColor&255;var Y=Math.max(0,Math.min(255,.299*r+.587*g+.114*b));var Cb=Math.max(0,Math.min(255,128-.168736*r-.331264* g+.5*b));var Cr=Math.max(0,Math.min(255,128+.5*r-.418688*g-.081312*b));if(Y>63)Y=63;var R=Math.max(0,Math.min(255,Y+1.402*(Cr-128)))|0;var G=Math.max(0,Math.min(255,Y-.34414*(Cb-128)-.71414*(Cr-128)))|0;var B=Math.max(0,Math.min(255,Y+1.772*(Cb-128)))|0;this.Light=new CColor(r,g,b,255);this.Dark=new CColor(R,G,B,255)};function loadScript(url,onSuccess,onError){if(window["NATIVE_EDITOR_ENJINE"]===true||window["Native"]!==undefined){onSuccess();return}if(window["AscDesktopEditor"]&&window["local_load_add"]){var _context= {"completeLoad":function(){return onSuccess()}};window["local_load_add"](_context,"sdk-all-from-min",url);var _ret_param=window["AscDesktopEditor"]["LoadJS"](url);if(2!=_ret_param)window["local_load_remove"](url);if(_ret_param==1){setTimeout(onSuccess,1);return}else if(_ret_param==2)return}var script=document.createElement("script");script.type="text/javascript";script.src=url;script.onload=onSuccess;script.onerror=onError;document.head.appendChild(script)}function loadSdk(sdkName,onSuccess,onError){if(window["AscNotLoadAllScript"])onSuccess(); -else loadScript("./../../../../sdkjs/"+sdkName+"/sdk-all.js",onSuccess,onError)}function getAltGr(e){var ctrlKey=e.metaKey||e.ctrlKey;var altKey=e.altKey;return altKey&&(AscBrowser.isMacOs?!ctrlKey:ctrlKey)}function getColorSchemeByName(sName){for(var i=0;ikoef2){_h=h;_w=koef2*_h>>0;_y=0;_x=w-_w>>1}else{_w=w;_h=_w/koef2>>0;_x=0;_y=h-_h>>1}_ctx.drawImage(this.ImageHtml,_x,_y,_w,_h)};CSignatureDrawer.prototype.selectImage=CSignatureDrawer.prototype["selectImage"]=function(){this.Text="";window["AscDesktopEditor"]["OpenFilenameDialog"]("images",false,function(_file){var file=_file;if(Array.isArray(file))file=file[0];if(file=="")return;var _drawer= -window.Asc.g_signature_drawer;_drawer.Image=window["AscDesktopEditor"]["GetImageBase64"](file);_drawer.ImageHtml=new Image;_drawer.ImageHtml.onload=function(){window.Asc.g_signature_drawer.drawImage()};_drawer.ImageHtml.src=_drawer.Image;_drawer=null})};CSignatureDrawer.prototype.isValid=function(){return this.Image!=""||this.Text!=""};CSignatureDrawer.prototype.destroy=function(){window.Asc.g_signature_drawer.CanvasParent.removeChild(this.Canvas);delete window.Asc.g_signature_drawer};function CSignatureImage(){this.ImageValidBase64= -"";this.ImageInvalidBase64="";this.ImageValid=null;this.ImageInvalid=null;this.Valid=false;this.Loading=0;this.Remove=function(){this.ImageValidBase64="";this.ImageInvalidBase64="";this.ImageValid=null;this.ImageInvalid=null;this.Valid=false;this.Loading=0};this.Register=function(_api,_guid){if(_api.ImageLoader.map_image_index[_guid])return;var _obj={Image:this.Valid?this.ImageValid:this.ImageInvalid,Status:AscFonts.ImageLoadStatus.Complete,src:_guid};_api.ImageLoader.map_image_index[_guid]=_obj}; -this.Unregister=function(_api,_guid){if(_api.ImageLoader.map_image_index[_guid])delete _api.ImageLoader.map_image_index[_guid]}}AscCommon.EncryptionMessageType={Encrypt:0,Decrypt:1};function CEncryptionData(){this._init=false;this.arrData=[];this.arrImages=[];this.handleChangesCallback=null;this.isChangesHandled=false;this.cryptoMode=0;this.isChartEditor=false;this.isExistDecryptedChanges=false;this.cryptoPrefix=window["AscDesktopEditor"]&&window["AscDesktopEditor"]["GetEncryptedHeader"]?window["AscDesktopEditor"]["GetEncryptedHeader"](): -"ENCRYPTED;";this.cryptoPrefixLen=this.cryptoPrefix.length;this.editorId=null;this.nextChangesTimeoutId=-1;this.isPasswordCryptoPresent=false;this.init=function(){this._init=true};this.isInit=function(){return this._init};this.isNeedCrypt=function(){if(window.g_asc_plugins)if(!window.g_asc_plugins.isRunnedEncryption())return false;if(!window["AscDesktopEditor"])return false;if(this.isChartEditor)return false;if(2==this.cryptoMode)return true;if(0===window["AscDesktopEditor"]["CryptoMode"])return false; -return true};this.isCryptoImages=function(){return this.isNeedCrypt()&&this.isPasswordCryptoPresent};this.addCryproImagesFromDialog=function(callback){var _this=this;window["AscDesktopEditor"]["OpenFilenameDialog"]("images",true,function(files){if(!Array.isArray(files))files=[files];if(0==files.length)return;var _files=[];var _options={isImageCrypt:true,callback:callback,ext:[]};for(var i=0;i=0;i--)this.handleChangesCallback.changesBase[i]=data[i];else for(var i=data.length-1;i>=0;i--)this.handleChangesCallback.changesBase[i].m_pData=data[i];this.isChangesHandled=true;this.handleChangesCallback.callback.call(this.handleChangesCallback.sender);this.handleChangesCallback=null;this.nextChanges();return}var obj=this.arrData[0];this.arrData.splice(0,1);if(AscCommon.EncryptionMessageType.Encrypt== -obj.type)if(obj.options&&obj.options.isImageCrypt){for(var i=0;i=0;i--)if(_array[i]["change"].length>_checkPrefixLen){_prefix=_array[i]["change"].substr(0,_checkPrefixLen);if(-1!=_prefix.indexOf(this.cryptoPrefix)){isCrypted=true;break}}return isCrypted}var isCrypted=false;if(this.editorId==AscCommon.c_oEditorId.Spreadsheet)for(var i=_array.length- -1;i>=0;i--){if(_array[i].length>_checkPrefixLen){_prefix=_array[i].substr(0,_checkPrefixLen);if(-1!=_prefix.indexOf(this.cryptoPrefix)){isCrypted=true;break}}}else for(var i=_array.length-1;i>=0;i--)if(_array[i].m_pData.length>_checkPrefixLen){_prefix=_array[i].m_pData.substr(0,_checkPrefixLen);if(-1!=_prefix.indexOf(this.cryptoPrefix)){isCrypted=true;break}}return isCrypted};this.handleChanges=function(_array,_sender,_callback){if(0==_array.length||!this.isNeedCrypt()){if(this.isExistEncryptedChanges(_array)){this.onDecodeError(); -return}this.isChangesHandled=true;_callback.call(_sender);return}this.handleChangesCallback={changesBase:_array,changes:[],sender:_sender,callback:_callback};this.checkEditorId();if(this.editorId==AscCommon.c_oEditorId.Spreadsheet)for(var i=_array.length-1;i>=0;i--)this.handleChangesCallback.changes[i]=_array[i];else for(var i=_array.length-1;i>=0;i--)this.handleChangesCallback.changes[i]=_array[i].m_pData;window.g_asc_plugins.sendToEncryption({"type":"decryptData","data":this.handleChangesCallback.changes})}; -this.asc_setAdvancedOptions=function(api,idOption,option){if(window.isNativeOpenPassword){window["AscDesktopEditor"]["NativeViewerOpen"](option.asc_getPassword());return}if(window.isCloudCryptoDownloadAs)return false;if(!this.isNeedCrypt())return false;window.checkPasswordFromPlugin=true;if(window["Asc"].c_oAscAdvancedOptionsID.TXT===idOption){var _param=""+option.asc_getCodePage()+"";window["AscDesktopEditor"]["SetAdvancedOptions"](_param)}else if(window["Asc"].c_oAscAdvancedOptionsID.CSV=== -idOption){var delimiter=option.asc_getDelimiter();var delimiterChar=option.asc_getDelimiterChar();var _param="";_param+=""+option.asc_getCodePage()+"";if(null!=delimiter)_param+=""+delimiter+"";if(null!=delimiterChar)_param+=""+delimiterChar+"";window["AscDesktopEditor"]["SetAdvancedOptions"](_param)}else if(window["Asc"].c_oAscAdvancedOptionsID.DRM===idOption){var _param=""+ -AscCommon.CopyPasteCorrectString(option.asc_getPassword())+"";api.currentPassword=option.asc_getPassword();window["AscDesktopEditor"]["SetAdvancedOptions"](_param)}return true}}AscCommon.EncryptionWorker=new CEncryptionData;function CMouseSmoothWheelCorrector(t,scrollFunction){this._deltaX=0;this._deltaY=0;this._isBreakX=false;this._isBreakY=false;this._timeoutCorrector=-1;this._api=t;this._scrollFunction=scrollFunction;this._normalDelta=120;this._isNormalDeltaActive=false;this.setNormalDeltaActive= -function(value){this._isNormalDeltaActive=true;this._normalDelta=value};this.isBreakX=function(){return this._isBreakX};this.isBreakY=function(){return this._isBreakY};this.get_DeltaX=function(wheelDeltaX){this._isBreakX=false;if(!AscCommon.AscBrowser.isMacOs)return wheelDeltaX;this._deltaX+=wheelDeltaX;if(Math.abs(this._deltaX)>=this._normalDelta)return this._isNormalDeltaActive?this._deltaX>0?this._normalDelta:-this._normalDelta:this._deltaX;this._isBreakX=true;return 0};this.get_DeltaY=function(wheelDeltaY){this._isBreakY= -false;if(!AscCommon.AscBrowser.isMacOs)return wheelDeltaY;this._deltaY+=wheelDeltaY;if(Math.abs(this._deltaY)>=this._normalDelta)return this._isNormalDeltaActive?this._deltaY>0?this._normalDelta:-this._normalDelta:this._deltaY;this._isBreakY=true;return 0};this.checkBreak=function(){if(-1!=this._timeoutCorrector){clearTimeout(this._timeoutCorrector);this._timeoutCorrector=-1}if((this._isBreakX||this._isBreakY)&&this._scrollFunction){var obj={t:this,x:this._isBreakX?this._deltaX:0,y:this._isBreakY? -this._deltaY:0};this._timeoutCorrector=setTimeout(function(){var t=obj.t;t._scrollFunction.call(t._api,obj.x,obj.y);t._timeoutCorrector=-1;t._deltaX=0;t._deltaY=0},100)}if(!this._isBreakX)this._deltaX=0;if(!this._isBreakY)this._deltaY=0;this._isBreakX=false;this._isBreakY=false}}AscCommon.CMouseSmoothWheelCorrector=CMouseSmoothWheelCorrector;function CTranslateManager(){this.mapTranslate={}}CTranslateManager.prototype.init=function(map){this.mapTranslate=map||{}};CTranslateManager.prototype.getValue= -function(key){return this.mapTranslate.hasOwnProperty(key)?this.mapTranslate[key]:key};if(!Array.prototype.fill)Object.defineProperty(Array.prototype,"fill",{value:function(value){if(this==null)throw new TypeError("this is null or not defined");var O=Object(this);var len=O.length>>>0;var start=arguments[1];var relativeStart=start>>0;var k=relativeStart<0?Math.max(len+relativeStart,0):Math.min(relativeStart,len);var end=arguments[2];var relativeEnd=end===undefined?len:end>>0;var final=relativeEnd< -0?Math.max(len+relativeEnd,0):Math.min(relativeEnd,len);while(kkoef2){_h=h;_w=koef2*_h>>0;_y=0;_x=w-_w>>1}else{_w=w;_h=_w/koef2>>0;_x=0;_y=h-_h>>1}_ctx.drawImage(this.ImageHtml,_x,_y,_w,_h)};CSignatureDrawer.prototype.selectImage=CSignatureDrawer.prototype["selectImage"]=function(){this.Text="";window["AscDesktopEditor"]["OpenFilenameDialog"]("images",false,function(_file){var file= +_file;if(Array.isArray(file))file=file[0];if(file=="")return;var _drawer=window.Asc.g_signature_drawer;_drawer.Image=window["AscDesktopEditor"]["GetImageBase64"](file);_drawer.ImageHtml=new Image;_drawer.ImageHtml.onload=function(){window.Asc.g_signature_drawer.drawImage()};_drawer.ImageHtml.src=_drawer.Image;_drawer=null})};CSignatureDrawer.prototype.isValid=function(){return this.Image!=""||this.Text!=""};CSignatureDrawer.prototype.destroy=function(){window.Asc.g_signature_drawer.CanvasParent.removeChild(this.Canvas); +delete window.Asc.g_signature_drawer};function CSignatureImage(){this.ImageValidBase64="";this.ImageInvalidBase64="";this.ImageValid=null;this.ImageInvalid=null;this.Valid=false;this.Loading=0;this.Remove=function(){this.ImageValidBase64="";this.ImageInvalidBase64="";this.ImageValid=null;this.ImageInvalid=null;this.Valid=false;this.Loading=0};this.Register=function(_api,_guid){if(_api.ImageLoader.map_image_index[_guid])return;var _obj={Image:this.Valid?this.ImageValid:this.ImageInvalid,Status:AscFonts.ImageLoadStatus.Complete, +src:_guid};_api.ImageLoader.map_image_index[_guid]=_obj};this.Unregister=function(_api,_guid){if(_api.ImageLoader.map_image_index[_guid])delete _api.ImageLoader.map_image_index[_guid]}}AscCommon.EncryptionMessageType={Encrypt:0,Decrypt:1};function CEncryptionData(){this._init=false;this.arrData=[];this.arrImages=[];this.handleChangesCallback=null;this.isChangesHandled=false;this.cryptoMode=0;this.isChartEditor=false;this.isExistDecryptedChanges=false;this.cryptoPrefix=window["AscDesktopEditor"]&& +window["AscDesktopEditor"]["GetEncryptedHeader"]?window["AscDesktopEditor"]["GetEncryptedHeader"]():"ENCRYPTED;";this.cryptoPrefixLen=this.cryptoPrefix.length;this.editorId=null;this.nextChangesTimeoutId=-1;this.isPasswordCryptoPresent=false;this.init=function(){this._init=true};this.isInit=function(){return this._init};this.isNeedCrypt=function(){if(window.g_asc_plugins)if(!window.g_asc_plugins.isRunnedEncryption())return false;if(!window["AscDesktopEditor"])return false;if(this.isChartEditor)return false; +if(2==this.cryptoMode)return true;if(0===window["AscDesktopEditor"]["CryptoMode"])return false;return true};this.isCryptoImages=function(){return this.isNeedCrypt()&&this.isPasswordCryptoPresent};this.addCryproImagesFromDialog=function(callback){var _this=this;window["AscDesktopEditor"]["OpenFilenameDialog"]("images",true,function(files){if(!Array.isArray(files))files=[files];if(0==files.length)return;var _files=[];var _options={isImageCrypt:true,callback:callback,ext:[]};for(var i=0;i=0;i--)this.handleChangesCallback.changesBase[i]=data[i];else for(var i=data.length-1;i>=0;i--)this.handleChangesCallback.changesBase[i].m_pData=data[i];this.isChangesHandled=true;this.handleChangesCallback.callback.call(this.handleChangesCallback.sender);this.handleChangesCallback= +null;this.nextChanges();return}var obj=this.arrData[0];this.arrData.splice(0,1);if(AscCommon.EncryptionMessageType.Encrypt==obj.type)if(obj.options&&obj.options.isImageCrypt){for(var i=0;i=0;i--)if(_array[i]["change"].length>_checkPrefixLen){_prefix=_array[i]["change"].substr(0,_checkPrefixLen);if(-1!=_prefix.indexOf(this.cryptoPrefix)){isCrypted= +true;break}}return isCrypted}var isCrypted=false;if(this.editorId==AscCommon.c_oEditorId.Spreadsheet)for(var i=_array.length-1;i>=0;i--){if(_array[i].length>_checkPrefixLen){_prefix=_array[i].substr(0,_checkPrefixLen);if(-1!=_prefix.indexOf(this.cryptoPrefix)){isCrypted=true;break}}}else for(var i=_array.length-1;i>=0;i--)if(_array[i].m_pData.length>_checkPrefixLen){_prefix=_array[i].m_pData.substr(0,_checkPrefixLen);if(-1!=_prefix.indexOf(this.cryptoPrefix)){isCrypted=true;break}}return isCrypted}; +this.handleChanges=function(_array,_sender,_callback){if(0==_array.length||!this.isNeedCrypt()){if(this.isExistEncryptedChanges(_array)){this.onDecodeError();return}this.isChangesHandled=true;_callback.call(_sender);return}this.handleChangesCallback={changesBase:_array,changes:[],sender:_sender,callback:_callback};this.checkEditorId();if(this.editorId==AscCommon.c_oEditorId.Spreadsheet)for(var i=_array.length-1;i>=0;i--)this.handleChangesCallback.changes[i]=_array[i];else for(var i=_array.length- +1;i>=0;i--)this.handleChangesCallback.changes[i]=_array[i].m_pData;window.g_asc_plugins.sendToEncryption({"type":"decryptData","data":this.handleChangesCallback.changes})};this.asc_setAdvancedOptions=function(api,idOption,option){if(window.isNativeOpenPassword){window["AscDesktopEditor"]["NativeViewerOpen"](option.asc_getPassword());return}if(window.isCloudCryptoDownloadAs)return false;if(!this.isNeedCrypt())return false;window.checkPasswordFromPlugin=true;if(window["Asc"].c_oAscAdvancedOptionsID.TXT=== +idOption){var _param=""+option.asc_getCodePage()+"";window["AscDesktopEditor"]["SetAdvancedOptions"](_param)}else if(window["Asc"].c_oAscAdvancedOptionsID.CSV===idOption){var delimiter=option.asc_getDelimiter();var delimiterChar=option.asc_getDelimiterChar();var _param="";_param+=""+option.asc_getCodePage()+"";if(null!=delimiter)_param+=""+delimiter+"";if(null!=delimiterChar)_param+=""+ +delimiterChar+"";window["AscDesktopEditor"]["SetAdvancedOptions"](_param)}else if(window["Asc"].c_oAscAdvancedOptionsID.DRM===idOption){var _param=""+AscCommon.CopyPasteCorrectString(option.asc_getPassword())+"";api.currentPassword=option.asc_getPassword();window["AscDesktopEditor"]["SetAdvancedOptions"](_param)}return true}}AscCommon.EncryptionWorker=new CEncryptionData;function CMouseSmoothWheelCorrector(t,scrollFunction){this._deltaX=0;this._deltaY= +0;this._isBreakX=false;this._isBreakY=false;this._timeoutCorrector=-1;this._api=t;this._scrollFunction=scrollFunction;this._normalDelta=120;this._isNormalDeltaActive=false;this.setNormalDeltaActive=function(value){this._isNormalDeltaActive=true;this._normalDelta=value};this.isBreakX=function(){return this._isBreakX};this.isBreakY=function(){return this._isBreakY};this.get_DeltaX=function(wheelDeltaX){this._isBreakX=false;if(!AscCommon.AscBrowser.isMacOs)return wheelDeltaX;this._deltaX+=wheelDeltaX; +if(Math.abs(this._deltaX)>=this._normalDelta)return this._isNormalDeltaActive?this._deltaX>0?this._normalDelta:-this._normalDelta:this._deltaX;this._isBreakX=true;return 0};this.get_DeltaY=function(wheelDeltaY){this._isBreakY=false;if(!AscCommon.AscBrowser.isMacOs)return wheelDeltaY;this._deltaY+=wheelDeltaY;if(Math.abs(this._deltaY)>=this._normalDelta)return this._isNormalDeltaActive?this._deltaY>0?this._normalDelta:-this._normalDelta:this._deltaY;this._isBreakY=true;return 0};this.checkBreak=function(){if(-1!= +this._timeoutCorrector){clearTimeout(this._timeoutCorrector);this._timeoutCorrector=-1}if((this._isBreakX||this._isBreakY)&&this._scrollFunction){var obj={t:this,x:this._isBreakX?this._deltaX:0,y:this._isBreakY?this._deltaY:0};this._timeoutCorrector=setTimeout(function(){var t=obj.t;t._scrollFunction.call(t._api,obj.x,obj.y);t._timeoutCorrector=-1;t._deltaX=0;t._deltaY=0},100)}if(!this._isBreakX)this._deltaX=0;if(!this._isBreakY)this._deltaY=0;this._isBreakX=false;this._isBreakY=false}}AscCommon.CMouseSmoothWheelCorrector= +CMouseSmoothWheelCorrector;function CTranslateManager(){this.mapTranslate={}}CTranslateManager.prototype.init=function(map){this.mapTranslate=map||{}};CTranslateManager.prototype.getValue=function(key){return this.mapTranslate.hasOwnProperty(key)?this.mapTranslate[key]:key};if(!Array.prototype.fill)Object.defineProperty(Array.prototype,"fill",{value:function(value){if(this==null)throw new TypeError("this is null or not defined");var O=Object(this);var len=O.length>>>0;var start=arguments[1];var relativeStart= +start>>0;var k=relativeStart<0?Math.max(len+relativeStart,0):Math.min(relativeStart,len);var end=arguments[2];var relativeEnd=end===undefined?len:end>>0;var final=relativeEnd<0?Math.max(len+relativeEnd,0):Math.min(relativeEnd,len);while(k=_usersCount?true:false; @@ -1198,9 +1198,9 @@ prot.asc_getGroupName;prot["asc_getFormulasArray"]=prot.asc_getFormulasArray;pro window["AscFonts"].onLoadModule=function(){if(window["AscFonts"].isEngineReady)return;++window["AscFonts"].curLoadingIndex;if(window["AscFonts"].curLoadingIndex==window["AscFonts"].maxLoadingIndex){if(window["AscFonts"].api){window["AscFonts"].isEngineReady=true;window["AscFonts"].onSuccess.call(window["AscFonts"].api)}delete window["AscFonts"].curLoadingIndex;delete window["AscFonts"].maxLoadingIndex;delete window["AscFonts"].api;delete window["AscFonts"].onSuccess;delete window["AscFonts"].onError}}; window["AscFonts"].load=function(api,onSuccess,onError){window["AscFonts"].api=api;window["AscFonts"].onSuccess=onSuccess;window["AscFonts"].onError=onError;if(window["NATIVE_EDITOR_ENJINE"]===true||window["IS_NATIVE_EDITOR"]===true||window["Native"]!==undefined){window["AscFonts"].isEngineReady=true;window["AscFonts"].onSuccess.call(window["AscFonts"].api);delete window["AscFonts"].curLoadingIndex;delete window["AscFonts"].maxLoadingIndex;delete window["AscFonts"].api;delete window["AscFonts"].onSuccess; delete window["AscFonts"].onError;return}var url="../../../../sdkjs/common/libfont";var useWasm=false;var webAsmObj=window["WebAssembly"];if(typeof webAsmObj==="object")if(typeof webAsmObj["Memory"]==="function")if(typeof webAsmObj["instantiateStreaming"]==="function"||typeof webAsmObj["instantiate"]==="function")useWasm=true;useWasm?url+="/wasm":url+="/js";if(!useWasm)window["AscFonts"].onLoadModule();var _onSuccess=function(){};var _onError=function(){window["AscFonts"].onError()};if(window["AscNotLoadAllScript"]){AscCommon.loadScript(url+ -"/engine.js",_onSuccess,_onError);AscCommon.loadScript(url+"/file.js",_onSuccess,_onError);AscCommon.loadScript(url+"/manager.js",_onSuccess,_onError)}else AscCommon.loadScript(url+"/fonts.js",_onSuccess,_onError)};function FontStream(data,size){this.data=data;this.size=size}window["AscFonts"].FontStream=FontStream;window["AscFonts"].FT_Common={UintToInt:function(v){return v>2147483647?v-4294967296:v},UShort_To_Short:function(v){return v>32767?v-65536:v},IntToUInt:function(v){return v<0?v+4294967296: -v},Short_To_UShort:function(v){return v<0?v+65536:v},memset:function(d,v,s){for(var i=0;i2147483647?v-4294967296:v},UShort_To_Short:function(v){return v>32767?v-65536:v},IntToUInt:function(v){return v< +0?v+4294967296:v},Short_To_UShort:function(v){return v<0?v+65536:v},memset:function(d,v,s){for(var i=0;i>24&63);result.push(128|code>>18&63);result.push(128|code>>12&63);result.pu 5;while(bitCount>=8){var _del=Math.pow(2,bitCount-8);var _res=buffer/_del&255;result.push(_res);bitCount-=8}}this.GetUTF16_fromUTF8(result)};this.CreateIndexByOctetAndMovePosition=function(obj,currentPosition){var j=0;while(j<8){if(currentPosition>=obj.data.length){obj.index[j++]=-1;continue}if(this.IgnoredSymbol(obj.data.charCodeAt(currentPosition))){currentPosition++;continue}obj.index[j]=obj.data[currentPosition];j++;currentPosition++}return currentPosition};this.IgnoredSymbol=function(checkedSymbol){return checkedSymbol>= 128||this.DecodingTable[checkedSymbol]==255}}var bIsLocalFontsUse=false;function _is_support_cors(){if(window["NATIVE_EDITOR_ENJINE"]===true)return false;var xhrSupported=new XMLHttpRequest;return!!xhrSupported&&"withCredentials"in xhrSupported}var bIsSupportOriginalFormatFonts=_is_support_cors();function postLoadScript(scriptName){window.postMessage({type:"FROM_PAGE_LOAD_SCRIPT",text:scriptName},"*")}function CFontFileLoader(id){this.LoadingCounter=0;this.Id=id;this.Status=-1;this.stream_index=-1; this.callback=null;this.IsNeedAddJSToFontPath=true;this.CanUseOriginalFormat=true;var oThis=this;this.CheckLoaded=function(){return 0==this.Status||1==this.Status};this._callback_font_load=function(){if(!window[oThis.Id]){oThis.LoadingCounter++;if(oThis.LoadingCounter>16&255;var g=nColor>>8&255;var b=nColor&255;var Y=Math.max(0,Math.min(255,.299*r+.587*g+.114*b));var Cb=Math.max(0,Math.min(255,128-.168736*r-.331264* g+.5*b));var Cr=Math.max(0,Math.min(255,128+.5*r-.418688*g-.081312*b));if(Y>63)Y=63;var R=Math.max(0,Math.min(255,Y+1.402*(Cr-128)))|0;var G=Math.max(0,Math.min(255,Y-.34414*(Cb-128)-.71414*(Cr-128)))|0;var B=Math.max(0,Math.min(255,Y+1.772*(Cb-128)))|0;this.Light=new CColor(r,g,b,255);this.Dark=new CColor(R,G,B,255)};function loadScript(url,onSuccess,onError){if(window["NATIVE_EDITOR_ENJINE"]===true||window["Native"]!==undefined){onSuccess();return}if(window["AscDesktopEditor"]&&window["local_load_add"]){var _context= {"completeLoad":function(){return onSuccess()}};window["local_load_add"](_context,"sdk-all-from-min",url);var _ret_param=window["AscDesktopEditor"]["LoadJS"](url);if(2!=_ret_param)window["local_load_remove"](url);if(_ret_param==1){setTimeout(onSuccess,1);return}else if(_ret_param==2)return}var script=document.createElement("script");script.type="text/javascript";script.src=url;script.onload=onSuccess;script.onerror=onError;document.head.appendChild(script)}function loadSdk(sdkName,onSuccess,onError){if(window["AscNotLoadAllScript"])onSuccess(); -else loadScript("./../../../../sdkjs/"+sdkName+"/sdk-all.js",onSuccess,onError)}function getAltGr(e){var ctrlKey=e.metaKey||e.ctrlKey;var altKey=e.altKey;return altKey&&(AscBrowser.isMacOs?!ctrlKey:ctrlKey)}function getColorSchemeByName(sName){for(var i=0;ikoef2){_h=h;_w=koef2*_h>>0;_y=0;_x=w-_w>>1}else{_w=w;_h=_w/koef2>>0;_x=0;_y=h-_h>>1}_ctx.drawImage(this.ImageHtml,_x,_y,_w,_h)};CSignatureDrawer.prototype.selectImage=CSignatureDrawer.prototype["selectImage"]=function(){this.Text="";window["AscDesktopEditor"]["OpenFilenameDialog"]("images",false,function(_file){var file=_file;if(Array.isArray(file))file=file[0];if(file=="")return;var _drawer= -window.Asc.g_signature_drawer;_drawer.Image=window["AscDesktopEditor"]["GetImageBase64"](file);_drawer.ImageHtml=new Image;_drawer.ImageHtml.onload=function(){window.Asc.g_signature_drawer.drawImage()};_drawer.ImageHtml.src=_drawer.Image;_drawer=null})};CSignatureDrawer.prototype.isValid=function(){return this.Image!=""||this.Text!=""};CSignatureDrawer.prototype.destroy=function(){window.Asc.g_signature_drawer.CanvasParent.removeChild(this.Canvas);delete window.Asc.g_signature_drawer};function CSignatureImage(){this.ImageValidBase64= -"";this.ImageInvalidBase64="";this.ImageValid=null;this.ImageInvalid=null;this.Valid=false;this.Loading=0;this.Remove=function(){this.ImageValidBase64="";this.ImageInvalidBase64="";this.ImageValid=null;this.ImageInvalid=null;this.Valid=false;this.Loading=0};this.Register=function(_api,_guid){if(_api.ImageLoader.map_image_index[_guid])return;var _obj={Image:this.Valid?this.ImageValid:this.ImageInvalid,Status:AscFonts.ImageLoadStatus.Complete,src:_guid};_api.ImageLoader.map_image_index[_guid]=_obj}; -this.Unregister=function(_api,_guid){if(_api.ImageLoader.map_image_index[_guid])delete _api.ImageLoader.map_image_index[_guid]}}AscCommon.EncryptionMessageType={Encrypt:0,Decrypt:1};function CEncryptionData(){this._init=false;this.arrData=[];this.arrImages=[];this.handleChangesCallback=null;this.isChangesHandled=false;this.cryptoMode=0;this.isChartEditor=false;this.isExistDecryptedChanges=false;this.cryptoPrefix=window["AscDesktopEditor"]&&window["AscDesktopEditor"]["GetEncryptedHeader"]?window["AscDesktopEditor"]["GetEncryptedHeader"](): -"ENCRYPTED;";this.cryptoPrefixLen=this.cryptoPrefix.length;this.editorId=null;this.nextChangesTimeoutId=-1;this.isPasswordCryptoPresent=false;this.init=function(){this._init=true};this.isInit=function(){return this._init};this.isNeedCrypt=function(){if(window.g_asc_plugins)if(!window.g_asc_plugins.isRunnedEncryption())return false;if(!window["AscDesktopEditor"])return false;if(this.isChartEditor)return false;if(2==this.cryptoMode)return true;if(0===window["AscDesktopEditor"]["CryptoMode"])return false; -return true};this.isCryptoImages=function(){return this.isNeedCrypt()&&this.isPasswordCryptoPresent};this.addCryproImagesFromDialog=function(callback){var _this=this;window["AscDesktopEditor"]["OpenFilenameDialog"]("images",true,function(files){if(!Array.isArray(files))files=[files];if(0==files.length)return;var _files=[];var _options={isImageCrypt:true,callback:callback,ext:[]};for(var i=0;i=0;i--)this.handleChangesCallback.changesBase[i]=data[i];else for(var i=data.length-1;i>=0;i--)this.handleChangesCallback.changesBase[i].m_pData=data[i];this.isChangesHandled=true;this.handleChangesCallback.callback.call(this.handleChangesCallback.sender);this.handleChangesCallback=null;this.nextChanges();return}var obj=this.arrData[0];this.arrData.splice(0,1);if(AscCommon.EncryptionMessageType.Encrypt== -obj.type)if(obj.options&&obj.options.isImageCrypt){for(var i=0;i=0;i--)if(_array[i]["change"].length>_checkPrefixLen){_prefix=_array[i]["change"].substr(0,_checkPrefixLen);if(-1!=_prefix.indexOf(this.cryptoPrefix)){isCrypted=true;break}}return isCrypted}var isCrypted=false;if(this.editorId==AscCommon.c_oEditorId.Spreadsheet)for(var i=_array.length- -1;i>=0;i--){if(_array[i].length>_checkPrefixLen){_prefix=_array[i].substr(0,_checkPrefixLen);if(-1!=_prefix.indexOf(this.cryptoPrefix)){isCrypted=true;break}}}else for(var i=_array.length-1;i>=0;i--)if(_array[i].m_pData.length>_checkPrefixLen){_prefix=_array[i].m_pData.substr(0,_checkPrefixLen);if(-1!=_prefix.indexOf(this.cryptoPrefix)){isCrypted=true;break}}return isCrypted};this.handleChanges=function(_array,_sender,_callback){if(0==_array.length||!this.isNeedCrypt()){if(this.isExistEncryptedChanges(_array)){this.onDecodeError(); -return}this.isChangesHandled=true;_callback.call(_sender);return}this.handleChangesCallback={changesBase:_array,changes:[],sender:_sender,callback:_callback};this.checkEditorId();if(this.editorId==AscCommon.c_oEditorId.Spreadsheet)for(var i=_array.length-1;i>=0;i--)this.handleChangesCallback.changes[i]=_array[i];else for(var i=_array.length-1;i>=0;i--)this.handleChangesCallback.changes[i]=_array[i].m_pData;window.g_asc_plugins.sendToEncryption({"type":"decryptData","data":this.handleChangesCallback.changes})}; -this.asc_setAdvancedOptions=function(api,idOption,option){if(window.isNativeOpenPassword){window["AscDesktopEditor"]["NativeViewerOpen"](option.asc_getPassword());return}if(window.isCloudCryptoDownloadAs)return false;if(!this.isNeedCrypt())return false;window.checkPasswordFromPlugin=true;if(window["Asc"].c_oAscAdvancedOptionsID.TXT===idOption){var _param=""+option.asc_getCodePage()+"";window["AscDesktopEditor"]["SetAdvancedOptions"](_param)}else if(window["Asc"].c_oAscAdvancedOptionsID.CSV=== -idOption){var delimiter=option.asc_getDelimiter();var delimiterChar=option.asc_getDelimiterChar();var _param="";_param+=""+option.asc_getCodePage()+"";if(null!=delimiter)_param+=""+delimiter+"";if(null!=delimiterChar)_param+=""+delimiterChar+"";window["AscDesktopEditor"]["SetAdvancedOptions"](_param)}else if(window["Asc"].c_oAscAdvancedOptionsID.DRM===idOption){var _param=""+ -AscCommon.CopyPasteCorrectString(option.asc_getPassword())+"";api.currentPassword=option.asc_getPassword();window["AscDesktopEditor"]["SetAdvancedOptions"](_param)}return true}}AscCommon.EncryptionWorker=new CEncryptionData;function CMouseSmoothWheelCorrector(t,scrollFunction){this._deltaX=0;this._deltaY=0;this._isBreakX=false;this._isBreakY=false;this._timeoutCorrector=-1;this._api=t;this._scrollFunction=scrollFunction;this._normalDelta=120;this._isNormalDeltaActive=false;this.setNormalDeltaActive= -function(value){this._isNormalDeltaActive=true;this._normalDelta=value};this.isBreakX=function(){return this._isBreakX};this.isBreakY=function(){return this._isBreakY};this.get_DeltaX=function(wheelDeltaX){this._isBreakX=false;if(!AscCommon.AscBrowser.isMacOs)return wheelDeltaX;this._deltaX+=wheelDeltaX;if(Math.abs(this._deltaX)>=this._normalDelta)return this._isNormalDeltaActive?this._deltaX>0?this._normalDelta:-this._normalDelta:this._deltaX;this._isBreakX=true;return 0};this.get_DeltaY=function(wheelDeltaY){this._isBreakY= -false;if(!AscCommon.AscBrowser.isMacOs)return wheelDeltaY;this._deltaY+=wheelDeltaY;if(Math.abs(this._deltaY)>=this._normalDelta)return this._isNormalDeltaActive?this._deltaY>0?this._normalDelta:-this._normalDelta:this._deltaY;this._isBreakY=true;return 0};this.checkBreak=function(){if(-1!=this._timeoutCorrector){clearTimeout(this._timeoutCorrector);this._timeoutCorrector=-1}if((this._isBreakX||this._isBreakY)&&this._scrollFunction){var obj={t:this,x:this._isBreakX?this._deltaX:0,y:this._isBreakY? -this._deltaY:0};this._timeoutCorrector=setTimeout(function(){var t=obj.t;t._scrollFunction.call(t._api,obj.x,obj.y);t._timeoutCorrector=-1;t._deltaX=0;t._deltaY=0},100)}if(!this._isBreakX)this._deltaX=0;if(!this._isBreakY)this._deltaY=0;this._isBreakX=false;this._isBreakY=false}}AscCommon.CMouseSmoothWheelCorrector=CMouseSmoothWheelCorrector;function CTranslateManager(){this.mapTranslate={}}CTranslateManager.prototype.init=function(map){this.mapTranslate=map||{}};CTranslateManager.prototype.getValue= -function(key){return this.mapTranslate.hasOwnProperty(key)?this.mapTranslate[key]:key};if(!Array.prototype.fill)Object.defineProperty(Array.prototype,"fill",{value:function(value){if(this==null)throw new TypeError("this is null or not defined");var O=Object(this);var len=O.length>>>0;var start=arguments[1];var relativeStart=start>>0;var k=relativeStart<0?Math.max(len+relativeStart,0):Math.min(relativeStart,len);var end=arguments[2];var relativeEnd=end===undefined?len:end>>0;var final=relativeEnd< -0?Math.max(len+relativeEnd,0):Math.min(relativeEnd,len);while(kkoef2){_h=h;_w=koef2*_h>>0;_y=0;_x=w-_w>>1}else{_w=w;_h=_w/koef2>>0;_x=0;_y=h-_h>>1}_ctx.drawImage(this.ImageHtml,_x,_y,_w,_h)};CSignatureDrawer.prototype.selectImage=CSignatureDrawer.prototype["selectImage"]=function(){this.Text="";window["AscDesktopEditor"]["OpenFilenameDialog"]("images",false,function(_file){var file= +_file;if(Array.isArray(file))file=file[0];if(file=="")return;var _drawer=window.Asc.g_signature_drawer;_drawer.Image=window["AscDesktopEditor"]["GetImageBase64"](file);_drawer.ImageHtml=new Image;_drawer.ImageHtml.onload=function(){window.Asc.g_signature_drawer.drawImage()};_drawer.ImageHtml.src=_drawer.Image;_drawer=null})};CSignatureDrawer.prototype.isValid=function(){return this.Image!=""||this.Text!=""};CSignatureDrawer.prototype.destroy=function(){window.Asc.g_signature_drawer.CanvasParent.removeChild(this.Canvas); +delete window.Asc.g_signature_drawer};function CSignatureImage(){this.ImageValidBase64="";this.ImageInvalidBase64="";this.ImageValid=null;this.ImageInvalid=null;this.Valid=false;this.Loading=0;this.Remove=function(){this.ImageValidBase64="";this.ImageInvalidBase64="";this.ImageValid=null;this.ImageInvalid=null;this.Valid=false;this.Loading=0};this.Register=function(_api,_guid){if(_api.ImageLoader.map_image_index[_guid])return;var _obj={Image:this.Valid?this.ImageValid:this.ImageInvalid,Status:AscFonts.ImageLoadStatus.Complete, +src:_guid};_api.ImageLoader.map_image_index[_guid]=_obj};this.Unregister=function(_api,_guid){if(_api.ImageLoader.map_image_index[_guid])delete _api.ImageLoader.map_image_index[_guid]}}AscCommon.EncryptionMessageType={Encrypt:0,Decrypt:1};function CEncryptionData(){this._init=false;this.arrData=[];this.arrImages=[];this.handleChangesCallback=null;this.isChangesHandled=false;this.cryptoMode=0;this.isChartEditor=false;this.isExistDecryptedChanges=false;this.cryptoPrefix=window["AscDesktopEditor"]&& +window["AscDesktopEditor"]["GetEncryptedHeader"]?window["AscDesktopEditor"]["GetEncryptedHeader"]():"ENCRYPTED;";this.cryptoPrefixLen=this.cryptoPrefix.length;this.editorId=null;this.nextChangesTimeoutId=-1;this.isPasswordCryptoPresent=false;this.init=function(){this._init=true};this.isInit=function(){return this._init};this.isNeedCrypt=function(){if(window.g_asc_plugins)if(!window.g_asc_plugins.isRunnedEncryption())return false;if(!window["AscDesktopEditor"])return false;if(this.isChartEditor)return false; +if(2==this.cryptoMode)return true;if(0===window["AscDesktopEditor"]["CryptoMode"])return false;return true};this.isCryptoImages=function(){return this.isNeedCrypt()&&this.isPasswordCryptoPresent};this.addCryproImagesFromDialog=function(callback){var _this=this;window["AscDesktopEditor"]["OpenFilenameDialog"]("images",true,function(files){if(!Array.isArray(files))files=[files];if(0==files.length)return;var _files=[];var _options={isImageCrypt:true,callback:callback,ext:[]};for(var i=0;i=0;i--)this.handleChangesCallback.changesBase[i]=data[i];else for(var i=data.length-1;i>=0;i--)this.handleChangesCallback.changesBase[i].m_pData=data[i];this.isChangesHandled=true;this.handleChangesCallback.callback.call(this.handleChangesCallback.sender);this.handleChangesCallback= +null;this.nextChanges();return}var obj=this.arrData[0];this.arrData.splice(0,1);if(AscCommon.EncryptionMessageType.Encrypt==obj.type)if(obj.options&&obj.options.isImageCrypt){for(var i=0;i=0;i--)if(_array[i]["change"].length>_checkPrefixLen){_prefix=_array[i]["change"].substr(0,_checkPrefixLen);if(-1!=_prefix.indexOf(this.cryptoPrefix)){isCrypted= +true;break}}return isCrypted}var isCrypted=false;if(this.editorId==AscCommon.c_oEditorId.Spreadsheet)for(var i=_array.length-1;i>=0;i--){if(_array[i].length>_checkPrefixLen){_prefix=_array[i].substr(0,_checkPrefixLen);if(-1!=_prefix.indexOf(this.cryptoPrefix)){isCrypted=true;break}}}else for(var i=_array.length-1;i>=0;i--)if(_array[i].m_pData.length>_checkPrefixLen){_prefix=_array[i].m_pData.substr(0,_checkPrefixLen);if(-1!=_prefix.indexOf(this.cryptoPrefix)){isCrypted=true;break}}return isCrypted}; +this.handleChanges=function(_array,_sender,_callback){if(0==_array.length||!this.isNeedCrypt()){if(this.isExistEncryptedChanges(_array)){this.onDecodeError();return}this.isChangesHandled=true;_callback.call(_sender);return}this.handleChangesCallback={changesBase:_array,changes:[],sender:_sender,callback:_callback};this.checkEditorId();if(this.editorId==AscCommon.c_oEditorId.Spreadsheet)for(var i=_array.length-1;i>=0;i--)this.handleChangesCallback.changes[i]=_array[i];else for(var i=_array.length- +1;i>=0;i--)this.handleChangesCallback.changes[i]=_array[i].m_pData;window.g_asc_plugins.sendToEncryption({"type":"decryptData","data":this.handleChangesCallback.changes})};this.asc_setAdvancedOptions=function(api,idOption,option){if(window.isNativeOpenPassword){window["AscDesktopEditor"]["NativeViewerOpen"](option.asc_getPassword());return}if(window.isCloudCryptoDownloadAs)return false;if(!this.isNeedCrypt())return false;window.checkPasswordFromPlugin=true;if(window["Asc"].c_oAscAdvancedOptionsID.TXT=== +idOption){var _param=""+option.asc_getCodePage()+"";window["AscDesktopEditor"]["SetAdvancedOptions"](_param)}else if(window["Asc"].c_oAscAdvancedOptionsID.CSV===idOption){var delimiter=option.asc_getDelimiter();var delimiterChar=option.asc_getDelimiterChar();var _param="";_param+=""+option.asc_getCodePage()+"";if(null!=delimiter)_param+=""+delimiter+"";if(null!=delimiterChar)_param+=""+ +delimiterChar+"";window["AscDesktopEditor"]["SetAdvancedOptions"](_param)}else if(window["Asc"].c_oAscAdvancedOptionsID.DRM===idOption){var _param=""+AscCommon.CopyPasteCorrectString(option.asc_getPassword())+"";api.currentPassword=option.asc_getPassword();window["AscDesktopEditor"]["SetAdvancedOptions"](_param)}return true}}AscCommon.EncryptionWorker=new CEncryptionData;function CMouseSmoothWheelCorrector(t,scrollFunction){this._deltaX=0;this._deltaY= +0;this._isBreakX=false;this._isBreakY=false;this._timeoutCorrector=-1;this._api=t;this._scrollFunction=scrollFunction;this._normalDelta=120;this._isNormalDeltaActive=false;this.setNormalDeltaActive=function(value){this._isNormalDeltaActive=true;this._normalDelta=value};this.isBreakX=function(){return this._isBreakX};this.isBreakY=function(){return this._isBreakY};this.get_DeltaX=function(wheelDeltaX){this._isBreakX=false;if(!AscCommon.AscBrowser.isMacOs)return wheelDeltaX;this._deltaX+=wheelDeltaX; +if(Math.abs(this._deltaX)>=this._normalDelta)return this._isNormalDeltaActive?this._deltaX>0?this._normalDelta:-this._normalDelta:this._deltaX;this._isBreakX=true;return 0};this.get_DeltaY=function(wheelDeltaY){this._isBreakY=false;if(!AscCommon.AscBrowser.isMacOs)return wheelDeltaY;this._deltaY+=wheelDeltaY;if(Math.abs(this._deltaY)>=this._normalDelta)return this._isNormalDeltaActive?this._deltaY>0?this._normalDelta:-this._normalDelta:this._deltaY;this._isBreakY=true;return 0};this.checkBreak=function(){if(-1!= +this._timeoutCorrector){clearTimeout(this._timeoutCorrector);this._timeoutCorrector=-1}if((this._isBreakX||this._isBreakY)&&this._scrollFunction){var obj={t:this,x:this._isBreakX?this._deltaX:0,y:this._isBreakY?this._deltaY:0};this._timeoutCorrector=setTimeout(function(){var t=obj.t;t._scrollFunction.call(t._api,obj.x,obj.y);t._timeoutCorrector=-1;t._deltaX=0;t._deltaY=0},100)}if(!this._isBreakX)this._deltaX=0;if(!this._isBreakY)this._deltaY=0;this._isBreakX=false;this._isBreakY=false}}AscCommon.CMouseSmoothWheelCorrector= +CMouseSmoothWheelCorrector;function CTranslateManager(){this.mapTranslate={}}CTranslateManager.prototype.init=function(map){this.mapTranslate=map||{}};CTranslateManager.prototype.getValue=function(key){return this.mapTranslate.hasOwnProperty(key)?this.mapTranslate[key]:key};if(!Array.prototype.fill)Object.defineProperty(Array.prototype,"fill",{value:function(value){if(this==null)throw new TypeError("this is null or not defined");var O=Object(this);var len=O.length>>>0;var start=arguments[1];var relativeStart= +start>>0;var k=relativeStart<0?Math.max(len+relativeStart,0):Math.min(relativeStart,len);var end=arguments[2];var relativeEnd=end===undefined?len:end>>0;var final=relativeEnd<0?Math.max(len+relativeEnd,0):Math.min(relativeEnd,len);while(k=_usersCount?true:false; @@ -1198,9 +1198,9 @@ prot.asc_getGroupName;prot["asc_getFormulasArray"]=prot.asc_getFormulasArray;pro window["AscFonts"].onLoadModule=function(){if(window["AscFonts"].isEngineReady)return;++window["AscFonts"].curLoadingIndex;if(window["AscFonts"].curLoadingIndex==window["AscFonts"].maxLoadingIndex){if(window["AscFonts"].api){window["AscFonts"].isEngineReady=true;window["AscFonts"].onSuccess.call(window["AscFonts"].api)}delete window["AscFonts"].curLoadingIndex;delete window["AscFonts"].maxLoadingIndex;delete window["AscFonts"].api;delete window["AscFonts"].onSuccess;delete window["AscFonts"].onError}}; window["AscFonts"].load=function(api,onSuccess,onError){window["AscFonts"].api=api;window["AscFonts"].onSuccess=onSuccess;window["AscFonts"].onError=onError;if(window["NATIVE_EDITOR_ENJINE"]===true||window["IS_NATIVE_EDITOR"]===true||window["Native"]!==undefined){window["AscFonts"].isEngineReady=true;window["AscFonts"].onSuccess.call(window["AscFonts"].api);delete window["AscFonts"].curLoadingIndex;delete window["AscFonts"].maxLoadingIndex;delete window["AscFonts"].api;delete window["AscFonts"].onSuccess; delete window["AscFonts"].onError;return}var url="../../../../sdkjs/common/libfont";var useWasm=false;var webAsmObj=window["WebAssembly"];if(typeof webAsmObj==="object")if(typeof webAsmObj["Memory"]==="function")if(typeof webAsmObj["instantiateStreaming"]==="function"||typeof webAsmObj["instantiate"]==="function")useWasm=true;useWasm?url+="/wasm":url+="/js";if(!useWasm)window["AscFonts"].onLoadModule();var _onSuccess=function(){};var _onError=function(){window["AscFonts"].onError()};if(window["AscNotLoadAllScript"]){AscCommon.loadScript(url+ -"/engine.js",_onSuccess,_onError);AscCommon.loadScript(url+"/file.js",_onSuccess,_onError);AscCommon.loadScript(url+"/manager.js",_onSuccess,_onError)}else AscCommon.loadScript(url+"/fonts.js",_onSuccess,_onError)};function FontStream(data,size){this.data=data;this.size=size}window["AscFonts"].FontStream=FontStream;window["AscFonts"].FT_Common={UintToInt:function(v){return v>2147483647?v-4294967296:v},UShort_To_Short:function(v){return v>32767?v-65536:v},IntToUInt:function(v){return v<0?v+4294967296: -v},Short_To_UShort:function(v){return v<0?v+65536:v},memset:function(d,v,s){for(var i=0;i2147483647?v-4294967296:v},UShort_To_Short:function(v){return v>32767?v-65536:v},IntToUInt:function(v){return v< +0?v+4294967296:v},Short_To_UShort:function(v){return v<0?v+65536:v},memset:function(d,v,s){for(var i=0;i>24&63);result.push(128|code>>18&63);result.push(128|code>>12&63);result.pu 5;while(bitCount>=8){var _del=Math.pow(2,bitCount-8);var _res=buffer/_del&255;result.push(_res);bitCount-=8}}this.GetUTF16_fromUTF8(result)};this.CreateIndexByOctetAndMovePosition=function(obj,currentPosition){var j=0;while(j<8){if(currentPosition>=obj.data.length){obj.index[j++]=-1;continue}if(this.IgnoredSymbol(obj.data.charCodeAt(currentPosition))){currentPosition++;continue}obj.index[j]=obj.data[currentPosition];j++;currentPosition++}return currentPosition};this.IgnoredSymbol=function(checkedSymbol){return checkedSymbol>= 128||this.DecodingTable[checkedSymbol]==255}}var bIsLocalFontsUse=false;function _is_support_cors(){if(window["NATIVE_EDITOR_ENJINE"]===true)return false;var xhrSupported=new XMLHttpRequest;return!!xhrSupported&&"withCredentials"in xhrSupported}var bIsSupportOriginalFormatFonts=_is_support_cors();function postLoadScript(scriptName){window.postMessage({type:"FROM_PAGE_LOAD_SCRIPT",text:scriptName},"*")}function CFontFileLoader(id){this.LoadingCounter=0;this.Id=id;this.Status=-1;this.stream_index=-1; this.callback=null;this.IsNeedAddJSToFontPath=true;this.CanUseOriginalFormat=true;var oThis=this;this.CheckLoaded=function(){return 0==this.Status||1==this.Status};this._callback_font_load=function(){if(!window[oThis.Id]){oThis.LoadingCounter++;if(oThis.LoadingCounter0||Bt.resolveWith(it,[ut]))}}),ut.ready.then=Bt.then,"complete"===it.readyState||"loading"!==it.readyState&&!it.documentElement.doScroll?t.setTimeout(ut.ready):(it.addEventListener("DOMContentLoaded",h),t.addEventListener("load",h));var Ut=function(t,e,i,n,o,s,a){var r=0,l=t.length,c=null==i;if("object"===ut.type(i)){o=!0;for(r in i)Ut(t,e,r,i[r],!0,s,a)}else if(void 0!==n&&(o=!0,ut.isFunction(n)||(a=!0),c&&(a?(e.call(t,n),e=null):(c=e,e=function(t,e,i){return c.call(ut(t),i)})),e))for(;r1,null,!0)},removeData:function(t){return this.each(function(){Dt.remove(this,t)})}}),ut.extend({queue:function(t,e,i){var n;if(t)return e=(e||"fx")+"queue",n=Et.get(t,e),i&&(!n||Array.isArray(i)?n=Et.access(t,e,ut.makeArray(i)):n.push(i)),n||[]},dequeue:function(t,e){e=e||"fx";var i=ut.queue(t,e),n=i.length,o=i.shift(),s=ut._queueHooks(t,e),a=function(){ut.dequeue(t,e)};"inprogress"===o&&(o=i.shift(),n--),o&&("fx"===e&&i.unshift("inprogress"),delete s.stop,o.call(t,a,s)),!n&&s&&s.empty.fire()},_queueHooks:function(t,e){var i=e+"queueHooks";return Et.get(t,i)||Et.access(t,i,{empty:ut.Callbacks("once memory").add(function(){Et.remove(t,[e+"queue",i])})})}}),ut.fn.extend({queue:function(t,e){var i=2;return"string"!=typeof t&&(e=t,t="fx",i--),arguments.length\x20\t\r\n\f]+)/i,jt=/^$|\/(?:java|ecma)script/i,qt={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};qt.optgroup=qt.option,qt.tbody=qt.tfoot=qt.colgroup=qt.caption=qt.thead,qt.th=qt.td;var Kt=/<|&#?\w+;/;!function(){var t=it.createDocumentFragment(),e=t.appendChild(it.createElement("div")),i=it.createElement("input");i.setAttribute("type","radio"),i.setAttribute("checked","checked"),i.setAttribute("name","t"),e.appendChild(i),mt.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="",mt.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var Yt=it.documentElement,Xt=/^key/,Jt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Zt=/^([^.]*)(?:\.(.+)|)/;ut.event={global:{},add:function(t,e,i,n,o){var s,a,r,l,c,d,h,p,m,u,g,b=Et.get(t);if(b)for(i.handler&&(s=i,i=s.handler,o=s.selector),o&&ut.find.matchesSelector(Yt,o),i.guid||(i.guid=ut.guid++),(l=b.events)||(l=b.events={}),(a=b.handle)||(a=b.handle=function(e){return void 0!==ut&&ut.event.triggered!==e.type?ut.event.dispatch.apply(t,arguments):void 0}),e=(e||"").match(Pt)||[""],c=e.length;c--;)r=Zt.exec(e[c])||[],m=g=r[1],u=(r[2]||"").split(".").sort(),m&&(h=ut.event.special[m]||{},m=(o?h.delegateType:h.bindType)||m,h=ut.event.special[m]||{},d=ut.extend({type:m,origType:g,data:n,handler:i,guid:i.guid,selector:o,needsContext:o&&ut.expr.match.needsContext.test(o),namespace:u.join(".")},s),(p=l[m])||(p=l[m]=[],p.delegateCount=0,h.setup&&!1!==h.setup.call(t,n,u,a)||t.addEventListener&&t.addEventListener(m,a)),h.add&&(h.add.call(t,d),d.handler.guid||(d.handler.guid=i.guid)),o?p.splice(p.delegateCount++,0,d):p.push(d),ut.event.global[m]=!0)},remove:function(t,e,i,n,o){var s,a,r,l,c,d,h,p,m,u,g,b=Et.hasData(t)&&Et.get(t);if(b&&(l=b.events)){for(e=(e||"").match(Pt)||[""],c=e.length;c--;)if(r=Zt.exec(e[c])||[],m=g=r[1],u=(r[2]||"").split(".").sort(),m){for(h=ut.event.special[m]||{},m=(n?h.delegateType:h.bindType)||m,p=l[m]||[],r=r[2]&&new RegExp("(^|\\.)"+u.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=s=p.length;s--;)d=p[s],!o&&g!==d.origType||i&&i.guid!==d.guid||r&&!r.test(d.namespace)||n&&n!==d.selector&&("**"!==n||!d.selector)||(p.splice(s,1),d.selector&&p.delegateCount--,h.remove&&h.remove.call(t,d));a&&!p.length&&(h.teardown&&!1!==h.teardown.call(t,u,b.handle)||ut.removeEvent(t,m,b.handle),delete l[m])}else for(m in l)ut.event.remove(t,m+e[c],i,n,!0);ut.isEmptyObject(l)&&Et.remove(t,"handle events")}},dispatch:function(t){var e,i,n,o,s,a,r=ut.event.fix(t),l=new Array(arguments.length),c=(Et.get(this,"events")||{})[r.type]||[],d=ut.event.special[r.type]||{};for(l[0]=r,e=1;e=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==t.type||!0!==c.disabled)){for(s=[],a={},i=0;i-1:ut.find(o,this,null,[c]).length),a[o]&&s.push(n);s.length&&r.push({elem:c,handlers:s})}return c=this,l\x20\t\r\n\f]*)[^>]*)\/>/gi,te=/\s*$/g;ut.extend({htmlPrefilter:function(t){return t.replace(Qt,"<$1>")},clone:function(t,e,i){var n,o,s,a,r=t.cloneNode(!0),l=ut.contains(t.ownerDocument,t);if(!(mt.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||ut.isXMLDoc(t)))for(a=C(r),s=C(t),n=0,o=s.length;n0&&v(a,!l&&C(t,"script")),r},cleanData:function(t){for(var e,i,n,o=ut.event.special,s=0;void 0!==(i=t[s]);s++)if(Vt(i)){if(e=i[Et.expando]){if(e.events)for(n in e.events)o[n]?ut.event.remove(i,n):ut.removeEvent(i,n,e.handle);i[Et.expando]=void 0}i[Dt.expando]&&(i[Dt.expando]=void 0)}}}),ut.fn.extend({detach:function(t){return B(this,t,!0)},remove:function(t){return B(this,t)},text:function(t){return Ut(this,function(t){return void 0===t?ut.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)})},null,t,arguments.length)},append:function(){return M(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){A(this,t).appendChild(t)}})},prepend:function(){return M(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=A(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return M(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return M(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(ut.cleanData(C(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map(function(){return ut.clone(this,t,e)})},html:function(t){return Ut(this,function(t){var e=this[0]||{},i=0,n=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!te.test(t)&&!qt[(Gt.exec(t)||["",""])[1].toLowerCase()]){t=ut.htmlPrefilter(t);try{for(;i1)}}),ut.Tween=H,H.prototype={constructor:H,init:function(t,e,i,n,o,s){this.elem=t,this.prop=i,this.easing=o||ut.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=n,this.unit=s||(ut.cssNumber[i]?"":"px")},cur:function(){var t=H.propHooks[this.prop];return t&&t.get?t.get(this):H.propHooks._default.get(this)},run:function(t){var e,i=H.propHooks[this.prop];return this.options.duration?this.pos=e=ut.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):H.propHooks._default.set(this),this}},H.prototype.init.prototype=H.prototype,H.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=ut.css(t.elem,t.prop,""),e&&"auto"!==e?e:0)},set:function(t){ut.fx.step[t.prop]?ut.fx.step[t.prop](t):1!==t.elem.nodeType||null==t.elem.style[ut.cssProps[t.prop]]&&!ut.cssHooks[t.prop]?t.elem[t.prop]=t.now:ut.style(t.elem,t.prop,t.now+t.unit)}}},H.propHooks.scrollTop=H.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},ut.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},ut.fx=H.prototype.init,ut.fx.step={};var me,ue,ge=/^(?:toggle|show|hide)$/,be=/queueHooks$/;ut.Animation=ut.extend(j,{tweeners:{"*":[function(t,e){var i=this.createTween(t,e);return g(i.elem,t,Ht.exec(e),i),i}]},tweener:function(t,e){ut.isFunction(t)?(e=t,t=["*"]):t=t.match(Pt);for(var i,n=0,o=t.length;n1)},removeAttr:function(t){return this.each(function(){ut.removeAttr(this,t)})}}),ut.extend({attr:function(t,e,i){var n,o,s=t.nodeType;if(3!==s&&8!==s&&2!==s)return void 0===t.getAttribute?ut.prop(t,e,i):(1===s&&ut.isXMLDoc(t)||(o=ut.attrHooks[e.toLowerCase()]||(ut.expr.match.bool.test(e)?fe:void 0)),void 0!==i?null===i?void ut.removeAttr(t,e):o&&"set"in o&&void 0!==(n=o.set(t,i,e))?n:(t.setAttribute(e,i+""),i):o&&"get"in o&&null!==(n=o.get(t,e))?n:(n=ut.find.attr(t,e),null==n?void 0:n))},attrHooks:{type:{set:function(t,e){if(!mt.radioValue&&"radio"===e&&o(t,"input")){var i=t.value;return t.setAttribute("type",e),i&&(t.value=i),e}}}},removeAttr:function(t,e){var i,n=0,o=e&&e.match(Pt);if(o&&1===t.nodeType)for(;i=o[n++];)t.removeAttribute(i)}}),fe={set:function(t,e,i){return!1===e?ut.removeAttr(t,i):t.setAttribute(i,i),i}},ut.each(ut.expr.match.bool.source.match(/\w+/g),function(t,e){var i=Ce[e]||ut.find.attr;Ce[e]=function(t,e,n){var o,s,a=e.toLowerCase();return n||(s=Ce[a],Ce[a]=o,o=null!=i(t,e,n)?a:null,Ce[a]=s),o}});var ve=/^(?:input|select|textarea|button)$/i,_e=/^(?:a|area)$/i;ut.fn.extend({prop:function(t,e){return Ut(this,ut.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each(function(){delete this[ut.propFix[t]||t]})}}),ut.extend({prop:function(t,e,i){var n,o,s=t.nodeType;if(3!==s&&8!==s&&2!==s)return 1===s&&ut.isXMLDoc(t)||(e=ut.propFix[e]||e,o=ut.propHooks[e]),void 0!==i?o&&"set"in o&&void 0!==(n=o.set(t,i,e))?n:t[e]=i:o&&"get"in o&&null!==(n=o.get(t,e))?n:t[e]},propHooks:{tabIndex:{get:function(t){var e=ut.find.attr(t,"tabindex");return e?parseInt(e,10):ve.test(t.nodeName)||_e.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),mt.optSelected||(ut.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),ut.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){ut.propFix[this.toLowerCase()]=this}),ut.fn.extend({addClass:function(t){var e,i,n,o,s,a,r,l=0;if(ut.isFunction(t))return this.each(function(e){ut(this).addClass(t.call(this,e,K(this)))});if("string"==typeof t&&t)for(e=t.match(Pt)||[];i=this[l++];)if(o=K(i),n=1===i.nodeType&&" "+q(o)+" "){for(a=0;s=e[a++];)n.indexOf(" "+s+" ")<0&&(n+=s+" ");r=q(n),o!==r&&i.setAttribute("class",r)}return this},removeClass:function(t){var e,i,n,o,s,a,r,l=0;if(ut.isFunction(t))return this.each(function(e){ut(this).removeClass(t.call(this,e,K(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof t&&t)for(e=t.match(Pt)||[];i=this[l++];)if(o=K(i),n=1===i.nodeType&&" "+q(o)+" "){for(a=0;s=e[a++];)for(;n.indexOf(" "+s+" ")>-1;)n=n.replace(" "+s+" "," ");r=q(n),o!==r&&i.setAttribute("class",r)}return this},toggleClass:function(t,e){var i=typeof t;return"boolean"==typeof e&&"string"===i?e?this.addClass(t):this.removeClass(t):ut.isFunction(t)?this.each(function(i){ut(this).toggleClass(t.call(this,i,K(this),e),e)}):this.each(function(){var e,n,o,s;if("string"===i)for(n=0,o=ut(this),s=t.match(Pt)||[];e=s[n++];)o.hasClass(e)?o.removeClass(e):o.addClass(e);else void 0!==t&&"boolean"!==i||(e=K(this),e&&Et.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":Et.get(this,"__className__")||""))})},hasClass:function(t){var e,i,n=0;for(e=" "+t+" ";i=this[n++];)if(1===i.nodeType&&(" "+q(K(i))+" ").indexOf(e)>-1)return!0;return!1}});var ye=/\r/g;ut.fn.extend({val:function(t){var e,i,n,o=this[0];{if(arguments.length)return n=ut.isFunction(t),this.each(function(i){var o;1===this.nodeType&&(o=n?t.call(this,i,ut(this).val()):t,null==o?o="":"number"==typeof o?o+="":Array.isArray(o)&&(o=ut.map(o,function(t){return null==t?"":t+""})),(e=ut.valHooks[this.type]||ut.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,o,"value")||(this.value=o))});if(o)return(e=ut.valHooks[o.type]||ut.valHooks[o.nodeName.toLowerCase()])&&"get"in e&&void 0!==(i=e.get(o,"value"))?i:(i=o.value,"string"==typeof i?i.replace(ye,""):null==i?"":i)}}}),ut.extend({valHooks:{option:{get:function(t){var e=ut.find.attr(t,"value");return null!=e?e:q(ut.text(t))}},select:{get:function(t){var e,i,n,s=t.options,a=t.selectedIndex,r="select-one"===t.type,l=r?null:[],c=r?a+1:s.length;for(n=a<0?c:r?a:0;n-1)&&(i=!0);return i||(t.selectedIndex=-1),s}}}}),ut.each(["radio","checkbox"],function(){ut.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=ut.inArray(ut(t).val(),e)>-1}},mt.checkOn||(ut.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})});var we=/^(?:focusinfocus|focusoutblur)$/;ut.extend(ut.event,{trigger:function(e,i,n,o){var s,a,r,l,c,d,h,p=[n||it],m=dt.call(e,"type")?e.type:e,u=dt.call(e,"namespace")?e.namespace.split("."):[];if(a=r=n=n||it,3!==n.nodeType&&8!==n.nodeType&&!we.test(m+ut.event.triggered)&&(m.indexOf(".")>-1&&(u=m.split("."),m=u.shift(),u.sort()),c=m.indexOf(":")<0&&"on"+m,e=e[ut.expando]?e:new ut.Event(m,"object"==typeof e&&e),e.isTrigger=o?2:3,e.namespace=u.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+u.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),i=null==i?[e]:ut.makeArray(i,[e]),h=ut.event.special[m]||{},o||!h.trigger||!1!==h.trigger.apply(n,i))){if(!o&&!h.noBubble&&!ut.isWindow(n)){for(l=h.delegateType||m,we.test(l+m)||(a=a.parentNode);a;a=a.parentNode)p.push(a),r=a;r===(n.ownerDocument||it)&&p.push(r.defaultView||r.parentWindow||t)}for(s=0;(a=p[s++])&&!e.isPropagationStopped();)e.type=s>1?l:h.bindType||m,d=(Et.get(a,"events")||{})[e.type]&&Et.get(a,"handle"),d&&d.apply(a,i),(d=c&&a[c])&&d.apply&&Vt(a)&&(e.result=d.apply(a,i),!1===e.result&&e.preventDefault());return e.type=m,o||e.isDefaultPrevented()||h._default&&!1!==h._default.apply(p.pop(),i)||!Vt(n)||c&&ut.isFunction(n[m])&&!ut.isWindow(n)&&(r=n[c],r&&(n[c]=null),ut.event.triggered=m,n[m](),ut.event.triggered=void 0,r&&(n[c]=r)),e.result}},simulate:function(t,e,i){var n=ut.extend(new ut.Event,i,{type:t,isSimulated:!0});ut.event.trigger(n,null,e)}}),ut.fn.extend({trigger:function(t,e){return this.each(function(){ut.event.trigger(t,e,this)})},triggerHandler:function(t,e){var i=this[0];if(i)return ut.event.trigger(t,e,i,!0)}}),ut.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(t,e){ut.fn[e]=function(t,i){return arguments.length>0?this.on(e,null,t,i):this.trigger(e)}}),ut.fn.extend({hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),mt.focusin="onfocusin"in t,mt.focusin||ut.each({focus:"focusin",blur:"focusout"},function(t,e){var i=function(t){ut.event.simulate(e,t.target,ut.event.fix(t))};ut.event.special[e]={setup:function(){var n=this.ownerDocument||this,o=Et.access(n,e);o||n.addEventListener(t,i,!0),Et.access(n,e,(o||0)+1)},teardown:function(){var n=this.ownerDocument||this,o=Et.access(n,e)-1;o?Et.access(n,e,o):(n.removeEventListener(t,i,!0),Et.remove(n,e))}}});var xe=t.location,Se=ut.now(),Ae=/\?/;ut.parseXML=function(e){var i;if(!e||"string"!=typeof e)return null;try{i=(new t.DOMParser).parseFromString(e,"text/xml")}catch(t){i=void 0}return i&&!i.getElementsByTagName("parsererror").length||ut.error("Invalid XML: "+e),i};var ke=/\[\]$/,Te=/\r?\n/g,Ie=/^(?:submit|button|image|reset|file)$/i,Pe=/^(?:input|select|textarea|keygen)/i;ut.param=function(t,e){var i,n=[],o=function(t,e){var i=ut.isFunction(e)?e():e;n[n.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==i?"":i)};if(Array.isArray(t)||t.jquery&&!ut.isPlainObject(t))ut.each(t,function(){o(this.name,this.value)});else for(i in t)Y(i,t[i],e,o);return n.join("&")},ut.fn.extend({serialize:function(){return ut.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=ut.prop(this,"elements");return t?ut.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!ut(this).is(":disabled")&&Pe.test(this.nodeName)&&!Ie.test(t)&&(this.checked||!Wt.test(t))}).map(function(t,e){var i=ut(this).val();return null==i?null:Array.isArray(i)?ut.map(i,function(t){return{name:e.name,value:t.replace(Te,"\r\n")}}):{name:e.name,value:i.replace(Te,"\r\n")}}).get()}});var Me=/%20/g,Be=/#.*$/,Ue=/([?&])_=[^&]*/,Ve=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ee=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,De=/^(?:GET|HEAD)$/,Re=/^\/\//,Fe={},Le={},He="*/".concat("*"),Ne=it.createElement("a");Ne.href=xe.href,ut.extend({active:0,lastModified:{},etag:{},ajaxSettings:{ url:xe.href,type:"GET",isLocal:Ee.test(xe.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":He,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":ut.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Z(Z(t,ut.ajaxSettings),e):Z(ut.ajaxSettings,t)},ajaxPrefilter:X(Fe),ajaxTransport:X(Le),ajax:function(e,i){function n(e,i,n,r){var c,p,m,_,y,w=i;d||(d=!0,l&&t.clearTimeout(l),o=void 0,a=r||"",x.readyState=e>0?4:0,c=e>=200&&e<300||304===e,n&&(_=Q(u,x,n)),_=tt(u,_,x,c),c?(u.ifModified&&(y=x.getResponseHeader("Last-Modified"),y&&(ut.lastModified[s]=y),(y=x.getResponseHeader("etag"))&&(ut.etag[s]=y)),204===e||"HEAD"===u.type?w="nocontent":304===e?w="notmodified":(w=_.state,p=_.data,m=_.error,c=!m)):(m=w,!e&&w||(w="error",e<0&&(e=0))),x.status=e,x.statusText=(i||w)+"",c?f.resolveWith(g,[p,w,x]):f.rejectWith(g,[x,w,m]),x.statusCode(v),v=void 0,h&&b.trigger(c?"ajaxSuccess":"ajaxError",[x,u,c?p:m]),C.fireWith(g,[x,w]),h&&(b.trigger("ajaxComplete",[x,u]),--ut.active||ut.event.trigger("ajaxStop")))}"object"==typeof e&&(i=e,e=void 0),i=i||{};var o,s,a,r,l,c,d,h,p,m,u=ut.ajaxSetup({},i),g=u.context||u,b=u.context&&(g.nodeType||g.jquery)?ut(g):ut.event,f=ut.Deferred(),C=ut.Callbacks("once memory"),v=u.statusCode||{},_={},y={},w="canceled",x={readyState:0,getResponseHeader:function(t){var e;if(d){if(!r)for(r={};e=Ve.exec(a);)r[e[1].toLowerCase()]=e[2];e=r[t.toLowerCase()]}return null==e?null:e},getAllResponseHeaders:function(){return d?a:null},setRequestHeader:function(t,e){return null==d&&(t=y[t.toLowerCase()]=y[t.toLowerCase()]||t,_[t]=e),this},overrideMimeType:function(t){return null==d&&(u.mimeType=t),this},statusCode:function(t){var e;if(t)if(d)x.always(t[x.status]);else for(e in t)v[e]=[v[e],t[e]];return this},abort:function(t){var e=t||w;return o&&o.abort(e),n(0,e),this}};if(f.promise(x),u.url=((e||u.url||xe.href)+"").replace(Re,xe.protocol+"//"),u.type=i.method||i.type||u.method||u.type,u.dataTypes=(u.dataType||"*").toLowerCase().match(Pt)||[""],null==u.crossDomain){c=it.createElement("a");try{c.href=u.url,c.href=c.href,u.crossDomain=Ne.protocol+"//"+Ne.host!=c.protocol+"//"+c.host}catch(t){u.crossDomain=!0}}if(u.data&&u.processData&&"string"!=typeof u.data&&(u.data=ut.param(u.data,u.traditional)),J(Fe,u,i,x),d)return x;h=ut.event&&u.global,h&&0==ut.active++&&ut.event.trigger("ajaxStart"),u.type=u.type.toUpperCase(),u.hasContent=!De.test(u.type),s=u.url.replace(Be,""),u.hasContent?u.data&&u.processData&&0===(u.contentType||"").indexOf("application/x-www-form-urlencoded")&&(u.data=u.data.replace(Me,"+")):(m=u.url.slice(s.length),u.data&&(s+=(Ae.test(s)?"&":"?")+u.data,delete u.data),!1===u.cache&&(s=s.replace(Ue,"$1"),m=(Ae.test(s)?"&":"?")+"_="+Se+++m),u.url=s+m),u.ifModified&&(ut.lastModified[s]&&x.setRequestHeader("If-Modified-Since",ut.lastModified[s]),ut.etag[s]&&x.setRequestHeader("If-None-Match",ut.etag[s])),(u.data&&u.hasContent&&!1!==u.contentType||i.contentType)&&x.setRequestHeader("Content-Type",u.contentType),x.setRequestHeader("Accept",u.dataTypes[0]&&u.accepts[u.dataTypes[0]]?u.accepts[u.dataTypes[0]]+("*"!==u.dataTypes[0]?", "+He+"; q=0.01":""):u.accepts["*"]);for(p in u.headers)x.setRequestHeader(p,u.headers[p]);if(u.beforeSend&&(!1===u.beforeSend.call(g,x,u)||d))return x.abort();if(w="abort",C.add(u.complete),x.done(u.success),x.fail(u.error),o=J(Le,u,i,x)){if(x.readyState=1,h&&b.trigger("ajaxSend",[x,u]),d)return x;u.async&&u.timeout>0&&(l=t.setTimeout(function(){x.abort("timeout")},u.timeout));try{d=!1,o.send(_,n)}catch(t){if(d)throw t;n(-1,t)}}else n(-1,"No Transport");return x},getJSON:function(t,e,i){return ut.get(t,e,i,"json")},getScript:function(t,e){return ut.get(t,void 0,e,"script")}}),ut.each(["get","post"],function(t,e){ut[e]=function(t,i,n,o){return ut.isFunction(i)&&(o=o||n,n=i,i=void 0),ut.ajax(ut.extend({url:t,type:e,dataType:o,data:i,success:n},ut.isPlainObject(t)&&t))}}),ut._evalUrl=function(t){return ut.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},ut.fn.extend({wrapAll:function(t){var e;return this[0]&&(ut.isFunction(t)&&(t=t.call(this[0])),e=ut(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t}).append(this)),this},wrapInner:function(t){return ut.isFunction(t)?this.each(function(e){ut(this).wrapInner(t.call(this,e))}):this.each(function(){var e=ut(this),i=e.contents();i.length?i.wrapAll(t):e.append(t)})},wrap:function(t){var e=ut.isFunction(t);return this.each(function(i){ut(this).wrapAll(e?t.call(this,i):t)})},unwrap:function(t){return this.parent(t).not("body").each(function(){ut(this).replaceWith(this.childNodes)}),this}}),ut.expr.pseudos.hidden=function(t){return!ut.expr.pseudos.visible(t)},ut.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},ut.ajaxSettings.xhr=function(){try{return new t.XMLHttpRequest}catch(t){}};var Oe={0:200,1223:204},ze=ut.ajaxSettings.xhr();mt.cors=!!ze&&"withCredentials"in ze,mt.ajax=ze=!!ze,ut.ajaxTransport(function(e){var i,n;if(mt.cors||ze&&!e.crossDomain)return{send:function(o,s){var a,r=e.xhr();if(r.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)r[a]=e.xhrFields[a];e.mimeType&&r.overrideMimeType&&r.overrideMimeType(e.mimeType),e.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest");for(a in o)r.setRequestHeader(a,o[a]);i=function(t){return function(){i&&(i=n=r.onload=r.onerror=r.onabort=r.onreadystatechange=null,"abort"===t?r.abort():"error"===t?"number"!=typeof r.status?s(0,"error"):s(r.status,r.statusText):s(Oe[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=i(),n=r.onerror=i("error"),void 0!==r.onabort?r.onabort=n:r.onreadystatechange=function(){4===r.readyState&&t.setTimeout(function(){i&&n()})},i=i("abort");try{r.send(e.hasContent&&e.data||null)}catch(t){if(i)throw t}},abort:function(){i&&i()}}}),ut.ajaxPrefilter(function(t){t.crossDomain&&(t.contents.script=!1)}),ut.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return ut.globalEval(t),t}}}),ut.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),ut.ajaxTransport("script",function(t){if(t.crossDomain){var e,i;return{send:function(n,o){e=ut(" + - \ No newline at end of file + diff --git a/www/common/onlyoffice/v2b/web-apps/apps/presentationeditor/main/app.js b/www/common/onlyoffice/v2b/web-apps/apps/presentationeditor/main/app.js index a8b350817..f5e3ee15c 100644 --- a/www/common/onlyoffice/v2b/web-apps/apps/presentationeditor/main/app.js +++ b/www/common/onlyoffice/v2b/web-apps/apps/presentationeditor/main/app.js @@ -10,7 +10,7 @@ i||Ae.test(t)?n(t,o):Y(t+"["+("object"==typeof o&&null!=o?e:"")+"]",o,i,n)});els t.console&&t.console.warn&&e&&Et.test(e.name)&&t.console.warn("jQuery.Deferred exception: "+e.message,e.stack,i)},mt.readyException=function(e){t.setTimeout(function(){throw e})};var Mt=mt.Deferred();mt.fn.ready=function(t){return Mt.then(t).catch(function(t){mt.readyException(t)}),this},mt.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--mt.readyWait:mt.isReady)||(mt.isReady=!0,!0!==t&&--mt.readyWait>0||Mt.resolveWith(it,[mt]))}}),mt.ready.then=Mt.then,"complete"===it.readyState||"loading"!==it.readyState&&!it.documentElement.doScroll?t.setTimeout(mt.ready):(it.addEventListener("DOMContentLoaded",d),t.addEventListener("load",d));var Ut=function(t,e,i,n,o,s,a){var l=0,r=t.length,c=null==i;if("object"===mt.type(i)){o=!0;for(l in i)Ut(t,e,l,i[l],!0,s,a)}else if(void 0!==n&&(o=!0,mt.isFunction(n)||(a=!0),c&&(a?(e.call(t,n),e=null):(c=e,e=function(t,e,i){return c.call(mt(t),i)})),e))for(;l1,null,!0)},removeData:function(t){return this.each(function(){Bt.remove(this,t)})}}),mt.extend({queue:function(t,e,i){var n;if(t)return e=(e||"fx")+"queue",n=Ft.get(t,e),i&&(!n||Array.isArray(i)?n=Ft.access(t,e,mt.makeArray(i)):n.push(i)),n||[]},dequeue:function(t,e){e=e||"fx";var i=mt.queue(t,e),n=i.length,o=i.shift(),s=mt._queueHooks(t,e),a=function(){mt.dequeue(t,e)};"inprogress"===o&&(o=i.shift(),n--),o&&("fx"===e&&i.unshift("inprogress"),delete s.stop,o.call(t,a,s)),!n&&s&&s.empty.fire()},_queueHooks:function(t,e){var i=e+"queueHooks";return Ft.get(t,i)||Ft.access(t,i,{empty:mt.Callbacks("once memory").add(function(){Ft.remove(t,[e+"queue",i])})})}}),mt.fn.extend({queue:function(t,e){var i=2;return"string"!=typeof t&&(e=t,t="fx",i--),arguments.length\x20\t\r\n\f]+)/i,Wt=/^$|\/(?:java|ecma)script/i,qt={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};qt.optgroup=qt.option,qt.tbody=qt.tfoot=qt.colgroup=qt.caption=qt.thead,qt.th=qt.td;var Kt=/<|&#?\w+;/;!function(){var t=it.createDocumentFragment(),e=t.appendChild(it.createElement("div")),i=it.createElement("input");i.setAttribute("type","radio"),i.setAttribute("checked","checked"),i.setAttribute("name","t"),e.appendChild(i),ut.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="",ut.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var Yt=it.documentElement,Xt=/^key/,Zt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Jt=/^([^.]*)(?:\.(.+)|)/;mt.event={global:{},add:function(t,e,i,n,o){var s,a,l,r,c,h,d,p,u,m,g,f=Ft.get(t);if(f)for(i.handler&&(s=i,i=s.handler,o=s.selector),o&&mt.find.matchesSelector(Yt,o),i.guid||(i.guid=mt.guid++),(r=f.events)||(r=f.events={}),(a=f.handle)||(a=f.handle=function(e){return void 0!==mt&&mt.event.triggered!==e.type?mt.event.dispatch.apply(t,arguments):void 0}),e=(e||"").match(Pt)||[""],c=e.length;c--;)l=Jt.exec(e[c])||[],u=g=l[1],m=(l[2]||"").split(".").sort(),u&&(d=mt.event.special[u]||{},u=(o?d.delegateType:d.bindType)||u,d=mt.event.special[u]||{},h=mt.extend({type:u,origType:g,data:n,handler:i,guid:i.guid,selector:o,needsContext:o&&mt.expr.match.needsContext.test(o),namespace:m.join(".")},s),(p=r[u])||(p=r[u]=[],p.delegateCount=0,d.setup&&!1!==d.setup.call(t,n,m,a)||t.addEventListener&&t.addEventListener(u,a)),d.add&&(d.add.call(t,h),h.handler.guid||(h.handler.guid=i.guid)),o?p.splice(p.delegateCount++,0,h):p.push(h),mt.event.global[u]=!0)},remove:function(t,e,i,n,o){var s,a,l,r,c,h,d,p,u,m,g,f=Ft.hasData(t)&&Ft.get(t);if(f&&(r=f.events)){for(e=(e||"").match(Pt)||[""],c=e.length;c--;)if(l=Jt.exec(e[c])||[],u=g=l[1],m=(l[2]||"").split(".").sort(),u){for(d=mt.event.special[u]||{},u=(n?d.delegateType:d.bindType)||u,p=r[u]||[],l=l[2]&&new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=s=p.length;s--;)h=p[s],!o&&g!==h.origType||i&&i.guid!==h.guid||l&&!l.test(h.namespace)||n&&n!==h.selector&&("**"!==n||!h.selector)||(p.splice(s,1),h.selector&&p.delegateCount--,d.remove&&d.remove.call(t,h));a&&!p.length&&(d.teardown&&!1!==d.teardown.call(t,m,f.handle)||mt.removeEvent(t,u,f.handle),delete r[u])}else for(u in r)mt.event.remove(t,u+e[c],i,n,!0);mt.isEmptyObject(r)&&Ft.remove(t,"handle events")}},dispatch:function(t){var e,i,n,o,s,a,l=mt.event.fix(t),r=new Array(arguments.length),c=(Ft.get(this,"events")||{})[l.type]||[],h=mt.event.special[l.type]||{};for(r[0]=l,e=1;e=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==t.type||!0!==c.disabled)){for(s=[],a={},i=0;i-1:mt.find(o,this,null,[c]).length),a[o]&&s.push(n);s.length&&l.push({elem:c,handlers:s})}return c=this,r\x20\t\r\n\f]*)[^>]*)\/>/gi,te=/\s*$/g;mt.extend({htmlPrefilter:function(t){return t.replace(Qt,"<$1>")},clone:function(t,e,i){var n,o,s,a,l=t.cloneNode(!0),r=mt.contains(t.ownerDocument,t);if(!(ut.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||mt.isXMLDoc(t)))for(a=C(l),s=C(t),n=0,o=s.length;n0&&v(a,!r&&C(t,"script")),l},cleanData:function(t){for(var e,i,n,o=mt.event.special,s=0;void 0!==(i=t[s]);s++)if(Dt(i)){if(e=i[Ft.expando]){if(e.events)for(n in e.events)o[n]?mt.event.remove(i,n):mt.removeEvent(i,n,e.handle);i[Ft.expando]=void 0}i[Bt.expando]&&(i[Bt.expando]=void 0)}}}),mt.fn.extend({detach:function(t){return M(this,t,!0)},remove:function(t){return M(this,t)},text:function(t){return Ut(this,function(t){return void 0===t?mt.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)})},null,t,arguments.length)},append:function(){return E(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){T(this,t).appendChild(t)}})},prepend:function(){return E(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=T(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return E(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return E(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(mt.cleanData(C(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map(function(){return mt.clone(this,t,e)})},html:function(t){return Ut(this,function(t){var e=this[0]||{},i=0,n=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!te.test(t)&&!qt[(jt.exec(t)||["",""])[1].toLowerCase()]){t=mt.htmlPrefilter(t);try{for(;i1)}}),mt.Tween=O,O.prototype={constructor:O,init:function(t,e,i,n,o,s){this.elem=t,this.prop=i,this.easing=o||mt.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=n,this.unit=s||(mt.cssNumber[i]?"":"px")},cur:function(){var t=O.propHooks[this.prop];return t&&t.get?t.get(this):O.propHooks._default.get(this)},run:function(t){var e,i=O.propHooks[this.prop];return this.options.duration?this.pos=e=mt.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):O.propHooks._default.set(this),this}},O.prototype.init.prototype=O.prototype,O.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=mt.css(t.elem,t.prop,""),e&&"auto"!==e?e:0)},set:function(t){mt.fx.step[t.prop]?mt.fx.step[t.prop](t):1!==t.elem.nodeType||null==t.elem.style[mt.cssProps[t.prop]]&&!mt.cssHooks[t.prop]?t.elem[t.prop]=t.now:mt.style(t.elem,t.prop,t.now+t.unit)}}},O.propHooks.scrollTop=O.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},mt.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},mt.fx=O.prototype.init,mt.fx.step={};var ue,me,ge=/^(?:toggle|show|hide)$/,fe=/queueHooks$/;mt.Animation=mt.extend(W,{tweeners:{"*":[function(t,e){var i=this.createTween(t,e);return g(i.elem,t,Ot.exec(e),i),i}]},tweener:function(t,e){mt.isFunction(t)?(e=t,t=["*"]):t=t.match(Pt);for(var i,n=0,o=t.length;n1)},removeAttr:function(t){return this.each(function(){mt.removeAttr(this,t)})}}),mt.extend({attr:function(t,e,i){var n,o,s=t.nodeType;if(3!==s&&8!==s&&2!==s)return void 0===t.getAttribute?mt.prop(t,e,i):(1===s&&mt.isXMLDoc(t)||(o=mt.attrHooks[e.toLowerCase()]||(mt.expr.match.bool.test(e)?be:void 0)),void 0!==i?null===i?void mt.removeAttr(t,e):o&&"set"in o&&void 0!==(n=o.set(t,i,e))?n:(t.setAttribute(e,i+""),i):o&&"get"in o&&null!==(n=o.get(t,e))?n:(n=mt.find.attr(t,e),null==n?void 0:n))},attrHooks:{type:{set:function(t,e){if(!ut.radioValue&&"radio"===e&&o(t,"input")){var i=t.value;return t.setAttribute("type",e),i&&(t.value=i),e}}}},removeAttr:function(t,e){var i,n=0,o=e&&e.match(Pt);if(o&&1===t.nodeType)for(;i=o[n++];)t.removeAttribute(i)}}),be={set:function(t,e,i){return!1===e?mt.removeAttr(t,i):t.setAttribute(i,i),i}},mt.each(mt.expr.match.bool.source.match(/\w+/g),function(t,e){var i=Ce[e]||mt.find.attr;Ce[e]=function(t,e,n){var o,s,a=e.toLowerCase();return n||(s=Ce[a],Ce[a]=o,o=null!=i(t,e,n)?a:null,Ce[a]=s),o}});var ve=/^(?:input|select|textarea|button)$/i,_e=/^(?:a|area)$/i;mt.fn.extend({prop:function(t,e){return Ut(this,mt.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each(function(){delete this[mt.propFix[t]||t]})}}),mt.extend({prop:function(t,e,i){var n,o,s=t.nodeType;if(3!==s&&8!==s&&2!==s)return 1===s&&mt.isXMLDoc(t)||(e=mt.propFix[e]||e,o=mt.propHooks[e]),void 0!==i?o&&"set"in o&&void 0!==(n=o.set(t,i,e))?n:t[e]=i:o&&"get"in o&&null!==(n=o.get(t,e))?n:t[e]},propHooks:{tabIndex:{get:function(t){var e=mt.find.attr(t,"tabindex");return e?parseInt(e,10):ve.test(t.nodeName)||_e.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),ut.optSelected||(mt.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),mt.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){mt.propFix[this.toLowerCase()]=this}),mt.fn.extend({addClass:function(t){var e,i,n,o,s,a,l,r=0;if(mt.isFunction(t))return this.each(function(e){mt(this).addClass(t.call(this,e,K(this)))});if("string"==typeof t&&t)for(e=t.match(Pt)||[];i=this[r++];)if(o=K(i),n=1===i.nodeType&&" "+q(o)+" "){for(a=0;s=e[a++];)n.indexOf(" "+s+" ")<0&&(n+=s+" ");l=q(n),o!==l&&i.setAttribute("class",l)}return this},removeClass:function(t){var e,i,n,o,s,a,l,r=0;if(mt.isFunction(t))return this.each(function(e){mt(this).removeClass(t.call(this,e,K(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof t&&t)for(e=t.match(Pt)||[];i=this[r++];)if(o=K(i),n=1===i.nodeType&&" "+q(o)+" "){for(a=0;s=e[a++];)for(;n.indexOf(" "+s+" ")>-1;)n=n.replace(" "+s+" "," ");l=q(n),o!==l&&i.setAttribute("class",l)}return this},toggleClass:function(t,e){var i=typeof t;return"boolean"==typeof e&&"string"===i?e?this.addClass(t):this.removeClass(t):mt.isFunction(t)?this.each(function(i){mt(this).toggleClass(t.call(this,i,K(this),e),e)}):this.each(function(){var e,n,o,s;if("string"===i)for(n=0,o=mt(this),s=t.match(Pt)||[];e=s[n++];)o.hasClass(e)?o.removeClass(e):o.addClass(e);else void 0!==t&&"boolean"!==i||(e=K(this),e&&Ft.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":Ft.get(this,"__className__")||""))})},hasClass:function(t){var e,i,n=0;for(e=" "+t+" ";i=this[n++];)if(1===i.nodeType&&(" "+q(K(i))+" ").indexOf(e)>-1)return!0;return!1}});var ye=/\r/g;mt.fn.extend({val:function(t){var e,i,n,o=this[0];{if(arguments.length)return n=mt.isFunction(t),this.each(function(i){var o;1===this.nodeType&&(o=n?t.call(this,i,mt(this).val()):t,null==o?o="":"number"==typeof o?o+="":Array.isArray(o)&&(o=mt.map(o,function(t){return null==t?"":t+""})),(e=mt.valHooks[this.type]||mt.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,o,"value")||(this.value=o))});if(o)return(e=mt.valHooks[o.type]||mt.valHooks[o.nodeName.toLowerCase()])&&"get"in e&&void 0!==(i=e.get(o,"value"))?i:(i=o.value,"string"==typeof i?i.replace(ye,""):null==i?"":i)}}}),mt.extend({valHooks:{option:{get:function(t){var e=mt.find.attr(t,"value");return null!=e?e:q(mt.text(t))}},select:{get:function(t){var e,i,n,s=t.options,a=t.selectedIndex,l="select-one"===t.type,r=l?null:[],c=l?a+1:s.length;for(n=a<0?c:l?a:0;n-1)&&(i=!0);return i||(t.selectedIndex=-1),s}}}}),mt.each(["radio","checkbox"],function(){mt.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=mt.inArray(mt(t).val(),e)>-1}},ut.checkOn||(mt.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})});var we=/^(?:focusinfocus|focusoutblur)$/;mt.extend(mt.event,{trigger:function(e,i,n,o){var s,a,l,r,c,h,d,p=[n||it],u=ht.call(e,"type")?e.type:e,m=ht.call(e,"namespace")?e.namespace.split("."):[];if(a=l=n=n||it,3!==n.nodeType&&8!==n.nodeType&&!we.test(u+mt.event.triggered)&&(u.indexOf(".")>-1&&(m=u.split("."),u=m.shift(),m.sort()),c=u.indexOf(":")<0&&"on"+u,e=e[mt.expando]?e:new mt.Event(u,"object"==typeof e&&e),e.isTrigger=o?2:3,e.namespace=m.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),i=null==i?[e]:mt.makeArray(i,[e]),d=mt.event.special[u]||{},o||!d.trigger||!1!==d.trigger.apply(n,i))){if(!o&&!d.noBubble&&!mt.isWindow(n)){for(r=d.delegateType||u,we.test(r+u)||(a=a.parentNode);a;a=a.parentNode)p.push(a),l=a;l===(n.ownerDocument||it)&&p.push(l.defaultView||l.parentWindow||t)}for(s=0;(a=p[s++])&&!e.isPropagationStopped();)e.type=s>1?r:d.bindType||u,h=(Ft.get(a,"events")||{})[e.type]&&Ft.get(a,"handle"),h&&h.apply(a,i),(h=c&&a[c])&&h.apply&&Dt(a)&&(e.result=h.apply(a,i),!1===e.result&&e.preventDefault());return e.type=u,o||e.isDefaultPrevented()||d._default&&!1!==d._default.apply(p.pop(),i)||!Dt(n)||c&&mt.isFunction(n[u])&&!mt.isWindow(n)&&(l=n[c],l&&(n[c]=null),mt.event.triggered=u,n[u](),mt.event.triggered=void 0,l&&(n[c]=l)),e.result}},simulate:function(t,e,i){var n=mt.extend(new mt.Event,i,{type:t,isSimulated:!0});mt.event.trigger(n,null,e)}}),mt.fn.extend({trigger:function(t,e){return this.each(function(){mt.event.trigger(t,e,this)})},triggerHandler:function(t,e){var i=this[0];if(i)return mt.event.trigger(t,e,i,!0)}}),mt.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(t,e){mt.fn[e]=function(t,i){return arguments.length>0?this.on(e,null,t,i):this.trigger(e)}}),mt.fn.extend({hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),ut.focusin="onfocusin"in t,ut.focusin||mt.each({focus:"focusin",blur:"focusout"},function(t,e){var i=function(t){mt.event.simulate(e,t.target,mt.event.fix(t))};mt.event.special[e]={setup:function(){var n=this.ownerDocument||this,o=Ft.access(n,e);o||n.addEventListener(t,i,!0),Ft.access(n,e,(o||0)+1)},teardown:function(){var n=this.ownerDocument||this,o=Ft.access(n,e)-1;o?Ft.access(n,e,o):(n.removeEventListener(t,i,!0),Ft.remove(n,e))}}});var xe=t.location,Se=mt.now(),Te=/\?/;mt.parseXML=function(e){var i;if(!e||"string"!=typeof e)return null;try{i=(new t.DOMParser).parseFromString(e,"text/xml")}catch(t){i=void 0}return i&&!i.getElementsByTagName("parsererror").length||mt.error("Invalid XML: "+e),i};var Ae=/\[\]$/,ke=/\r?\n/g,Ie=/^(?:submit|button|image|reset|file)$/i,Pe=/^(?:input|select|textarea|keygen)/i;mt.param=function(t,e){var i,n=[],o=function(t,e){var i=mt.isFunction(e)?e():e;n[n.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==i?"":i)};if(Array.isArray(t)||t.jquery&&!mt.isPlainObject(t))mt.each(t,function(){o(this.name,this.value)});else for(i in t)Y(i,t[i],e,o);return n.join("&")},mt.fn.extend({serialize:function(){return mt.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=mt.prop(this,"elements");return t?mt.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!mt(this).is(":disabled")&&Pe.test(this.nodeName)&&!Ie.test(t)&&(this.checked||!Gt.test(t))}).map(function(t,e){var i=mt(this).val();return null==i?null:Array.isArray(i)?mt.map(i,function(t){return{name:e.name,value:t.replace(ke,"\r\n")}}):{name:e.name,value:i.replace(ke,"\r\n")}}).get()}});var Ee=/%20/g,Me=/#.*$/,Ue=/([?&])_=[^&]*/,De=/^(.*?):[ \t]*([^\r\n]*)$/gm,Fe=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Be=/^(?:GET|HEAD)$/,Le=/^\/\//,Ve={},Re={},Oe="*/".concat("*"),Ne=it.createElement("a");Ne.href=xe.href,mt.extend({active:0,lastModified:{},etag:{},ajaxSettings:{ url:xe.href,type:"GET",isLocal:Fe.test(xe.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Oe,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":mt.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?J(J(t,mt.ajaxSettings),e):J(mt.ajaxSettings,t)},ajaxPrefilter:X(Ve),ajaxTransport:X(Re),ajax:function(e,i){function n(e,i,n,l){var c,p,u,_,y,w=i;h||(h=!0,r&&t.clearTimeout(r),o=void 0,a=l||"",x.readyState=e>0?4:0,c=e>=200&&e<300||304===e,n&&(_=Q(m,x,n)),_=tt(m,_,x,c),c?(m.ifModified&&(y=x.getResponseHeader("Last-Modified"),y&&(mt.lastModified[s]=y),(y=x.getResponseHeader("etag"))&&(mt.etag[s]=y)),204===e||"HEAD"===m.type?w="nocontent":304===e?w="notmodified":(w=_.state,p=_.data,u=_.error,c=!u)):(u=w,!e&&w||(w="error",e<0&&(e=0))),x.status=e,x.statusText=(i||w)+"",c?b.resolveWith(g,[p,w,x]):b.rejectWith(g,[x,w,u]),x.statusCode(v),v=void 0,d&&f.trigger(c?"ajaxSuccess":"ajaxError",[x,m,c?p:u]),C.fireWith(g,[x,w]),d&&(f.trigger("ajaxComplete",[x,m]),--mt.active||mt.event.trigger("ajaxStop")))}"object"==typeof e&&(i=e,e=void 0),i=i||{};var o,s,a,l,r,c,h,d,p,u,m=mt.ajaxSetup({},i),g=m.context||m,f=m.context&&(g.nodeType||g.jquery)?mt(g):mt.event,b=mt.Deferred(),C=mt.Callbacks("once memory"),v=m.statusCode||{},_={},y={},w="canceled",x={readyState:0,getResponseHeader:function(t){var e;if(h){if(!l)for(l={};e=De.exec(a);)l[e[1].toLowerCase()]=e[2];e=l[t.toLowerCase()]}return null==e?null:e},getAllResponseHeaders:function(){return h?a:null},setRequestHeader:function(t,e){return null==h&&(t=y[t.toLowerCase()]=y[t.toLowerCase()]||t,_[t]=e),this},overrideMimeType:function(t){return null==h&&(m.mimeType=t),this},statusCode:function(t){var e;if(t)if(h)x.always(t[x.status]);else for(e in t)v[e]=[v[e],t[e]];return this},abort:function(t){var e=t||w;return o&&o.abort(e),n(0,e),this}};if(b.promise(x),m.url=((e||m.url||xe.href)+"").replace(Le,xe.protocol+"//"),m.type=i.method||i.type||m.method||m.type,m.dataTypes=(m.dataType||"*").toLowerCase().match(Pt)||[""],null==m.crossDomain){c=it.createElement("a");try{c.href=m.url,c.href=c.href,m.crossDomain=Ne.protocol+"//"+Ne.host!=c.protocol+"//"+c.host}catch(t){m.crossDomain=!0}}if(m.data&&m.processData&&"string"!=typeof m.data&&(m.data=mt.param(m.data,m.traditional)),Z(Ve,m,i,x),h)return x;d=mt.event&&m.global,d&&0==mt.active++&&mt.event.trigger("ajaxStart"),m.type=m.type.toUpperCase(),m.hasContent=!Be.test(m.type),s=m.url.replace(Me,""),m.hasContent?m.data&&m.processData&&0===(m.contentType||"").indexOf("application/x-www-form-urlencoded")&&(m.data=m.data.replace(Ee,"+")):(u=m.url.slice(s.length),m.data&&(s+=(Te.test(s)?"&":"?")+m.data,delete m.data),!1===m.cache&&(s=s.replace(Ue,"$1"),u=(Te.test(s)?"&":"?")+"_="+Se+++u),m.url=s+u),m.ifModified&&(mt.lastModified[s]&&x.setRequestHeader("If-Modified-Since",mt.lastModified[s]),mt.etag[s]&&x.setRequestHeader("If-None-Match",mt.etag[s])),(m.data&&m.hasContent&&!1!==m.contentType||i.contentType)&&x.setRequestHeader("Content-Type",m.contentType),x.setRequestHeader("Accept",m.dataTypes[0]&&m.accepts[m.dataTypes[0]]?m.accepts[m.dataTypes[0]]+("*"!==m.dataTypes[0]?", "+Oe+"; q=0.01":""):m.accepts["*"]);for(p in m.headers)x.setRequestHeader(p,m.headers[p]);if(m.beforeSend&&(!1===m.beforeSend.call(g,x,m)||h))return x.abort();if(w="abort",C.add(m.complete),x.done(m.success),x.fail(m.error),o=Z(Re,m,i,x)){if(x.readyState=1,d&&f.trigger("ajaxSend",[x,m]),h)return x;m.async&&m.timeout>0&&(r=t.setTimeout(function(){x.abort("timeout")},m.timeout));try{h=!1,o.send(_,n)}catch(t){if(h)throw t;n(-1,t)}}else n(-1,"No Transport");return x},getJSON:function(t,e,i){return mt.get(t,e,i,"json")},getScript:function(t,e){return mt.get(t,void 0,e,"script")}}),mt.each(["get","post"],function(t,e){mt[e]=function(t,i,n,o){return mt.isFunction(i)&&(o=o||n,n=i,i=void 0),mt.ajax(mt.extend({url:t,type:e,dataType:o,data:i,success:n},mt.isPlainObject(t)&&t))}}),mt._evalUrl=function(t){return mt.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},mt.fn.extend({wrapAll:function(t){var e;return this[0]&&(mt.isFunction(t)&&(t=t.call(this[0])),e=mt(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t}).append(this)),this},wrapInner:function(t){return mt.isFunction(t)?this.each(function(e){mt(this).wrapInner(t.call(this,e))}):this.each(function(){var e=mt(this),i=e.contents();i.length?i.wrapAll(t):e.append(t)})},wrap:function(t){var e=mt.isFunction(t);return this.each(function(i){mt(this).wrapAll(e?t.call(this,i):t)})},unwrap:function(t){return this.parent(t).not("body").each(function(){mt(this).replaceWith(this.childNodes)}),this}}),mt.expr.pseudos.hidden=function(t){return!mt.expr.pseudos.visible(t)},mt.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},mt.ajaxSettings.xhr=function(){try{return new t.XMLHttpRequest}catch(t){}};var He={0:200,1223:204},$e=mt.ajaxSettings.xhr();ut.cors=!!$e&&"withCredentials"in $e,ut.ajax=$e=!!$e,mt.ajaxTransport(function(e){var i,n;if(ut.cors||$e&&!e.crossDomain)return{send:function(o,s){var a,l=e.xhr();if(l.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)l[a]=e.xhrFields[a];e.mimeType&&l.overrideMimeType&&l.overrideMimeType(e.mimeType),e.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest");for(a in o)l.setRequestHeader(a,o[a]);i=function(t){return function(){i&&(i=n=l.onload=l.onerror=l.onabort=l.onreadystatechange=null,"abort"===t?l.abort():"error"===t?"number"!=typeof l.status?s(0,"error"):s(l.status,l.statusText):s(He[l.status]||l.status,l.statusText,"text"!==(l.responseType||"text")||"string"!=typeof l.responseText?{binary:l.response}:{text:l.responseText},l.getAllResponseHeaders()))}},l.onload=i(),n=l.onerror=i("error"),void 0!==l.onabort?l.onabort=n:l.onreadystatechange=function(){4===l.readyState&&t.setTimeout(function(){i&&n()})},i=i("abort");try{l.send(e.hasContent&&e.data||null)}catch(t){if(i)throw t}},abort:function(){i&&i()}}}),mt.ajaxPrefilter(function(t){t.crossDomain&&(t.contents.script=!1)}),mt.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return mt.globalEval(t),t}}}),mt.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),mt.ajaxTransport("script",function(t){if(t.crossDomain){var e,i;return{send:function(n,o){e=mt(" + - \ No newline at end of file + diff --git a/www/common/onlyoffice/v2b/web-apps/apps/spreadsheeteditor/main/app.js b/www/common/onlyoffice/v2b/web-apps/apps/spreadsheeteditor/main/app.js index 8e2af06f9..928c3ab25 100644 --- a/www/common/onlyoffice/v2b/web-apps/apps/spreadsheeteditor/main/app.js +++ b/www/common/onlyoffice/v2b/web-apps/apps/spreadsheeteditor/main/app.js @@ -10,7 +10,7 @@ i||ke.test(t)?n(t,o):Y(t+"["+("object"==typeof o&&null!=o?e:"")+"]",o,i,n)});els t.console&&t.console.warn&&e&&Pt.test(e.name)&&t.console.warn("jQuery.Deferred exception: "+e.message,e.stack,i)},ut.readyException=function(e){t.setTimeout(function(){throw e})};var Mt=ut.Deferred();ut.fn.ready=function(t){return Mt.then(t).catch(function(t){ut.readyException(t)}),this},ut.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--ut.readyWait:ut.isReady)||(ut.isReady=!0,!0!==t&&--ut.readyWait>0||Mt.resolveWith(it,[ut]))}}),ut.ready.then=Mt.then,"complete"===it.readyState||"loading"!==it.readyState&&!it.documentElement.doScroll?t.setTimeout(ut.ready):(it.addEventListener("DOMContentLoaded",d),t.addEventListener("load",d));var Dt=function(t,e,i,n,o,s,a){var l=0,r=t.length,c=null==i;if("object"===ut.type(i)){o=!0;for(l in i)Dt(t,e,l,i[l],!0,s,a)}else if(void 0!==n&&(o=!0,ut.isFunction(n)||(a=!0),c&&(a?(e.call(t,n),e=null):(c=e,e=function(t,e,i){return c.call(ut(t),i)})),e))for(;l1,null,!0)},removeData:function(t){return this.each(function(){Vt.remove(this,t)})}}),ut.extend({queue:function(t,e,i){var n;if(t)return e=(e||"fx")+"queue",n=Ut.get(t,e),i&&(!n||Array.isArray(i)?n=Ut.access(t,e,ut.makeArray(i)):n.push(i)),n||[]},dequeue:function(t,e){e=e||"fx";var i=ut.queue(t,e),n=i.length,o=i.shift(),s=ut._queueHooks(t,e),a=function(){ut.dequeue(t,e)};"inprogress"===o&&(o=i.shift(),n--),o&&("fx"===e&&i.unshift("inprogress"),delete s.stop,o.call(t,a,s)),!n&&s&&s.empty.fire()},_queueHooks:function(t,e){var i=e+"queueHooks";return Ut.get(t,i)||Ut.access(t,i,{empty:ut.Callbacks("once memory").add(function(){Ut.remove(t,[e+"queue",i])})})}}),ut.fn.extend({queue:function(t,e){var i=2;return"string"!=typeof t&&(e=t,t="fx",i--),arguments.length\x20\t\r\n\f]+)/i,Wt=/^$|\/(?:java|ecma)script/i,qt={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};qt.optgroup=qt.option,qt.tbody=qt.tfoot=qt.colgroup=qt.caption=qt.thead,qt.th=qt.td;var Kt=/<|&#?\w+;/;!function(){var t=it.createDocumentFragment(),e=t.appendChild(it.createElement("div")),i=it.createElement("input");i.setAttribute("type","radio"),i.setAttribute("checked","checked"),i.setAttribute("name","t"),e.appendChild(i),mt.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="",mt.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var Yt=it.documentElement,Xt=/^key/,Jt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Zt=/^([^.]*)(?:\.(.+)|)/;ut.event={global:{},add:function(t,e,i,n,o){var s,a,l,r,c,h,d,p,m,u,g,b=Ut.get(t);if(b)for(i.handler&&(s=i,i=s.handler,o=s.selector),o&&ut.find.matchesSelector(Yt,o),i.guid||(i.guid=ut.guid++),(r=b.events)||(r=b.events={}),(a=b.handle)||(a=b.handle=function(e){return void 0!==ut&&ut.event.triggered!==e.type?ut.event.dispatch.apply(t,arguments):void 0}),e=(e||"").match(Et)||[""],c=e.length;c--;)l=Zt.exec(e[c])||[],m=g=l[1],u=(l[2]||"").split(".").sort(),m&&(d=ut.event.special[m]||{},m=(o?d.delegateType:d.bindType)||m,d=ut.event.special[m]||{},h=ut.extend({type:m,origType:g,data:n,handler:i,guid:i.guid,selector:o,needsContext:o&&ut.expr.match.needsContext.test(o),namespace:u.join(".")},s),(p=r[m])||(p=r[m]=[],p.delegateCount=0,d.setup&&!1!==d.setup.call(t,n,u,a)||t.addEventListener&&t.addEventListener(m,a)),d.add&&(d.add.call(t,h),h.handler.guid||(h.handler.guid=i.guid)),o?p.splice(p.delegateCount++,0,h):p.push(h),ut.event.global[m]=!0)},remove:function(t,e,i,n,o){var s,a,l,r,c,h,d,p,m,u,g,b=Ut.hasData(t)&&Ut.get(t);if(b&&(r=b.events)){for(e=(e||"").match(Et)||[""],c=e.length;c--;)if(l=Zt.exec(e[c])||[],m=g=l[1],u=(l[2]||"").split(".").sort(),m){for(d=ut.event.special[m]||{},m=(n?d.delegateType:d.bindType)||m,p=r[m]||[],l=l[2]&&new RegExp("(^|\\.)"+u.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=s=p.length;s--;)h=p[s],!o&&g!==h.origType||i&&i.guid!==h.guid||l&&!l.test(h.namespace)||n&&n!==h.selector&&("**"!==n||!h.selector)||(p.splice(s,1),h.selector&&p.delegateCount--,d.remove&&d.remove.call(t,h));a&&!p.length&&(d.teardown&&!1!==d.teardown.call(t,u,b.handle)||ut.removeEvent(t,m,b.handle),delete r[m])}else for(m in r)ut.event.remove(t,m+e[c],i,n,!0);ut.isEmptyObject(r)&&Ut.remove(t,"handle events")}},dispatch:function(t){var e,i,n,o,s,a,l=ut.event.fix(t),r=new Array(arguments.length),c=(Ut.get(this,"events")||{})[l.type]||[],h=ut.event.special[l.type]||{};for(r[0]=l,e=1;e=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==t.type||!0!==c.disabled)){for(s=[],a={},i=0;i-1:ut.find(o,this,null,[c]).length),a[o]&&s.push(n);s.length&&l.push({elem:c,handlers:s})}return c=this,r\x20\t\r\n\f]*)[^>]*)\/>/gi,te=/\s*$/g;ut.extend({htmlPrefilter:function(t){return t.replace(Qt,"<$1>")},clone:function(t,e,i){var n,o,s,a,l=t.cloneNode(!0),r=ut.contains(t.ownerDocument,t);if(!(mt.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||ut.isXMLDoc(t)))for(a=C(l),s=C(t),n=0,o=s.length;n0&&v(a,!r&&C(t,"script")),l},cleanData:function(t){for(var e,i,n,o=ut.event.special,s=0;void 0!==(i=t[s]);s++)if(Ft(i)){if(e=i[Ut.expando]){if(e.events)for(n in e.events)o[n]?ut.event.remove(i,n):ut.removeEvent(i,n,e.handle);i[Ut.expando]=void 0}i[Vt.expando]&&(i[Vt.expando]=void 0)}}}),ut.fn.extend({detach:function(t){return M(this,t,!0)},remove:function(t){return M(this,t)},text:function(t){return Dt(this,function(t){return void 0===t?ut.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)})},null,t,arguments.length)},append:function(){return P(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){A(this,t).appendChild(t)}})},prepend:function(){return P(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=A(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return P(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return P(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(ut.cleanData(C(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map(function(){return ut.clone(this,t,e)})},html:function(t){return Dt(this,function(t){var e=this[0]||{},i=0,n=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!te.test(t)&&!qt[(jt.exec(t)||["",""])[1].toLowerCase()]){t=ut.htmlPrefilter(t);try{for(;i1)}}),ut.Tween=N,N.prototype={constructor:N,init:function(t,e,i,n,o,s){this.elem=t,this.prop=i,this.easing=o||ut.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=n,this.unit=s||(ut.cssNumber[i]?"":"px")},cur:function(){var t=N.propHooks[this.prop];return t&&t.get?t.get(this):N.propHooks._default.get(this)},run:function(t){var e,i=N.propHooks[this.prop];return this.options.duration?this.pos=e=ut.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):N.propHooks._default.set(this),this}},N.prototype.init.prototype=N.prototype,N.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=ut.css(t.elem,t.prop,""),e&&"auto"!==e?e:0)},set:function(t){ut.fx.step[t.prop]?ut.fx.step[t.prop](t):1!==t.elem.nodeType||null==t.elem.style[ut.cssProps[t.prop]]&&!ut.cssHooks[t.prop]?t.elem[t.prop]=t.now:ut.style(t.elem,t.prop,t.now+t.unit)}}},N.propHooks.scrollTop=N.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},ut.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},ut.fx=N.prototype.init,ut.fx.step={};var me,ue,ge=/^(?:toggle|show|hide)$/,be=/queueHooks$/;ut.Animation=ut.extend(W,{tweeners:{"*":[function(t,e){var i=this.createTween(t,e);return g(i.elem,t,Nt.exec(e),i),i}]},tweener:function(t,e){ut.isFunction(t)?(e=t,t=["*"]):t=t.match(Et);for(var i,n=0,o=t.length;n1)},removeAttr:function(t){return this.each(function(){ut.removeAttr(this,t)})}}),ut.extend({attr:function(t,e,i){var n,o,s=t.nodeType;if(3!==s&&8!==s&&2!==s)return void 0===t.getAttribute?ut.prop(t,e,i):(1===s&&ut.isXMLDoc(t)||(o=ut.attrHooks[e.toLowerCase()]||(ut.expr.match.bool.test(e)?fe:void 0)),void 0!==i?null===i?void ut.removeAttr(t,e):o&&"set"in o&&void 0!==(n=o.set(t,i,e))?n:(t.setAttribute(e,i+""),i):o&&"get"in o&&null!==(n=o.get(t,e))?n:(n=ut.find.attr(t,e),null==n?void 0:n))},attrHooks:{type:{set:function(t,e){if(!mt.radioValue&&"radio"===e&&o(t,"input")){var i=t.value;return t.setAttribute("type",e),i&&(t.value=i),e}}}},removeAttr:function(t,e){var i,n=0,o=e&&e.match(Et);if(o&&1===t.nodeType)for(;i=o[n++];)t.removeAttribute(i)}}),fe={set:function(t,e,i){return!1===e?ut.removeAttr(t,i):t.setAttribute(i,i),i}},ut.each(ut.expr.match.bool.source.match(/\w+/g),function(t,e){var i=Ce[e]||ut.find.attr;Ce[e]=function(t,e,n){var o,s,a=e.toLowerCase();return n||(s=Ce[a],Ce[a]=o,o=null!=i(t,e,n)?a:null,Ce[a]=s),o}});var ve=/^(?:input|select|textarea|button)$/i,_e=/^(?:a|area)$/i;ut.fn.extend({prop:function(t,e){return Dt(this,ut.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each(function(){delete this[ut.propFix[t]||t]})}}),ut.extend({prop:function(t,e,i){var n,o,s=t.nodeType;if(3!==s&&8!==s&&2!==s)return 1===s&&ut.isXMLDoc(t)||(e=ut.propFix[e]||e,o=ut.propHooks[e]),void 0!==i?o&&"set"in o&&void 0!==(n=o.set(t,i,e))?n:t[e]=i:o&&"get"in o&&null!==(n=o.get(t,e))?n:t[e]},propHooks:{tabIndex:{get:function(t){var e=ut.find.attr(t,"tabindex");return e?parseInt(e,10):ve.test(t.nodeName)||_e.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),mt.optSelected||(ut.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),ut.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){ut.propFix[this.toLowerCase()]=this}),ut.fn.extend({addClass:function(t){var e,i,n,o,s,a,l,r=0;if(ut.isFunction(t))return this.each(function(e){ut(this).addClass(t.call(this,e,K(this)))});if("string"==typeof t&&t)for(e=t.match(Et)||[];i=this[r++];)if(o=K(i),n=1===i.nodeType&&" "+q(o)+" "){for(a=0;s=e[a++];)n.indexOf(" "+s+" ")<0&&(n+=s+" ");l=q(n),o!==l&&i.setAttribute("class",l)}return this},removeClass:function(t){var e,i,n,o,s,a,l,r=0;if(ut.isFunction(t))return this.each(function(e){ut(this).removeClass(t.call(this,e,K(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof t&&t)for(e=t.match(Et)||[];i=this[r++];)if(o=K(i),n=1===i.nodeType&&" "+q(o)+" "){for(a=0;s=e[a++];)for(;n.indexOf(" "+s+" ")>-1;)n=n.replace(" "+s+" "," ");l=q(n),o!==l&&i.setAttribute("class",l)}return this},toggleClass:function(t,e){var i=typeof t;return"boolean"==typeof e&&"string"===i?e?this.addClass(t):this.removeClass(t):ut.isFunction(t)?this.each(function(i){ut(this).toggleClass(t.call(this,i,K(this),e),e)}):this.each(function(){var e,n,o,s;if("string"===i)for(n=0,o=ut(this),s=t.match(Et)||[];e=s[n++];)o.hasClass(e)?o.removeClass(e):o.addClass(e);else void 0!==t&&"boolean"!==i||(e=K(this),e&&Ut.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":Ut.get(this,"__className__")||""))})},hasClass:function(t){var e,i,n=0;for(e=" "+t+" ";i=this[n++];)if(1===i.nodeType&&(" "+q(K(i))+" ").indexOf(e)>-1)return!0;return!1}});var ye=/\r/g;ut.fn.extend({val:function(t){var e,i,n,o=this[0];{if(arguments.length)return n=ut.isFunction(t),this.each(function(i){var o;1===this.nodeType&&(o=n?t.call(this,i,ut(this).val()):t,null==o?o="":"number"==typeof o?o+="":Array.isArray(o)&&(o=ut.map(o,function(t){return null==t?"":t+""})),(e=ut.valHooks[this.type]||ut.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,o,"value")||(this.value=o))});if(o)return(e=ut.valHooks[o.type]||ut.valHooks[o.nodeName.toLowerCase()])&&"get"in e&&void 0!==(i=e.get(o,"value"))?i:(i=o.value,"string"==typeof i?i.replace(ye,""):null==i?"":i)}}}),ut.extend({valHooks:{option:{get:function(t){var e=ut.find.attr(t,"value");return null!=e?e:q(ut.text(t))}},select:{get:function(t){var e,i,n,s=t.options,a=t.selectedIndex,l="select-one"===t.type,r=l?null:[],c=l?a+1:s.length;for(n=a<0?c:l?a:0;n-1)&&(i=!0);return i||(t.selectedIndex=-1),s}}}}),ut.each(["radio","checkbox"],function(){ut.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=ut.inArray(ut(t).val(),e)>-1}},mt.checkOn||(ut.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})});var xe=/^(?:focusinfocus|focusoutblur)$/;ut.extend(ut.event,{trigger:function(e,i,n,o){var s,a,l,r,c,h,d,p=[n||it],m=ht.call(e,"type")?e.type:e,u=ht.call(e,"namespace")?e.namespace.split("."):[];if(a=l=n=n||it,3!==n.nodeType&&8!==n.nodeType&&!xe.test(m+ut.event.triggered)&&(m.indexOf(".")>-1&&(u=m.split("."),m=u.shift(),u.sort()),c=m.indexOf(":")<0&&"on"+m,e=e[ut.expando]?e:new ut.Event(m,"object"==typeof e&&e),e.isTrigger=o?2:3,e.namespace=u.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+u.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),i=null==i?[e]:ut.makeArray(i,[e]),d=ut.event.special[m]||{},o||!d.trigger||!1!==d.trigger.apply(n,i))){if(!o&&!d.noBubble&&!ut.isWindow(n)){for(r=d.delegateType||m,xe.test(r+m)||(a=a.parentNode);a;a=a.parentNode)p.push(a),l=a;l===(n.ownerDocument||it)&&p.push(l.defaultView||l.parentWindow||t)}for(s=0;(a=p[s++])&&!e.isPropagationStopped();)e.type=s>1?r:d.bindType||m,h=(Ut.get(a,"events")||{})[e.type]&&Ut.get(a,"handle"),h&&h.apply(a,i),(h=c&&a[c])&&h.apply&&Ft(a)&&(e.result=h.apply(a,i),!1===e.result&&e.preventDefault());return e.type=m,o||e.isDefaultPrevented()||d._default&&!1!==d._default.apply(p.pop(),i)||!Ft(n)||c&&ut.isFunction(n[m])&&!ut.isWindow(n)&&(l=n[c],l&&(n[c]=null),ut.event.triggered=m,n[m](),ut.event.triggered=void 0,l&&(n[c]=l)),e.result}},simulate:function(t,e,i){var n=ut.extend(new ut.Event,i,{type:t,isSimulated:!0});ut.event.trigger(n,null,e)}}),ut.fn.extend({trigger:function(t,e){return this.each(function(){ut.event.trigger(t,e,this)})},triggerHandler:function(t,e){var i=this[0];if(i)return ut.event.trigger(t,e,i,!0)}}),ut.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(t,e){ut.fn[e]=function(t,i){return arguments.length>0?this.on(e,null,t,i):this.trigger(e)}}),ut.fn.extend({hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),mt.focusin="onfocusin"in t,mt.focusin||ut.each({focus:"focusin",blur:"focusout"},function(t,e){var i=function(t){ut.event.simulate(e,t.target,ut.event.fix(t))};ut.event.special[e]={setup:function(){var n=this.ownerDocument||this,o=Ut.access(n,e);o||n.addEventListener(t,i,!0),Ut.access(n,e,(o||0)+1)},teardown:function(){var n=this.ownerDocument||this,o=Ut.access(n,e)-1;o?Ut.access(n,e,o):(n.removeEventListener(t,i,!0),Ut.remove(n,e))}}});var we=t.location,Se=ut.now(),Ae=/\?/;ut.parseXML=function(e){var i;if(!e||"string"!=typeof e)return null;try{i=(new t.DOMParser).parseFromString(e,"text/xml")}catch(t){i=void 0}return i&&!i.getElementsByTagName("parsererror").length||ut.error("Invalid XML: "+e),i};var ke=/\[\]$/,Te=/\r?\n/g,Ie=/^(?:submit|button|image|reset|file)$/i,Ee=/^(?:input|select|textarea|keygen)/i;ut.param=function(t,e){var i,n=[],o=function(t,e){var i=ut.isFunction(e)?e():e;n[n.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==i?"":i)};if(Array.isArray(t)||t.jquery&&!ut.isPlainObject(t))ut.each(t,function(){o(this.name,this.value)});else for(i in t)Y(i,t[i],e,o);return n.join("&")},ut.fn.extend({serialize:function(){return ut.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=ut.prop(this,"elements");return t?ut.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!ut(this).is(":disabled")&&Ee.test(this.nodeName)&&!Ie.test(t)&&(this.checked||!Gt.test(t))}).map(function(t,e){var i=ut(this).val();return null==i?null:Array.isArray(i)?ut.map(i,function(t){return{name:e.name,value:t.replace(Te,"\r\n")}}):{name:e.name,value:i.replace(Te,"\r\n")}}).get()}});var Pe=/%20/g,Me=/#.*$/,De=/([?&])_=[^&]*/,Fe=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ue=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ve=/^(?:GET|HEAD)$/,Re=/^\/\//,Be={},Le={},Ne="*/".concat("*"),Oe=it.createElement("a");Oe.href=we.href,ut.extend({active:0,lastModified:{},etag:{},ajaxSettings:{ url:we.href,type:"GET",isLocal:Ue.test(we.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ne,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":ut.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Z(Z(t,ut.ajaxSettings),e):Z(ut.ajaxSettings,t)},ajaxPrefilter:X(Be),ajaxTransport:X(Le),ajax:function(e,i){function n(e,i,n,l){var c,p,m,_,y,x=i;h||(h=!0,r&&t.clearTimeout(r),o=void 0,a=l||"",w.readyState=e>0?4:0,c=e>=200&&e<300||304===e,n&&(_=Q(u,w,n)),_=tt(u,_,w,c),c?(u.ifModified&&(y=w.getResponseHeader("Last-Modified"),y&&(ut.lastModified[s]=y),(y=w.getResponseHeader("etag"))&&(ut.etag[s]=y)),204===e||"HEAD"===u.type?x="nocontent":304===e?x="notmodified":(x=_.state,p=_.data,m=_.error,c=!m)):(m=x,!e&&x||(x="error",e<0&&(e=0))),w.status=e,w.statusText=(i||x)+"",c?f.resolveWith(g,[p,x,w]):f.rejectWith(g,[w,x,m]),w.statusCode(v),v=void 0,d&&b.trigger(c?"ajaxSuccess":"ajaxError",[w,u,c?p:m]),C.fireWith(g,[w,x]),d&&(b.trigger("ajaxComplete",[w,u]),--ut.active||ut.event.trigger("ajaxStop")))}"object"==typeof e&&(i=e,e=void 0),i=i||{};var o,s,a,l,r,c,h,d,p,m,u=ut.ajaxSetup({},i),g=u.context||u,b=u.context&&(g.nodeType||g.jquery)?ut(g):ut.event,f=ut.Deferred(),C=ut.Callbacks("once memory"),v=u.statusCode||{},_={},y={},x="canceled",w={readyState:0,getResponseHeader:function(t){var e;if(h){if(!l)for(l={};e=Fe.exec(a);)l[e[1].toLowerCase()]=e[2];e=l[t.toLowerCase()]}return null==e?null:e},getAllResponseHeaders:function(){return h?a:null},setRequestHeader:function(t,e){return null==h&&(t=y[t.toLowerCase()]=y[t.toLowerCase()]||t,_[t]=e),this},overrideMimeType:function(t){return null==h&&(u.mimeType=t),this},statusCode:function(t){var e;if(t)if(h)w.always(t[w.status]);else for(e in t)v[e]=[v[e],t[e]];return this},abort:function(t){var e=t||x;return o&&o.abort(e),n(0,e),this}};if(f.promise(w),u.url=((e||u.url||we.href)+"").replace(Re,we.protocol+"//"),u.type=i.method||i.type||u.method||u.type,u.dataTypes=(u.dataType||"*").toLowerCase().match(Et)||[""],null==u.crossDomain){c=it.createElement("a");try{c.href=u.url,c.href=c.href,u.crossDomain=Oe.protocol+"//"+Oe.host!=c.protocol+"//"+c.host}catch(t){u.crossDomain=!0}}if(u.data&&u.processData&&"string"!=typeof u.data&&(u.data=ut.param(u.data,u.traditional)),J(Be,u,i,w),h)return w;d=ut.event&&u.global,d&&0==ut.active++&&ut.event.trigger("ajaxStart"),u.type=u.type.toUpperCase(),u.hasContent=!Ve.test(u.type),s=u.url.replace(Me,""),u.hasContent?u.data&&u.processData&&0===(u.contentType||"").indexOf("application/x-www-form-urlencoded")&&(u.data=u.data.replace(Pe,"+")):(m=u.url.slice(s.length),u.data&&(s+=(Ae.test(s)?"&":"?")+u.data,delete u.data),!1===u.cache&&(s=s.replace(De,"$1"),m=(Ae.test(s)?"&":"?")+"_="+Se+++m),u.url=s+m),u.ifModified&&(ut.lastModified[s]&&w.setRequestHeader("If-Modified-Since",ut.lastModified[s]),ut.etag[s]&&w.setRequestHeader("If-None-Match",ut.etag[s])),(u.data&&u.hasContent&&!1!==u.contentType||i.contentType)&&w.setRequestHeader("Content-Type",u.contentType),w.setRequestHeader("Accept",u.dataTypes[0]&&u.accepts[u.dataTypes[0]]?u.accepts[u.dataTypes[0]]+("*"!==u.dataTypes[0]?", "+Ne+"; q=0.01":""):u.accepts["*"]);for(p in u.headers)w.setRequestHeader(p,u.headers[p]);if(u.beforeSend&&(!1===u.beforeSend.call(g,w,u)||h))return w.abort();if(x="abort",C.add(u.complete),w.done(u.success),w.fail(u.error),o=J(Le,u,i,w)){if(w.readyState=1,d&&b.trigger("ajaxSend",[w,u]),h)return w;u.async&&u.timeout>0&&(r=t.setTimeout(function(){w.abort("timeout")},u.timeout));try{h=!1,o.send(_,n)}catch(t){if(h)throw t;n(-1,t)}}else n(-1,"No Transport");return w},getJSON:function(t,e,i){return ut.get(t,e,i,"json")},getScript:function(t,e){return ut.get(t,void 0,e,"script")}}),ut.each(["get","post"],function(t,e){ut[e]=function(t,i,n,o){return ut.isFunction(i)&&(o=o||n,n=i,i=void 0),ut.ajax(ut.extend({url:t,type:e,dataType:o,data:i,success:n},ut.isPlainObject(t)&&t))}}),ut._evalUrl=function(t){return ut.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},ut.fn.extend({wrapAll:function(t){var e;return this[0]&&(ut.isFunction(t)&&(t=t.call(this[0])),e=ut(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t}).append(this)),this},wrapInner:function(t){return ut.isFunction(t)?this.each(function(e){ut(this).wrapInner(t.call(this,e))}):this.each(function(){var e=ut(this),i=e.contents();i.length?i.wrapAll(t):e.append(t)})},wrap:function(t){var e=ut.isFunction(t);return this.each(function(i){ut(this).wrapAll(e?t.call(this,i):t)})},unwrap:function(t){return this.parent(t).not("body").each(function(){ut(this).replaceWith(this.childNodes)}),this}}),ut.expr.pseudos.hidden=function(t){return!ut.expr.pseudos.visible(t)},ut.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},ut.ajaxSettings.xhr=function(){try{return new t.XMLHttpRequest}catch(t){}};var He={0:200,1223:204},$e=ut.ajaxSettings.xhr();mt.cors=!!$e&&"withCredentials"in $e,mt.ajax=$e=!!$e,ut.ajaxTransport(function(e){var i,n;if(mt.cors||$e&&!e.crossDomain)return{send:function(o,s){var a,l=e.xhr();if(l.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)l[a]=e.xhrFields[a];e.mimeType&&l.overrideMimeType&&l.overrideMimeType(e.mimeType),e.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest");for(a in o)l.setRequestHeader(a,o[a]);i=function(t){return function(){i&&(i=n=l.onload=l.onerror=l.onabort=l.onreadystatechange=null,"abort"===t?l.abort():"error"===t?"number"!=typeof l.status?s(0,"error"):s(l.status,l.statusText):s(He[l.status]||l.status,l.statusText,"text"!==(l.responseType||"text")||"string"!=typeof l.responseText?{binary:l.response}:{text:l.responseText},l.getAllResponseHeaders()))}},l.onload=i(),n=l.onerror=i("error"),void 0!==l.onabort?l.onabort=n:l.onreadystatechange=function(){4===l.readyState&&t.setTimeout(function(){i&&n()})},i=i("abort");try{l.send(e.hasContent&&e.data||null)}catch(t){if(i)throw t}},abort:function(){i&&i()}}}),ut.ajaxPrefilter(function(t){t.crossDomain&&(t.contents.script=!1)}),ut.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return ut.globalEval(t),t}}}),ut.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),ut.ajaxTransport("script",function(t){if(t.crossDomain){var e,i;return{send:function(n,o){e=ut(" + + - \ No newline at end of file + From 81ec2000406f2b8d64afdbcbba500be9e9d1120c Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 21 Oct 2020 15:53:01 +0200 Subject: [PATCH 08/14] New OO build to fix cache issues --- .../v2b/sdkjs/common/libfont/wasm/fonts.js | 74 +++++++++---------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/www/common/onlyoffice/v2b/sdkjs/common/libfont/wasm/fonts.js b/www/common/onlyoffice/v2b/sdkjs/common/libfont/wasm/fonts.js index 0d75c38e1..11de77631 100644 --- a/www/common/onlyoffice/v2b/sdkjs/common/libfont/wasm/fonts.js +++ b/www/common/onlyoffice/v2b/sdkjs/common/libfont/wasm/fonts.js @@ -23,43 +23,43 @@ TOTAL_STACK+")");if(Module["buffer"])buffer=Module["buffer"];else{if(typeof WebA continue}var func=callback.func;if(typeof func==="number")if(callback.arg===undefined)Module["dynCall_v"](func);else Module["dynCall_vi"](func,callback.arg);else func(callback.arg===undefined?null:callback.arg)}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATPOSTRUN__=[function(){window["AscFonts"].onLoadModule()}];var runtimeInitialized=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length)addOnPreRun(Module["preRun"].shift())}callRuntimeCallbacks(__ATPRERUN__)} function ensureInitRuntime(){if(runtimeInitialized)return;runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length)addOnPostRun(Module["postRun"].shift())}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies= 0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"])Module["monitorRunDependencies"](runDependencies)}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"])Module["monitorRunDependencies"](runDependencies);if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled; -dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return String.prototype.startsWith?filename.startsWith(dataURIPrefix):filename.indexOf(dataURIPrefix)===0}var wasmBinaryFile="fonts.wasm";if(!isDataURI(wasmBinaryFile))wasmBinaryFile=locateFile(wasmBinaryFile);function getBinary(){try{if(Module["wasmBinary"])return new Uint8Array(Module["wasmBinary"]);if(Module["readBinary"])return Module["readBinary"](wasmBinaryFile); -else throw"both async and sync fetching of the wasm failed";}catch(err$0){abort(err$0)}}function getBinaryPromise2(){if(!Module["wasmBinary"]&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&typeof fetch==="function")return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"])throw"failed to load wasm binary file at '"+wasmBinaryFile+"'";return response["arrayBuffer"]()}).catch(function(){return getBinary()});return new Promise(function(resolve,reject){resolve(getBinary())})} -function createWasm(env){var info={"env":env,"global":{"NaN":NaN,Infinity:Infinity},"global.Math":Math,"asm2wasm":asm2wasmImports};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");if(Module["instantiateWasm"])try{return Module["instantiateWasm"](info,receiveInstance)}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}function receiveInstantiatedSource(output){receiveInstance(output["instance"])} -function instantiateArrayBuffer(receiver){getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}if(!Module["wasmBinary"]&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&typeof fetch==="function")WebAssembly.instantiateStreaming(fetch(wasmBinaryFile,{credentials:"same-origin"}),info).then(receiveInstantiatedSource,function(reason){err("wasm streaming compile failed: "+ -reason);err("falling back to ArrayBuffer instantiation");instantiateArrayBuffer(receiveInstantiatedSource)});else instantiateArrayBuffer(receiveInstantiatedSource);return{}}Module["asm"]=function(global,env,providedBuffer){env["memory"]=wasmMemory;env["table"]=wasmTable=new WebAssembly.Table({"initial":814,"maximum":814,"element":"anyfunc"});env["__memory_base"]=1024;env["__table_base"]=0;var exports=createWasm(env);return exports};__ATINIT__.push({func:function(){___emscripten_environ_constructor()}}); -var ENV={};function ___buildEnvironment(environ){var MAX_ENV_VALUES=64;var TOTAL_ENV_SIZE=1024;var poolPtr;var envPtr;if(!___buildEnvironment.called){___buildEnvironment.called=true;ENV["USER"]=ENV["LOGNAME"]="web_user";ENV["PATH"]="/";ENV["PWD"]="/";ENV["HOME"]="/home/web_user";ENV["LANG"]="C.UTF-8";ENV["_"]=Module["thisProgram"];poolPtr=getMemory(TOTAL_ENV_SIZE);envPtr=getMemory(MAX_ENV_VALUES*4);HEAP32[envPtr>>2]=poolPtr;HEAP32[environ>>2]=envPtr}else{envPtr=HEAP32[environ>>2];poolPtr=HEAP32[envPtr>> -2]}var strings=[];var totalSize=0;for(var key in ENV)if(typeof ENV[key]==="string"){var line=key+"="+ENV[key];strings.push(line);totalSize+=line.length}if(totalSize>TOTAL_ENV_SIZE)throw new Error("Environment size exceeded TOTAL_ENV_SIZE!");var ptrSize=4;for(var i=0;i>2]=poolPtr;poolPtr+=line.length+1}HEAP32[envPtr+strings.length*ptrSize>>2]=0}function ___lock(){}var SYSCALLS={buffers:[null,[],[]],printChar:function(stream, -curr){var buffer=SYSCALLS.buffers[stream];if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0}else buffer.push(curr)},varargs:0,get:function(varargs){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(){var ret=UTF8ToString(SYSCALLS.get());return ret},get64:function(){var low=SYSCALLS.get(),high=SYSCALLS.get();return low},getZero:function(){SYSCALLS.get()}};function ___syscall140(which,varargs){SYSCALLS.varargs=varargs;try{var stream= -SYSCALLS.getStreamFromFD(),offset_high=SYSCALLS.get(),offset_low=SYSCALLS.get(),result=SYSCALLS.get(),whence=SYSCALLS.get();var offset=offset_low;FS.llseek(stream,offset,whence);HEAP32[result>>2]=stream.position;if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall145(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),iov=SYSCALLS.get(), -iovcnt=SYSCALLS.get();return SYSCALLS.doReadv(stream,iov,iovcnt)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall146(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.get(),iov=SYSCALLS.get(),iovcnt=SYSCALLS.get();var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];for(var j=0;j>2]=value;return value}function ___syscall221(which,varargs){SYSCALLS.varargs=varargs;try{return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall5(which,varargs){SYSCALLS.varargs=varargs;try{var pathname=SYSCALLS.getStr(),flags=SYSCALLS.get(),mode=SYSCALLS.get();var stream=FS.open(pathname, -flags,mode);return stream.fd}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall54(which,varargs){SYSCALLS.varargs=varargs;try{return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall6(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD();FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}} -function ___unlock(){}function _emscripten_get_heap_size(){return TOTAL_MEMORY}function _longjmp(env,value){_setThrew(env,value||1);throw"longjmp";}function _emscripten_longjmp(env,value){_longjmp(env,value)}function abortOnCannotGrowMemory(requestedSize){abort("OOM")}function emscripten_realloc_buffer(size){var PAGE_MULTIPLE=65536;size=alignUp(size,PAGE_MULTIPLE);var old=Module["buffer"];var oldSize=old.byteLength;try{var result=wasmMemory.grow((size-oldSize)/65536);if(result!==(-1|0))return Module["buffer"]= -wasmMemory.buffer;else return null}catch(e){return null}}function _emscripten_resize_heap(requestedSize){var oldSize=_emscripten_get_heap_size();var PAGE_MULTIPLE=65536;var LIMIT=2147483648-PAGE_MULTIPLE;if(requestedSize>LIMIT)return false;var MIN_TOTAL_MEMORY=16777216;var newSize=Math.max(oldSize,MIN_TOTAL_MEMORY);while(newSize0)return;preRun();if(runDependencies>0)return;if(Module["calledRun"])return;function doRun(){if(Module["calledRun"])return;Module["calledRun"]=true;if(ABORT)return;ensureInitRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running..."); -setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else doRun()}Module["run"]=run;function abort(what){if(Module["onAbort"])Module["onAbort"](what);if(what!==undefined){out(what);err(what);what=JSON.stringify(what)}else what="";ABORT=true;EXITSTATUS=1;throw"abort("+what+"). Build with -s ASSERTIONS=1 for more info.";}Module["abort"]=abort;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length> -0)Module["preInit"].pop()()}Module["noExitRuntime"]=true;run();window["AscFonts"]=window["AscFonts"]||{};var AscFonts=window["AscFonts"];AscFonts.CreateLibrary=function(){return Module["_ASC_FT_Init"]()};AscFonts.TT_INTERPRETER_VERSION_35=35;AscFonts.TT_INTERPRETER_VERSION_38=38;AscFonts.TT_INTERPRETER_VERSION_40=40;AscFonts.FT_Set_TrueType_HintProp=function(library,tt_interpreter){return Module["_ASC_FT_Set_TrueType_HintProp"](library,tt_interpreter)};AscFonts.CreateNativeStream=function(_typed_array){var _fontStreamPointer= -Module["_ASC_FT_Malloc"](_typed_array.size);Module["HEAP8"].set(_typed_array.data,_fontStreamPointer);return{asc_marker:true,data:_fontStreamPointer,len:_typed_array.size}};AscFonts.CreateNativeStreamByIndex=function(stream_index){var _stream_pos=AscFonts.g_fonts_streams[stream_index];if(_stream_pos&&true!==_stream_pos.asc_marker){var _native_stream=AscFonts.CreateNativeStream(AscFonts.g_fonts_streams[stream_index]);AscFonts.g_fonts_streams[stream_index]=null;AscFonts.g_fonts_streams[stream_index]= -_native_stream}};function CFaceInfo(){this.units_per_EM=0;this.ascender=0;this.descender=0;this.height=0;this.face_flags=0;this.num_faces=0;this.num_glyphs=0;this.num_charmaps=0;this.style_flags=0;this.face_index=0;this.family_name="";this.style_name="";this.os2_version=0;this.os2_usWeightClass=0;this.os2_fsSelection=0;this.os2_usWinAscent=0;this.os2_usWinDescent=0;this.os2_usDefaultChar=0;this.os2_sTypoAscender=0;this.os2_sTypoDescender=0;this.os2_sTypoLineGap=0;this.os2_ulUnicodeRange1=0;this.os2_ulUnicodeRange2= -0;this.os2_ulUnicodeRange3=0;this.os2_ulUnicodeRange4=0;this.os2_ulCodePageRange1=0;this.os2_ulCodePageRange2=0;this.os2_nSymbolic=0;this.header_yMin=0;this.header_yMax=0;this.monochromeSizes=[]}CFaceInfo.prototype.load=function(face){var _bufferPtr=Module["_ASC_FT_GetFaceInfo"](face);if(!_bufferPtr)return;var _len_buffer=Math.min(Module["HEAP8"].length-_bufferPtr>>2,250);var _buffer=new Int32Array(Module["HEAP8"].buffer,_bufferPtr,_len_buffer);var _index=0;this.units_per_EM=Math.abs(_buffer[_index++]); -this.ascender=_buffer[_index++];this.descender=_buffer[_index++];this.height=_buffer[_index++];this.face_flags=_buffer[_index++];this.num_faces=_buffer[_index++];this.num_glyphs=_buffer[_index++];this.num_charmaps=_buffer[_index++];this.style_flags=_buffer[_index++];this.face_index=_buffer[_index++];var c=_buffer[_index++];while(c){this.family_name+=String.fromCharCode(c);c=_buffer[_index++]}c=_buffer[_index++];while(c){this.style_name+=String.fromCharCode(c);c=_buffer[_index++]}this.os2_version= -_buffer[_index++];this.os2_usWeightClass=_buffer[_index++];this.os2_fsSelection=_buffer[_index++];this.os2_usWinAscent=_buffer[_index++];this.os2_usWinDescent=_buffer[_index++];this.os2_usDefaultChar=_buffer[_index++];this.os2_sTypoAscender=_buffer[_index++];this.os2_sTypoDescender=_buffer[_index++];this.os2_sTypoLineGap=_buffer[_index++];this.os2_ulUnicodeRange1=AscFonts.FT_Common.IntToUInt(_buffer[_index++]);this.os2_ulUnicodeRange2=AscFonts.FT_Common.IntToUInt(_buffer[_index++]);this.os2_ulUnicodeRange3= -AscFonts.FT_Common.IntToUInt(_buffer[_index++]);this.os2_ulUnicodeRange4=AscFonts.FT_Common.IntToUInt(_buffer[_index++]);this.os2_ulCodePageRange1=AscFonts.FT_Common.IntToUInt(_buffer[_index++]);this.os2_ulCodePageRange2=AscFonts.FT_Common.IntToUInt(_buffer[_index++]);this.os2_nSymbolic=_buffer[_index++];this.header_yMin=_buffer[_index++];this.header_yMax=_buffer[_index++];var fixedSizesCount=_buffer[_index++];for(var i=0;i>2];var _buffer=new Int32Array(Module["HEAP8"].buffer,_bufferPtr,4*_len);var _info=new CGlyphMetrics;_info.bbox_xMin=_buffer[1]; -_info.bbox_yMin=_buffer[2];_info.bbox_xMax=_buffer[3];_info.bbox_yMax=_buffer[4];_info.width=_buffer[5];_info.height=_buffer[6];_info.horiAdvance=_buffer[7];_info.horiBearingX=_buffer[8];_info.horiBearingY=_buffer[9];_info.vertAdvance=_buffer[10];_info.vertBearingX=_buffer[11];_info.vertBearingY=_buffer[12];_info.linearHoriAdvance=_buffer[13];_info.linearVertAdvance=_buffer[14];if(vector_worker){painter.start(vector_worker);var _pos=15;while(_pos<_len)switch(_buffer[_pos++]){case 0:{painter._move_to(_buffer[_pos++], +dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return String.prototype.startsWith?filename.startsWith(dataURIPrefix):filename.indexOf(dataURIPrefix)===0}var wasmBinaryFile="fonts.wasm?"+window.CP_urlArgs;if(!isDataURI(wasmBinaryFile))wasmBinaryFile=locateFile(wasmBinaryFile);function getBinary(){try{if(Module["wasmBinary"])return new Uint8Array(Module["wasmBinary"]); +if(Module["readBinary"])return Module["readBinary"](wasmBinaryFile);else throw"both async and sync fetching of the wasm failed";}catch(err$0){abort(err$0)}}function getBinaryPromise2(){if(!Module["wasmBinary"]&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&typeof fetch==="function")return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"])throw"failed to load wasm binary file at '"+wasmBinaryFile+"'";return response["arrayBuffer"]()}).catch(function(){return getBinary()}); +return new Promise(function(resolve,reject){resolve(getBinary())})}function createWasm(env){var info={"env":env,"global":{"NaN":NaN,Infinity:Infinity},"global.Math":Math,"asm2wasm":asm2wasmImports};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");if(Module["instantiateWasm"])try{return Module["instantiateWasm"](info,receiveInstance)}catch(e){err("Module.instantiateWasm callback failed with error: "+ +e);return false}function receiveInstantiatedSource(output){receiveInstance(output["instance"])}function instantiateArrayBuffer(receiver){getBinaryPromise().then(function(binary){return WebAssembly.instantiate(binary,info)}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}if(!Module["wasmBinary"]&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&typeof fetch==="function")WebAssembly.instantiateStreaming(fetch(wasmBinaryFile, +{credentials:"same-origin"}),info).then(receiveInstantiatedSource,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");instantiateArrayBuffer(receiveInstantiatedSource)});else instantiateArrayBuffer(receiveInstantiatedSource);return{}}Module["asm"]=function(global,env,providedBuffer){env["memory"]=wasmMemory;env["table"]=wasmTable=new WebAssembly.Table({"initial":814,"maximum":814,"element":"anyfunc"});env["__memory_base"]=1024;env["__table_base"]= +0;var exports=createWasm(env);return exports};__ATINIT__.push({func:function(){___emscripten_environ_constructor()}});var ENV={};function ___buildEnvironment(environ){var MAX_ENV_VALUES=64;var TOTAL_ENV_SIZE=1024;var poolPtr;var envPtr;if(!___buildEnvironment.called){___buildEnvironment.called=true;ENV["USER"]=ENV["LOGNAME"]="web_user";ENV["PATH"]="/";ENV["PWD"]="/";ENV["HOME"]="/home/web_user";ENV["LANG"]="C.UTF-8";ENV["_"]=Module["thisProgram"];poolPtr=getMemory(TOTAL_ENV_SIZE);envPtr=getMemory(MAX_ENV_VALUES* +4);HEAP32[envPtr>>2]=poolPtr;HEAP32[environ>>2]=envPtr}else{envPtr=HEAP32[environ>>2];poolPtr=HEAP32[envPtr>>2]}var strings=[];var totalSize=0;for(var key in ENV)if(typeof ENV[key]==="string"){var line=key+"="+ENV[key];strings.push(line);totalSize+=line.length}if(totalSize>TOTAL_ENV_SIZE)throw new Error("Environment size exceeded TOTAL_ENV_SIZE!");var ptrSize=4;for(var i=0;i>2]=poolPtr;poolPtr+=line.length+ +1}HEAP32[envPtr+strings.length*ptrSize>>2]=0}function ___lock(){}var SYSCALLS={buffers:[null,[],[]],printChar:function(stream,curr){var buffer=SYSCALLS.buffers[stream];if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0}else buffer.push(curr)},varargs:0,get:function(varargs){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(){var ret=UTF8ToString(SYSCALLS.get());return ret},get64:function(){var low=SYSCALLS.get(),high=SYSCALLS.get(); +return low},getZero:function(){SYSCALLS.get()}};function ___syscall140(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),offset_high=SYSCALLS.get(),offset_low=SYSCALLS.get(),result=SYSCALLS.get(),whence=SYSCALLS.get();var offset=offset_low;FS.llseek(stream,offset,whence);HEAP32[result>>2]=stream.position;if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}} +function ___syscall145(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),iov=SYSCALLS.get(),iovcnt=SYSCALLS.get();return SYSCALLS.doReadv(stream,iov,iovcnt)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall146(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.get(),iov=SYSCALLS.get(),iovcnt=SYSCALLS.get();var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+ +4)>>2];for(var j=0;j>2]=value;return value}function ___syscall221(which,varargs){SYSCALLS.varargs=varargs;try{return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall5(which,varargs){SYSCALLS.varargs= +varargs;try{var pathname=SYSCALLS.getStr(),flags=SYSCALLS.get(),mode=SYSCALLS.get();var stream=FS.open(pathname,flags,mode);return stream.fd}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall54(which,varargs){SYSCALLS.varargs=varargs;try{return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall6(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(); +FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___unlock(){}function _emscripten_get_heap_size(){return TOTAL_MEMORY}function _longjmp(env,value){_setThrew(env,value||1);throw"longjmp";}function _emscripten_longjmp(env,value){_longjmp(env,value)}function abortOnCannotGrowMemory(requestedSize){abort("OOM")}function emscripten_realloc_buffer(size){var PAGE_MULTIPLE=65536;size=alignUp(size,PAGE_MULTIPLE);var old=Module["buffer"]; +var oldSize=old.byteLength;try{var result=wasmMemory.grow((size-oldSize)/65536);if(result!==(-1|0))return Module["buffer"]=wasmMemory.buffer;else return null}catch(e){return null}}function _emscripten_resize_heap(requestedSize){var oldSize=_emscripten_get_heap_size();var PAGE_MULTIPLE=65536;var LIMIT=2147483648-PAGE_MULTIPLE;if(requestedSize>LIMIT)return false;var MIN_TOTAL_MEMORY=16777216;var newSize=Math.max(oldSize,MIN_TOTAL_MEMORY);while(newSize0)return;preRun();if(runDependencies>0)return;if(Module["calledRun"])return;function doRun(){if(Module["calledRun"])return;Module["calledRun"]=true;if(ABORT)return;ensureInitRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"](); +postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else doRun()}Module["run"]=run;function abort(what){if(Module["onAbort"])Module["onAbort"](what);if(what!==undefined){out(what);err(what);what=JSON.stringify(what)}else what="";ABORT=true;EXITSTATUS=1;throw"abort("+what+"). Build with -s ASSERTIONS=1 for more info.";}Module["abort"]=abort;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]= +[Module["preInit"]];while(Module["preInit"].length>0)Module["preInit"].pop()()}Module["noExitRuntime"]=true;run();window["AscFonts"]=window["AscFonts"]||{};var AscFonts=window["AscFonts"];AscFonts.CreateLibrary=function(){return Module["_ASC_FT_Init"]()};AscFonts.TT_INTERPRETER_VERSION_35=35;AscFonts.TT_INTERPRETER_VERSION_38=38;AscFonts.TT_INTERPRETER_VERSION_40=40;AscFonts.FT_Set_TrueType_HintProp=function(library,tt_interpreter){return Module["_ASC_FT_Set_TrueType_HintProp"](library,tt_interpreter)}; +AscFonts.CreateNativeStream=function(_typed_array){var _fontStreamPointer=Module["_ASC_FT_Malloc"](_typed_array.size);Module["HEAP8"].set(_typed_array.data,_fontStreamPointer);return{asc_marker:true,data:_fontStreamPointer,len:_typed_array.size}};AscFonts.CreateNativeStreamByIndex=function(stream_index){var _stream_pos=AscFonts.g_fonts_streams[stream_index];if(_stream_pos&&true!==_stream_pos.asc_marker){var _native_stream=AscFonts.CreateNativeStream(AscFonts.g_fonts_streams[stream_index]);AscFonts.g_fonts_streams[stream_index]= +null;AscFonts.g_fonts_streams[stream_index]=_native_stream}};function CFaceInfo(){this.units_per_EM=0;this.ascender=0;this.descender=0;this.height=0;this.face_flags=0;this.num_faces=0;this.num_glyphs=0;this.num_charmaps=0;this.style_flags=0;this.face_index=0;this.family_name="";this.style_name="";this.os2_version=0;this.os2_usWeightClass=0;this.os2_fsSelection=0;this.os2_usWinAscent=0;this.os2_usWinDescent=0;this.os2_usDefaultChar=0;this.os2_sTypoAscender=0;this.os2_sTypoDescender=0;this.os2_sTypoLineGap= +0;this.os2_ulUnicodeRange1=0;this.os2_ulUnicodeRange2=0;this.os2_ulUnicodeRange3=0;this.os2_ulUnicodeRange4=0;this.os2_ulCodePageRange1=0;this.os2_ulCodePageRange2=0;this.os2_nSymbolic=0;this.header_yMin=0;this.header_yMax=0;this.monochromeSizes=[]}CFaceInfo.prototype.load=function(face){var _bufferPtr=Module["_ASC_FT_GetFaceInfo"](face);if(!_bufferPtr)return;var _len_buffer=Math.min(Module["HEAP8"].length-_bufferPtr>>2,250);var _buffer=new Int32Array(Module["HEAP8"].buffer,_bufferPtr,_len_buffer); +var _index=0;this.units_per_EM=Math.abs(_buffer[_index++]);this.ascender=_buffer[_index++];this.descender=_buffer[_index++];this.height=_buffer[_index++];this.face_flags=_buffer[_index++];this.num_faces=_buffer[_index++];this.num_glyphs=_buffer[_index++];this.num_charmaps=_buffer[_index++];this.style_flags=_buffer[_index++];this.face_index=_buffer[_index++];var c=_buffer[_index++];while(c){this.family_name+=String.fromCharCode(c);c=_buffer[_index++]}c=_buffer[_index++];while(c){this.style_name+=String.fromCharCode(c); +c=_buffer[_index++]}this.os2_version=_buffer[_index++];this.os2_usWeightClass=_buffer[_index++];this.os2_fsSelection=_buffer[_index++];this.os2_usWinAscent=_buffer[_index++];this.os2_usWinDescent=_buffer[_index++];this.os2_usDefaultChar=_buffer[_index++];this.os2_sTypoAscender=_buffer[_index++];this.os2_sTypoDescender=_buffer[_index++];this.os2_sTypoLineGap=_buffer[_index++];this.os2_ulUnicodeRange1=AscFonts.FT_Common.IntToUInt(_buffer[_index++]);this.os2_ulUnicodeRange2=AscFonts.FT_Common.IntToUInt(_buffer[_index++]); +this.os2_ulUnicodeRange3=AscFonts.FT_Common.IntToUInt(_buffer[_index++]);this.os2_ulUnicodeRange4=AscFonts.FT_Common.IntToUInt(_buffer[_index++]);this.os2_ulCodePageRange1=AscFonts.FT_Common.IntToUInt(_buffer[_index++]);this.os2_ulCodePageRange2=AscFonts.FT_Common.IntToUInt(_buffer[_index++]);this.os2_nSymbolic=_buffer[_index++];this.header_yMin=_buffer[_index++];this.header_yMax=_buffer[_index++];var fixedSizesCount=_buffer[_index++];for(var i=0;i>2];var _buffer=new Int32Array(Module["HEAP8"].buffer,_bufferPtr,4*_len);var _info=new CGlyphMetrics;_info.bbox_xMin= +_buffer[1];_info.bbox_yMin=_buffer[2];_info.bbox_xMax=_buffer[3];_info.bbox_yMax=_buffer[4];_info.width=_buffer[5];_info.height=_buffer[6];_info.horiAdvance=_buffer[7];_info.horiBearingX=_buffer[8];_info.horiBearingY=_buffer[9];_info.vertAdvance=_buffer[10];_info.vertBearingX=_buffer[11];_info.vertBearingY=_buffer[12];_info.linearHoriAdvance=_buffer[13];_info.linearVertAdvance=_buffer[14];if(vector_worker){painter.start(vector_worker);var _pos=15;while(_pos<_len)switch(_buffer[_pos++]){case 0:{painter._move_to(_buffer[_pos++], _buffer[_pos++],vector_worker);break}case 1:{painter._line_to(_buffer[_pos++],_buffer[_pos++],vector_worker);break}case 2:{painter._conic_to(_buffer[_pos++],_buffer[_pos++],_buffer[_pos++],_buffer[_pos++],vector_worker);break}case 3:{painter._cubic_to(_buffer[_pos++],_buffer[_pos++],_buffer[_pos++],_buffer[_pos++],_buffer[_pos++],_buffer[_pos++],vector_worker);break}default:break}painter.end(vector_worker)}Module["_ASC_FT_Free"](_bufferPtr);_buffer=null;return _info};AscFonts.FT_Glyph_Get_Raster= function(face,render_mode){var _bufferPtr=Module["_ASC_FT_Get_Glyph_Render_Params"](face,render_mode);if(!_bufferPtr)return null;var _buffer=new Int32Array(Module["HEAP8"].buffer,_bufferPtr,24);var _info=new CGlyphBitmapImage;_info.left=_buffer[0];_info.top=_buffer[1];_info.width=_buffer[2];_info.rows=_buffer[3];_info.pitch=_buffer[4];_info.mode=_buffer[5];Module["_ASC_FT_Free"](_bufferPtr);return _info};AscFonts.FT_Load_Glyph=Module["_FT_Load_Glyph"];AscFonts.FT_Set_Transform=Module["_ASC_FT_Set_Transform"]; AscFonts.FT_Set_Char_Size=Module["_FT_Set_Char_Size"];AscFonts.FT_SetCMapForCharCode=Module["_ASC_FT_SetCMapForCharCode"];AscFonts.FT_GetKerningX=Module["_ASC_FT_GetKerningX"];AscFonts.FT_GetFaceMaxAdvanceX=Module["_ASC_FT_GetFaceMaxAdvanceX"];AscFonts.FT_Get_Glyph_Render_Buffer=function(face,rasterInfo,isCopyToRasterMemory){var _bufferPtr=Module["_ASC_FT_Get_Glyph_Render_Buffer"](face);var tmp=new Uint8Array(Module["HEAP8"].buffer,_bufferPtr,rasterInfo.pitch*rasterInfo.rows);if(!isCopyToRasterMemory)return tmp; From ae95b088dc0af562b210bbbe951562b058531c81 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 21 Oct 2020 16:04:04 +0200 Subject: [PATCH 09/14] Fix syntax error --- www/pad/csp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/pad/csp.js b/www/pad/csp.js index 02f21f883..13a40f851 100644 --- a/www/pad/csp.js +++ b/www/pad/csp.js @@ -27,7 +27,7 @@ define(['jquery'], function ($) { if (bgImg) { $icon[0].style.setProperty('background-image', bgImg, 'important'); } - catch (e) { console.error(e); } + } catch (e) { console.error(e); } } $el.on('keydown blur focus click dragstart', function (e) { e.preventDefault(); From 0e6e691d7df5fc81e100fceadc72ac19ef12d2d0 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 21 Oct 2020 16:14:49 +0200 Subject: [PATCH 10/14] Remove hardcoded translation key --- www/common/toolbar.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/www/common/toolbar.js b/www/common/toolbar.js index cf319f124..9a96039f6 100644 --- a/www/common/toolbar.js +++ b/www/common/toolbar.js @@ -1350,8 +1350,6 @@ MessengerUI, Messages) { } }; - Messages.snaphot_title = "Snapshot"; //XXX - toolbar.setSnapshot = function (bool) { toolbar.history = bool; toolbar.title.toggleClass('cp-toolbar-unsync', bool); From 714f2c6051d1481e467897425651a506b5ad6218 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 21 Oct 2020 16:27:18 +0200 Subject: [PATCH 11/14] Fix an issue with the maxTeamsSlots configuration --- www/teams/inner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/teams/inner.js b/www/teams/inner.js index 44734ad85..2eb234b12 100644 --- a/www/teams/inner.js +++ b/www/teams/inner.js @@ -395,7 +395,7 @@ define([ if (obj.error === "OFFLINE") { return UI.alert(Messages.driveOfflineError); } if (obj.error) { return void console.error(obj.error); } var list = []; - var keys = Object.keys(obj).slice(0,3); + var keys = Object.keys(obj).slice(0,MAX_TEAMS_SLOTS); var slots = '('+Math.min(keys.length, MAX_TEAMS_SLOTS)+'/'+MAX_TEAMS_SLOTS+')'; for (var i = keys.length; i < MAX_TEAMS_SLOTS; i++) { obj[i] = { From fbfb25bf290783b074a971711a78390400246780 Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 21 Oct 2020 21:29:52 +0530 Subject: [PATCH 12/14] lint compliance --- lib/workers/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/workers/index.js b/lib/workers/index.js index 4ca1996d0..6e9f57e88 100644 --- a/lib/workers/index.js +++ b/lib/workers/index.js @@ -110,6 +110,7 @@ Workers.initialize = function (Env, config, _cb) { return; } + const txid = guid(); var cb = Util.once(Util.mkAsync(Util.both(_cb, function (err /*, value */) { if (err !== 'TIMEOUT') { return; } // in the event of a timeout the user will receive an error @@ -124,7 +125,6 @@ Workers.initialize = function (Env, config, _cb) { return void cb('ESERVERERR'); } - const txid = guid(); msg.txid = txid; msg.pid = PID; From 67430de7ffb1749cc3f5f9561c892fbe3e59fab3 Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 22 Oct 2020 11:17:03 +0530 Subject: [PATCH 13/14] Make efforts to avoid closing streams mid-read 1. Close streams when you're done with them 2. Close streams if they seem to have been abandoned --- lib/storage/file.js | 68 +++++++++++++++++++++++---------------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/lib/storage/file.js b/lib/storage/file.js index d9d3f7c89..5f3d4ae46 100644 --- a/lib/storage/file.js +++ b/lib/storage/file.js @@ -94,25 +94,28 @@ const destroyStream = function (stream) { }, STREAM_DESTROY_TIMEOUT); }; -/* - accept a stream, an id (used as a label) and an optional number of milliseconds +/* createIdleStreamCollector + +Takes a stream and returns a function to asynchronously close that stream. +Successive calls to the function will be ignored. - return a function which ignores all arguments - and first tries to gracefully close a stream - then destroys it after a period if the close was not successful - if the function is not called within the specified number of milliseconds - then it will be called implicitly with an error to indicate - that it was run because it timed out +If the function is not called for a period of STREAM_CLOSE_TIMEOUT it will +be called automatically unless its `keepAlive` method has been invoked +in the meantime. Used to prevent file descriptor leaks in the case of +abandoned streams while closing streams which are being read very very +slowly. */ -const ensureStreamCloses = function (stream, id, ms) { - return Util.bake(Util.mkTimeout(Util.once(function (err) { - destroyStream(stream); - if (err) { - // this can only be a timeout error... - console.log("stream close error:", err, id); - } - }), ms || STREAM_CLOSE_TIMEOUT), []); +const createIdleStreamCollector = function (stream) { + // create a function to close the stream which takes no arguments + // and will do nothing after being called the first time + var collector = Util.once(Util.mkAsync(Util.bake(destroyStream, [stream]))); + + // create a second function which will execute the first function after a delay + // calling this function will reset the delay and thus keep the stream 'alive' + collector.keepAlive = Util.throttle(collector, STREAM_CLOSE_TIMEOUT); + collector.keepAlive(); + return collector; }; // readMessagesBin asynchronously iterates over the messages in a channel log @@ -122,25 +125,22 @@ const ensureStreamCloses = function (stream, id, ms) { // it also allows the handler to abort reading at any time const readMessagesBin = (env, id, start, msgHandler, cb) => { const stream = Fs.createReadStream(mkPath(env, id), { start: start }); - const finish = ensureStreamCloses(stream, '[readMessagesBin:' + id + ']'); - return void readFileBin(stream, msgHandler, function (err) { - cb(err); - finish(); - }); + const collector = createIdleStreamCollector(stream); + const handleMessageAndKeepStreamAlive = Util.both(msgHandler, collector.keepAlive); + const done = Util.both(cb, collector); + return void readFileBin(stream, handleMessageAndKeepStreamAlive, done); }; // reads classic metadata from a channel log and aborts // returns undefined if the first message was not an object (not an array) var getMetadataAtPath = function (Env, path, _cb) { const stream = Fs.createReadStream(path, { start: 0 }); - const finish = ensureStreamCloses(stream, '[getMetadataAtPath:' + path + ']'); - var cb = Util.once(Util.mkAsync(Util.both(_cb, finish)), function () { - throw new Error("Multiple Callbacks"); - }); - + const collector = createIdleStreamCollector(stream); + var cb = Util.once(Util.mkAsync(Util.both(_cb, collector))); var i = 0; return readFileBin(stream, function (msgObj, readMore, abort) { + collector.keepAlive(); const line = msgObj.buff.toString('utf8'); if (!line) { @@ -149,7 +149,7 @@ var getMetadataAtPath = function (Env, path, _cb) { // metadata should always be on the first line or not exist in the channel at all if (i++ > 0) { - console.log("aborting"); + //console.log("aborting"); abort(); return void cb(); } @@ -219,10 +219,11 @@ var clearChannel = function (env, channelId, _cb) { */ var readMessages = function (path, msgHandler, _cb) { var stream = Fs.createReadStream(path, { start: 0}); - const finish = ensureStreamCloses(stream, '[readMessages:' + path + ']'); - var cb = Util.once(Util.mkAsync(Util.both(finish, _cb))); + var collector = createIdleStreamCollector(stream); + var cb = Util.once(Util.mkAsync(Util.both(_cb, collector))); return readFileBin(stream, function (msgObj, readMore) { + collector.keepAlive(); msgHandler(msgObj.buff.toString('utf8')); readMore(); }, function (err) { @@ -247,10 +248,11 @@ var getDedicatedMetadata = function (env, channelId, handler, _cb) { var metadataPath = mkMetadataPath(env, channelId); var stream = Fs.createReadStream(metadataPath, {start: 0}); - const finish = ensureStreamCloses(stream, '[getDedicatedMetadata:' + metadataPath + ']'); - var cb = Util.both(finish, _cb); + const collector = createIdleStreamCollector(stream); + var cb = Util.both(_cb, collector); readFileBin(stream, function (msgObj, readMore) { + collector.keepAlive(); var line = msgObj.buff.toString('utf8'); try { var parsed = JSON.parse(line); @@ -758,11 +760,11 @@ var getChannel = function (env, id, _callback) { }); }); }).nThen(function () { - channel.delayClose = Util.throttle(function () { + channel.delayClose = Util.throttle(Util.once(function () { delete env.channels[id]; destroyStream(channel.writeStream, path); //console.log("closing writestream"); - }, CHANNEL_WRITE_WINDOW); + }), CHANNEL_WRITE_WINDOW); channel.delayClose(); env.channels[id] = channel; done(void 0, channel); From d72e053560f7dfeab8fd244f47ec76b173219324 Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 22 Oct 2020 11:24:58 +0530 Subject: [PATCH 14/14] make a note to improve stream timeout error handling --- lib/storage/file.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/storage/file.js b/lib/storage/file.js index 5f3d4ae46..b1ccfde0f 100644 --- a/lib/storage/file.js +++ b/lib/storage/file.js @@ -105,6 +105,9 @@ in the meantime. Used to prevent file descriptor leaks in the case of abandoned streams while closing streams which are being read very very slowly. +XXX inform the stream consumer when it has been closed prematurely +by calling back with a TIMEOUT error or something + */ const createIdleStreamCollector = function (stream) { // create a function to close the stream which takes no arguments