Commit aaf05cde authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

(1.0.0.120): FileConverterUtils2

Добавил documentUrlChanges в объекте не открытии

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@62415 954022d7-b5bf-4e40-9824-e11837661b57
parent ebb92476
...@@ -54,6 +54,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -54,6 +54,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
this.documentId = undefined; this.documentId = undefined;
this.documentUserId = undefined; this.documentUserId = undefined;
this.documentUrl = "null"; this.documentUrl = "null";
this.documentUrlChanges = null;
this.documentTitle = "null"; this.documentTitle = "null";
this.documentTitleWithoutExtention = "null"; this.documentTitleWithoutExtention = "null";
this.documentFormat = "null"; this.documentFormat = "null";
...@@ -436,7 +437,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -436,7 +437,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
this.asc_setDocInfo(c_DocInfo); this.asc_setDocInfo(c_DocInfo);
if(this.DocInfo){ if (this.DocInfo) {
this.documentId = this.DocInfo["Id"]; this.documentId = this.DocInfo["Id"];
this.documentUserId = this.DocInfo["UserId"]; this.documentUserId = this.DocInfo["UserId"];
this.documentUrl = this.DocInfo["Url"]; this.documentUrl = this.DocInfo["Url"];
...@@ -1041,10 +1042,11 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -1041,10 +1042,11 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
} else if (!this.documentId || !this.documentUrl) { } else if (!this.documentId || !this.documentUrl) {
// Назначим id-сами, если он не пришел (для открытия тестового документа) // Назначим id-сами, если он не пришел (для открытия тестового документа)
if (!this.documentId) if (!this.documentId)
this.documentId = "9876543210"; this.documentId = '9876543210';
this._OfflineAppDocumentStartLoad(fCallback); this._OfflineAppDocumentStartLoad(fCallback);
} else { } else {
var v = { var v = {
"c" : '',
"id" : this.documentId, "id" : this.documentId,
"userid" : this.documentUserId, "userid" : this.documentUserId,
"format" : this.documentFormat, "format" : this.documentFormat,
...@@ -1053,7 +1055,8 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -1053,7 +1055,8 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
"url" : this.documentUrl, "url" : this.documentUrl,
"title" : this.documentTitle, "title" : this.documentTitle,
"embeddedfonts" : this.isUseEmbeddedCutFonts, "embeddedfonts" : this.isUseEmbeddedCutFonts,
"viewmode" : this.asc_getViewerMode() "viewmode" : this.asc_getViewerMode(),
"urlchanges" : this.documentUrlChanges
}; };
if (false && this.documentOpenOptions && this.documentOpenOptions["isEmpty"]) { if (false && this.documentOpenOptions && this.documentOpenOptions["isEmpty"]) {
var sEmptyWorkbook = getEmptyWorkbook(); var sEmptyWorkbook = getEmptyWorkbook();
...@@ -1066,7 +1069,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -1066,7 +1069,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
// Меняем тип состояния (на открытие) // Меняем тип состояния (на открытие)
this.advancedOptionsAction = c_oAscAdvancedOptionsAction.Open; this.advancedOptionsAction = c_oAscAdvancedOptionsAction.Open;
v["c"] = "open"; v["c"] = "open";
this._asc_sendCommand (fCallback, v); this._asc_sendCommand(fCallback, v);
} }
} }
}; };
...@@ -3326,14 +3329,17 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -3326,14 +3329,17 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
// Version History // Version History
spreadsheet_api.prototype.asc_showRevision = function () { spreadsheet_api.prototype.asc_showRevision = function (url, urlChanges, currentChangeId) {
var bUpdate = true; var bUpdate = true;
if (null === this.VersionHistory) if (null === this.VersionHistory)
this.VersionHistory = new asc.CVersionHistory(url, urlChanges, currentChangeId); this.VersionHistory = new asc.CVersionHistory(url, urlChanges, currentChangeId);
else else
bUpdate = this.VersionHistory.update(url, urlChanges, currentChangeId); bUpdate = this.VersionHistory.update(url, urlChanges, currentChangeId);
if (bUpdate) { if (bUpdate) {
// ToDo Add code load file with changes this.documentUrl = url;
this.documentUrlChanges = urlChanges;
this.isCoAuthoringEnable = false;
this.asc_LoadDocument();
} }
}; };
......
...@@ -7,6 +7,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -7,6 +7,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
var documentId = undefined; var documentId = undefined;
var documentUserId = undefined; var documentUserId = undefined;
var documentUrl = 'null'; var documentUrl = 'null';
var documentUrlChanges = null;
var documentTitle = 'null'; var documentTitle = 'null';
var documentTitleWithoutExtention = 'null'; var documentTitleWithoutExtention = 'null';
var documentFormat = 'null'; var documentFormat = 'null';
...@@ -800,7 +801,6 @@ asc_docs_api.prototype.asc_setLocale = function(val) ...@@ -800,7 +801,6 @@ asc_docs_api.prototype.asc_setLocale = function(val)
}; };
asc_docs_api.prototype.LoadDocument = function(c_DocInfo) asc_docs_api.prototype.LoadDocument = function(c_DocInfo)
{ {
this.asc_setDocInfo(c_DocInfo); this.asc_setDocInfo(c_DocInfo);
this.WordControl.m_oDrawingDocument.m_bIsOpeningDocument = true; this.WordControl.m_oDrawingDocument.m_bIsOpeningDocument = true;
...@@ -853,16 +853,18 @@ asc_docs_api.prototype.LoadDocument = function(c_DocInfo) ...@@ -853,16 +853,18 @@ asc_docs_api.prototype.LoadDocument = function(c_DocInfo)
{ {
this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Open); this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Open);
var rData = { var rData = {
"id":documentId, "id" : documentId,
"userid": documentUserId, "userid" : documentUserId,
"format": documentFormat, "format" : documentFormat,
"vkey": documentVKey, "vkey" : documentVKey,
"editorid": c_oEditorId.Presentation, "editorid" : c_oEditorId.Presentation,
"c":"open", "c" : "open",
"url": documentUrl, "url" : documentUrl,
"title": documentTitle, "title" : documentTitle,
"embeddedfonts": this.isUseEmbeddedCutFonts, "embeddedfonts" : this.isUseEmbeddedCutFonts,
"viewmode": this.isViewMode}; "viewmode" : this.isViewMode,
"urlchanges" : documentUrlChanges
};
sendCommand( oThis, function(){}, rData ); sendCommand( oThis, function(){}, rData );
...@@ -5040,7 +5042,10 @@ asc_docs_api.prototype.asc_showRevision = function (url, urlChanges, currentChan ...@@ -5040,7 +5042,10 @@ asc_docs_api.prototype.asc_showRevision = function (url, urlChanges, currentChan
else else
bUpdate = this.VersionHistory.update(url, urlChanges, currentChangeId); bUpdate = this.VersionHistory.update(url, urlChanges, currentChangeId);
if (bUpdate) { if (bUpdate) {
// ToDo Add code load file with changes documentUrl = url;
documentUrlChanges = urlChanges;
this.isCoAuthoringEnable = false;
this.LoadDocument();
} }
}; };
asc_docs_api.prototype.asc_undoAllChanges = function () { asc_docs_api.prototype.asc_undoAllChanges = function () {
......
...@@ -8,6 +8,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -8,6 +8,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
var documentId = undefined; var documentId = undefined;
var documentUserId = undefined; var documentUserId = undefined;
var documentUrl = 'null'; var documentUrl = 'null';
var documentUrlChanges = null;
var documentTitle = 'null'; var documentTitle = 'null';
var documentTitleWithoutExtention = 'null'; var documentTitleWithoutExtention = 'null';
var documentFormat = 'null'; var documentFormat = 'null';
...@@ -813,11 +814,10 @@ asc_docs_api.prototype.asc_setLocale = function(val) ...@@ -813,11 +814,10 @@ asc_docs_api.prototype.asc_setLocale = function(val)
}; };
asc_docs_api.prototype.LoadDocument = function(c_DocInfo) asc_docs_api.prototype.LoadDocument = function(c_DocInfo)
{ {
this.asc_setDocInfo(c_DocInfo); this.asc_setDocInfo(c_DocInfo);
this.WordControl.m_oDrawingDocument.m_bIsOpeningDocument = true; this.WordControl.m_oDrawingDocument.m_bIsOpeningDocument = true;
if(this.DocInfo){ if (this.DocInfo) {
documentId = this.DocInfo.get_Id(); documentId = this.DocInfo.get_Id();
documentUserId = this.DocInfo.get_UserId(); documentUserId = this.DocInfo.get_UserId();
documentUrl = this.DocInfo.get_Url(); documentUrl = this.DocInfo.get_Url();
...@@ -882,20 +882,24 @@ asc_docs_api.prototype.LoadDocument = function(c_DocInfo) ...@@ -882,20 +882,24 @@ asc_docs_api.prototype.LoadDocument = function(c_DocInfo)
if(documentId){ if(documentId){
var oOpenOptions = this.DocInfo.get_Options(); var oOpenOptions = this.DocInfo.get_Options();
var rData = {
"c" : '',
"id" : documentId,
"userid" : documentUserId,
"format" : documentFormat,
"vkey" : documentVKey,
"editorid" : c_oEditorId.Word,
"url" : documentUrl,
"title" : documentTitle,
"embeddedfonts" : this.isUseEmbeddedCutFonts,
"viewmode" : this.isViewMode,
"urlchanges" : documentUrlChanges
};
if(false && oOpenOptions && oOpenOptions["isEmpty"]) if(false && oOpenOptions && oOpenOptions["isEmpty"])
{ {
var rData = { rData['c'] = 'create';
"c": "create", rData['data'] = g_sEmpty_bin;
"id": documentId,
"userid": documentUserId,
"format": documentFormat,
"vkey": documentVKey,
"editorid": c_oEditorId.Word,
"url": documentUrl,
"title": documentTitle,
"embeddedfonts": this.isUseEmbeddedCutFonts,
"data": g_sEmpty_bin};
sendCommand( oThis, function(){}, rData ); sendCommand( oThis, function(){}, rData );
editor.OpenDocument2(g_sResourceServiceLocalUrl + documentId + "/", g_sEmpty_bin); editor.OpenDocument2(g_sResourceServiceLocalUrl + documentId + "/", g_sEmpty_bin);
if(this.InterfaceLocale) if(this.InterfaceLocale)
...@@ -907,19 +911,8 @@ asc_docs_api.prototype.LoadDocument = function(c_DocInfo) ...@@ -907,19 +911,8 @@ asc_docs_api.prototype.LoadDocument = function(c_DocInfo)
} }
else else
{ {
rData['c'] = 'open';
this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Open); this.sync_StartAction(c_oAscAsyncActionType.BlockInteraction, c_oAscAsyncAction.Open);
var rData = {
"id": documentId,
"userid": documentUserId,
"format": documentFormat,
"vkey": documentVKey,
"editorid": c_oEditorId.Word,
"c": "open",
"url": documentUrl,
"title": documentTitle,
"embeddedfonts": this.isUseEmbeddedCutFonts,
"viewmode": this.isViewMode};
sendCommand( oThis, function(){}, rData ); sendCommand( oThis, function(){}, rData );
} }
this.sync_zoomChangeCallback(this.WordControl.m_nZoomValue, 0); this.sync_zoomChangeCallback(this.WordControl.m_nZoomValue, 0);
...@@ -7577,14 +7570,17 @@ asc_docs_api.prototype.asc_continueSaving = function () { ...@@ -7577,14 +7570,17 @@ asc_docs_api.prototype.asc_continueSaving = function () {
// Version History // Version History
asc_docs_api.prototype.asc_showRevision = function () { asc_docs_api.prototype.asc_showRevision = function (url, urlChanges, currentChangeId) {
var bUpdate = true; var bUpdate = true;
if (null === this.VersionHistory) if (null === this.VersionHistory)
this.VersionHistory = new window["Asc"].CVersionHistory(url, urlChanges, currentChangeId); this.VersionHistory = new window["Asc"].CVersionHistory(url, urlChanges, currentChangeId);
else else
bUpdate = this.VersionHistory.update(url, urlChanges, currentChangeId); bUpdate = this.VersionHistory.update(url, urlChanges, currentChangeId);
if (bUpdate) { if (bUpdate) {
// ToDo Add code load file with changes documentUrl = url;
documentUrlChanges = urlChanges;
this.isCoAuthoringEnable = false;
this.LoadDocument();
} }
}; };
asc_docs_api.prototype.asc_undoAllChanges = function () asc_docs_api.prototype.asc_undoAllChanges = function ()
......
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