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

Добавил класс asc_CVersionHistory

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@62472 954022d7-b5bf-4e40-9824-e11837661b57
parent ff743874
...@@ -2515,21 +2515,41 @@ ...@@ -2515,21 +2515,41 @@
window["Asc"].generateColor = generateColor; window["Asc"].generateColor = generateColor;
window["Asc"].hsvToRgb = hsvToRgb; window["Asc"].hsvToRgb = hsvToRgb;
function CVersionHistory (url, urlChanges, currentChangeId) { /** @constructor */
this.url = url; function asc_CVersionHistory (newObj) {
this.urlChanges = urlChanges; this.docId = null;
this.currentChangeId = currentChangeId; this.url = null;
this.urlChanges = null;
this.currentChangeId = null;
this.colors = null;
if (newObj) this.update(newObj);
} }
CVersionHistory.prototype.update = function (url, urlChanges, currentChangeId) { asc_CVersionHistory.prototype.update = function (newObj) {
var bUpdate = (this.url !== url || this.urlChanges !== urlChanges || this.currentChangeId === currentChangeId); var bUpdate = (this.docId !== newObj.docId || this.url !== newObj.url ||
this.urlChanges !== newObj.urlChanges || this.currentChangeId === newObj.currentChangeId);
if (bUpdate) { if (bUpdate) {
this.url = url; this.docId = newObj.docId;
this.urlChanges = urlChanges; this.url = newObj.url;
this.currentChangeId = currentChangeId; this.urlChanges = newObj.urlChanges;
this.currentChangeId = newObj.currentChangeId;
this.colors = newObj.colors;
} }
return bUpdate; return bUpdate;
}; };
window["Asc"].CVersionHistory = CVersionHistory; asc_CVersionHistory.prototype.asc_setDocId = function(val) {this.docId = val;};
asc_CVersionHistory.prototype.asc_setUrl = function(val) {this.url = val;};
asc_CVersionHistory.prototype.asc_setUrlChanges = function(val) {this.urlChanges = val;};
asc_CVersionHistory.prototype.asc_setCurrentChangeId = function(val) {this.currentChangeId = val;};
asc_CVersionHistory.prototype.asc_setArrColors = function(val) {this.colors = val;};
window["Asc"].asc_CVersionHistory = window["Asc"]["asc_CVersionHistory"] = asc_CVersionHistory;
prot = asc_CVersionHistory.prototype;
prot["asc_setDocId"] = prot.asc_setDocId;
prot["asc_setUrl"] = prot.asc_setUrl;
prot["asc_setUrlChanges"] = prot.asc_setUrlChanges;
prot["asc_setCurrentChangeId"] = prot.asc_setCurrentChangeId;
prot["asc_setArrColors"] = prot.asc_setArrColors;
} }
)(window); )(window);
......
...@@ -7129,9 +7129,6 @@ function _onOpenCommand(fCallback, incomeObject) { ...@@ -7129,9 +7129,6 @@ function _onOpenCommand(fCallback, incomeObject) {
} }
if (result.changes) { if (result.changes) {
g_oIdCounter.Clear();
g_oTableId.Clear();
editor.isApplyChangesOnOpenEnabled = true;
for (var i = 0; i < result.changes.length; ++i) for (var i = 0; i < result.changes.length; ++i)
editor._coAuthoringSetChanges(result.changes[i], new CDocumentColor( 191, 255, 199 )); editor._coAuthoringSetChanges(result.changes[i], new CDocumentColor( 191, 255, 199 ));
} }
...@@ -7436,16 +7433,30 @@ asc_docs_api.prototype.asc_continueSaving = function () { ...@@ -7436,16 +7433,30 @@ asc_docs_api.prototype.asc_continueSaving = function () {
// Version History // Version History
asc_docs_api.prototype.asc_showRevision = function (url, urlChanges, currentChangeId) { asc_docs_api.prototype.asc_showRevision = function (newObj) {
if (3 === arguments.length) {
var tmp = arguments[0];
newObj = new window["Asc"].asc_CVersionHistory();
newObj.docId = '1233211';
newObj.url = tmp;
newObj.urlChanges = arguments[1];
newObj.currentChangeId = arguments[2];
newObj.colors = [];
}
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"].asc_CVersionHistory(newObj);
else else
bUpdate = this.VersionHistory.update(url, urlChanges, currentChangeId); bUpdate = this.VersionHistory.update(newObj);
if (bUpdate) { if (bUpdate) {
this.DocInfo.put_Id('1233211'); g_oIdCounter.Clear();
this.DocInfo.put_Url(url); g_oTableId.Clear();
documentUrlChanges = urlChanges; this.isApplyChangesOnOpenEnabled = true;
this.DocInfo.put_Id(this.VersionHistory.docId);
this.DocInfo.put_Url(this.VersionHistory.url);
documentUrlChanges = this.VersionHistory.urlChanges;
this.isCoAuthoringEnable = false; this.isCoAuthoringEnable = false;
this.LoadDocument(); this.LoadDocument();
} }
......
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