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

Вынес историю версий в Private

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@66179 954022d7-b5bf-4e40-9824-e11837661b57
parent 285d2d01
......@@ -118,6 +118,7 @@
"../../Word/api.js",
"../../Common/Private/license.js",
"../../Word/Private/license.js",
"../../Common/Private/versionHistory.js",
"../../Word/Private/comments.js",
"../../Word/Private/StyleManager.js",
"../../Word/Private/MailMerge.js",
......
"use strict";
(/**
* @param {Window} window
* @param {undefined} undefined
*/
function(window, undefined) {
/** @constructor */
function asc_CVersionHistory(newObj) {
this.docId = null;
this.url = null;
this.urlChanges = null;
this.currentChangeId = -1;
this.newChangeId = -1;
this.colors = null;
this.changes = null;
if (newObj) {
this.update(newObj);
}
}
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.docId = newObj.docId;
this.url = newObj.url;
this.urlChanges = newObj.urlChanges;
this.currentChangeId = -1;
this.changes = null;
}
this.colors = newObj.colors;
this.newChangeId = newObj.currentChangeId;
return bUpdate;
};
asc_CVersionHistory.prototype.applyChanges = function(editor) {
var color;
this.newChangeId = (null == this.newChangeId) ? (this.changes.length - 1) : this.newChangeId;
for (var i = this.currentChangeId + 1; i <= this.newChangeId && i < this.changes.length; ++i) {
color = this.colors[i];
editor._coAuthoringSetChanges(this.changes[i], i !== this.newChangeId ? null : (color ? new CDocumentColor((color >> 16) & 0xFF, (color >> 8) & 0xFF, color & 0xFF) : new CDocumentColor(191, 255, 199)));
}
this.currentChangeId = this.newChangeId;
};
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);
baseEditorsApi.prototype.asc_showRevision = function(newObj) {
if (!newObj.docId) {
return;
}
if (this.isCoAuthoringEnable) {
this.asc_coAuthoringDisconnect();
}
var bUpdate = true;
if (null === this.VersionHistory) {
this.VersionHistory = new window["Asc"].asc_CVersionHistory(newObj);
} else {
bUpdate = this.VersionHistory.update(newObj);
}
// ToDo должно быть все общее
if (bUpdate) {
this.asc_CloseFile();
this.DocInfo.put_Id(this.VersionHistory.docId);
this.DocInfo.put_Url(this.VersionHistory.url);
documentUrlChanges = this.VersionHistory.urlChanges;
this.asc_setDocInfo(this.DocInfo);
this.LoadDocument(true);
} else if (this.VersionHistory.currentChangeId < newObj.currentChangeId) {
// Нужно только добавить некоторые изменения
CollaborativeEditing.Clear_CollaborativeMarks();
editor.VersionHistory.applyChanges(editor);
CollaborativeEditing.Apply_Changes();
}
};
\ No newline at end of file
......@@ -40,6 +40,9 @@ function baseEditorsApi(name) {
this.isOnFirstConnectEnd = false;
this.canSave = true; // Флаг нужен чтобы не происходило сохранение пока не завершится предыдущее сохранение
// Version History
this.VersionHistory = null; // Объект, который отвечает за точку в списке версий
}
baseEditorsApi.prototype.asc_GetFontThumbnailsPath = function() {
return '../Common/Images/';
......@@ -66,4 +69,9 @@ baseEditorsApi.prototype.asc_setChartTranslate = function(translate) {
};
baseEditorsApi.prototype.asc_setTextArtTranslate = function(translate) {
this.textArtTranslate = translate;
};
// Version History
baseEditorsApi.prototype.asc_showRevision = function(newObj) {
};
baseEditorsApi.prototype.asc_undoAllChanges = function() {
};
\ No newline at end of file
......@@ -2548,57 +2548,6 @@
prot["get_LockedObjectType"] = CMouseMoveData.prototype.get_LockedObjectType;
window["CMouseMoveData"] = CMouseMoveData;
/** @constructor */
function asc_CVersionHistory (newObj) {
this.docId = null;
this.url = null;
this.urlChanges = null;
this.currentChangeId = -1;
this.newChangeId = -1;
this.colors = null;
this.changes = null;
if (newObj) this.update(newObj);
}
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.docId = newObj.docId;
this.url = newObj.url;
this.urlChanges = newObj.urlChanges;
this.currentChangeId = -1;
this.changes = null;
}
this.colors = newObj.colors;
this.newChangeId = newObj.currentChangeId;
return bUpdate;
};
asc_CVersionHistory.prototype.applyChanges = function (editor) {
var color;
this.newChangeId = (null == this.newChangeId) ? (this.changes.length - 1) : this.newChangeId;
for (var i = this.currentChangeId + 1; i <= this.newChangeId && i < this.changes.length; ++i) {
color = this.colors[i];
editor._coAuthoringSetChanges(this.changes[i], i !== this.newChangeId ? null : (color ?
new CDocumentColor((color >> 16) & 0xFF, (color >> 8) & 0xFF, color & 0xFF) :
new CDocumentColor(191, 255, 199)));
}
this.currentChangeId = this.newChangeId;
};
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;
function asc_CUserInfo(obj)
{
......
......@@ -77,8 +77,6 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
this.collaborativeEditing = null;
this.isDocumentCanSave = false; // Флаг, говорит о возможности сохранять документ (активна кнопка save или нет)
this.VersionHistory = null; // Объект, который отвечает за точку в списке версий
// AutoSave
this.lastSaveTime = null; // Время последнего сохранения
this.autoSaveGapRealTime = 30; // Интервал быстрого автосохранения (когда выставлен флаг realtime) - 30 мс.
......@@ -3320,26 +3318,6 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
this.waitSave = false;
};
// Version History
spreadsheet_api.prototype.asc_showRevision = function(url, urlChanges, currentChangeId) {
var bUpdate = true;
if (null === this.VersionHistory) {
this.VersionHistory = new asc.CVersionHistory(url, urlChanges, currentChangeId);
} else {
bUpdate = this.VersionHistory.update(url, urlChanges, currentChangeId);
}
if (bUpdate) {
this.documentUrl = url;
this.documentUrlChanges = urlChanges;
this.asc_LoadDocument();
}
};
spreadsheet_api.prototype.asc_undoAllChanges = function() {
// ToDo Add code here
};
// Выставление локали
spreadsheet_api.prototype.asc_setLocalization = function(oLocalizedData) {
if (null == oLocalizedData) {
......
......@@ -114,7 +114,6 @@ function asc_docs_api(name)
this.CoAuthoringApi.isPowerPoint = true;
this.isDocumentCanSave = false; // Флаг, говорит о возможности сохранять документ (активна кнопка save или нет)
this.VersionHistory = null; // Объект, который отвечает за точку в списке версий
/**************************************/
// AutoSave
this.autoSaveGap = 0; // Интервал автосохранения (0 - означает, что автосохранения нет) в милесекундах
......@@ -4911,24 +4910,6 @@ asc_docs_api.prototype.asc_continueSaving = function () {
this.asc_DecrementCounterLongAction();
};
// Version History
asc_docs_api.prototype.asc_showRevision = function (url, urlChanges, currentChangeId) {
var bUpdate = true;
if (null === this.VersionHistory)
this.VersionHistory = new window["Asc"].CVersionHistory(url, urlChanges, currentChangeId);
else
bUpdate = this.VersionHistory.update(url, urlChanges, currentChangeId);
if (bUpdate) {
documentUrl = url;
documentUrlChanges = urlChanges;
this.LoadDocument();
}
};
asc_docs_api.prototype.asc_undoAllChanges = function () {
// ToDo Add code here
};
//-----------------------------------------------------------------
// События контекстного меню
//-----------------------------------------------------------------
......
......@@ -332,8 +332,6 @@ function asc_docs_api(name)
this.isCoMarksDraw = false;
this.isDocumentCanSave = false; // Флаг, говорит о возможности сохранять документ (активна кнопка save или нет)
this.VersionHistory = null; // Объект, который отвечает за точку в списке версий
// Spell Checking
this.SpellCheckApi = (window["AscDesktopEditor"] === undefined) ? new CSpellCheckApi() : new CSpellCheckApi_desktop();
this.isSpellCheckEnable = true;
......@@ -7011,37 +7009,6 @@ asc_docs_api.prototype.asc_continueSaving = function () {
this.asc_DecrementCounterLongAction();
};
// Version History
asc_docs_api.prototype.asc_showRevision = function(newObj) {
if (!newObj.docId) {
return;
}
if (this.isCoAuthoringEnable) {
this.asc_coAuthoringDisconnect();
}
var bUpdate = true;
if (null === this.VersionHistory) {
this.VersionHistory = new window["Asc"].asc_CVersionHistory(newObj);
} else {
bUpdate = this.VersionHistory.update(newObj);
}
if (bUpdate) {
this.asc_CloseFile();
this.DocInfo.put_Id(this.VersionHistory.docId);
this.DocInfo.put_Url(this.VersionHistory.url);
documentUrlChanges = this.VersionHistory.urlChanges;
this.asc_setDocInfo(this.DocInfo);
this.LoadDocument(true);
} else if (this.VersionHistory.currentChangeId < newObj.currentChangeId) {
// Нужно только добавить некоторые изменения
CollaborativeEditing.Clear_CollaborativeMarks();
editor.VersionHistory.applyChanges(editor);
CollaborativeEditing.Apply_Changes();
}
};
asc_docs_api.prototype.asc_undoAllChanges = function ()
{
this.WordControl.m_oLogicDocument.Document_Undo({All : true});
......
......@@ -422,6 +422,7 @@
<script type="text/javascript" src="../../../../OfficeWeb/Common/Private/license.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Word/Private/license.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/Private/versionHistory.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Word/Private/comments.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Word/Private/StyleManager.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Word/Private/MailMerge.js"></script>
......
......@@ -172,6 +172,7 @@
<script type="text/javascript" src="../../../../OfficeWeb/Word/api.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/Private/license.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Word/Private/license.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/Private/versionHistory.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Word/Private/comments.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Word/document/empty.js"></script>
<script type="text/javascript" src="../../../../OfficeWeb/Common/scroll.js"></script>
......
......@@ -110,6 +110,7 @@
<script type="text/javascript" src="../../OfficeWeb/Word/api.js"></script>
<script type="text/javascript" src="../../OfficeWeb/Common/Private/license.js"></script>
<script type="text/javascript" src="../../OfficeWeb/Word/Private/license.js"></script>
<script type="text/javascript" src="../../OfficeWeb/Common/Private/versionHistory.js"></script>
<script type="text/javascript" src="../../OfficeWeb/Word/Private/comments.js"></script>
<script type="text/javascript" src="../../OfficeWeb/Word/document/empty.js"></script>
<script type="text/javascript" src="../../OfficeWeb/Common/scroll.js"></script>
......
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