Commit 5b9bc613 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

g_oIdCounter и g_oTableId перенес в editorscommon.js

CLock и CContentChanges перевел на prototype

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@62494 954022d7-b5bf-4e40-9824-e11837661b57
parent 4a8b38c4
......@@ -993,7 +993,7 @@ function CTableId()
this.m_bTurnOff = false;
this.Id = g_oIdCounter.Get_NewId();
this.Add(this, this.Id);
};
}
CTableId.prototype.Add = function(Class, Id)
{
if (false === this.m_bTurnOff)
......@@ -1439,15 +1439,12 @@ function CLock()
this.UserId = null;
}
CLock.prototype =
CLock.prototype.Get_Type = function()
{
Get_Type : function()
{
return this.Type;
},
Set_Type : function(NewType, Redraw)
{
};
CLock.prototype.Set_Type = function(NewType, Redraw)
{
if ( NewType === locktype_None )
this.UserId = null;
......@@ -1460,20 +1457,18 @@ CLock.prototype =
DrawingDocument.ClearCachePages();
DrawingDocument.FirePaint();
}
},
Check : function(Id)
{
};
CLock.prototype.Check = function(Id)
{
if ( this.Type === locktype_Mine )
CollaborativeEditing.Add_CheckLock( false );
else if ( this.Type === locktype_Other || this.Type === locktype_Other2 || this.Type === locktype_Other3 )
CollaborativeEditing.Add_CheckLock( true );
else
CollaborativeEditing.Add_CheckLock( Id );
},
Lock : function(bMine)
{
};
CLock.prototype.Lock = function(bMine)
{
if ( locktype_None === this.Type )
{
if ( true === bMine )
......@@ -1481,33 +1476,28 @@ CLock.prototype =
else
true.Type = locktype_Other;
}
},
Is_Locked : function()
{
};
CLock.prototype.Is_Locked = function()
{
if ( locktype_None != this.Type && locktype_Mine != this.Type )
return true;
return false;
},
Set_UserId : function(UserId)
{
};
CLock.prototype.Set_UserId = function(UserId)
{
this.UserId = UserId;
},
Get_UserId : function()
{
};
CLock.prototype.Get_UserId = function()
{
return this.UserId;
},
Have_Changes : function()
{
};
CLock.prototype.Have_Changes = function()
{
if ( locktype_Other2 === this.Type || locktype_Other3 === this.Type )
return true;
return false;
}
};
......@@ -1516,20 +1506,16 @@ function CContentChanges()
this.m_aChanges = [];
}
CContentChanges.prototype =
CContentChanges.prototype.Add = function(Changes)
{
Add : function(Changes)
{
this.m_aChanges.push( Changes );
},
Clear : function()
{
};
CContentChanges.prototype.Clear = function()
{
this.m_aChanges.length = 0;
},
Check : function(Type, Pos)
{
};
CContentChanges.prototype.Check = function(Type, Pos)
{
var CurPos = Pos;
var Count = this.m_aChanges.length;
for ( var Index = 0; Index < Count; Index++ )
......@@ -1542,14 +1528,15 @@ CContentChanges.prototype =
}
return CurPos;
},
Refresh : function()
{
};
CContentChanges.prototype.Refresh = function()
{
var Count = this.m_aChanges.length;
for ( var Index = 0; Index < Count; Index++ )
{
this.m_aChanges[Index].Refresh_BinaryData();
}
}
};
var g_oIdCounter = new CIdCounter();
var g_oTableId = null;
\ No newline at end of file
......@@ -389,7 +389,6 @@
History = new CHistory(wb);
g_oIdCounter = new CIdCounter();
g_oTableId = new CTableId();
if ( this.User )
g_oIdCounter.Set_UserId(this.User.asc_getId());
......
......@@ -525,7 +525,6 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
// History & global counters
History = new CHistory(wbModel);
g_oIdCounter = new CIdCounter();
g_oTableId = new CTableId();
if ( this.User )
g_oIdCounter.Set_UserId(this.User.asc_getId());
......
......@@ -2,8 +2,6 @@
//-----------------------------------------------------------------------------------
// Global counters
//-----------------------------------------------------------------------------------
var g_oIdCounter = null;
var g_oTableId = null;
function CCollaborativeEditing()
{
......
......@@ -6,11 +6,6 @@
* Time: 12:01
*/
var g_oIdCounter = new CIdCounter();
var g_oTableId = null;
function CCollaborativeChanges()
{
this.m_pData = null;
......
......@@ -6,10 +6,6 @@
* Time: 12:01
*/
var g_oIdCounter = new CIdCounter();
var g_oTableId = null;
function CCollaborativeChanges()
{
this.m_pData = null;
......
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