Commit aa743f5d authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander.Trofimov

Сделан первый вариант быстрого совместного редактирования.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@65287 954022d7-b5bf-4e40-9824-e11837661b57
parent 8d1a1b5d
......@@ -3493,6 +3493,7 @@ function CEditorPage(api)
oThis.m_oLogicDocument.Continue_CheckSpelling();
oThis.m_oLogicDocument.Continue_TrackRevisions();
oThis.m_oLogicDocument.Continue_FastCollaborativeEditing();
}
this.OnScroll = function()
{
......
......@@ -226,6 +226,8 @@ function CCollaborativeEditing()
this.m_oMemory = new CMemory(); // Глобальные класс для сохранения
this.m_bFast = false;
// // CollaborativeEditing LOG
// this.m_nErrorLog_PointChangesCount = 0;
// this.m_nErrorLog_SavedPCC = 0;
......@@ -250,6 +252,16 @@ function CCollaborativeEditing()
this.m_aNewImages = [];
};
this.Set_Fast = function()
{
this.m_bFast = true;
};
this.Is_Fast = function()
{
return this.m_bFast;
};
this.Is_SingleUser = function()
{
if (1 === this.m_nUseType)
......@@ -310,6 +322,11 @@ function CCollaborativeEditing()
editor._onUpdateDocumentCanSave();
};
this.Have_OtherChanges = function()
{
return (this.m_aChanges.length > 0 ? true: false);
};
this.Apply_OtherChanges = function()
{
// Чтобы заново созданные параграфы не отображались залоченными
......
......@@ -970,6 +970,8 @@ CDocument.prototype =
this.private_ProcessTemplateReplacement(TemplateReplacementData);
}
}
//this.Set_FastCollaborativeEditing(true);
},
Add_TestDocument : function()
......@@ -9451,7 +9453,7 @@ CDocument.prototype =
if ( e.KeyCode == 8 && false === editor.isViewMode ) // BackSpace
{
if (false === this.Document_Is_SelectionLocked(changestype_Remove))
if (true === CollaborativeEditing.Is_Fast() || false === this.Document_Is_SelectionLocked(changestype_Remove))
{
this.Create_NewHistoryPoint(historydescription_Document_BackSpaceButton);
this.Remove(-1, true);
......@@ -9599,7 +9601,7 @@ CDocument.prototype =
}
else if ( e.KeyCode == 32 && false === editor.isViewMode ) // Space
{
if ( false === this.Document_Is_SelectionLocked(changestype_Paragraph_Content) )
if (true === CollaborativeEditing.Is_Fast() || false === this.Document_Is_SelectionLocked(changestype_Paragraph_Content))
{
this.Create_NewHistoryPoint(historydescription_Document_SpaceButton);
......@@ -9961,7 +9963,7 @@ CDocument.prototype =
{
if ( true != e.ShiftKey )
{
if ( false === this.Document_Is_SelectionLocked(changestype_Delete) )
if (true === CollaborativeEditing.Is_Fast() || false === this.Document_Is_SelectionLocked(changestype_Delete))
{
this.Create_NewHistoryPoint(historydescription_Document_DeleteButton);
this.Remove( 1, true );
......@@ -10438,7 +10440,7 @@ CDocument.prototype =
if ( Code > 0x20 )
{
if ( false === this.Document_Is_SelectionLocked(changestype_Paragraph_Content) )
if (true === CollaborativeEditing.Is_Fast() || false === this.Document_Is_SelectionLocked(changestype_Paragraph_Content))
{
this.Create_NewHistoryPoint(historydescription_Document_AddLetter);
......@@ -14597,6 +14599,30 @@ CDocument.prototype.Get_ElementByIndex = function(Index)
{
return this.Content[Index];
};
CDocument.prototype.Set_FastCollaborativeEditing = function(isOn)
{
CollaborativeEditing.Set_Fast(true);
editor.SetCollaborativeMarksShowType(c_oAscCollaborativeMarksShowType.All);
};
CDocument.prototype.Continue_FastCollaborativeEditing = function()
{
if (true !== CollaborativeEditing.Is_Fast())
return;
// TODO: Убрать эту функцю
editor.SetCollaborativeMarksShowType(c_oAscCollaborativeMarksShowType.All);
if (true !== History.Have_Changes() && true === CollaborativeEditing.Have_OtherChanges())
{
// Принимаем чужие изменение. Своих нет, но функцию отсылки надо вызвать, чтобы снялить локи.
CollaborativeEditing.Apply_Changes();
CollaborativeEditing.Send_Changes();
}
else if (true === History.Have_Changes() || true === CollaborativeEditing.Have_OtherChanges())
{
editor.asc_Save();
}
};
//-----------------------------------------------------------------------------------
// Private
......
......@@ -5591,7 +5591,8 @@ asc_docs_api.prototype.sync_UnLockDocumentProps = function()
asc_docs_api.prototype.sync_CollaborativeChanges = function()
{
this.asc_fireCallback("asc_onCollaborativeChanges");
if (true !== CollaborativeEditing.Is_Fast())
this.asc_fireCallback("asc_onCollaborativeChanges");
};
asc_docs_api.prototype.sync_LockDocumentSchema = function()
......
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