Commit 446b5f3a authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

На ShowRevision нужно выставлять DocId.

bugs #30399, #30340

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@64791 954022d7-b5bf-4e40-9824-e11837661b57
parent eb913e9a
...@@ -762,10 +762,10 @@ asc_docs_api.prototype._onGetLicense = function (response) { ...@@ -762,10 +762,10 @@ asc_docs_api.prototype._onGetLicense = function (response) {
this.asc_fireCallback("asc_onGetLicense", oLicense); this.asc_fireCallback("asc_onGetLicense", oLicense);
} }
}; };
asc_docs_api.prototype.asc_setDocInfo = function(c_DocInfo) asc_docs_api.prototype.asc_setDocInfo = function(c_DocInfo) {
{ if (c_DocInfo) {
if(c_DocInfo)
this.DocInfo = c_DocInfo; this.DocInfo = c_DocInfo;
}
if (this.DocInfo) { if (this.DocInfo) {
documentId = this.DocInfo.get_Id(); documentId = this.DocInfo.get_Id();
...@@ -774,41 +774,25 @@ asc_docs_api.prototype.asc_setDocInfo = function(c_DocInfo) ...@@ -774,41 +774,25 @@ asc_docs_api.prototype.asc_setDocInfo = function(c_DocInfo)
documentTitle = this.DocInfo.get_Title(); documentTitle = this.DocInfo.get_Title();
documentFormat = this.DocInfo.get_Format(); documentFormat = this.DocInfo.get_Format();
documentCallbackUrl = this.DocInfo.get_CallbackUrl(); documentCallbackUrl = this.DocInfo.get_CallbackUrl();
// if(documentFormat)
// {
// switch(documentFormat)
// {
// case "docx" : documentFormatSave = c_oAscFileType.DOCX;break;
// case "doc" : documentFormatSave = c_oAscFileType.DOC;break;
// case "odt" : documentFormatSave = c_oAscFileType.ODT;break;
// case "rtf" : documentFormatSave = c_oAscFileType.RTF;break;
// case "txt" : documentFormatSave = c_oAscFileType.TXT;break;
// case "htm" :
// case "html" : documentFormatSave = c_oAscFileType.HTML;break;
// case "mht" : documentFormatSave = c_oAscFileType.MHT;break;
// case "pdf" : documentFormatSave = c_oAscFileType.PDF;break;
// case "epub" : documentFormatSave = c_oAscFileType.EPUB;break;
// case "fb2" : documentFormatSave = c_oAscFileType.FB2;break;
// case "mobi" : documentFormatSave = c_oAscFileType.MOBI;break;
// }
// }
var nIndex = -1; var nIndex = -1;
if(documentTitle) if (documentTitle) {
nIndex = documentTitle.lastIndexOf("."); nIndex = documentTitle.lastIndexOf(".");
if(-1 != nIndex) }
if (-1 != nIndex) {
documentTitleWithoutExtention = documentTitle.substring(0, nIndex); documentTitleWithoutExtention = documentTitle.substring(0, nIndex);
else } else {
documentTitleWithoutExtention = documentTitle; documentTitleWithoutExtention = documentTitle;
}
documentVKey = this.DocInfo.get_VKey(); documentVKey = this.DocInfo.get_VKey();
// documentOrigin = this.DocInfo.get_Origin();
var sProtocol = window.location.protocol; var sProtocol = window.location.protocol;
var sHost = window.location.host; var sHost = window.location.host;
documentOrigin = ""; documentOrigin = "";
if(sProtocol && "" != sProtocol) if (sProtocol && "" != sProtocol) {
documentOrigin = sProtocol + "//" + sHost; documentOrigin = sProtocol + "//" + sHost;
else } else {
documentOrigin = sHost; documentOrigin = sHost;
}
this.User = new Asc.asc_CUser(); this.User = new Asc.asc_CUser();
this.User.asc_setId(this.DocInfo.get_UserId()); this.User.asc_setId(this.DocInfo.get_UserId());
...@@ -816,8 +800,7 @@ asc_docs_api.prototype.asc_setDocInfo = function(c_DocInfo) ...@@ -816,8 +800,7 @@ asc_docs_api.prototype.asc_setDocInfo = function(c_DocInfo)
} }
this.DocumentName = documentTitle; this.DocumentName = documentTitle;
if (undefined !== window["AscDesktopEditor"]) if (undefined !== window["AscDesktopEditor"]) {
{
window["AscDesktopEditor"]["SetDocumentName"](this.DocumentName); window["AscDesktopEditor"]["SetDocumentName"](this.DocumentName);
} }
}; };
...@@ -7243,23 +7226,27 @@ asc_docs_api.prototype.asc_continueSaving = function () { ...@@ -7243,23 +7226,27 @@ asc_docs_api.prototype.asc_continueSaving = function () {
// Version History // Version History
asc_docs_api.prototype.asc_showRevision = function (newObj) { asc_docs_api.prototype.asc_showRevision = function(newObj) {
if (!newObj.docId) if (!newObj.docId) {
return; return;
if (this.isCoAuthoringEnable) }
if (this.isCoAuthoringEnable) {
this.asc_coAuthoringDisconnect(); this.asc_coAuthoringDisconnect();
}
var bUpdate = true; var bUpdate = true;
if (null === this.VersionHistory) if (null === this.VersionHistory) {
this.VersionHistory = new window["Asc"].asc_CVersionHistory(newObj); this.VersionHistory = new window["Asc"].asc_CVersionHistory(newObj);
else } else {
bUpdate = this.VersionHistory.update(newObj); bUpdate = this.VersionHistory.update(newObj);
}
if (bUpdate) { if (bUpdate) {
this.asc_CloseFile(); this.asc_CloseFile();
this.DocInfo.put_Id(this.VersionHistory.docId); this.DocInfo.put_Id(this.VersionHistory.docId);
this.DocInfo.put_Url(this.VersionHistory.url); this.DocInfo.put_Url(this.VersionHistory.url);
documentUrlChanges = this.VersionHistory.urlChanges; documentUrlChanges = this.VersionHistory.urlChanges;
this.asc_setDocInfo(this.DocInfo);
this.LoadDocument(); this.LoadDocument();
} else if (this.VersionHistory.currentChangeId < newObj.currentChangeId) { } else if (this.VersionHistory.currentChangeId < newObj.currentChangeId) {
// Нужно только добавить некоторые изменения // Нужно только добавить некоторые изменения
......
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