Commit 9ee0c58f authored by konovalovsergey's avatar konovalovsergey

jwt for versionHistory

parent 2fb22f4d
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
this.newChangeId = -1; this.newChangeId = -1;
this.colors = null; this.colors = null;
this.changes = null; this.changes = null;
this.token = null;
if (newObj) { if (newObj) {
this.update(newObj); this.update(newObj);
...@@ -59,6 +60,7 @@ ...@@ -59,6 +60,7 @@
this.urlChanges = newObj.urlChanges; this.urlChanges = newObj.urlChanges;
this.currentChangeId = -1; this.currentChangeId = -1;
this.changes = null; this.changes = null;
this.token = newObj.token;
} }
this.colors = newObj.colors; this.colors = newObj.colors;
this.newChangeId = newObj.currentChangeId; this.newChangeId = newObj.currentChangeId;
...@@ -88,6 +90,9 @@ ...@@ -88,6 +90,9 @@
asc_CVersionHistory.prototype.asc_setArrColors = function(val) { asc_CVersionHistory.prototype.asc_setArrColors = function(val) {
this.colors = val; this.colors = val;
}; };
asc_CVersionHistory.prototype.asc_setToken = function(val) {
this.token = val;
};
window["Asc"].asc_CVersionHistory = window["Asc"]["asc_CVersionHistory"] = asc_CVersionHistory; window["Asc"].asc_CVersionHistory = window["Asc"]["asc_CVersionHistory"] = asc_CVersionHistory;
prot = asc_CVersionHistory.prototype; prot = asc_CVersionHistory.prototype;
...@@ -96,6 +101,7 @@ ...@@ -96,6 +101,7 @@
prot["asc_setUrlChanges"] = prot.asc_setUrlChanges; prot["asc_setUrlChanges"] = prot.asc_setUrlChanges;
prot["asc_setCurrentChangeId"] = prot.asc_setCurrentChangeId; prot["asc_setCurrentChangeId"] = prot.asc_setCurrentChangeId;
prot["asc_setArrColors"] = prot.asc_setArrColors; prot["asc_setArrColors"] = prot.asc_setArrColors;
prot["asc_setToken"] = prot.asc_setToken;
})(window); })(window);
AscCommon.baseEditorsApi.prototype.asc_showRevision = function(newObj) { AscCommon.baseEditorsApi.prototype.asc_showRevision = function(newObj) {
...@@ -120,7 +126,7 @@ AscCommon.baseEditorsApi.prototype.asc_showRevision = function(newObj) { ...@@ -120,7 +126,7 @@ AscCommon.baseEditorsApi.prototype.asc_showRevision = function(newObj) {
this.DocInfo.put_Url(this.VersionHistory.url); this.DocInfo.put_Url(this.VersionHistory.url);
this.documentUrlChanges = this.VersionHistory.urlChanges; this.documentUrlChanges = this.VersionHistory.urlChanges;
this.asc_setDocInfo(this.DocInfo); this.asc_setDocInfo(this.DocInfo);
this.asc_LoadDocument(true); this.asc_LoadDocument(this.VersionHistory);
} else if (this.VersionHistory.currentChangeId < newObj.currentChangeId) { } else if (this.VersionHistory.currentChangeId < newObj.currentChangeId) {
// Нужно только добавить некоторые изменения // Нужно только добавить некоторые изменения
AscCommon.CollaborativeEditing.Clear_CollaborativeMarks(); AscCommon.CollaborativeEditing.Clear_CollaborativeMarks();
......
...@@ -394,7 +394,7 @@ ...@@ -394,7 +394,7 @@
this.sendEvent("asc_onPrint"); this.sendEvent("asc_onPrint");
}; };
// Open // Open
baseEditorsApi.prototype.asc_LoadDocument = function(isVersionHistory, isRepeat) baseEditorsApi.prototype.asc_LoadDocument = function(versionHistory, isRepeat)
{ {
// Меняем тип состояния (на открытие) // Меняем тип состояния (на открытие)
this.advancedOptionsAction = AscCommon.c_oAscAdvancedOptionsAction.Open; this.advancedOptionsAction = AscCommon.c_oAscAdvancedOptionsAction.Open;
...@@ -410,13 +410,14 @@ ...@@ -410,13 +410,14 @@
"title" : this.documentTitle, "title" : this.documentTitle,
"embeddedfonts" : this.isUseEmbeddedCutFonts "embeddedfonts" : this.isUseEmbeddedCutFonts
}; };
if (isVersionHistory) if (versionHistory)
{ {
rData["jwt"] = versionHistory.token;
//чтобы результат пришел только этому соединению, а не всем кто в документе //чтобы результат пришел только этому соединению, а не всем кто в документе
rData["userconnectionid"] = this.CoAuthoringApi.getUserConnectionId(); rData["userconnectionid"] = this.CoAuthoringApi.getUserConnectionId();
} }
} }
if (isVersionHistory) { if (versionHistory) {
this.CoAuthoringApi.versionHistory(rData); this.CoAuthoringApi.versionHistory(rData);
} else { } else {
this.CoAuthoringApi.auth(this.getViewMode(), rData); this.CoAuthoringApi.auth(this.getViewMode(), rData);
......
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