Commit 1e3e3dac authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Общий asc_LoadDocument

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@66610 954022d7-b5bf-4e40-9824-e11837661b57
parent 675e16b3
......@@ -88,7 +88,7 @@ baseEditorsApi.prototype.asc_showRevision = function(newObj) {
this.DocInfo.put_Url(this.VersionHistory.url);
this.documentUrlChanges = this.VersionHistory.urlChanges;
this.asc_setDocInfo(this.DocInfo);
this.LoadDocument(true);
this.asc_LoadDocument(true);
} else if (this.VersionHistory.currentChangeId < newObj.currentChangeId) {
// Нужно только добавить некоторые изменения
CollaborativeEditing.Clear_CollaborativeMarks();
......
......@@ -219,6 +219,38 @@ baseEditorsApi.prototype.checkLongActionCallback = function(_callback, _param) {
}
};
// Open
baseEditorsApi.prototype.asc_LoadDocument = function(isVersionHistory) {
// Меняем тип состояния (на открытие)
this.advancedOptionsAction = 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 + "../Excel/document/"; // поменять!
this.DocInfo.asc_putOfflineApp(true);
this._OfflineAppDocumentStartLoad();
} else {
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,
"viewmode": this.getViewMode()
};
if (isVersionHistory) {
//чтобы результат пришел только этому соединению, а не всем кто в документе
rData["userconnectionid"] = this.CoAuthoringApi.getUserConnectionId();
}
sendCommand2(this, null, rData);
}
};
baseEditorsApi.prototype._onOpenCommand = function(data) {
};
baseEditorsApi.prototype._onNeedParams = function(data) {
......
......@@ -337,12 +337,6 @@ var editor;
}
}
};
spreadsheet_api.prototype.asc_LoadDocument = function() {
this.CoAuthoringApi.auth(this.getViewMode());
this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Open);
this._asc_open();
};
spreadsheet_api.prototype.asc_LoadEmptyDocument = function() {
this.CoAuthoringApi.auth(this.getViewMode());
......@@ -690,32 +684,6 @@ var editor;
}
};
spreadsheet_api.prototype._asc_open = function() {
// Меняем тип состояния (на открытие)
this.advancedOptionsAction = c_oAscAdvancedOptionsAction.Open;
if (offlineMode === this.documentUrl) {
// ToDo убрать зависимость от this.FontLoader.fontFilesPath
this.documentUrl = this.FontLoader.fontFilesPath + "../Excel/document/";
this.DocInfo.asc_putOfflineApp(true);
this._OfflineAppDocumentStartLoad();
} else {
var v = {
"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,
"viewmode": this.getViewMode()
};
sendCommand2(this, null, v);
}
};
spreadsheet_api.prototype._asc_save2 = function() {
var oBinaryFileWriter = new Asc.BinaryFileWriter(this.wbModel);
var dataContainer = {data: null, part: null, index: 0, count: 0};
......
......@@ -1303,7 +1303,6 @@
editor.asc_SetFontsPath("../Fonts/");
editor.SetThemesPath("themes/");
editor.Init();
//editor.LoadDocument();
window.onresize = function()
{
......
......@@ -23,6 +23,7 @@ asc_docs_api.prototype['Init'] = asc_docs_api.prototype.Init;
asc_docs_api.prototype['asc_getEditorPermissions'] = asc_docs_api.prototype.asc_getEditorPermissions;
asc_docs_api.prototype['asc_setDocInfo'] = asc_docs_api.prototype.asc_setDocInfo;
asc_docs_api.prototype['asc_setLocale'] = asc_docs_api.prototype.asc_setLocale;
asc_docs_api.prototype['asc_LoadDocument'] = asc_docs_api.prototype.asc_LoadDocument;
asc_docs_api.prototype['LoadDocument'] = asc_docs_api.prototype.LoadDocument;
asc_docs_api.prototype['asc_SetFontsPath'] = asc_docs_api.prototype.asc_SetFontsPath;
asc_docs_api.prototype['SetThemesPath'] = asc_docs_api.prototype.SetThemesPath;
......@@ -255,7 +256,6 @@ asc_docs_api.prototype['zoom'] = asc_docs_api.prototype.zoom;
asc_docs_api.prototype['goToPage'] = asc_docs_api.prototype.goToPage;
asc_docs_api.prototype['getCountPages'] = asc_docs_api.prototype.getCountPages;
asc_docs_api.prototype['getCurrentPage'] = asc_docs_api.prototype.getCurrentPage;
asc_docs_api.prototype['sync_zoomChangeCallback'] = asc_docs_api.prototype.sync_zoomChangeCallback;
asc_docs_api.prototype['sync_countPagesCallback'] = asc_docs_api.prototype.sync_countPagesCallback;
asc_docs_api.prototype['sync_currentPageCallback'] = asc_docs_api.prototype.sync_currentPageCallback;
asc_docs_api.prototype['sync_SendThemeColors'] = asc_docs_api.prototype.sync_SendThemeColors;
......
......@@ -3053,11 +3053,7 @@ $(document).ready(function(){
editor.asc_setDocInfo(c_DocInfo);
editor.asc_getEditorPermissions();
editor.LoadDocument();
editor.asc_LoadDocument();
},500)
......
......@@ -2264,7 +2264,7 @@ $(".colorWatch").mouseover(function(){
decodeURIComponent(getURLParameter("vkey")) :
undefined );
editor.LoadDocument(c_DocInfo);
editor.asc_LoadDocument(c_DocInfo);
},500)
......
......@@ -532,40 +532,7 @@ asc_docs_api.prototype.asc_setLocale = function(val)
this.InterfaceLocale = val;
};
asc_docs_api.prototype.LoadDocument = function(isVersionHistory) {
this.CoAuthoringApi.auth(this.isViewMode);
// Меняем тип состояния (на открытие)
this.advancedOptionsAction = c_oAscAdvancedOptionsAction.Open;
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,
"viewmode": this.isViewMode
};
if (isVersionHistory) {
//чтобы результат пришел только этому соединению, а не всем кто в документе
rData["userconnectionid"] = this.CoAuthoringApi.getUserConnectionId();
}
this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Open);
sendCommand2(this, null, rData);
} else {
// ToDo убрать зависимость от this.FontLoader.fontFilesPath
this.documentUrl = this.FontLoader.fontFilesPath + "../Word/document/";
this.DocInfo.put_OfflineApp(true);
this._OfflineAppDocumentStartLoad();
}
this.sync_zoomChangeCallback(this.WordControl.m_nZoomValue, 0);
this.asc_LoadDocument(isVersionHistory);
};
asc_docs_api.prototype.SetTextBoxInputMode = function(bIsEA)
......
......@@ -97,6 +97,7 @@ asc_docs_api.prototype['Init'] = asc_docs_api.prototype.Init;
asc_docs_api.prototype['asc_getEditorPermissions'] = asc_docs_api.prototype.asc_getEditorPermissions;
asc_docs_api.prototype['asc_setDocInfo'] = asc_docs_api.prototype.asc_setDocInfo;
asc_docs_api.prototype['asc_setLocale'] = asc_docs_api.prototype.asc_setLocale;
asc_docs_api.prototype['asc_LoadDocument'] = asc_docs_api.prototype.asc_LoadDocument;
asc_docs_api.prototype['LoadDocument'] = asc_docs_api.prototype.LoadDocument;
asc_docs_api.prototype['asc_SetFontsPath'] = asc_docs_api.prototype.asc_SetFontsPath;
asc_docs_api.prototype['SetTextBoxInputMode'] = asc_docs_api.prototype.SetTextBoxInputMode;
......@@ -408,7 +409,6 @@ asc_docs_api.prototype['zoom'] = asc_docs_api.prototype.zoom;
asc_docs_api.prototype['goToPage'] = asc_docs_api.prototype.goToPage;
asc_docs_api.prototype['getCountPages'] = asc_docs_api.prototype.getCountPages;
asc_docs_api.prototype['getCurrentPage'] = asc_docs_api.prototype.getCurrentPage;
asc_docs_api.prototype['sync_zoomChangeCallback'] = asc_docs_api.prototype.sync_zoomChangeCallback;
asc_docs_api.prototype['sync_countPagesCallback'] = asc_docs_api.prototype.sync_countPagesCallback;
asc_docs_api.prototype['sync_currentPageCallback'] = asc_docs_api.prototype.sync_currentPageCallback;
asc_docs_api.prototype['asc_enableKeyEvents'] = asc_docs_api.prototype.asc_enableKeyEvents;
......
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