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 @@
window["Asc"].generateColor = generateColor;
window["Asc"].hsvToRgb = hsvToRgb;
function CVersionHistory (url, urlChanges, currentChangeId) {
this.url = url;
this.urlChanges = urlChanges;
this.currentChangeId = currentChangeId;
/** @constructor */
function asc_CVersionHistory (newObj) {
this.docId = null;
this.url = null;
this.urlChanges = null;
this.currentChangeId = null;
this.colors = null;
if (newObj) this.update(newObj);
}
CVersionHistory.prototype.update = function (url, urlChanges, currentChangeId) {
var bUpdate = (this.url !== url || this.urlChanges !== urlChanges || this.currentChangeId === currentChangeId);
asc_CVersionHistory.prototype.update = function (newObj) {
var bUpdate = (this.docId !== newObj.docId || this.url !== newObj.url ||
this.urlChanges !== newObj.urlChanges || this.currentChangeId === newObj.currentChangeId);
if (bUpdate) {
this.url = url;
this.urlChanges = urlChanges;
this.currentChangeId = currentChangeId;
this.docId = newObj.docId;
this.url = newObj.url;
this.urlChanges = newObj.urlChanges;
this.currentChangeId = newObj.currentChangeId;
this.colors = newObj.colors;
}
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);
......
......@@ -7129,9 +7129,6 @@ function _onOpenCommand(fCallback, incomeObject) {
}
if (result.changes) {
g_oIdCounter.Clear();
g_oTableId.Clear();
editor.isApplyChangesOnOpenEnabled = true;
for (var i = 0; i < result.changes.length; ++i)
editor._coAuthoringSetChanges(result.changes[i], new CDocumentColor( 191, 255, 199 ));
}
......@@ -7436,16 +7433,30 @@ asc_docs_api.prototype.asc_continueSaving = function () {
// 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;
if (null === this.VersionHistory)
this.VersionHistory = new window["Asc"].CVersionHistory(url, urlChanges, currentChangeId);
this.VersionHistory = new window["Asc"].asc_CVersionHistory(newObj);
else
bUpdate = this.VersionHistory.update(url, urlChanges, currentChangeId);
bUpdate = this.VersionHistory.update(newObj);
if (bUpdate) {
this.DocInfo.put_Id('1233211');
this.DocInfo.put_Url(url);
documentUrlChanges = urlChanges;
g_oIdCounter.Clear();
g_oTableId.Clear();
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.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