Commit f8b48ca7 authored by konovalovsergey's avatar konovalovsergey Committed by Alexander.Trofimov

join auth and open command

parent e05801a1
......@@ -759,7 +759,6 @@ var editor;
"userid": this.documentUserId,
"format": this.documentFormat,
"vkey": this.documentVKey,
"editorid": this.editorId,
"c": "reopen",
"url": this.documentUrl,
"title": this.documentTitle,
......
......@@ -278,23 +278,14 @@ baseEditorsApi.prototype.onPrint = function() {
baseEditorsApi.prototype.asc_LoadDocument = function(isVersionHistory) {
// Меняем тип состояния (на открытие)
this.advancedOptionsAction = AscCommon.c_oAscAdvancedOptionsAction.Open;
this.CoAuthoringApi.auth(this.getViewMode());
this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Open);
if (offlineMode === this.documentUrl) {
// ToDo убрать зависимость от this.FontLoader.fontFilesPath
this.documentUrl = this.FontLoader.fontFilesPath + '../' + this._editorNameById() + '/document/';
this.DocInfo.asc_putOfflineApp(true);
this._OfflineAppDocumentStartLoad();
} else {
var rData = null;
if (offlineMode !== this.documentUrl) {
var rData = {
"c": 'open',
"id": this.documentId,
"userid": this.documentUserId,
"format": this.documentFormat,
"vkey": this.documentVKey,
"editorid": this.editorId,
"url": this.documentUrl,
"title": this.documentTitle,
"embeddedfonts": this.isUseEmbeddedCutFonts,
......@@ -304,7 +295,16 @@ baseEditorsApi.prototype.asc_LoadDocument = function(isVersionHistory) {
//чтобы результат пришел только этому соединению, а не всем кто в документе
rData["userconnectionid"] = this.CoAuthoringApi.getUserConnectionId();
}
AscCommon.sendCommand(this, null, rData);
}
this.CoAuthoringApi.auth(this.getViewMode(), rData);
this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Open);
if (offlineMode === this.documentUrl) {
// ToDo убрать зависимость от this.FontLoader.fontFilesPath
this.documentUrl = this.FontLoader.fontFilesPath + '../' + this._editorNameById() + '/document/';
this.DocInfo.asc_putOfflineApp(true);
this._OfflineAppDocumentStartLoad();
}
};
baseEditorsApi.prototype._OfflineAppDocumentStartLoad = function() {
......
......@@ -121,9 +121,9 @@
return undefined;
};
CDocsCoApi.prototype.auth = function(isViewer) {
CDocsCoApi.prototype.auth = function(isViewer, opt_openCmd) {
if (this._CoAuthoringApi && this._onlineWork) {
this._CoAuthoringApi.auth(isViewer);
this._CoAuthoringApi.auth(isViewer, opt_openCmd);
} else {
// Фиктивные вызовы
this.callback_OnSpellCheckInit('');
......@@ -1161,7 +1161,7 @@
return this._docid;
};
// Авторизация (ее нужно делать после выставления состояния редактора view-mode)
DocsCoApi.prototype.auth = function(isViewer) {
DocsCoApi.prototype.auth = function(isViewer, opt_openCmd) {
this.isAuthInit = true;
this._isViewer = isViewer;
if (this._locks) {
......@@ -1193,6 +1193,7 @@
'documentFormatSave': this._documentFormatSave,
'view': this._isViewer,
'isCloseCoAuthoring': this.isCloseCoAuthoring,
'openCmd': opt_openCmd,
'version': asc_coAuthV
});
};
......
......@@ -1966,7 +1966,6 @@ asc_docs_api.prototype.asc_setAdvancedOptions = function(idOption, option) {
"userid": this.documentUserId,
"format": this.documentFormat,
"vkey": this.documentVKey,
"editorid": this.editorId,
"c":"reopen",
"url": this.documentUrl,
"title": this.documentTitle,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment