Commit dc87a303 authored by Alexander.Trofimov's avatar Alexander.Trofimov

common/CollaborativeEditingBase to function-closure

parent 38476e15
...@@ -61,6 +61,7 @@ ...@@ -61,6 +61,7 @@
"../common/Drawings/Externals.js", "../common/Drawings/Externals.js",
"../common/GlobalLoaders.js", "../common/GlobalLoaders.js",
"../common/CollaborativeEditingBase.js",
"../common/scroll.js", "../common/scroll.js",
"../cell/view/iscroll.js", "../cell/view/iscroll.js",
...@@ -157,7 +158,6 @@ ...@@ -157,7 +158,6 @@
"../word/Math/operators.js", "../word/Math/operators.js",
"../word/Math/accent.js", "../word/Math/accent.js",
"../word/Math/borderBox.js", "../word/Math/borderBox.js",
"../common/CollaborativeEditingBase.js",
"../cell/model/DrawingObjects/GlobalCounters.js", "../cell/model/DrawingObjects/GlobalCounters.js",
"../word/apiCommon.js", "../word/apiCommon.js",
"../cell/apiCommonExport.js", "../cell/apiCommonExport.js",
......
...@@ -61,6 +61,7 @@ ...@@ -61,6 +61,7 @@
"../common/Drawings/Externals.js", "../common/Drawings/Externals.js",
"../common/GlobalLoaders.js", "../common/GlobalLoaders.js",
"../common/CollaborativeEditingBase.js",
"../common/scroll.js", "../common/scroll.js",
...@@ -73,7 +74,6 @@ ...@@ -73,7 +74,6 @@
"../word/Editor/Serialize2.js", "../word/Editor/Serialize2.js",
"../word/Editor/Styles.js", "../word/Editor/Styles.js",
"../word/Editor/Numbering.js", "../word/Editor/Numbering.js",
"../common/CollaborativeEditingBase.js",
"../slide/Editor/CollaborativeEditing.js", "../slide/Editor/CollaborativeEditing.js",
"../word/Drawing/GraphicsEvents.js", "../word/Drawing/GraphicsEvents.js",
"../word/Drawing/WorkEvents.js", "../word/Drawing/WorkEvents.js",
......
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
"../common/Drawings/Externals.js", "../common/Drawings/Externals.js",
"../common/GlobalLoaders.js", "../common/GlobalLoaders.js",
"../common/CollaborativeEditingBase.js",
"../common/scroll.js", "../common/scroll.js",
"../common/Scrolls/iscroll.js", "../common/Scrolls/iscroll.js",
...@@ -112,7 +113,6 @@ ...@@ -112,7 +113,6 @@
"../common/Overlay.js", "../common/Overlay.js",
"../word/Drawing/HatchPattern.js", "../word/Drawing/HatchPattern.js",
"../word/Drawing/ShapeDrawer.js", "../word/Drawing/ShapeDrawer.js",
"../common/CollaborativeEditingBase.js",
"../word/Drawing/DrawingDocument.js", "../word/Drawing/DrawingDocument.js",
"../word/Drawing/GraphicsEvents.js", "../word/Drawing/GraphicsEvents.js",
"../word/Drawing/WorkEvents.js", "../word/Drawing/WorkEvents.js",
......
...@@ -6,14 +6,14 @@ ...@@ -6,14 +6,14 @@
/** /**
* *
* @constructor * @constructor
* @extends {CCollaborativeEditingBase} * @extends {AscCommon.CCollaborativeEditingBase}
*/ */
function CCollaborativeEditing() function CCollaborativeEditing()
{ {
CCollaborativeEditing.superclass.constructor.call(this); CCollaborativeEditing.superclass.constructor.call(this);
} }
AscCommon.extendClass(CCollaborativeEditing, CCollaborativeEditingBase); AscCommon.extendClass(CCollaborativeEditing, AscCommon.CCollaborativeEditingBase);
CCollaborativeEditing.prototype.Have_OtherChanges = function() CCollaborativeEditing.prototype.Have_OtherChanges = function()
{ {
......
"use strict"; "use strict";
/** (function(window, undefined){
* User: Ilja.Kirillov
* Date: 25.07.12
* Time: 12:01
*/
// Import // Import
var g_memory = AscFonts.g_memory; var g_memory = AscFonts.g_memory;
...@@ -846,4 +842,12 @@ CDocumentPositionsManager.prototype.Remove_DocumentPosition = function(DocPos) ...@@ -846,4 +842,12 @@ CDocumentPositionsManager.prototype.Remove_DocumentPosition = function(DocPos)
return; return;
} }
} }
}; };
\ No newline at end of file
//--------------------------------------------------------export----------------------------------------------------
window['AscCommon'] = window['AscCommon'] || {};
window['AscCommon'].FOREIGN_CURSOR_LABEL_HIDETIME = FOREIGN_CURSOR_LABEL_HIDETIME;
window['AscCommon'].CCollaborativeChanges = CCollaborativeChanges;
window['AscCommon'].CCollaborativeEditingBase = CCollaborativeEditingBase;
window['AscCommon'].CDocumentPositionsManager = CDocumentPositionsManager;
})(window);
...@@ -4,15 +4,15 @@ ...@@ -4,15 +4,15 @@
/** /**
* *
* @constructor * @constructor
* @extends {CCollaborativeEditingBase} * @extends {AscCommon.CCollaborativeEditingBase}
*/ */
function CCollaborativeEditing() function CCollaborativeEditing()
{ {
CCollaborativeEditing.superclass.constructor.call(this); CCollaborativeEditing.superclass.constructor.call(this);
this.m_oLogicDocument = null; this.m_oLogicDocument = null;
this.m_aDocumentPositions = new CDocumentPositionsManager(); this.m_aDocumentPositions = new AscCommon.CDocumentPositionsManager();
this.m_aForeignCursorsPos = new CDocumentPositionsManager(); this.m_aForeignCursorsPos = new AscCommon.CDocumentPositionsManager();
this.m_aForeignCursors = {}; this.m_aForeignCursors = {};
this.PosExtChangesX = []; this.PosExtChangesX = [];
this.PosExtChangesY = []; this.PosExtChangesY = [];
...@@ -23,7 +23,7 @@ function CCollaborativeEditing() ...@@ -23,7 +23,7 @@ function CCollaborativeEditing()
this.m_aForeignCursorsToShow = {}; this.m_aForeignCursorsToShow = {};
} }
AscCommon.extendClass(CCollaborativeEditing, CCollaborativeEditingBase); AscCommon.extendClass(CCollaborativeEditing, AscCommon.CCollaborativeEditingBase);
CCollaborativeEditing.prototype.Send_Changes = function(IsUserSave, AdditionalInfo) CCollaborativeEditing.prototype.Send_Changes = function(IsUserSave, AdditionalInfo)
...@@ -64,7 +64,7 @@ CCollaborativeEditing.prototype.Send_Changes = function(IsUserSave, AdditionalIn ...@@ -64,7 +64,7 @@ CCollaborativeEditing.prototype.Send_Changes = function(IsUserSave, AdditionalIn
for ( var Index = 0; Index < Point.Items.length; Index++ ) for ( var Index = 0; Index < Point.Items.length; Index++ )
{ {
var Item = Point.Items[Index]; var Item = Point.Items[Index];
var oChanges = new CCollaborativeChanges(); var oChanges = new AscCommon.CCollaborativeChanges();
oChanges.Set_FromUndoRedo( Item.Class, Item.Data, Item.Binary ); oChanges.Set_FromUndoRedo( Item.Class, Item.Data, Item.Binary );
aChanges.push( oChanges.m_pData ); aChanges.push( oChanges.m_pData );
} }
...@@ -184,7 +184,7 @@ CCollaborativeEditing.prototype.Send_Changes = function(IsUserSave, AdditionalIn ...@@ -184,7 +184,7 @@ CCollaborativeEditing.prototype.Send_Changes = function(IsUserSave, AdditionalIn
// editor.WordControl.m_oLogicDocument.DrawingDocument.FirePaint(); // editor.WordControl.m_oLogicDocument.DrawingDocument.FirePaint();
}; };
CCollaborativeEditingBase.prototype.Refresh_ForeignCursors = function() AscCommon.CCollaborativeEditingBase.prototype.Refresh_ForeignCursors = function()
{ {
for (var UserId in this.m_aCursorsToUpdate) for (var UserId in this.m_aCursorsToUpdate)
{ {
...@@ -569,7 +569,7 @@ CCollaborativeEditing.prototype.Show_ForeignCursorLabel = function(UserId) ...@@ -569,7 +569,7 @@ CCollaborativeEditing.prototype.Show_ForeignCursorLabel = function(UserId)
{ {
Cursor.ShowId = null; Cursor.ShowId = null;
Api.sync_HideForeignCursorLabel(UserId); Api.sync_HideForeignCursorLabel(UserId);
}, FOREIGN_CURSOR_LABEL_HIDETIME); }, AscCommon.FOREIGN_CURSOR_LABEL_HIDETIME);
var UserShortId = this.m_aForeignCursorsId[UserId] ? this.m_aForeignCursorsId[UserId] : UserId; var UserShortId = this.m_aForeignCursorsId[UserId] ? this.m_aForeignCursorsId[UserId] : UserId;
var Color = AscCommon.getUserColorById(UserShortId, null, true); var Color = AscCommon.getUserColorById(UserShortId, null, true);
......
...@@ -921,7 +921,7 @@ CPresentation.prototype = ...@@ -921,7 +921,7 @@ CPresentation.prototype =
return; return;
} }
var Changes = new CCollaborativeChanges(); var Changes = new AscCommon.CCollaborativeChanges();
var Reader = Changes.Internal_Load_Data2(CursorInfo, 0, CursorInfo.length); var Reader = Changes.Internal_Load_Data2(CursorInfo, 0, CursorInfo.length);
var RunId = Reader.GetString2(); var RunId = Reader.GetString2();
......
...@@ -134,7 +134,7 @@ asc_docs_api.prototype.sendEvent = function() { ...@@ -134,7 +134,7 @@ asc_docs_api.prototype.sendEvent = function() {
// Init CoAuthoring // Init CoAuthoring
asc_docs_api.prototype._coAuthoringSetChange = function(change, oColor) asc_docs_api.prototype._coAuthoringSetChange = function(change, oColor)
{ {
var oChange = new CCollaborativeChanges(); var oChange = new AscCommon.CCollaborativeChanges();
oChange.Set_Data( change ); oChange.Set_Data( change );
oChange.Set_Color( oColor ); oChange.Set_Color( oColor );
CollaborativeEditing.Add_Changes( oChange ); CollaborativeEditing.Add_Changes( oChange );
...@@ -344,7 +344,7 @@ asc_docs_api.prototype._coAuthoringInitEnd = function() { ...@@ -344,7 +344,7 @@ asc_docs_api.prototype._coAuthoringInitEnd = function() {
}; };
this.CoAuthoringApi.onSaveChanges = function(e, userId, bFirstLoad) { this.CoAuthoringApi.onSaveChanges = function(e, userId, bFirstLoad) {
// bSendEvent = false - это означает, что мы загружаем имеющиеся изменения при открытии // bSendEvent = false - это означает, что мы загружаем имеющиеся изменения при открытии
var Changes = new CCollaborativeChanges(); var Changes = new AscCommon.CCollaborativeChanges();
Changes.Set_Data(e); Changes.Set_Data(e);
CollaborativeEditing.Add_Changes(Changes); CollaborativeEditing.Add_Changes(Changes);
...@@ -4843,7 +4843,7 @@ window["asc_docs_api"].prototype["asc_nativeApplyChanges"] = function(changes) ...@@ -4843,7 +4843,7 @@ window["asc_docs_api"].prototype["asc_nativeApplyChanges"] = function(changes)
var _len = changes.length; var _len = changes.length;
for (var i = 0; i < _len; i++) for (var i = 0; i < _len; i++)
{ {
var Changes = new CCollaborativeChanges(); var Changes = new AscCommon.CCollaborativeChanges();
Changes.Set_Data( changes[i]); Changes.Set_Data( changes[i]);
CollaborativeEditing.Add_Changes( Changes ); CollaborativeEditing.Add_Changes( Changes );
} }
......
...@@ -9,21 +9,21 @@ ...@@ -9,21 +9,21 @@
/** /**
* *
* @constructor * @constructor
* @extends {CCollaborativeEditingBase} * @extends {AscCommon.CCollaborativeEditingBase}
*/ */
function CWordCollaborativeEditing() function CWordCollaborativeEditing()
{ {
CWordCollaborativeEditing.superclass.constructor.call(this); CWordCollaborativeEditing.superclass.constructor.call(this);
this.m_oLogicDocument = null; this.m_oLogicDocument = null;
this.m_aDocumentPositions = new CDocumentPositionsManager(); this.m_aDocumentPositions = new AscCommon.CDocumentPositionsManager();
this.m_aForeignCursorsPos = new CDocumentPositionsManager(); this.m_aForeignCursorsPos = new AscCommon.CDocumentPositionsManager();
this.m_aForeignCursors = {}; this.m_aForeignCursors = {};
this.m_aForeignCursorsXY = {}; this.m_aForeignCursorsXY = {};
this.m_aForeignCursorsToShow = {}; this.m_aForeignCursorsToShow = {};
} }
AscCommon.extendClass(CWordCollaborativeEditing, CCollaborativeEditingBase); AscCommon.extendClass(CWordCollaborativeEditing, AscCommon.CCollaborativeEditingBase);
CWordCollaborativeEditing.prototype.Send_Changes = function(IsUserSave, AdditionalInfo, IsUpdateInterface) CWordCollaborativeEditing.prototype.Send_Changes = function(IsUserSave, AdditionalInfo, IsUpdateInterface)
{ {
...@@ -64,7 +64,7 @@ CWordCollaborativeEditing.prototype.Send_Changes = function(IsUserSave, Addition ...@@ -64,7 +64,7 @@ CWordCollaborativeEditing.prototype.Send_Changes = function(IsUserSave, Addition
for (var Index = 0; Index < Point.Items.length; Index++) for (var Index = 0; Index < Point.Items.length; Index++)
{ {
var Item = Point.Items[Index]; var Item = Point.Items[Index];
var oChanges = new CCollaborativeChanges(); var oChanges = new AscCommon.CCollaborativeChanges();
oChanges.Set_FromUndoRedo(Item.Class, Item.Data, Item.Binary); oChanges.Set_FromUndoRedo(Item.Class, Item.Data, Item.Binary);
aChanges.push(oChanges.m_pData); aChanges.push(oChanges.m_pData);
} }
...@@ -448,7 +448,7 @@ CWordCollaborativeEditing.prototype.Show_ForeignCursorLabel = function(UserId) ...@@ -448,7 +448,7 @@ CWordCollaborativeEditing.prototype.Show_ForeignCursorLabel = function(UserId)
{ {
Cursor.ShowId = null; Cursor.ShowId = null;
Api.sync_HideForeignCursorLabel(UserId); Api.sync_HideForeignCursorLabel(UserId);
}, FOREIGN_CURSOR_LABEL_HIDETIME); }, AscCommon.FOREIGN_CURSOR_LABEL_HIDETIME);
var UserShortId = this.m_aForeignCursorsId[UserId] ? this.m_aForeignCursorsId[UserId] : UserId; var UserShortId = this.m_aForeignCursorsId[UserId] ? this.m_aForeignCursorsId[UserId] : UserId;
var Color = AscCommon.getUserColorById(UserShortId, null, true); var Color = AscCommon.getUserColorById(UserShortId, null, true);
......
...@@ -15985,7 +15985,7 @@ CDocument.prototype.Update_ForeignCursor = function(CursorInfo, UserId, Show, Us ...@@ -15985,7 +15985,7 @@ CDocument.prototype.Update_ForeignCursor = function(CursorInfo, UserId, Show, Us
return; return;
} }
var Changes = new CCollaborativeChanges(); var Changes = new AscCommon.CCollaborativeChanges();
var Reader = Changes.Internal_Load_Data2(CursorInfo, 0, CursorInfo.length); var Reader = Changes.Internal_Load_Data2(CursorInfo, 0, CursorInfo.length);
var RunId = Reader.GetString2(); var RunId = Reader.GetString2();
......
...@@ -799,7 +799,7 @@ asc_docs_api.prototype.get_PropertyThemeColorSchemes = function() ...@@ -799,7 +799,7 @@ asc_docs_api.prototype.get_PropertyThemeColorSchemes = function()
// Init CoAuthoring // Init CoAuthoring
asc_docs_api.prototype._coAuthoringSetChange = function(change, oColor) asc_docs_api.prototype._coAuthoringSetChange = function(change, oColor)
{ {
var oChange = new CCollaborativeChanges(); var oChange = new AscCommon.CCollaborativeChanges();
oChange.Set_Data( change ); oChange.Set_Data( change );
oChange.Set_Color( oColor ); oChange.Set_Color( oColor );
CollaborativeEditing.Add_Changes( oChange ); CollaborativeEditing.Add_Changes( oChange );
......
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