Update sdkjs

pull/1/head
yflory 3 years ago
parent 24fa6a4fb6
commit a76fc3a427

@ -268,13 +268,13 @@ editorType;this._isExcel=c_oEditorId.Spreadsheet===editorType;this._isPresentati
docid;this.sockjs_url=AscCommon.getBaseUrl()+"../../../../doc/"+docid+"/c"};DocsCoApi.prototype.auth=function(isViewer,opt_openCmd,opt_isIdle){this._isViewer=isViewer;if(this._locks){this.ownedLockBlocks=[];for(var block in this._locks)if(this._locks.hasOwnProperty(block)){var lock=this._locks[block];if(lock["state"]===2)this.ownedLockBlocks.push(lock["blockValue"])}this._locks={}}this._send({"type":"auth","docid":this._docid,"documentCallbackUrl":this._documentCallbackUrl,"token":this._token,"user":{"id":this._user.asc_getId(),
"username":this._user.asc_getUserName(),"firstname":this._user.asc_getFirstName(),"lastname":this._user.asc_getLastName(),"indexUser":this._indexUser},"editorType":this.editorType,"lastOtherSaveTime":this.lastOtherSaveTime,"block":this.ownedLockBlocks,"sessionId":this._id,"sessionTimeConnect":this._sessionTimeConnect,"sessionTimeIdle":opt_isIdle>=0?opt_isIdle:0,"documentFormatSave":this._documentFormatSave,"view":this._isViewer,"isCloseCoAuthoring":this.isCloseCoAuthoring,"openCmd":opt_openCmd,"lang":this.lang,
"mode":this.mode,"permissions":this.permissions,"encrypted":this.encrypted,"jwtOpen":this.jwtOpen,"jwtSession":this.jwtSession})};DocsCoApi.prototype._initSocksJs=function(){var t=this;var sockjs;sockjs=this.sockjs={};var send=function(data){setTimeout(function(){sockjs.onmessage({data:JSON.stringify(data)})})};var license={type:"license",license:{type:3,mode:0,rights:1,buildVersion:"5.2.6",buildNumber:2}};var channel;require(["/common/outer/worker-channel.js","/common/common-util.js"],function(Channel,
Util){var msgEv=Util.mkEvent();var p=window.parent;if(editor.isReporterMode){p=window.opener;window.parent=p}else window.APP=p&&p.APP;window.addEventListener("message",function(msg){if(msg.source!==p)return;msgEv.fire(msg)});var postMsg=function(data){p.postMessage(data,"*")};Channel.create(msgEv,postMsg,function(chan){channel=chan;send(license);chan.on("CMD",function(obj){send(obj)})})});sockjs.onopen=function(){t._state=ConnectionState.WaitAuth;t.onFirstConnect()};sockjs.onopen();sockjs.close=function(){console.error("Close realtime")};
sockjs.send=function(data){try{var obj=JSON.parse(data)}catch(e){console.error(e);return}if(channel)channel.event("CMD",obj)};sockjs.onmessage=function(e){t._onServerMessage(e.data)};return sockjs};DocsCoApi.prototype._onServerOpen=function(){if(this.reconnectTimeout){clearTimeout(this.reconnectTimeout);this.reconnectTimeout=null;this.attemptCount=0}this._state=ConnectionState.WaitAuth;this.onFirstConnect()};DocsCoApi.prototype._onServerMessage=function(data){var dataObject=JSON.parse(data);switch(dataObject["type"]){case "auth":this._onAuth(dataObject);
break;case "message":this._onMessages(dataObject,false);break;case "cursor":this._onCursor(dataObject);break;case "meta":this._onMeta(dataObject);break;case "getLock":this._onGetLock(dataObject);break;case "releaseLock":this._onReleaseLock(dataObject);break;case "connectState":this._onConnectionStateChanged(dataObject);break;case "saveChanges":this._onSaveChanges(dataObject);break;case "authChanges":this._onAuthChanges(dataObject);break;case "saveLock":this._onSaveLock(dataObject);break;case "unSaveLock":this._onUnSaveLock(dataObject);
break;case "savePartChanges":this._onSavePartChanges(dataObject);break;case "drop":this._onDrop(dataObject);break;case "waitAuth":break;case "error":this._onDrop(dataObject);break;case "documentOpen":this._documentOpen(dataObject);break;case "warning":this._onWarning(dataObject);break;case "license":this._onLicense(dataObject);break;case "session":this._onSession(dataObject);break;case "refreshToken":this._onRefreshToken(dataObject["messages"]);break;case "expiredToken":this._onExpiredToken(dataObject);
break;case "forceSaveStart":this._onForceSaveStart(dataObject["messages"]);break;case "forceSave":this._onForceSave(dataObject["messages"]);break}};DocsCoApi.prototype._onServerClose=function(evt){if(ConnectionState.SaveChanges===this._state){this._isReSaveAfterAuth=true;if(null!==this.saveCallbackErrorTimeOutId){clearTimeout(this.saveCallbackErrorTimeOutId);this.saveCallbackErrorTimeOutId=null}}this._state=ConnectionState.Reconnect;var bIsDisconnectAtAll=c_oCloseCode.serverShutdown<=evt.code&&evt.code<=
c_oCloseCode.drop||this.attemptCount>=this.maxAttemptCount;var code=null;if(bIsDisconnectAtAll){this._state=ConnectionState.ClosedAll;code=evt.code}if(this.onDisconnect)this.onDisconnect(evt.reason,code);if(!bIsDisconnectAtAll)this._tryReconnect()};DocsCoApi.prototype._reconnect=function(){delete this.sockjs;this._initSocksJs()};DocsCoApi.prototype._tryReconnect=function(){var t=this;if(this.reconnectTimeout){clearTimeout(this.reconnectTimeout);t.reconnectTimeout=null}++this.attemptCount;this.reconnectTimeout=
setTimeout(function(){t._reconnect()},this.reconnectInterval)};window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].CDocsCoApi=CDocsCoApi})(window);"use strict";
Util){var msgEv=Util.mkEvent();var p=window.parent;if(editor&&editor.isReporterMode){p=window.opener;window.parent=p}else window.APP=p&&p.APP;window.addEventListener("message",function(msg){if(msg.source!==p)return;msgEv.fire(msg)});var postMsg=function(data){p.postMessage(data,"*")};Channel.create(msgEv,postMsg,function(chan){channel=chan;send(license);chan.on("CMD",function(obj){send(obj)})})});sockjs.onopen=function(){t._state=ConnectionState.WaitAuth;t.onFirstConnect()};sockjs.onopen();sockjs.close=
function(){console.error("Close realtime")};sockjs.send=function(data){try{var obj=JSON.parse(data)}catch(e){console.error(e);return}if(channel)channel.event("CMD",obj)};sockjs.onmessage=function(e){t._onServerMessage(e.data)};return sockjs};DocsCoApi.prototype._onServerOpen=function(){if(this.reconnectTimeout){clearTimeout(this.reconnectTimeout);this.reconnectTimeout=null;this.attemptCount=0}this._state=ConnectionState.WaitAuth;this.onFirstConnect()};DocsCoApi.prototype._onServerMessage=function(data){var dataObject=
JSON.parse(data);switch(dataObject["type"]){case "auth":this._onAuth(dataObject);break;case "message":this._onMessages(dataObject,false);break;case "cursor":this._onCursor(dataObject);break;case "meta":this._onMeta(dataObject);break;case "getLock":this._onGetLock(dataObject);break;case "releaseLock":this._onReleaseLock(dataObject);break;case "connectState":this._onConnectionStateChanged(dataObject);break;case "saveChanges":this._onSaveChanges(dataObject);break;case "authChanges":this._onAuthChanges(dataObject);
break;case "saveLock":this._onSaveLock(dataObject);break;case "unSaveLock":this._onUnSaveLock(dataObject);break;case "savePartChanges":this._onSavePartChanges(dataObject);break;case "drop":this._onDrop(dataObject);break;case "waitAuth":break;case "error":this._onDrop(dataObject);break;case "documentOpen":this._documentOpen(dataObject);break;case "warning":this._onWarning(dataObject);break;case "license":this._onLicense(dataObject);break;case "session":this._onSession(dataObject);break;case "refreshToken":this._onRefreshToken(dataObject["messages"]);
break;case "expiredToken":this._onExpiredToken(dataObject);break;case "forceSaveStart":this._onForceSaveStart(dataObject["messages"]);break;case "forceSave":this._onForceSave(dataObject["messages"]);break}};DocsCoApi.prototype._onServerClose=function(evt){if(ConnectionState.SaveChanges===this._state){this._isReSaveAfterAuth=true;if(null!==this.saveCallbackErrorTimeOutId){clearTimeout(this.saveCallbackErrorTimeOutId);this.saveCallbackErrorTimeOutId=null}}this._state=ConnectionState.Reconnect;var bIsDisconnectAtAll=
c_oCloseCode.serverShutdown<=evt.code&&evt.code<=c_oCloseCode.drop||this.attemptCount>=this.maxAttemptCount;var code=null;if(bIsDisconnectAtAll){this._state=ConnectionState.ClosedAll;code=evt.code}if(this.onDisconnect)this.onDisconnect(evt.reason,code);if(!bIsDisconnectAtAll)this._tryReconnect()};DocsCoApi.prototype._reconnect=function(){delete this.sockjs;this._initSocksJs()};DocsCoApi.prototype._tryReconnect=function(){var t=this;if(this.reconnectTimeout){clearTimeout(this.reconnectTimeout);t.reconnectTimeout=
null}++this.attemptCount;this.reconnectTimeout=setTimeout(function(){t._reconnect()},this.reconnectInterval)};window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].CDocsCoApi=CDocsCoApi})(window);"use strict";
(function(window){var CSpellCheckApi=function(){this._SpellCheckApi=new SpellCheckApi;this._onlineWork=false;this.onDisconnect=null;this.onSpellCheck=null};CSpellCheckApi.prototype.init=function(docid){if(this._SpellCheckApi&&this._SpellCheckApi.isRightURL()){var t=this;this._SpellCheckApi.onDisconnect=function(e,isDisconnectAtAll,isCloseCoAuthoring){t.callback_OnDisconnect(e,isDisconnectAtAll,isCloseCoAuthoring)};this._SpellCheckApi.onSpellCheck=function(e){t.callback_OnSpellCheck(e)};this._SpellCheckApi.onInit=
function(e){t.callback_OnInit(e)};this._SpellCheckApi.init(docid);this._onlineWork=true}};CSpellCheckApi.prototype.set_url=function(url){if(this._SpellCheckApi)this._SpellCheckApi.set_url(url)};CSpellCheckApi.prototype.get_state=function(){if(this._SpellCheckApi)return this._SpellCheckApi.get_state();return 0};CSpellCheckApi.prototype.disconnect=function(){if(this._SpellCheckApi&&this._onlineWork)this._SpellCheckApi.disconnect()};CSpellCheckApi.prototype.spellCheck=function(spellCheckData){if(this._SpellCheckApi&&
this._onlineWork)this._SpellCheckApi.spellCheck(spellCheckData)};CSpellCheckApi.prototype.checkDictionary=function(lang){if(this._SpellCheckApi&&this._onlineWork)return this._SpellCheckApi.checkDictionary(lang);return true};CSpellCheckApi.prototype.callback_OnSpellCheck=function(e){if(this.onSpellCheck)return this.onSpellCheck(e)};CSpellCheckApi.prototype.callback_OnInit=function(e){if(this.onInit)return this.onInit(e)};CSpellCheckApi.prototype.callback_OnDisconnect=function(e,isDisconnectAtAll,isCloseCoAuthoring){if(this.onDisconnect)return this.onDisconnect(e,

@ -266,13 +266,13 @@ editorType;this._isExcel=c_oEditorId.Spreadsheet===editorType;this._isPresentati
docid;this.sockjs_url=AscCommon.getBaseUrl()+"../../../../doc/"+docid+"/c"};DocsCoApi.prototype.auth=function(isViewer,opt_openCmd,opt_isIdle){this._isViewer=isViewer;if(this._locks){this.ownedLockBlocks=[];for(var block in this._locks)if(this._locks.hasOwnProperty(block)){var lock=this._locks[block];if(lock["state"]===2)this.ownedLockBlocks.push(lock["blockValue"])}this._locks={}}this._send({"type":"auth","docid":this._docid,"documentCallbackUrl":this._documentCallbackUrl,"token":this._token,"user":{"id":this._user.asc_getId(),
"username":this._user.asc_getUserName(),"firstname":this._user.asc_getFirstName(),"lastname":this._user.asc_getLastName(),"indexUser":this._indexUser},"editorType":this.editorType,"lastOtherSaveTime":this.lastOtherSaveTime,"block":this.ownedLockBlocks,"sessionId":this._id,"sessionTimeConnect":this._sessionTimeConnect,"sessionTimeIdle":opt_isIdle>=0?opt_isIdle:0,"documentFormatSave":this._documentFormatSave,"view":this._isViewer,"isCloseCoAuthoring":this.isCloseCoAuthoring,"openCmd":opt_openCmd,"lang":this.lang,
"mode":this.mode,"permissions":this.permissions,"encrypted":this.encrypted,"jwtOpen":this.jwtOpen,"jwtSession":this.jwtSession})};DocsCoApi.prototype._initSocksJs=function(){var t=this;var sockjs;sockjs=this.sockjs={};var send=function(data){setTimeout(function(){sockjs.onmessage({data:JSON.stringify(data)})})};var license={type:"license",license:{type:3,mode:0,rights:1,buildVersion:"5.2.6",buildNumber:2}};var channel;require(["/common/outer/worker-channel.js","/common/common-util.js"],function(Channel,
Util){var msgEv=Util.mkEvent();var p=window.parent;if(editor.isReporterMode){p=window.opener;window.parent=p}else window.APP=p&&p.APP;window.addEventListener("message",function(msg){if(msg.source!==p)return;msgEv.fire(msg)});var postMsg=function(data){p.postMessage(data,"*")};Channel.create(msgEv,postMsg,function(chan){channel=chan;send(license);chan.on("CMD",function(obj){send(obj)})})});sockjs.onopen=function(){t._state=ConnectionState.WaitAuth;t.onFirstConnect()};sockjs.onopen();sockjs.close=function(){console.error("Close realtime")};
sockjs.send=function(data){try{var obj=JSON.parse(data)}catch(e){console.error(e);return}if(channel)channel.event("CMD",obj)};sockjs.onmessage=function(e){t._onServerMessage(e.data)};return sockjs};DocsCoApi.prototype._onServerOpen=function(){if(this.reconnectTimeout){clearTimeout(this.reconnectTimeout);this.reconnectTimeout=null;this.attemptCount=0}this._state=ConnectionState.WaitAuth;this.onFirstConnect()};DocsCoApi.prototype._onServerMessage=function(data){var dataObject=JSON.parse(data);switch(dataObject["type"]){case "auth":this._onAuth(dataObject);
break;case "message":this._onMessages(dataObject,false);break;case "cursor":this._onCursor(dataObject);break;case "meta":this._onMeta(dataObject);break;case "getLock":this._onGetLock(dataObject);break;case "releaseLock":this._onReleaseLock(dataObject);break;case "connectState":this._onConnectionStateChanged(dataObject);break;case "saveChanges":this._onSaveChanges(dataObject);break;case "authChanges":this._onAuthChanges(dataObject);break;case "saveLock":this._onSaveLock(dataObject);break;case "unSaveLock":this._onUnSaveLock(dataObject);
break;case "savePartChanges":this._onSavePartChanges(dataObject);break;case "drop":this._onDrop(dataObject);break;case "waitAuth":break;case "error":this._onDrop(dataObject);break;case "documentOpen":this._documentOpen(dataObject);break;case "warning":this._onWarning(dataObject);break;case "license":this._onLicense(dataObject);break;case "session":this._onSession(dataObject);break;case "refreshToken":this._onRefreshToken(dataObject["messages"]);break;case "expiredToken":this._onExpiredToken(dataObject);
break;case "forceSaveStart":this._onForceSaveStart(dataObject["messages"]);break;case "forceSave":this._onForceSave(dataObject["messages"]);break}};DocsCoApi.prototype._onServerClose=function(evt){if(ConnectionState.SaveChanges===this._state){this._isReSaveAfterAuth=true;if(null!==this.saveCallbackErrorTimeOutId){clearTimeout(this.saveCallbackErrorTimeOutId);this.saveCallbackErrorTimeOutId=null}}this._state=ConnectionState.Reconnect;var bIsDisconnectAtAll=c_oCloseCode.serverShutdown<=evt.code&&evt.code<=
c_oCloseCode.drop||this.attemptCount>=this.maxAttemptCount;var code=null;if(bIsDisconnectAtAll){this._state=ConnectionState.ClosedAll;code=evt.code}if(this.onDisconnect)this.onDisconnect(evt.reason,code);if(!bIsDisconnectAtAll)this._tryReconnect()};DocsCoApi.prototype._reconnect=function(){delete this.sockjs;this._initSocksJs()};DocsCoApi.prototype._tryReconnect=function(){var t=this;if(this.reconnectTimeout){clearTimeout(this.reconnectTimeout);t.reconnectTimeout=null}++this.attemptCount;this.reconnectTimeout=
setTimeout(function(){t._reconnect()},this.reconnectInterval)};window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].CDocsCoApi=CDocsCoApi})(window);"use strict";
Util){var msgEv=Util.mkEvent();var p=window.parent;if(editor&&editor.isReporterMode){p=window.opener;window.parent=p}else window.APP=p&&p.APP;window.addEventListener("message",function(msg){if(msg.source!==p)return;msgEv.fire(msg)});var postMsg=function(data){p.postMessage(data,"*")};Channel.create(msgEv,postMsg,function(chan){channel=chan;send(license);chan.on("CMD",function(obj){send(obj)})})});sockjs.onopen=function(){t._state=ConnectionState.WaitAuth;t.onFirstConnect()};sockjs.onopen();sockjs.close=
function(){console.error("Close realtime")};sockjs.send=function(data){try{var obj=JSON.parse(data)}catch(e){console.error(e);return}if(channel)channel.event("CMD",obj)};sockjs.onmessage=function(e){t._onServerMessage(e.data)};return sockjs};DocsCoApi.prototype._onServerOpen=function(){if(this.reconnectTimeout){clearTimeout(this.reconnectTimeout);this.reconnectTimeout=null;this.attemptCount=0}this._state=ConnectionState.WaitAuth;this.onFirstConnect()};DocsCoApi.prototype._onServerMessage=function(data){var dataObject=
JSON.parse(data);switch(dataObject["type"]){case "auth":this._onAuth(dataObject);break;case "message":this._onMessages(dataObject,false);break;case "cursor":this._onCursor(dataObject);break;case "meta":this._onMeta(dataObject);break;case "getLock":this._onGetLock(dataObject);break;case "releaseLock":this._onReleaseLock(dataObject);break;case "connectState":this._onConnectionStateChanged(dataObject);break;case "saveChanges":this._onSaveChanges(dataObject);break;case "authChanges":this._onAuthChanges(dataObject);
break;case "saveLock":this._onSaveLock(dataObject);break;case "unSaveLock":this._onUnSaveLock(dataObject);break;case "savePartChanges":this._onSavePartChanges(dataObject);break;case "drop":this._onDrop(dataObject);break;case "waitAuth":break;case "error":this._onDrop(dataObject);break;case "documentOpen":this._documentOpen(dataObject);break;case "warning":this._onWarning(dataObject);break;case "license":this._onLicense(dataObject);break;case "session":this._onSession(dataObject);break;case "refreshToken":this._onRefreshToken(dataObject["messages"]);
break;case "expiredToken":this._onExpiredToken(dataObject);break;case "forceSaveStart":this._onForceSaveStart(dataObject["messages"]);break;case "forceSave":this._onForceSave(dataObject["messages"]);break}};DocsCoApi.prototype._onServerClose=function(evt){if(ConnectionState.SaveChanges===this._state){this._isReSaveAfterAuth=true;if(null!==this.saveCallbackErrorTimeOutId){clearTimeout(this.saveCallbackErrorTimeOutId);this.saveCallbackErrorTimeOutId=null}}this._state=ConnectionState.Reconnect;var bIsDisconnectAtAll=
c_oCloseCode.serverShutdown<=evt.code&&evt.code<=c_oCloseCode.drop||this.attemptCount>=this.maxAttemptCount;var code=null;if(bIsDisconnectAtAll){this._state=ConnectionState.ClosedAll;code=evt.code}if(this.onDisconnect)this.onDisconnect(evt.reason,code);if(!bIsDisconnectAtAll)this._tryReconnect()};DocsCoApi.prototype._reconnect=function(){delete this.sockjs;this._initSocksJs()};DocsCoApi.prototype._tryReconnect=function(){var t=this;if(this.reconnectTimeout){clearTimeout(this.reconnectTimeout);t.reconnectTimeout=
null}++this.attemptCount;this.reconnectTimeout=setTimeout(function(){t._reconnect()},this.reconnectInterval)};window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].CDocsCoApi=CDocsCoApi})(window);"use strict";
(function(window){var CSpellCheckApi=function(){this._SpellCheckApi=new SpellCheckApi;this._onlineWork=false;this.onDisconnect=null;this.onSpellCheck=null};CSpellCheckApi.prototype.init=function(docid){if(this._SpellCheckApi&&this._SpellCheckApi.isRightURL()){var t=this;this._SpellCheckApi.onDisconnect=function(e,isDisconnectAtAll,isCloseCoAuthoring){t.callback_OnDisconnect(e,isDisconnectAtAll,isCloseCoAuthoring)};this._SpellCheckApi.onSpellCheck=function(e){t.callback_OnSpellCheck(e)};this._SpellCheckApi.onInit=
function(e){t.callback_OnInit(e)};this._SpellCheckApi.init(docid);this._onlineWork=true}};CSpellCheckApi.prototype.set_url=function(url){if(this._SpellCheckApi)this._SpellCheckApi.set_url(url)};CSpellCheckApi.prototype.get_state=function(){if(this._SpellCheckApi)return this._SpellCheckApi.get_state();return 0};CSpellCheckApi.prototype.disconnect=function(){if(this._SpellCheckApi&&this._onlineWork)this._SpellCheckApi.disconnect()};CSpellCheckApi.prototype.spellCheck=function(spellCheckData){if(this._SpellCheckApi&&
this._onlineWork)this._SpellCheckApi.spellCheck(spellCheckData)};CSpellCheckApi.prototype.checkDictionary=function(lang){if(this._SpellCheckApi&&this._onlineWork)return this._SpellCheckApi.checkDictionary(lang);return true};CSpellCheckApi.prototype.callback_OnSpellCheck=function(e){if(this.onSpellCheck)return this.onSpellCheck(e)};CSpellCheckApi.prototype.callback_OnInit=function(e){if(this.onInit)return this.onInit(e)};CSpellCheckApi.prototype.callback_OnDisconnect=function(e,isDisconnectAtAll,isCloseCoAuthoring){if(this.onDisconnect)return this.onDisconnect(e,

@ -15924,7 +15924,7 @@ themeInfo.Master);var oldMaster=this.Slides[this.CurPage]&&this.Slides[this.CurP
oMasterSp.getDocContent&&oMasterSp.getDocContent();if(oMasterContent){oSp=themeInfo.Master.getMatchingShape(AscFormat.phType_dt,null,false,{});if(oSp){oContent=oSp.getDocContent&&oSp.getDocContent();oContent.Copy2(oMasterContent)}for(i=0;i<themeInfo.Master.sldLayoutLst.length;++i){oSp=themeInfo.Master.sldLayoutLst[i].getMatchingShape(AscFormat.phType_dt,null,false,{});if(oSp){oContent=oSp.getDocContent&&oSp.getDocContent();oContent.Copy2(oMasterContent)}}}}}if(oldMaster.hf.hdr!==false){oMasterSp=
oldMaster.getMatchingShape(AscFormat.phType_hdr,null,false,{});if(oMasterSp){oMasterContent=oMasterSp.getDocContent&&oMasterSp.getDocContent();if(oMasterContent){oSp=themeInfo.Master.getMatchingShape(AscFormat.phType_hdr,null,false,{});if(oSp){oContent=oSp.getDocContent&&oSp.getDocContent();oContent.Copy2(oMasterContent)}for(i=0;i<themeInfo.Master.sldLayoutLst.length;++i){oSp=themeInfo.Master.sldLayoutLst[i].getMatchingShape(AscFormat.phType_hdr,null,false,{});if(oSp){oContent=oSp.getDocContent&&
oSp.getDocContent();oContent.Copy2(oMasterContent)}}}}}if(oldMaster.hf.ftr!==false){oMasterSp=oldMaster.getMatchingShape(AscFormat.phType_ftr,null,false,{});if(oMasterSp){oMasterContent=oMasterSp.getDocContent&&oMasterSp.getDocContent();if(oMasterContent){oSp=themeInfo.Master.getMatchingShape(AscFormat.phType_ftr,null,false,{});if(oSp){oContent=oSp.getDocContent&&oSp.getDocContent();oContent.Copy2(oMasterContent)}for(i=0;i<themeInfo.Master.sldLayoutLst.length;++i){oSp=themeInfo.Master.sldLayoutLst[i].getMatchingShape(AscFormat.phType_ftr,
null,false,{});if(oSp){oContent=oSp.getDocContent&&oSp.getDocContent();oContent.Copy2(oMasterContent)}}}}}}for(i=0;i<themeInfo.Master.sldLayoutLst.length;++i)themeInfo.Master.sldLayoutLst[i].changeSize(this.Width,this.Height);var slides_array=[];for(i=0;i<arr_ind.length;++i)slides_array.push(this.Slides[arr_ind[i]]);var new_layout;for(i=0;i<slides_array.length;++i){console.error(slides_array[i]);if(slides_array[i].Layout.calculatedType==null)slides_array[i].Layout.calculateType();new_layout=_new_master.getMatchingLayout(slides_array[i].Layout.type,
null,false,{});if(oSp){oContent=oSp.getDocContent&&oSp.getDocContent();oContent.Copy2(oMasterContent)}}}}}}for(i=0;i<themeInfo.Master.sldLayoutLst.length;++i)themeInfo.Master.sldLayoutLst[i].changeSize(this.Width,this.Height);var slides_array=[];for(i=0;i<arr_ind.length;++i)slides_array.push(this.Slides[arr_ind[i]]);var new_layout;for(i=0;i<slides_array.length;++i){if(slides_array[i].Layout.calculatedType==null)slides_array[i].Layout.calculateType();new_layout=_new_master.getMatchingLayout(slides_array[i].Layout.type,
slides_array[i].Layout.matchingName,slides_array[i].Layout.cSld.name,true);if(!isRealObject(new_layout))new_layout=_new_master.sldLayoutLst[0];slides_array[i].setLayout(new_layout);slides_array[i].checkNoTransformPlaceholder()}History.Add(new AscDFH.CChangesDrawingChangeTheme(this,AscDFH.historyitem_Presentation_ChangeTheme,arr_ind));this.Recalculate();this.Document_UpdateInterfaceState()};CPresentation.prototype.changeSlideSizeFunction=function(width,height){AscFormat.ExecuteNoHistory(function(){for(var i=
0;i<this.slideMasters.length;++i){this.slideMasters[i].changeSize(width,height);var master=this.slideMasters[i];for(var j=0;j<master.sldLayoutLst.length;++j)master.sldLayoutLst[j].changeSize(width,height)}for(var i=0;i<this.Slides.length;++i)this.Slides[i].changeSize(width,height)},this,[])};CPresentation.prototype.changeSlideSize=function(width,height){if(this.Document_Is_SelectionLocked(AscCommon.changestype_SlideSize)===false){History.Create_NewPoint(AscDFH.historydescription_Presentation_ChangeSlideSize);
History.Add(new AscDFH.CChangesDrawingsObjectNoId(this,AscDFH.historyitem_Presentation_SlideSize,new AscFormat.CDrawingBaseCoordsWritable(this.Width,this.Height),new AscFormat.CDrawingBaseCoordsWritable(width,height)));this.Width=width;this.Height=height;this.changeSlideSizeFunction(this.Width,this.Height);this.Recalculate();this.Document_UpdateInterfaceState()}};CPresentation.prototype.changeColorScheme=function(colorScheme){if(this.viewMode===true)return;if(!(this.Document_Is_SelectionLocked(AscCommon.changestype_Theme)===

@ -1 +1 @@
AscCommon.g_defaultThemes = ["Blank","Basic","Classic","Official","Green leaf","Lines","Office","Safari","Dotted","Corner","Turtle","XWiki"];
AscCommon.g_defaultThemes = ["Blank","Basic","Classic","Official","Green leaf","Lines","Office","Safari","Dotted","Corner","Turtle"];

@ -266,13 +266,13 @@ editorType;this._isExcel=c_oEditorId.Spreadsheet===editorType;this._isPresentati
docid;this.sockjs_url=AscCommon.getBaseUrl()+"../../../../doc/"+docid+"/c"};DocsCoApi.prototype.auth=function(isViewer,opt_openCmd,opt_isIdle){this._isViewer=isViewer;if(this._locks){this.ownedLockBlocks=[];for(var block in this._locks)if(this._locks.hasOwnProperty(block)){var lock=this._locks[block];if(lock["state"]===2)this.ownedLockBlocks.push(lock["blockValue"])}this._locks={}}this._send({"type":"auth","docid":this._docid,"documentCallbackUrl":this._documentCallbackUrl,"token":this._token,"user":{"id":this._user.asc_getId(),
"username":this._user.asc_getUserName(),"firstname":this._user.asc_getFirstName(),"lastname":this._user.asc_getLastName(),"indexUser":this._indexUser},"editorType":this.editorType,"lastOtherSaveTime":this.lastOtherSaveTime,"block":this.ownedLockBlocks,"sessionId":this._id,"sessionTimeConnect":this._sessionTimeConnect,"sessionTimeIdle":opt_isIdle>=0?opt_isIdle:0,"documentFormatSave":this._documentFormatSave,"view":this._isViewer,"isCloseCoAuthoring":this.isCloseCoAuthoring,"openCmd":opt_openCmd,"lang":this.lang,
"mode":this.mode,"permissions":this.permissions,"encrypted":this.encrypted,"jwtOpen":this.jwtOpen,"jwtSession":this.jwtSession})};DocsCoApi.prototype._initSocksJs=function(){var t=this;var sockjs;sockjs=this.sockjs={};var send=function(data){setTimeout(function(){sockjs.onmessage({data:JSON.stringify(data)})})};var license={type:"license",license:{type:3,mode:0,rights:1,buildVersion:"5.2.6",buildNumber:2}};var channel;require(["/common/outer/worker-channel.js","/common/common-util.js"],function(Channel,
Util){var msgEv=Util.mkEvent();var p=window.parent;if(editor.isReporterMode){p=window.opener;window.parent=p}else window.APP=p&&p.APP;window.addEventListener("message",function(msg){if(msg.source!==p)return;msgEv.fire(msg)});var postMsg=function(data){p.postMessage(data,"*")};Channel.create(msgEv,postMsg,function(chan){channel=chan;send(license);chan.on("CMD",function(obj){send(obj)})})});sockjs.onopen=function(){t._state=ConnectionState.WaitAuth;t.onFirstConnect()};sockjs.onopen();sockjs.close=function(){console.error("Close realtime")};
sockjs.send=function(data){try{var obj=JSON.parse(data)}catch(e){console.error(e);return}if(channel)channel.event("CMD",obj)};sockjs.onmessage=function(e){t._onServerMessage(e.data)};return sockjs};DocsCoApi.prototype._onServerOpen=function(){if(this.reconnectTimeout){clearTimeout(this.reconnectTimeout);this.reconnectTimeout=null;this.attemptCount=0}this._state=ConnectionState.WaitAuth;this.onFirstConnect()};DocsCoApi.prototype._onServerMessage=function(data){var dataObject=JSON.parse(data);switch(dataObject["type"]){case "auth":this._onAuth(dataObject);
break;case "message":this._onMessages(dataObject,false);break;case "cursor":this._onCursor(dataObject);break;case "meta":this._onMeta(dataObject);break;case "getLock":this._onGetLock(dataObject);break;case "releaseLock":this._onReleaseLock(dataObject);break;case "connectState":this._onConnectionStateChanged(dataObject);break;case "saveChanges":this._onSaveChanges(dataObject);break;case "authChanges":this._onAuthChanges(dataObject);break;case "saveLock":this._onSaveLock(dataObject);break;case "unSaveLock":this._onUnSaveLock(dataObject);
break;case "savePartChanges":this._onSavePartChanges(dataObject);break;case "drop":this._onDrop(dataObject);break;case "waitAuth":break;case "error":this._onDrop(dataObject);break;case "documentOpen":this._documentOpen(dataObject);break;case "warning":this._onWarning(dataObject);break;case "license":this._onLicense(dataObject);break;case "session":this._onSession(dataObject);break;case "refreshToken":this._onRefreshToken(dataObject["messages"]);break;case "expiredToken":this._onExpiredToken(dataObject);
break;case "forceSaveStart":this._onForceSaveStart(dataObject["messages"]);break;case "forceSave":this._onForceSave(dataObject["messages"]);break}};DocsCoApi.prototype._onServerClose=function(evt){if(ConnectionState.SaveChanges===this._state){this._isReSaveAfterAuth=true;if(null!==this.saveCallbackErrorTimeOutId){clearTimeout(this.saveCallbackErrorTimeOutId);this.saveCallbackErrorTimeOutId=null}}this._state=ConnectionState.Reconnect;var bIsDisconnectAtAll=c_oCloseCode.serverShutdown<=evt.code&&evt.code<=
c_oCloseCode.drop||this.attemptCount>=this.maxAttemptCount;var code=null;if(bIsDisconnectAtAll){this._state=ConnectionState.ClosedAll;code=evt.code}if(this.onDisconnect)this.onDisconnect(evt.reason,code);if(!bIsDisconnectAtAll)this._tryReconnect()};DocsCoApi.prototype._reconnect=function(){delete this.sockjs;this._initSocksJs()};DocsCoApi.prototype._tryReconnect=function(){var t=this;if(this.reconnectTimeout){clearTimeout(this.reconnectTimeout);t.reconnectTimeout=null}++this.attemptCount;this.reconnectTimeout=
setTimeout(function(){t._reconnect()},this.reconnectInterval)};window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].CDocsCoApi=CDocsCoApi})(window);"use strict";
Util){var msgEv=Util.mkEvent();var p=window.parent;if(editor&&editor.isReporterMode){p=window.opener;window.parent=p}else window.APP=p&&p.APP;window.addEventListener("message",function(msg){if(msg.source!==p)return;msgEv.fire(msg)});var postMsg=function(data){p.postMessage(data,"*")};Channel.create(msgEv,postMsg,function(chan){channel=chan;send(license);chan.on("CMD",function(obj){send(obj)})})});sockjs.onopen=function(){t._state=ConnectionState.WaitAuth;t.onFirstConnect()};sockjs.onopen();sockjs.close=
function(){console.error("Close realtime")};sockjs.send=function(data){try{var obj=JSON.parse(data)}catch(e){console.error(e);return}if(channel)channel.event("CMD",obj)};sockjs.onmessage=function(e){t._onServerMessage(e.data)};return sockjs};DocsCoApi.prototype._onServerOpen=function(){if(this.reconnectTimeout){clearTimeout(this.reconnectTimeout);this.reconnectTimeout=null;this.attemptCount=0}this._state=ConnectionState.WaitAuth;this.onFirstConnect()};DocsCoApi.prototype._onServerMessage=function(data){var dataObject=
JSON.parse(data);switch(dataObject["type"]){case "auth":this._onAuth(dataObject);break;case "message":this._onMessages(dataObject,false);break;case "cursor":this._onCursor(dataObject);break;case "meta":this._onMeta(dataObject);break;case "getLock":this._onGetLock(dataObject);break;case "releaseLock":this._onReleaseLock(dataObject);break;case "connectState":this._onConnectionStateChanged(dataObject);break;case "saveChanges":this._onSaveChanges(dataObject);break;case "authChanges":this._onAuthChanges(dataObject);
break;case "saveLock":this._onSaveLock(dataObject);break;case "unSaveLock":this._onUnSaveLock(dataObject);break;case "savePartChanges":this._onSavePartChanges(dataObject);break;case "drop":this._onDrop(dataObject);break;case "waitAuth":break;case "error":this._onDrop(dataObject);break;case "documentOpen":this._documentOpen(dataObject);break;case "warning":this._onWarning(dataObject);break;case "license":this._onLicense(dataObject);break;case "session":this._onSession(dataObject);break;case "refreshToken":this._onRefreshToken(dataObject["messages"]);
break;case "expiredToken":this._onExpiredToken(dataObject);break;case "forceSaveStart":this._onForceSaveStart(dataObject["messages"]);break;case "forceSave":this._onForceSave(dataObject["messages"]);break}};DocsCoApi.prototype._onServerClose=function(evt){if(ConnectionState.SaveChanges===this._state){this._isReSaveAfterAuth=true;if(null!==this.saveCallbackErrorTimeOutId){clearTimeout(this.saveCallbackErrorTimeOutId);this.saveCallbackErrorTimeOutId=null}}this._state=ConnectionState.Reconnect;var bIsDisconnectAtAll=
c_oCloseCode.serverShutdown<=evt.code&&evt.code<=c_oCloseCode.drop||this.attemptCount>=this.maxAttemptCount;var code=null;if(bIsDisconnectAtAll){this._state=ConnectionState.ClosedAll;code=evt.code}if(this.onDisconnect)this.onDisconnect(evt.reason,code);if(!bIsDisconnectAtAll)this._tryReconnect()};DocsCoApi.prototype._reconnect=function(){delete this.sockjs;this._initSocksJs()};DocsCoApi.prototype._tryReconnect=function(){var t=this;if(this.reconnectTimeout){clearTimeout(this.reconnectTimeout);t.reconnectTimeout=
null}++this.attemptCount;this.reconnectTimeout=setTimeout(function(){t._reconnect()},this.reconnectInterval)};window["AscCommon"]=window["AscCommon"]||{};window["AscCommon"].CDocsCoApi=CDocsCoApi})(window);"use strict";
(function(window){var CSpellCheckApi=function(){this._SpellCheckApi=new SpellCheckApi;this._onlineWork=false;this.onDisconnect=null;this.onSpellCheck=null};CSpellCheckApi.prototype.init=function(docid){if(this._SpellCheckApi&&this._SpellCheckApi.isRightURL()){var t=this;this._SpellCheckApi.onDisconnect=function(e,isDisconnectAtAll,isCloseCoAuthoring){t.callback_OnDisconnect(e,isDisconnectAtAll,isCloseCoAuthoring)};this._SpellCheckApi.onSpellCheck=function(e){t.callback_OnSpellCheck(e)};this._SpellCheckApi.onInit=
function(e){t.callback_OnInit(e)};this._SpellCheckApi.init(docid);this._onlineWork=true}};CSpellCheckApi.prototype.set_url=function(url){if(this._SpellCheckApi)this._SpellCheckApi.set_url(url)};CSpellCheckApi.prototype.get_state=function(){if(this._SpellCheckApi)return this._SpellCheckApi.get_state();return 0};CSpellCheckApi.prototype.disconnect=function(){if(this._SpellCheckApi&&this._onlineWork)this._SpellCheckApi.disconnect()};CSpellCheckApi.prototype.spellCheck=function(spellCheckData){if(this._SpellCheckApi&&
this._onlineWork)this._SpellCheckApi.spellCheck(spellCheckData)};CSpellCheckApi.prototype.checkDictionary=function(lang){if(this._SpellCheckApi&&this._onlineWork)return this._SpellCheckApi.checkDictionary(lang);return true};CSpellCheckApi.prototype.callback_OnSpellCheck=function(e){if(this.onSpellCheck)return this.onSpellCheck(e)};CSpellCheckApi.prototype.callback_OnInit=function(e){if(this.onInit)return this.onInit(e)};CSpellCheckApi.prototype.callback_OnDisconnect=function(e,isDisconnectAtAll,isCloseCoAuthoring){if(this.onDisconnect)return this.onDisconnect(e,

Loading…
Cancel
Save