Commit e8aa15d7 authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander Trofimov
parent 7709be71
......@@ -10394,7 +10394,7 @@ AscBrowser.isRetina = 2 === window.devicePixelRatio;
"use strict";
window.g_cAscCoAuthoringUrl = "http://192.168.3.213:3000";
window.g_cAscCoAuthoringUrl = "";
"use strict"; /* docscoapicommon.js * * Author: Alexander.Trofimov * Date: 09.11.12 */ ( /** * @param {Window} window * @param {undefined} undefined */ function (window, undefined) { /* * Import * ----------------------------------------------------------------------------- */ var asc = window["Asc"] ? window["Asc"] : (window["Asc"] = {}); var prot; /** * Класс user для совместного редактирования/просмотра документа * ----------------------------------------------------------------------------- * * @constructor * @memberOf Asc */ function asc_CUser (val) { this.id = null; // уникальный id - пользователя this.userName = null; // имя пользователя this.state = undefined; // состояние (true - подключен, false - отключился) this.indexUser = -1; // Индекс пользователя (фактически равно числу заходов в документ на сервере) this.color = null; // цвет пользователя this.view = false; // просмотр(true), редактор(false) this._setUser(val); return this; } asc_CUser.prototype._setUser = function (val) { if (val) { this.id = val['id']; this.userName = val['username']; this.indexUser = val['indexUser']; this.color = g_oArrUserColors[this.indexUser % g_oArrUserColors.length]; this.state = val['state']; this.view = val['view']; } }; asc_CUser.prototype.asc_getId = function () { return this.id; }; asc_CUser.prototype.asc_getUserName = function () { return this.userName; }; asc_CUser.prototype.asc_getState = function () { return this.state; }; asc_CUser.prototype.asc_getColor = function () { return '#' + ('000000' + this.color.toString(16)).substr(-6); }; asc_CUser.prototype.asc_getColorValue = function () { return this.color; }; asc_CUser.prototype.asc_getView = function () { return this.view; }; asc_CUser.prototype.asc_setId = function (val) { this.id = val; }; asc_CUser.prototype.asc_setUserName = function (val) { this.userName = val; }; asc_CUser.prototype.asc_setState = function (val) { this.state = val; }; asc_CUser.prototype.asc_setColor = function (val) { this.color = val; }; /* * Export * ----------------------------------------------------------------------------- */ window["Asc"]["asc_CUser"] = window["Asc"].asc_CUser = asc_CUser; prot = asc_CUser.prototype; prot["asc_getId"] = prot.asc_getId; prot["asc_getUserName"] = prot.asc_getUserName; prot["asc_getState"] = prot.asc_getState; prot["asc_setId"] = prot.asc_setId; prot["asc_getColor"] = prot.asc_getColor; prot["asc_getColorValue"] = prot.asc_getColorValue; prot["asc_getView"] = prot.asc_getView; prot["asc_setUserName"] = prot.asc_setUserName; prot["asc_setState"] = prot.asc_setState; prot["asc_setColor"] = prot.asc_setColor; } )(window);
......@@ -157248,12 +157248,30 @@ CGraphicObjects.prototype =
this.handleEventMode = HANDLE_EVENT_MODE_CURSOR;
var cursor_type = this.nullState.onMouseDown(global_mouseEvent, x, y, pageIndex);
this.handleEventMode = HANDLE_EVENT_MODE_HANDLE;
if(cursor_type && cursor_type.cursorType === "text")
var object;
if(cursor_type )
{
var object = g_oTableId.Get_ById(cursor_type.objectId);
if(object && object.getNearestPos)
object = g_oTableId.Get_ById(cursor_type.objectId);
if(object)
{
return object.getNearestPos(x, y, pageIndex);
if(cursor_type.cursorType === "text")
{
if(object.getNearestPos)
{
return object.getNearestPos(x, y, pageIndex);
}
}
else
{
if(object.getObjectType() === historyitem_type_ImageShape && object.parent)
{
var oShape = object.parent.isShapeChild(true);
if(oShape)
{
return oShape.getNearestPos(x, y, pageIndex);
}
}
}
}
}
return null;
......@@ -216360,6 +216378,7 @@ function CDocument(DrawingDocument)
this.TurnOffRecalc = false;
this.TurnOffInterfaceEvents = false;
this.TurnOffRecalcCurPos = false;
this.CheckEmptyElementsOnSelection = true; // При выделении проверять или нет пустой параграф в конце/начале выделения.
......@@ -217169,8 +217188,14 @@ CDocument.prototype =
{
if ( PageIndex + 1 > this.FullRecalc.StartPage + 2 )
{
if (window["native"]["WC_CheckSuspendRecalculate"] && window["native"]["WC_CheckSuspendRecalculate"]())
if (window["native"]["WC_CheckSuspendRecalculate"] !== undefined)
{
//if (window["native"]["WC_CheckSuspendRecalculate"]())
// return;
this.FullRecalc.Id = setTimeout( Document_Recalculate_Page, 10 );
return;
}
}
this.Recalculate_Page();
......@@ -217802,19 +217827,25 @@ CDocument.prototype =
this.FullRecalc.StartIndex = _StartIndex;
this.FullRecalc.NewSection = _bStartNewSection;
this.FullRecalc.MainStartPos = _StartIndex;
if (window["NATIVE_EDITOR_ENJINE_SYNC_RECALC"] === true)
{
if ( _PageIndex > this.FullRecalc.StartPage + 2 )
{
if (window["native"]["WC_CheckSuspendRecalculate"] && window["native"]["WC_CheckSuspendRecalculate"]())
return;
if (window["native"]["WC_CheckSuspendRecalculate"] !== undefined)
{
//if (window["native"]["WC_CheckSuspendRecalculate"]())
// return;
this.FullRecalc.Id = setTimeout( Document_Recalculate_Page, 10 );
return;
}
}
this.Recalculate_Page();
return;
}
if ( _PageIndex > this.FullRecalc.StartPage + 2 )
{
this.FullRecalc.Id = setTimeout( Document_Recalculate_Page, 20 );
......@@ -217921,6 +217952,9 @@ CDocument.prototype =
RecalculateCurPos : function()
{
if (true === this.TurnOffRecalcCurPos)
return;
if ( true === CollaborativeEditing.m_bGlobalLockSelection )
return;
......@@ -217949,6 +217983,9 @@ CDocument.prototype =
Internal_CheckCurPage : function()
{
if (true === this.TurnOffRecalcCurPos)
return;
if ( true === CollaborativeEditing.m_bGlobalLockSelection )
return;
......@@ -227743,6 +227780,19 @@ CDocument.prototype =
}
},
TurnOff_RecalculateCurPos : function()
{
this.TurnOffRecalcCurPos = true;
},
TurnOn_RecalculateCurPos : function(bUpdate)
{
this.TurnOffRecalcCurPos = false;
if (true === bUpdate)
this.Document_UpdateSelectionState();
},
Can_CopyCut : function()
{
var bCanCopyCut = false;
......@@ -229117,6 +229167,8 @@ CDocument.prototype =
// Отключаем пересчет, включим перед последним добавлением. Поскольку,
// у нас все добавляется в 1 параграф, так можно делать.
this.TurnOffRecalc = true;
this.TurnOff_InterfaceEvents();
this.TurnOff_RecalculateCurPos();
var Count = sText.length;
var e = global_keyboardEvent;
......@@ -229134,6 +229186,8 @@ CDocument.prototype =
// На случай, если Count = 0
this.TurnOffRecalc = false;
this.TurnOn_RecalculateCurPos(false);
this.TurnOn_InterfaceEvents(true);
}
else
{
......@@ -357476,7 +357530,10 @@ CDrawingDocument.prototype =
var _len = _params.length / 4;
this.LogicDocument.TurnOff_Recalculate();
//this.LogicDocument.TurnOff_Recalculate();
// если выключить - падает на некоторых документах. Например в списке если заселектить
// несколько параграфов и ввести букву
this.LogicDocument.TurnOff_InterfaceEvents();
this.StartUpdateOverlay();
......@@ -357514,7 +357571,7 @@ CDrawingDocument.prototype =
this.EndUpdateOverlay();
this.LogicDocument.TurnOn_Recalculate(true);
//this.LogicDocument.TurnOn_Recalculate(true);
this.LogicDocument.TurnOn_InterfaceEvents(true);
},
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