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