Commit d175f69a authored by Oleg Korshul's avatar Oleg Korshul

onResize input bug

parent 43375450
......@@ -121,6 +121,7 @@
{
// нужен еще один родитель. чтобы скроллился он, а не oHtmlParent
var oHtmlDivScrollable = document.createElement("div");
oHtmlDivScrollable.id = "area_id_main";
oHtmlDivScrollable.style.background = "transparent";
oHtmlDivScrollable.style.border = "none";
oHtmlDivScrollable.style.position = "absolute";
......@@ -137,16 +138,6 @@
oHtmlDivScrollable.appendChild(this.HtmlDiv);
oHtmlParent.parentNode.appendChild(oHtmlDivScrollable);
oHtmlParent.onresize = function(e)
{
var _elem = document.getElementById("area_id_parent");
var style = getComputedStyle(oHtmlParent);
_elem.style.left = style.left;
_elem.style.top = style.top;
_elem.style.width = style.width;
_elem.style.height = style.height;
};
}
else
{
......@@ -205,6 +196,16 @@
this.Api.Input_UpdatePos();
},
onResize : function(_editorContainerId)
{
var _elem = document.getElementById("area_id_main");
var _elemSrc = document.getElementById(_editorContainerId);
_elem.style.left = _elemSrc.style.left;
_elem.style.top = _elemSrc.style.top;
_elem.style.width = _elemSrc.style.width;
_elem.style.height = _elemSrc.style.height;
},
checkFocus : function()
{
if (oThis.Api.asc_IsFocus() && !AscCommon.g_clipboardBase.IsFocus() && !AscCommon.g_clipboardBase.IsWorking())
......@@ -634,7 +635,7 @@
var t = window['AscCommon'].g_inputContext;
t.nativeFocusElement = e.target;
//console.log(t.nativeFocusElement);
console.log(t.nativeFocusElement);
if (t.InterfaceEnableKeyEvents == false)
{
......
......@@ -99,7 +99,8 @@ var GlobalSkinFlat = {
var GlobalSkin = GlobalSkinFlat;
function updateGlobalSkin(newSkin) {
function updateGlobalSkin(newSkin)
{
GlobalSkin.Name = newSkin.Name;
GlobalSkin.RulersButton = newSkin.RulersButton;
GlobalSkin.NavigationButtons = newSkin.NavigationButtons;
......@@ -193,7 +194,7 @@ function CEditorPage(api)
this.m_bDocumentPlaceChangedEnabled = false;
this.m_nZoomValue = 100;
this.zoom_values = [50,60,70,80,90,100,110,120,130,140,150,160,170,180,190,200];
this.zoom_values = [50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200];
this.m_nZoomType = 2; // 0 - custom, 1 - fitToWodth, 2 - fitToPage
this.m_oBoundsController = new AscFormat.CBoundsController();
......@@ -290,16 +291,16 @@ function CEditorPage(api)
this.bIsDoublePx = true;
var oTestSpan = document.createElement("span");
oTestSpan.setAttribute("style", "font-size:8pt");
document.body.appendChild( oTestSpan );
document.body.appendChild(oTestSpan);
var defaultView = oTestSpan.ownerDocument.defaultView;
var computedStyle = defaultView.getComputedStyle( oTestSpan, null );
if(null != computedStyle)
var computedStyle = defaultView.getComputedStyle(oTestSpan, null);
if (null != computedStyle)
{
var fontSize = computedStyle.getPropertyValue( "font-size" );
if(-1 != fontSize.indexOf("px") && parseFloat(fontSize) == parseInt(fontSize))
var fontSize = computedStyle.getPropertyValue("font-size");
if (-1 != fontSize.indexOf("px") && parseFloat(fontSize) == parseInt(fontSize))
this.bIsDoublePx = false;
}
document.body.removeChild( oTestSpan );
document.body.removeChild(oTestSpan);
// -----------------------------------------------------------------------
......@@ -307,7 +308,7 @@ function CEditorPage(api)
this.m_nCurrentTimeClearCache = 0;
this.StartVerticalScroll = false;
this.VerticalScrollOnMouseUp = { SlideNum : 0, ScrollY : 0, ScrollY_max : 0};
this.VerticalScrollOnMouseUp = {SlideNum : 0, ScrollY : 0, ScrollY_max : 0};
this.IsGoToPageMAXPosition = false;
this.bIsRetinaSupport = true;
......@@ -344,13 +345,13 @@ function CEditorPage(api)
this.MainScrollLock = function()
{
this.MainScrollsEnabledFlag++;
}
};
this.MainScrollUnLock = function()
{
this.MainScrollsEnabledFlag--;
if (this.MainScrollsEnabledFlag < 0)
this.MainScrollsEnabledFlag = 0;
}
};
this.checkBodySize = function()
{
......@@ -371,7 +372,7 @@ function CEditorPage(api)
return true;
}
return false;
}
};
this.Init = function()
{
......@@ -398,18 +399,18 @@ function CEditorPage(api)
this.m_oBody.AddControl(this.m_oThumbnailsContainer);
this.m_oThumbnailsBack = CreateControl("id_thumbnails_background");
this.m_oThumbnailsBack.Bounds.SetParams(0,0,ScrollWidthMm9,1000,false,false,true,false,-1,-1);
this.m_oThumbnailsBack.Anchor = (g_anchor_left | g_anchor_top | g_anchor_right |g_anchor_bottom);
this.m_oThumbnailsBack.Bounds.SetParams(0, 0, ScrollWidthMm9, 1000, false, false, true, false, -1, -1);
this.m_oThumbnailsBack.Anchor = (g_anchor_left | g_anchor_top | g_anchor_right | g_anchor_bottom);
this.m_oThumbnailsContainer.AddControl(this.m_oThumbnailsBack);
this.m_oThumbnails = CreateControl("id_thumbnails");
this.m_oThumbnails.Bounds.SetParams(0,0,ScrollWidthMm9,1000,false,false,true,false,-1,-1);
this.m_oThumbnails.Anchor = (g_anchor_left | g_anchor_top | g_anchor_right |g_anchor_bottom);
this.m_oThumbnails.Bounds.SetParams(0, 0, ScrollWidthMm9, 1000, false, false, true, false, -1, -1);
this.m_oThumbnails.Anchor = (g_anchor_left | g_anchor_top | g_anchor_right | g_anchor_bottom);
this.m_oThumbnailsContainer.AddControl(this.m_oThumbnails);
this.m_oThumbnails_scroll = CreateControl("id_vertical_scroll_thmbnl");
this.m_oThumbnails_scroll.Bounds.SetParams(0,0,1000,1000,false,false,false,false,ScrollWidthMm9,-1);
this.m_oThumbnails_scroll.Anchor = (g_anchor_top | g_anchor_right |g_anchor_bottom);
this.m_oThumbnails_scroll.Bounds.SetParams(0, 0, 1000, 1000, false, false, false, false, ScrollWidthMm9, -1);
this.m_oThumbnails_scroll.Anchor = (g_anchor_top | g_anchor_right | g_anchor_bottom);
this.m_oThumbnailsContainer.AddControl(this.m_oThumbnails_scroll);
// ----------------
......@@ -417,22 +418,22 @@ function CEditorPage(api)
this.m_oMainContent = CreateControlContainer("id_main");
if (GlobalSkin.SupportNotes)
this.m_oMainContent.Bounds.SetParams(this.Splitter1Pos + GlobalSkin.SplitterWidthMM,0,g_dKoef_pix_to_mm,this.Splitter2Pos + GlobalSkin.SplitterWidthMM,true,false,true,true,-1,-1);
this.m_oMainContent.Bounds.SetParams(this.Splitter1Pos + GlobalSkin.SplitterWidthMM, 0, g_dKoef_pix_to_mm, this.Splitter2Pos + GlobalSkin.SplitterWidthMM, true, false, true, true, -1, -1);
else
this.m_oMainContent.Bounds.SetParams(this.Splitter1Pos + GlobalSkin.SplitterWidthMM,0,g_dKoef_pix_to_mm,1000,true,false,true,false,-1,-1);
this.m_oMainContent.Bounds.SetParams(this.Splitter1Pos + GlobalSkin.SplitterWidthMM, 0, g_dKoef_pix_to_mm, 1000, true, false, true, false, -1, -1);
this.m_oMainContent.Anchor = (g_anchor_left | g_anchor_top | g_anchor_right | g_anchor_bottom);
this.m_oBody.AddControl(this.m_oMainContent);
// panel right --------------------------------------------------------------
this.m_oPanelRight = CreateControlContainer("id_panel_right");
this.m_oPanelRight.Bounds.SetParams(0,0,1000,0,false,false,false,true,ScrollWidthMm,-1);
this.m_oPanelRight.Bounds.SetParams(0, 0, 1000, 0, false, false, false, true, ScrollWidthMm, -1);
this.m_oPanelRight.Anchor = (g_anchor_top | g_anchor_right | g_anchor_bottom);
this.m_oMainContent.AddControl(this.m_oPanelRight);
this.m_oPanelRight_buttonRulers = CreateControl("id_buttonRulers");
this.m_oPanelRight_buttonRulers.Bounds.SetParams(0,0,1000,1000,false,false,false,false,-1,ScrollWidthMm);
this.m_oPanelRight_buttonRulers.Bounds.SetParams(0, 0, 1000, 1000, false, false, false, false, -1, ScrollWidthMm);
this.m_oPanelRight_buttonRulers.Anchor = (g_anchor_left | g_anchor_top | g_anchor_right);
this.m_oPanelRight.AddControl(this.m_oPanelRight_buttonRulers);
......@@ -444,12 +445,12 @@ function CEditorPage(api)
}
this.m_oPanelRight_buttonNextPage = CreateControl("id_buttonNextPage");
this.m_oPanelRight_buttonNextPage.Bounds.SetParams(0,0,1000,1000,false,false,false,false,-1,ScrollWidthMm);
this.m_oPanelRight_buttonNextPage.Bounds.SetParams(0, 0, 1000, 1000, false, false, false, false, -1, ScrollWidthMm);
this.m_oPanelRight_buttonNextPage.Anchor = (g_anchor_left | g_anchor_bottom | g_anchor_right);
this.m_oPanelRight.AddControl(this.m_oPanelRight_buttonNextPage);
this.m_oPanelRight_buttonPrevPage = CreateControl("id_buttonPrevPage");
this.m_oPanelRight_buttonPrevPage.Bounds.SetParams(0,0,1000,ScrollWidthMm,false,false,false,true,-1,ScrollWidthMm);
this.m_oPanelRight_buttonPrevPage.Bounds.SetParams(0, 0, 1000, ScrollWidthMm, false, false, false, true, -1, ScrollWidthMm);
this.m_oPanelRight_buttonPrevPage.Anchor = (g_anchor_left | g_anchor_bottom | g_anchor_right);
this.m_oPanelRight.AddControl(this.m_oPanelRight_buttonPrevPage);
......@@ -462,43 +463,43 @@ function CEditorPage(api)
}
this.m_oPanelRight_vertScroll = CreateControl("id_vertical_scroll");
this.m_oPanelRight_vertScroll.Bounds.SetParams(0,_vertScrollTop,1000,_vertScrollBottom,false,true,false,true,-1,-1);
this.m_oPanelRight_vertScroll.Bounds.SetParams(0, _vertScrollTop, 1000, _vertScrollBottom, false, true, false, true, -1, -1);
this.m_oPanelRight_vertScroll.Anchor = (g_anchor_left | g_anchor_top | g_anchor_right | g_anchor_bottom);
this.m_oPanelRight.AddControl(this.m_oPanelRight_vertScroll);
// --------------------------------------------------------------------------
// --- left ---
this.m_oLeftRuler = CreateControlContainer("id_panel_left");
this.m_oLeftRuler.Bounds.SetParams(0,0,1000,1000,false,false,false,false,5,-1);
this.m_oLeftRuler.Bounds.SetParams(0, 0, 1000, 1000, false, false, false, false, 5, -1);
this.m_oLeftRuler.Anchor = (g_anchor_left | g_anchor_top | g_anchor_bottom);
this.m_oMainContent.AddControl(this.m_oLeftRuler);
this.m_oLeftRuler_buttonsTabs = CreateControl("id_buttonTabs");
this.m_oLeftRuler_buttonsTabs.Bounds.SetParams(0,0.8,1000,1000,false,true,false,false,-1,5);
this.m_oLeftRuler_buttonsTabs.Bounds.SetParams(0, 0.8, 1000, 1000, false, true, false, false, -1, 5);
this.m_oLeftRuler_buttonsTabs.Anchor = (g_anchor_left | g_anchor_top | g_anchor_right);
this.m_oLeftRuler.AddControl(this.m_oLeftRuler_buttonsTabs);
this.m_oLeftRuler_vertRuler = CreateControl("id_vert_ruler");
this.m_oLeftRuler_vertRuler.Bounds.SetParams(0,7,1000,1000,false,true,false,false,-1,-1);
this.m_oLeftRuler_vertRuler.Bounds.SetParams(0, 7, 1000, 1000, false, true, false, false, -1, -1);
this.m_oLeftRuler_vertRuler.Anchor = (g_anchor_left | g_anchor_right | g_anchor_top | g_anchor_bottom);
this.m_oLeftRuler.AddControl(this.m_oLeftRuler_vertRuler);
// ------------
// --- top ----
this.m_oTopRuler = CreateControlContainer("id_panel_top");
this.m_oTopRuler.Bounds.SetParams(5,0,1000,1000,true,false,false,false,-1,7);
this.m_oTopRuler.Bounds.SetParams(5, 0, 1000, 1000, true, false, false, false, -1, 7);
this.m_oTopRuler.Anchor = (g_anchor_left | g_anchor_top | g_anchor_right);
this.m_oMainContent.AddControl(this.m_oTopRuler);
this.m_oTopRuler_horRuler = CreateControl("id_hor_ruler");
this.m_oTopRuler_horRuler.Bounds.SetParams(0,0,1000,1000,false,false,false,false,-1,-1);
this.m_oTopRuler_horRuler.Bounds.SetParams(0, 0, 1000, 1000, false, false, false, false, -1, -1);
this.m_oTopRuler_horRuler.Anchor = (g_anchor_left | g_anchor_right | g_anchor_top | g_anchor_bottom);
this.m_oTopRuler.AddControl(this.m_oTopRuler_horRuler);
// ------------
// scroll hor --
this.m_oScrollHor = CreateControlContainer("id_horscrollpanel");
this.m_oScrollHor.Bounds.SetParams(0,0,ScrollWidthMm,1000,false,false,true,false,-1,ScrollWidthMm);
this.m_oScrollHor.Bounds.SetParams(0, 0, ScrollWidthMm, 1000, false, false, true, false, -1, ScrollWidthMm);
this.m_oScrollHor.Anchor = (g_anchor_left | g_anchor_right | g_anchor_bottom);
this.m_oMainContent.AddControl(this.m_oScrollHor);
// -------------
......@@ -510,13 +511,13 @@ function CEditorPage(api)
this.m_oBody.AddControl(this.m_oNotesContainer);
this.m_oNotes = CreateControl("id_notes");
this.m_oNotes.Bounds.SetParams(0,0,ScrollWidthMm,1000,false,false,true,false,-1,-1);
this.m_oNotes.Anchor = (g_anchor_left | g_anchor_top | g_anchor_right |g_anchor_bottom);
this.m_oNotes.Bounds.SetParams(0, 0, ScrollWidthMm, 1000, false, false, true, false, -1, -1);
this.m_oNotes.Anchor = (g_anchor_left | g_anchor_top | g_anchor_right | g_anchor_bottom);
this.m_oNotesContainer.AddControl(this.m_oNotes);
this.m_oNotes_scroll = CreateControl("id_vertical_scroll_notes");
this.m_oNotes_scroll.Bounds.SetParams(0,0,1000,1000,false,false,false,false,ScrollWidthMm,-1);
this.m_oNotes_scroll.Anchor = (g_anchor_top | g_anchor_right |g_anchor_bottom);
this.m_oNotes_scroll.Bounds.SetParams(0, 0, 1000, 1000, false, false, false, false, ScrollWidthMm, -1);
this.m_oNotes_scroll.Anchor = (g_anchor_top | g_anchor_right | g_anchor_bottom);
this.m_oNotesContainer.AddControl(this.m_oNotes_scroll);
if (!GlobalSkin.SupportNotes)
......@@ -527,18 +528,18 @@ function CEditorPage(api)
// ----------
this.m_oMainView = CreateControlContainer("id_main_view");
this.m_oMainView.Bounds.SetParams(5,7,ScrollWidthMm,0,true,true,true,true,-1,-1);
this.m_oMainView.Bounds.SetParams(5, 7, ScrollWidthMm, 0, true, true, true, true, -1, -1);
this.m_oMainView.Anchor = (g_anchor_left | g_anchor_right | g_anchor_top | g_anchor_bottom);
this.m_oMainContent.AddControl(this.m_oMainView);
this.m_oEditor = CreateControl("id_viewer");
this.m_oEditor.Bounds.SetParams(0,0,1000,1000,false,false,false,false,-1,-1);
this.m_oEditor.Anchor = (g_anchor_left | g_anchor_top | g_anchor_right |g_anchor_bottom);
this.m_oEditor.Bounds.SetParams(0, 0, 1000, 1000, false, false, false, false, -1, -1);
this.m_oEditor.Anchor = (g_anchor_left | g_anchor_top | g_anchor_right | g_anchor_bottom);
this.m_oMainView.AddControl(this.m_oEditor);
this.m_oOverlay = CreateControl("id_viewer_overlay");
this.m_oOverlay.Bounds.SetParams(0,0,1000,1000,false,false,false,false,-1,-1);
this.m_oOverlay.Anchor = (g_anchor_left | g_anchor_top | g_anchor_right |g_anchor_bottom);
this.m_oOverlay.Bounds.SetParams(0, 0, 1000, 1000, false, false, false, false, -1, -1);
this.m_oOverlay.Anchor = (g_anchor_left | g_anchor_top | g_anchor_right | g_anchor_bottom);
this.m_oMainView.AddControl(this.m_oOverlay);
// --------------------------------------------------------------------------
......@@ -557,7 +558,7 @@ function CEditorPage(api)
this.checkNeedRules();
this.initEvents();
this.OnResize(true);
}
};
this.CheckRetinaDisplay = function()
{
......@@ -577,7 +578,7 @@ function CEditorPage(api)
// сбросить кэш страниц
this.onButtonTabsDraw();
}
}
};
this.CheckRetinaElement = function(htmlElem)
{
......@@ -591,16 +592,16 @@ function CEditorPage(api)
return true;
}
return false;
}
};
this.ShowOverlay = function()
{
this.m_oOverlayApi.Show();
}
};
this.UnShowOverlay = function()
{
this.m_oOverlayApi.UnShow();
}
};
this.CheckUnShowOverlay = function()
{
var drDoc = this.m_oDrawingDocument;
......@@ -614,19 +615,19 @@ function CEditorPage(api)
*/
return true;
}
};
this.CheckShowOverlay = function()
{
var drDoc = this.m_oDrawingDocument;
if (drDoc.m_bIsSearching || drDoc.m_bIsSelection)
this.ShowOverlay();
}
};
this.initEvents = function()
{
this.arrayEventHandlers[0] = new AscCommon.button_eventHandlers("","0px 0px","0px -16px", "0px -32px",this.m_oPanelRight_buttonRulers,this.onButtonRulersClick);
this.arrayEventHandlers[1] = new AscCommon.button_eventHandlers("","0px 0px","0px -16px", "0px -32px",this.m_oPanelRight_buttonPrevPage,this.onPrevPage);
this.arrayEventHandlers[2] = new AscCommon.button_eventHandlers("","0px -48px","0px -64px", "0px -80px",this.m_oPanelRight_buttonNextPage,this.onNextPage);
this.arrayEventHandlers[0] = new AscCommon.button_eventHandlers("", "0px 0px", "0px -16px", "0px -32px", this.m_oPanelRight_buttonRulers, this.onButtonRulersClick);
this.arrayEventHandlers[1] = new AscCommon.button_eventHandlers("", "0px 0px", "0px -16px", "0px -32px", this.m_oPanelRight_buttonPrevPage, this.onPrevPage);
this.arrayEventHandlers[2] = new AscCommon.button_eventHandlers("", "0px -48px", "0px -64px", "0px -80px", this.m_oPanelRight_buttonNextPage, this.onNextPage);
this.m_oLeftRuler_buttonsTabs.HtmlElement.onclick = this.onButtonTabsClick;
......@@ -647,7 +648,8 @@ function CEditorPage(api)
if (this.m_oMainContent.HtmlElement.addEventListener)
this.m_oMainContent.HtmlElement.addEventListener("DOMMouseScroll", this.onMouseWhell, false);
this.m_oBody.HtmlElement.onmousewheel = function(e){
this.m_oBody.HtmlElement.onmousewheel = function(e)
{
e.preventDefault();
return false;
};
......@@ -671,62 +673,74 @@ function CEditorPage(api)
this.initEvents2MobileAdvances();
this.Thumbnails.initEvents();
}
};
this.initEvents2MobileAdvances = function()
{
this.m_oEditor.HtmlElement["ontouchstart"] = function (e){
this.m_oEditor.HtmlElement["ontouchstart"] = function(e)
{
oThis.onMouseDown(e.touches[0]);
return false;
}
this.m_oEditor.HtmlElement["ontouchmove"] = function (e){
};
this.m_oEditor.HtmlElement["ontouchmove"] = function(e)
{
oThis.onMouseMove(e.touches[0]);
return false;
}
this.m_oEditor.HtmlElement["ontouchend"] = function (e){
};
this.m_oEditor.HtmlElement["ontouchend"] = function(e)
{
oThis.onMouseUp(e.changedTouches[0]);
return false;
}
};
this.m_oOverlay.HtmlElement["ontouchstart"] = function (e){
this.m_oOverlay.HtmlElement["ontouchstart"] = function(e)
{
oThis.onMouseDown(e.touches[0]);
return false;
}
this.m_oOverlay.HtmlElement["ontouchmove"] = function (e){
};
this.m_oOverlay.HtmlElement["ontouchmove"] = function(e)
{
oThis.onMouseMove(e.touches[0]);
return false;
}
this.m_oOverlay.HtmlElement["ontouchend"] = function (e){
};
this.m_oOverlay.HtmlElement["ontouchend"] = function(e)
{
oThis.onMouseUp(e.changedTouches[0]);
return false;
}
};
this.m_oTopRuler_horRuler.HtmlElement["ontouchstart"] = function (e){
this.m_oTopRuler_horRuler.HtmlElement["ontouchstart"] = function(e)
{
oThis.horRulerMouseDown(e.touches[0]);
return false;
}
this.m_oTopRuler_horRuler.HtmlElement["ontouchmove"] = function (e){
};
this.m_oTopRuler_horRuler.HtmlElement["ontouchmove"] = function(e)
{
oThis.horRulerMouseMove(e.touches[0]);
return false;
}
this.m_oTopRuler_horRuler.HtmlElement["ontouchend"] = function (e){
};
this.m_oTopRuler_horRuler.HtmlElement["ontouchend"] = function(e)
{
oThis.horRulerMouseUp(e.changedTouches[0]);
return false;
}
};
this.m_oLeftRuler_vertRuler.HtmlElement["ontouchstart"] = function (e){
this.m_oLeftRuler_vertRuler.HtmlElement["ontouchstart"] = function(e)
{
oThis.verRulerMouseDown(e.touches[0]);
return false;
}
this.m_oLeftRuler_vertRuler.HtmlElement["ontouchmove"] = function (e){
};
this.m_oLeftRuler_vertRuler.HtmlElement["ontouchmove"] = function(e)
{
oThis.verRulerMouseMove(e.touches[0]);
return false;
}
this.m_oLeftRuler_vertRuler.HtmlElement["ontouchend"] = function (e){
};
this.m_oLeftRuler_vertRuler.HtmlElement["ontouchend"] = function(e)
{
oThis.verRulerMouseUp(e.changedTouches[0]);
return false;
}
}
};
};
this.onButtonRulersClick = function()
{
if (false === oThis.m_oApi.bInit_word_control || true === oThis.m_oApi.isViewMode)
......@@ -735,7 +749,7 @@ function CEditorPage(api)
oThis.m_bIsRuler = !oThis.m_bIsRuler;
oThis.checkNeedRules();
oThis.OnResize(true);
}
};
this.HideRulers = function()
{
......@@ -748,7 +762,7 @@ function CEditorPage(api)
oThis.m_bIsRuler = !oThis.m_bIsRuler;
oThis.checkNeedRules();
oThis.OnResize(true);
}
};
this.zoom_FitToWidth = function()
{
......@@ -785,7 +799,7 @@ function CEditorPage(api)
this.m_oApi.sync_zoomChangeCallback(this.m_nZoomValue, 1);
}
return false;
}
};
this.zoom_FitToPage = function()
{
if (null == this.m_oLogicDocument)
......@@ -828,7 +842,7 @@ function CEditorPage(api)
this.m_oApi.sync_zoomChangeCallback(this.m_nZoomValue, 2);
}
return false;
}
};
this.zoom_Fire = function(type)
{
......@@ -872,7 +886,7 @@ function CEditorPage(api)
oWordControl.m_bIsRePaintOnScroll = true;
oWordControl.OnScroll();
}
};
this.zoom_Out = function()
{
......@@ -897,7 +911,7 @@ function CEditorPage(api)
oThis.m_nZoomValue = _Zoom;
oThis.zoom_Fire(0);
}
};
this.zoom_In = function()
{
......@@ -922,7 +936,7 @@ function CEditorPage(api)
oThis.m_nZoomValue = _Zoom;
oThis.zoom_Fire(0);
}
};
this.DisableRulerMarkers = function()
{
......@@ -945,7 +959,7 @@ function CEditorPage(api)
this.UpdateHorRuler();
this.UpdateVerRuler();
}
}
};
this.EnableRulerMarkers = function()
{
......@@ -959,7 +973,7 @@ function CEditorPage(api)
if (this.m_bIsRuler)
this.UpdateHorRuler();
}
};
this.ToSearchResult = function()
{
......@@ -1033,7 +1047,7 @@ function CEditorPage(api)
}
this.OnUpdateOverlay();
}
};
this.onButtonTabsClick = function()
{
......@@ -1054,7 +1068,7 @@ function CEditorPage(api)
oWordControl
.onButtonTabsDraw();
}
}
};
this.onButtonTabsDraw = function()
{
......@@ -1103,7 +1117,7 @@ function CEditorPage(api)
_ctx.stroke();
_ctx.beginPath();
}
};
this.onPrevPage = function()
{
......@@ -1119,7 +1133,7 @@ function CEditorPage(api)
{
oWordControl.GoToPage(0);
}
}
};
this.onNextPage = function()
{
if (false === oThis.m_oApi.bInit_word_control)
......@@ -1134,7 +1148,7 @@ function CEditorPage(api)
{
oWordControl.GoToPage(oWordControl.m_oDrawingDocument.SlidesCount - 1);
}
}
};
this.horRulerMouseDown = function(e)
{
......@@ -1150,7 +1164,7 @@ function CEditorPage(api)
if (-1 != oWordControl.m_oDrawingDocument.SlideCurrent)
oWordControl.m_oHorRuler.OnMouseDown(oWordControl.m_oDrawingDocument.SlideCurrectRect.left, 0, e);
}
};
this.horRulerMouseUp = function(e)
{
if (false === oThis.m_oApi.bInit_word_control)
......@@ -1165,7 +1179,7 @@ function CEditorPage(api)
if (-1 != oWordControl.m_oDrawingDocument.SlideCurrent)
oWordControl.m_oHorRuler.OnMouseUp(oWordControl.m_oDrawingDocument.SlideCurrectRect.left, 0, e);
}
};
this.horRulerMouseMove = function(e)
{
if (false === oThis.m_oApi.bInit_word_control)
......@@ -1180,7 +1194,7 @@ function CEditorPage(api)
if (-1 != oWordControl.m_oDrawingDocument.SlideCurrent)
oWordControl.m_oHorRuler.OnMouseMove(oWordControl.m_oDrawingDocument.SlideCurrectRect.left, 0, e);
}
};
this.verRulerMouseDown = function(e)
{
......@@ -1196,7 +1210,7 @@ function CEditorPage(api)
if (-1 != oWordControl.m_oDrawingDocument.SlideCurrent)
oWordControl.m_oVerRuler.OnMouseDown(0, oWordControl.m_oDrawingDocument.SlideCurrectRect.top, e);
}
};
this.verRulerMouseUp = function(e)
{
if (false === oThis.m_oApi.bInit_word_control)
......@@ -1211,7 +1225,7 @@ function CEditorPage(api)
if (-1 != oWordControl.m_oDrawingDocument.SlideCurrent)
oWordControl.m_oVerRuler.OnMouseUp(0, oWordControl.m_oDrawingDocument.SlideCurrectRect.top, e);
}
};
this.verRulerMouseMove = function(e)
{
if (false === oThis.m_oApi.bInit_word_control)
......@@ -1226,7 +1240,7 @@ function CEditorPage(api)
if (-1 != oWordControl.m_oDrawingDocument.SlideCurrent)
oWordControl.m_oVerRuler.OnMouseMove(0, oWordControl.m_oDrawingDocument.SlideCurrectRect.top, e);
}
};
this.SelectWheel = function()
{
......@@ -1296,7 +1310,7 @@ function CEditorPage(api)
if (scrollXVal != 0 || scrollYVal != 0)
oWordControl.onMouseMove2();
}
};
this.createSplitterDiv = function(bIsVert)
{
......@@ -1335,8 +1349,8 @@ function CEditorPage(api)
Splitter.setAttribute("contentEditable", false);
this.SplitterDiv = Splitter;
this.m_oBody.HtmlElement.appendChild( this.SplitterDiv );
}
this.m_oBody.HtmlElement.appendChild(this.SplitterDiv);
};
this.onBodyMouseDown = function(e)
{
......@@ -1384,7 +1398,7 @@ function CEditorPage(api)
else
e.returnValue = false;
}
}
};
this.onBodyMouseMove = function(e)
{
......@@ -1462,7 +1476,7 @@ function CEditorPage(api)
else
e.returnValue = false;
}
}
};
this.OnResizeSplitter = function()
{
......@@ -1500,7 +1514,7 @@ function CEditorPage(api)
}
this.OnResize2(true);
}
};
this.onBodyMouseUp = function(e)
{
......@@ -1553,7 +1567,7 @@ function CEditorPage(api)
else
e.returnValue = false;
}
}
};
this.onMouseDown = function(e)
{
......@@ -1630,7 +1644,7 @@ function CEditorPage(api)
}
oWordControl.Thumbnails.SetFocusElement(FOCUS_OBJECT_MAIN);
}
};
this.onMouseMove = function(e)
{
......@@ -1661,7 +1675,7 @@ function CEditorPage(api)
oWordControl.StartUpdateOverlay();
oWordControl.m_oLogicDocument.OnMouseMove(global_mouseEvent, pos.X, pos.Y, pos.Page);
oWordControl.EndUpdateOverlay();
}
};
this.onMouseMove2 = function()
{
if (false === oThis.m_oApi.bInit_word_control)
......@@ -1678,7 +1692,7 @@ function CEditorPage(api)
oWordControl.StartUpdateOverlay();
oWordControl.m_oLogicDocument.OnMouseMove(global_mouseEvent, pos.X, pos.Y, pos.Page);
oWordControl.EndUpdateOverlay();
}
};
this.onMouseUp = function(e, bIsWindow)
{
if (false === oThis.m_oApi.bInit_word_control)
......@@ -1737,11 +1751,11 @@ function CEditorPage(api)
oWordControl.m_oLogicDocument.OnMouseUp(global_mouseEvent, pos.X, pos.Y, pos.Page);
oWordControl.m_bIsMouseUpSend = false;
// oWordControl.m_oLogicDocument.Document_UpdateInterfaceState();
// oWordControl.m_oLogicDocument.Document_UpdateInterfaceState();
oWordControl.m_oLogicDocument.Document_UpdateRulersState();
oWordControl.EndUpdateOverlay();
}
};
this.onMouseUpExternal = function(x, y)
{
......@@ -1794,7 +1808,7 @@ function CEditorPage(api)
oWordControl.m_oLogicDocument.Document_UpdateRulersState();
oWordControl.EndUpdateOverlay();
}
};
this.onMouseWhell = function(e)
{
......@@ -1890,7 +1904,7 @@ function CEditorPage(api)
else
e.returnValue = false;
return false;
}
};
this.onKeyUp = function(e)
{
......@@ -1898,7 +1912,7 @@ function CEditorPage(api)
global_keyboardEvent.CtrlKey = false;
global_keyboardEvent.ShiftKey = false;
global_keyboardEvent.AltGr = false;
}
};
this.onKeyDown = function(e)
{
......@@ -1977,7 +1991,7 @@ function CEditorPage(api)
}
oWordControl.EndUpdateOverlay();
}
};
this.onKeyDownNoActiveControl = function(e)
{
......@@ -1997,7 +2011,7 @@ function CEditorPage(api)
}
return bSendToEditor;
}
};
this.onKeyDownTBIM = function(e)
{
......@@ -2057,7 +2071,7 @@ function CEditorPage(api)
e.preventDefault();
return false;
}
}
};
this.DisableTextEATextboxAttack = function()
{
......@@ -2075,7 +2089,7 @@ function CEditorPage(api)
this.TextBoxInputFocus = false;
this.ReinitTB();
}
}
};
this.onKeyPress = function(e)
{
......@@ -2138,19 +2152,19 @@ function CEditorPage(api)
oWordControl.StartUpdateOverlay();
var retValue = oWordControl.m_oLogicDocument.OnKeyPress(global_keyboardEvent);
if ( true === retValue )
if (true === retValue)
{
e.preventDefault();
}
oWordControl.EndUpdateOverlay();
}
};
// -------------------------------------------------------- //
// -----------------end demonstration---------------------- //
// -------------------------------------------------------- //
this.verticalScroll = function(sender,scrollPositionY,maxY,isAtTop,isAtBottom)
this.verticalScroll = function(sender, scrollPositionY, maxY, isAtTop, isAtBottom)
{
if (false === oThis.m_oApi.bInit_word_control)
return;
......@@ -2219,7 +2233,7 @@ function CEditorPage(api)
if (oWordControl.m_bIsRePaintOnScroll === true)
oWordControl.OnScroll();
}
};
this.verticalScrollMouseUp = function(sender, e)
{
if (0 != this.MainScrollsEnabledFlag || !this.StartVerticalScroll)
......@@ -2241,7 +2255,7 @@ function CEditorPage(api)
this.m_oScrollVerApi.scrollByY(0, true);
}
}
};
this.CorrectSpeedVerticalScroll = function(newScrollPos)
{
if (0 != this.MainScrollsEnabledFlag)
......@@ -2249,16 +2263,16 @@ function CEditorPage(api)
this.StartVerticalScroll = true;
var res = { isChange : false, Pos : newScrollPos };
var res = {isChange : false, Pos : newScrollPos};
return res;
}
};
this.CorrectVerticalScrollByYDelta = function(delta)
{
if (0 != this.MainScrollsEnabledFlag)
return;
this.IsGoToPageMAXPosition = true;
var res = { isChange : false, Pos : delta };
var res = {isChange : false, Pos : delta};
if (this.m_dScrollY > this.SlideScrollMIN && (this.m_dScrollY + delta) < this.SlideScrollMIN)
{
......@@ -2272,9 +2286,9 @@ function CEditorPage(api)
}
return res;
}
};
this.horizontalScroll = function(sender,scrollPositionX,maxX,isAtLeft,isAtRight)
this.horizontalScroll = function(sender, scrollPositionX, maxX, isAtLeft, isAtRight)
{
if (false === oThis.m_oApi.bInit_word_control)
return;
......@@ -2292,7 +2306,7 @@ function CEditorPage(api)
{
oWordControl.OnScroll();
}
}
};
this.UpdateScrolls = function()
{
......@@ -2300,14 +2314,14 @@ function CEditorPage(api)
return;
var settings = {
showArrows: true,
animateScroll: false,
screenW: this.m_oEditor.HtmlElement.width,
screenH: this.m_oEditor.HtmlElement.height,
showArrows : true,
animateScroll : false,
screenW : this.m_oEditor.HtmlElement.width,
screenH : this.m_oEditor.HtmlElement.height,
screenAddW : 0,
screenAddH : 0,
vsscrollStep: 45,
hsscrollStep: 45,
vsscrollStep : 45,
hsscrollStep : 45,
contentH : this.m_dDocumentHeight,
contentW : this.m_dDocumentWidth
};
......@@ -2329,17 +2343,21 @@ function CEditorPage(api)
{
if (this.m_oScrollHor_)
this.m_oScrollHor_.Repos(settings, true, undefined);//unbind("scrollhorizontal")
else {
this.m_oScrollHor_ = new AscCommon.ScrollObject( "id_horizontal_scroll",settings);
this.m_oScrollHor_.bind("scrollhorizontal",function(evt){
oThis.horizontalScroll(this,evt.scrollD,evt.maxScrollX);
else
{
this.m_oScrollHor_ = new AscCommon.ScrollObject("id_horizontal_scroll", settings);
this.m_oScrollHor_.bind("scrollhorizontal", function(evt)
{
oThis.horizontalScroll(this, evt.scrollD, evt.maxScrollX);
});
this.m_oScrollHor_.onLockMouse = function(evt){
this.m_oScrollHor_.onLockMouse = function(evt)
{
AscCommon.check_MouseDownEvent(evt, true);
global_mouseEvent.LockMouse();
};
this.m_oScrollHor_.offLockMouse = function(evt){
this.m_oScrollHor_.offLockMouse = function(evt)
{
AscCommon.check_MouseUpEvent(evt);
};
......@@ -2354,28 +2372,34 @@ function CEditorPage(api)
else
{
this.m_oScrollVer_ = new AscCommon.ScrollObject( "id_vertical_scroll",
this.m_oScrollVer_ = new AscCommon.ScrollObject("id_vertical_scroll",
settings
);
this.m_oScrollVer_.onLockMouse = function(evt){
this.m_oScrollVer_.onLockMouse = function(evt)
{
AscCommon.check_MouseDownEvent(evt, true);
global_mouseEvent.LockMouse();
};
this.m_oScrollVer_.offLockMouse = function(evt){
this.m_oScrollVer_.offLockMouse = function(evt)
{
AscCommon.check_MouseUpEvent(evt);
};
this.m_oScrollVer_.bind("scrollvertical",function(evt){
oThis.verticalScroll(this,evt.scrollD,evt.maxScrollY);
this.m_oScrollVer_.bind("scrollvertical", function(evt)
{
oThis.verticalScroll(this, evt.scrollD, evt.maxScrollY);
});
this.m_oScrollVer_.bind("mouseup.presentations",function(evt){
oThis.verticalScrollMouseUp(this,evt);
this.m_oScrollVer_.bind("mouseup.presentations", function(evt)
{
oThis.verticalScrollMouseUp(this, evt);
});
this.m_oScrollVer_.bind("correctVerticalScroll",function(yPos){
this.m_oScrollVer_.bind("correctVerticalScroll", function(yPos)
{
return oThis.CorrectSpeedVerticalScroll(yPos);
});
this.m_oScrollVer_.bind("correctVerticalScrollDelta",function(delta){
this.m_oScrollVer_.bind("correctVerticalScrollDelta", function(delta)
{
return oThis.CorrectVerticalScrollByYDelta(delta);
});
this.m_oScrollVerApi = this.m_oScrollVer_;
......@@ -2389,8 +2413,9 @@ function CEditorPage(api)
}
else
{
this.m_oScrollNotes_ = new AscCommon.ScrollObject( "id_vertical_scroll_notes",settings);
this.m_oScrollNotes_.bind("scrollvertical",function(evt){
this.m_oScrollNotes_ = new AscCommon.ScrollObject("id_vertical_scroll_notes", settings);
this.m_oScrollNotes_.bind("scrollvertical", function(evt)
{
});
this.m_oScrollNotesApi = this.m_oScrollNotes_;
}
......@@ -2405,20 +2430,20 @@ function CEditorPage(api)
this.m_dScrollX = this.m_dScrollX_max;
if (this.m_dScrollY >= this.m_dScrollY_max)
this.m_dScrollY = this.m_dScrollY_max;
}
};
this.OnRePaintAttack = function()
{
this.m_bIsFullRepaint = true;
this.OnScroll();
}
};
this.DeleteVerticalScroll = function()
{
this.m_oMainView.Bounds.R = 0;
this.m_oPanelRight.HtmlElement.style.display = "none";
this.OnResize();
}
};
this.OnResize = function(isAttack)
{
......@@ -2435,6 +2460,10 @@ function CEditorPage(api)
this.CheckRetinaDisplay();
this.m_oBody.Resize(this.Width * g_dKoef_pix_to_mm, this.Height * g_dKoef_pix_to_mm, this);
this.onButtonTabsDraw();
if (AscCommon.g_inputContext)
AscCommon.g_inputContext.onResize("id_main_view");
this.DemonstrationManager.Resize();
if (this.checkNeedHorScroll())
......@@ -2477,7 +2506,7 @@ function CEditorPage(api)
this.onTimerScroll_sync(true);
this.DemonstrationManager.Resize();
}
};
this.OnResize2 = function(isAttack)
{
......@@ -2525,7 +2554,7 @@ function CEditorPage(api)
this.onTimerScroll_sync(true);
this.DemonstrationManager.Resize();
}
};
this.checkNeedRules = function()
{
......@@ -2545,7 +2574,7 @@ function CEditorPage(api)
this.m_oMainView.Bounds.L = 0;
this.m_oMainView.Bounds.T = 0;
}
}
};
this.checkNeedHorScroll = function()
{
var w = this.m_oEditor.HtmlElement.width;
......@@ -2602,19 +2631,19 @@ function CEditorPage(api)
}
this.m_bIsCheckHeedHorScrollRepeat = false;
return false;
}
};
this.StartUpdateOverlay = function()
{
this.IsUpdateOverlayOnlyEnd = true;
}
};
this.EndUpdateOverlay = function()
{
this.IsUpdateOverlayOnlyEnd = false;
if (this.IsUpdateOverlayOnEndCheck)
this.OnUpdateOverlay();
this.IsUpdateOverlayOnEndCheck = false;
}
};
this.OnUpdateOverlay = function()
{
......@@ -2710,7 +2739,7 @@ function CEditorPage(api)
drDoc.DrawHorVerAnchor();
return true;
}
};
this.GetDrawingPageInfo = function(nPageIndex)
{
......@@ -2719,7 +2748,7 @@ function CEditorPage(api)
width_mm : this.m_oLogicDocument.Width,
height_mm : this.m_oLogicDocument.Height
};
}
};
this.OnCalculatePagesPlace = function()
{
......@@ -2788,7 +2817,7 @@ function CEditorPage(api)
if (this.m_bDocumentPlaceChangedEnabled)
this.m_oApi.asc_fireCallback("asc_onDocumentPlaceChanged");
}
};
this.OnPaint = function()
{
......@@ -2835,7 +2864,7 @@ function CEditorPage(api)
this.m_oDrawingDocument.UpdateTargetNoAttack();
this.m_bIsUpdateTargetNoAttack = false;
}
}
};
this.CheckFontCache = function()
{
......@@ -2848,17 +2877,17 @@ function CEditorPage(api)
}
this.m_oLogicDocument.Continue_FastCollaborativeEditing();
}
};
this.OnScroll = function()
{
this.OnCalculatePagesPlace();
this.m_bIsScroll = true;
}
};
this.CheckZoom = function()
{
this.m_oDrawingDocument.ClearCachePages();
}
};
this.CalculateDocumentSize = function(bIsAttack)
{
......@@ -2967,7 +2996,7 @@ function CEditorPage(api)
this.Thumbnails.SlideHeight = this.m_oLogicDocument.Height;
this.Thumbnails.SlidesCount = this.m_oDrawingDocument.SlidesCount;
this.Thumbnails.CheckSizes();
}
};
this.CheckCalculateDocumentSize = function(_bounds)
{
......@@ -3058,7 +3087,7 @@ function CEditorPage(api)
this.MainScrollUnLock();
return bIsResize;
}
};
this.InitDocument = function(bIsEmpty)
{
......@@ -3077,7 +3106,7 @@ function CEditorPage(api)
this.CreateBackgroundVerRuler();
this.UpdateHorRuler();
this.UpdateVerRuler();
}
};
this.InitControl = function()
{
......@@ -3094,13 +3123,13 @@ function CEditorPage(api)
this.m_oApi.syncOnThumbnailsShow();
AscCommon.InitBrowserInputContext(this.m_oApi, "id_target_cursor");
}
};
this.StartMainTimer = function()
{
if (-1 == this.m_nPaintTimerId)
this.onTimerScroll();
}
};
this.onTimerScroll = function(isThUpdateSync)
{
......@@ -3172,7 +3201,7 @@ function CEditorPage(api)
this.m_nPaintTimerId = setTimeout(oWordControl.onTimerScroll, oWordControl.m_nTimerScrollInterval);
//window.requestAnimationFrame(oWordControl.onTimerScroll);
}
};
this.onTimerScroll_sync = function(isThUpdateSync)
{
......@@ -3203,7 +3232,7 @@ function CEditorPage(api)
oWordControl.CheckFontCache();
}
oWordControl.m_oDrawingDocument.Collaborative_TargetsUpdate(isRepaint);
}
};
this.UpdateHorRuler = function()
{
......@@ -3216,7 +3245,7 @@ function CEditorPage(api)
var drawRect = this.m_oDrawingDocument.SlideCurrectRect;
var _left = drawRect.left;
this.m_oHorRuler.BlitToMain(_left, 0, this.m_oTopRuler_horRuler.HtmlElement);
}
};
this.UpdateVerRuler = function()
{
if (!this.m_bIsRuler)
......@@ -3228,7 +3257,7 @@ function CEditorPage(api)
var drawRect = this.m_oDrawingDocument.SlideCurrectRect;
var _top = drawRect.top;
this.m_oVerRuler.BlitToMain(0, _top, this.m_oLeftRuler_vertRuler.HtmlElement);
}
};
this.SetCurrentPage = function()
{
......@@ -3245,7 +3274,7 @@ function CEditorPage(api)
this.OnScroll();
this.m_oApi.sync_currentPageCallback(drDoc.m_lCurrentPage);
}
};
this.UpdateHorRulerBack = function(isattack)
{
......@@ -3255,7 +3284,7 @@ function CEditorPage(api)
this.CreateBackgroundHorRuler(undefined, isattack);
}
this.UpdateHorRuler();
}
};
this.UpdateVerRulerBack = function(isattack)
{
var drDoc = this.m_oDrawingDocument;
......@@ -3264,7 +3293,7 @@ function CEditorPage(api)
this.CreateBackgroundVerRuler(undefined, isattack);
}
this.UpdateVerRuler();
}
};
this.CreateBackgroundHorRuler = function(margins, isattack)
{
......@@ -3288,7 +3317,7 @@ function CEditorPage(api)
}
this.m_oHorRuler.CreateBackground(cachedPage, isattack);
}
};
this.CreateBackgroundVerRuler = function(margins, isattack)
{
var cachedPage = {};
......@@ -3311,7 +3340,7 @@ function CEditorPage(api)
}
this.m_oVerRuler.CreateBackground(cachedPage, isattack);
}
};
this.ThemeGenerateThumbnails = function(_master)
{
......@@ -3326,7 +3355,7 @@ function CEditorPage(api)
_layouts[i].Width64 = this.m_oLayoutDrawer.WidthPx;
_layouts[i].Height64 = this.m_oLayoutDrawer.HeightPx;
}
}
};
this.CheckLayouts = function(bIsAttack)
{
......@@ -3378,7 +3407,7 @@ function CEditorPage(api)
}
this.m_oDrawingDocument.CheckGuiControlColors(bIsAttack);
}
};
this.GoToPage = function(lPageNum, isFromZoom, bIsAttack)
{
......@@ -3474,19 +3503,19 @@ function CEditorPage(api)
if (this.m_oDrawingDocument.IsEmptyPresentation != _old_empty || _bIsUpdate || bIsAttack === true)
this.OnScroll();
}
};
this.GetVerticalScrollTo = function(y)
{
var dKoef = g_dKoef_mm_to_pix * this.m_nZoomValue / 100;
return 5 + y * dKoef;
}
};
this.GetHorizontalScrollTo = function(x)
{
var dKoef = g_dKoef_mm_to_pix * this.m_nZoomValue / 100;
return 5 + dKoef * x;
}
};
// -------------------------------------------------------- //
// -------------------- east asian fonts ------------------ //
......@@ -3497,7 +3526,7 @@ function CEditorPage(api)
this.TextBoxChangedValueEvent = false;
this.TextBoxInput.value = "";
this.TextBoxChangedValueEvent = true;
}
};
this.SetTextBoxMode = function(isEA)
{
......@@ -3553,7 +3582,7 @@ function CEditorPage(api)
this.TextBoxInput = null;
}
}
}
};
this.TextBoxFocus = function()
{
......@@ -3564,7 +3593,7 @@ function CEditorPage(api)
AscCommon.CollaborativeEditing.m_bGlobalLock = true;
oThis.CheckTextBoxInputPos();
oThis.TextBoxInput.style.zIndex = 90;
}
};
this.OnTextBoxInput = function()
{
......@@ -3573,7 +3602,7 @@ function CEditorPage(api)
oThis.TextBoxFocus();
oThis.CheckTextBoxSize();
}
};
this.CheckTextBoxSize = function()
{
......@@ -3625,7 +3654,7 @@ function CEditorPage(api)
var oldZindex = parseInt(this.TextBoxInput.style.zIndex);
var newZindex = (oldZindex == 90) ? "89" : "90";
this.TextBoxInput.style.zIndex = newZindex;
}
};
this.TextBoxOnKeyDown = function(e)
{
......@@ -3635,7 +3664,7 @@ function CEditorPage(api)
e.preventDefault();
return false;
}
}
};
this.onChangeTB = function()
{
......@@ -3645,7 +3674,7 @@ function CEditorPage(api)
this.TextBoxInputFocus = false;
oThis.m_oLogicDocument.TextBox_Put(oThis.TextBoxInput.value);
this.ReinitTB();
}
};
this.CheckTextBoxInputPos = function()
{
if (this.TextBoxInput == null || !this.TextBoxInputFocus)
......@@ -3685,7 +3714,7 @@ function CEditorPage(api)
this.CheckTextBoxSize();
this.TextBoxInput.focus();
}
};
this.SaveDocument = function()
{
......@@ -3694,7 +3723,7 @@ function CEditorPage(api)
var str = writer.WriteDocument(this.m_oLogicDocument);
return str;
//console.log(str);
}
};
}
//------------------------------------------------------------export----------------------------------------------------
......
......@@ -90,12 +90,13 @@ var GlobalSkinFlat = {
PageOutline : "#BBBEC2",
STYLE_THUMBNAIL_WIDTH : 104,
STYLE_THUMBNAIL_HEIGHT : 38,
isNeedInvertOnActive: false
isNeedInvertOnActive : false
};
var GlobalSkin = GlobalSkinFlat;
function updateGlobalSkin(newSkin) {
function updateGlobalSkin(newSkin)
{
GlobalSkin.Name = newSkin.Name;
GlobalSkin.RulersButton = newSkin.RulersButton;
GlobalSkin.NavigationButtons = newSkin.NavigationButtons;
......@@ -220,16 +221,16 @@ function CEditorPage(api)
this.bIsDoublePx = true;//поддерживает ли браузер нецелые пикселы
var oTestSpan = document.createElement("span");
oTestSpan.setAttribute("style", "font-size:8pt");
document.body.appendChild( oTestSpan );
document.body.appendChild(oTestSpan);
var defaultView = oTestSpan.ownerDocument.defaultView;
var computedStyle = defaultView.getComputedStyle( oTestSpan, null );
if(null != computedStyle)
var computedStyle = defaultView.getComputedStyle(oTestSpan, null);
if (null != computedStyle)
{
var fontSize = computedStyle.getPropertyValue( "font-size" );
if(-1 != fontSize.indexOf("px") && parseFloat(fontSize) == parseInt(fontSize))
var fontSize = computedStyle.getPropertyValue("font-size");
if (-1 != fontSize.indexOf("px") && parseFloat(fontSize) == parseInt(fontSize))
this.bIsDoublePx = false;
}
document.body.removeChild( oTestSpan );
document.body.removeChild(oTestSpan);
this.m_nPaintTimerId = -1;
this.m_nTimerScrollInterval = 40;
......@@ -237,7 +238,7 @@ function CEditorPage(api)
this.m_bIsMouseUpSend = false;
this.zoom_values = [50,60,70,80,90,100,110,120,130,140,150,160,170,180,190,200];
this.zoom_values = [50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200];
this.m_nZoomType = 0; // 0 - custom, 1 - fitToWodth, 2 - fitToPage
// ввод текста через дивку (привет китайцам)
......@@ -268,14 +269,16 @@ function CEditorPage(api)
//this.UseRequestAnimationFrame = false;
this.UseRequestAnimationFrame = (undefined !== window["AscDesktopEditor"]) ? true : false;
this.RequestAnimationFrame = (function() {
this.RequestAnimationFrame = (function()
{
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame || null;
})();
this.CancelAnimationFrame = (function () {
this.CancelAnimationFrame = (function()
{
return window.cancelRequestAnimationFrame ||
window.webkitCancelAnimationFrame ||
window.webkitCancelRequestAnimationFrame ||
......@@ -329,7 +332,7 @@ function CEditorPage(api)
return true;
}
return false;
}
};
this.Init = function()
{
......@@ -338,13 +341,13 @@ function CEditorPage(api)
var scrollWidthMm = this.ScrollsWidthPx * g_dKoef_pix_to_mm;
this.m_oScrollHor = CreateControlContainer("id_horscrollpanel");
this.m_oScrollHor.Bounds.SetParams(0,0,scrollWidthMm,0,false,false,true,true,-1,scrollWidthMm);
this.m_oScrollHor.Bounds.SetParams(0, 0, scrollWidthMm, 0, false, false, true, true, -1, scrollWidthMm);
this.m_oScrollHor.Anchor = (g_anchor_left | g_anchor_right | g_anchor_bottom);
this.m_oBody.AddControl(this.m_oScrollHor);
// panel right --------------------------------------------------------------
this.m_oPanelRight = CreateControlContainer("id_panel_right");
this.m_oPanelRight.Bounds.SetParams(0,0,1000,0,false,true,false,true,scrollWidthMm,-1);
this.m_oPanelRight.Bounds.SetParams(0, 0, 1000, 0, false, true, false, true, scrollWidthMm, -1);
this.m_oPanelRight.Anchor = (g_anchor_top | g_anchor_right | g_anchor_bottom);
this.m_oBody.AddControl(this.m_oPanelRight);
......@@ -357,7 +360,7 @@ function CEditorPage(api)
}
this.m_oPanelRight_buttonRulers = CreateControl("id_buttonRulers");
this.m_oPanelRight_buttonRulers.Bounds.SetParams(0,0,1000,1000,false,false,false,false,-1,scrollWidthMm);
this.m_oPanelRight_buttonRulers.Bounds.SetParams(0, 0, 1000, 1000, false, false, false, false, -1, scrollWidthMm);
this.m_oPanelRight_buttonRulers.Anchor = (g_anchor_left | g_anchor_top | g_anchor_right);
this.m_oPanelRight.AddControl(this.m_oPanelRight_buttonRulers);
......@@ -369,12 +372,12 @@ function CEditorPage(api)
}
this.m_oPanelRight_buttonNextPage = CreateControl("id_buttonNextPage");
this.m_oPanelRight_buttonNextPage.Bounds.SetParams(0,0,1000,1000,false,false,false,false,-1,scrollWidthMm);
this.m_oPanelRight_buttonNextPage.Bounds.SetParams(0, 0, 1000, 1000, false, false, false, false, -1, scrollWidthMm);
this.m_oPanelRight_buttonNextPage.Anchor = (g_anchor_left | g_anchor_bottom | g_anchor_right);
this.m_oPanelRight.AddControl(this.m_oPanelRight_buttonNextPage);
this.m_oPanelRight_buttonPrevPage = CreateControl("id_buttonPrevPage");
this.m_oPanelRight_buttonPrevPage.Bounds.SetParams(0,0,1000,scrollWidthMm,false,false,false,true,-1,scrollWidthMm);
this.m_oPanelRight_buttonPrevPage.Bounds.SetParams(0, 0, 1000, scrollWidthMm, false, false, false, true, -1, scrollWidthMm);
this.m_oPanelRight_buttonPrevPage.Anchor = (g_anchor_left | g_anchor_bottom | g_anchor_right);
this.m_oPanelRight.AddControl(this.m_oPanelRight_buttonPrevPage);
......@@ -387,7 +390,7 @@ function CEditorPage(api)
}
this.m_oPanelRight_vertScroll = CreateControl("id_vertical_scroll");
this.m_oPanelRight_vertScroll.Bounds.SetParams(0,_vertScrollTop,1000,_vertScrollBottom,false,true,false,true,-1,-1);
this.m_oPanelRight_vertScroll.Bounds.SetParams(0, _vertScrollTop, 1000, _vertScrollBottom, false, true, false, true, -1, -1);
this.m_oPanelRight_vertScroll.Anchor = (g_anchor_left | g_anchor_top | g_anchor_right | g_anchor_bottom);
this.m_oPanelRight.AddControl(this.m_oPanelRight_vertScroll);
// --------------------------------------------------------------------------
......@@ -395,43 +398,43 @@ function CEditorPage(api)
// main content -------------------------------------------------------------
this.m_oMainContent = CreateControlContainer("id_main");
if (!this.m_oApi.isMobileVersion)
this.m_oMainContent.Bounds.SetParams(0,0,scrollWidthMm,0,false,true,true,true,-1,-1);
this.m_oMainContent.Bounds.SetParams(0, 0, scrollWidthMm, 0, false, true, true, true, -1, -1);
else
this.m_oMainContent.Bounds.SetParams(0,0,0,0,false,true,true,true,-1,-1);
this.m_oMainContent.Bounds.SetParams(0, 0, 0, 0, false, true, true, true, -1, -1);
this.m_oMainContent.Anchor = (g_anchor_left | g_anchor_top | g_anchor_right | g_anchor_bottom);
this.m_oBody.AddControl(this.m_oMainContent);
// --- left ---
this.m_oLeftRuler = CreateControlContainer("id_panel_left");
this.m_oLeftRuler.Bounds.SetParams(0,0,1000,1000,false,false,false,false,5,-1);
this.m_oLeftRuler.Bounds.SetParams(0, 0, 1000, 1000, false, false, false, false, 5, -1);
this.m_oLeftRuler.Anchor = (g_anchor_left | g_anchor_top | g_anchor_bottom);
this.m_oMainContent.AddControl(this.m_oLeftRuler);
this.m_oLeftRuler_buttonsTabs = CreateControl("id_buttonTabs");
this.m_oLeftRuler_buttonsTabs.Bounds.SetParams(0,0.8,1000,1000,false,true,false,false,-1,5);
this.m_oLeftRuler_buttonsTabs.Bounds.SetParams(0, 0.8, 1000, 1000, false, true, false, false, -1, 5);
this.m_oLeftRuler_buttonsTabs.Anchor = (g_anchor_left | g_anchor_top | g_anchor_right);
this.m_oLeftRuler.AddControl(this.m_oLeftRuler_buttonsTabs);
this.m_oLeftRuler_vertRuler = CreateControl("id_vert_ruler");
this.m_oLeftRuler_vertRuler.Bounds.SetParams(0,7,1000,1000,false,true,false,false,-1,-1);
this.m_oLeftRuler_vertRuler.Bounds.SetParams(0, 7, 1000, 1000, false, true, false, false, -1, -1);
this.m_oLeftRuler_vertRuler.Anchor = (g_anchor_left | g_anchor_right | g_anchor_top | g_anchor_bottom);
this.m_oLeftRuler.AddControl(this.m_oLeftRuler_vertRuler);
// ------------
// --- top ----
this.m_oTopRuler = CreateControlContainer("id_panel_top");
this.m_oTopRuler.Bounds.SetParams(5,0,1000,1000,true,false,false,false,-1,7);
this.m_oTopRuler.Bounds.SetParams(5, 0, 1000, 1000, true, false, false, false, -1, 7);
this.m_oTopRuler.Anchor = (g_anchor_left | g_anchor_top | g_anchor_right);
this.m_oMainContent.AddControl(this.m_oTopRuler);
this.m_oTopRuler_horRuler = CreateControl("id_hor_ruler");
this.m_oTopRuler_horRuler.Bounds.SetParams(0,0,1000,1000,false,false,false,false,-1,-1);
this.m_oTopRuler_horRuler.Bounds.SetParams(0, 0, 1000, 1000, false, false, false, false, -1, -1);
this.m_oTopRuler_horRuler.Anchor = (g_anchor_left | g_anchor_right | g_anchor_top | g_anchor_bottom);
this.m_oTopRuler.AddControl(this.m_oTopRuler_horRuler);
// ------------
this.m_oMainView = CreateControlContainer("id_main_view");
this.m_oMainView.Bounds.SetParams(5,7,1000,1000,true,true,false,false,-1,-1);
this.m_oMainView.Bounds.SetParams(5, 7, 1000, 1000, true, true, false, false, -1, -1);
this.m_oMainView.Anchor = (g_anchor_left | g_anchor_right | g_anchor_top | g_anchor_bottom);
this.m_oMainContent.AddControl(this.m_oMainView);
......@@ -453,25 +456,30 @@ function CEditorPage(api)
}
// в некоторых браузерах - readonly
try {_text_bx_back.willValidate = false;}catch(err){}
try
{
_text_bx_back.willValidate = false;
} catch (err)
{
}
this.m_oMainView.HtmlElement.appendChild(_text_bx_back);
this.TextBoxBackground = CreateControl("id_text_box_background");
this.TextBoxBackground.Bounds.SetParams(-100,0,1100,1000,false,false,false,false,-1,-1);
this.TextBoxBackground.Anchor = (g_anchor_left | g_anchor_top | g_anchor_right |g_anchor_bottom);
this.TextBoxBackground.Bounds.SetParams(-100, 0, 1100, 1000, false, false, false, false, -1, -1);
this.TextBoxBackground.Anchor = (g_anchor_left | g_anchor_top | g_anchor_right | g_anchor_bottom);
this.m_oMainView.AddControl(this.TextBoxBackground);
this.TextBoxBackground.HtmlElement.value = "a";
}
this.m_oEditor = CreateControl("id_viewer");
this.m_oEditor.Bounds.SetParams(0,0,1000,1000,false,false,false,false,-1,-1);
this.m_oEditor.Anchor = (g_anchor_left | g_anchor_top | g_anchor_right |g_anchor_bottom);
this.m_oEditor.Bounds.SetParams(0, 0, 1000, 1000, false, false, false, false, -1, -1);
this.m_oEditor.Anchor = (g_anchor_left | g_anchor_top | g_anchor_right | g_anchor_bottom);
this.m_oMainView.AddControl(this.m_oEditor);
this.m_oOverlay = CreateControl("id_viewer_overlay");
this.m_oOverlay.Bounds.SetParams(0,0,1000,1000,false,false,false,false,-1,-1);
this.m_oOverlay.Anchor = (g_anchor_left | g_anchor_top | g_anchor_right |g_anchor_bottom);
this.m_oOverlay.Bounds.SetParams(0, 0, 1000, 1000, false, false, false, false, -1, -1);
this.m_oOverlay.Anchor = (g_anchor_left | g_anchor_top | g_anchor_right | g_anchor_bottom);
this.m_oMainView.AddControl(this.m_oOverlay);
// --------------------------------------------------------------------------
......@@ -495,7 +503,7 @@ function CEditorPage(api)
this.m_oDrawingDocument.AutoShapesTrack.init2(this.m_oOverlayApi);
this.OnResize(true);
}
};
this.CheckRetinaDisplay = function()
{
......@@ -515,7 +523,7 @@ function CEditorPage(api)
this.m_oDrawingDocument.ClearCachePages();
this.onButtonTabsDraw();
}
}
};
this.ShowOverlay = function()
{
......@@ -523,11 +531,11 @@ function CEditorPage(api)
if (null == this.m_oOverlayApi.m_oContext)
this.m_oOverlayApi.m_oContext = this.m_oOverlayApi.m_oControl.HtmlElement.getContext('2d');
}
};
this.UnShowOverlay = function()
{
this.m_oOverlay.HtmlElement.style.display = "none";
}
};
this.CheckUnShowOverlay = function()
{
var drDoc = this.m_oDrawingDocument;
......@@ -537,19 +545,19 @@ function CEditorPage(api)
return false;
}
return true;
}
};
this.CheckShowOverlay = function()
{
var drDoc = this.m_oDrawingDocument;
if (drDoc.m_bIsSearching || drDoc.m_bIsSelection || this.MobileTouchManager)
this.ShowOverlay();
}
};
this.initEvents2 = function()
{
this.arrayEventHandlers[0] = new AscCommon.button_eventHandlers("","0px 0px","0px -16px", "0px -32px",this.m_oPanelRight_buttonRulers,this.onButtonRulersClick);
this.arrayEventHandlers[1] = new AscCommon.button_eventHandlers("","0px 0px","0px -16px", "0px -32px",this.m_oPanelRight_buttonPrevPage,this.onPrevPage);
this.arrayEventHandlers[2] = new AscCommon.button_eventHandlers("","0px -48px","0px -64px", "0px -80px",this.m_oPanelRight_buttonNextPage,this.onNextPage);
this.arrayEventHandlers[0] = new AscCommon.button_eventHandlers("", "0px 0px", "0px -16px", "0px -32px", this.m_oPanelRight_buttonRulers, this.onButtonRulersClick);
this.arrayEventHandlers[1] = new AscCommon.button_eventHandlers("", "0px 0px", "0px -16px", "0px -32px", this.m_oPanelRight_buttonPrevPage, this.onPrevPage);
this.arrayEventHandlers[2] = new AscCommon.button_eventHandlers("", "0px -48px", "0px -64px", "0px -80px", this.m_oPanelRight_buttonNextPage, this.onNextPage);
this.m_oLeftRuler_buttonsTabs.HtmlElement.onclick = this.onButtonTabsClick;//new Function("onButtonTabsClick();");
......@@ -588,11 +596,14 @@ function CEditorPage(api)
window.onkeyup = this.onKeyUp;
*/
this.m_oBody.HtmlElement.oncontextmenu = function() { return false; };
this.m_oBody.HtmlElement.oncontextmenu = function()
{
return false;
};
//window.oncontextmenu = function() { return false; };
this.initEvents2MobileAdvances();
}
};
this.initEvents2MobileAdvances = function()
{
......@@ -648,31 +659,37 @@ function CEditorPage(api)
}
*/
this.m_oTopRuler_horRuler.HtmlElement["ontouchstart"] = function (e){
this.m_oTopRuler_horRuler.HtmlElement["ontouchstart"] = function(e)
{
oThis.horRulerMouseDown(e.touches[0]);
return false;
}
this.m_oTopRuler_horRuler.HtmlElement["ontouchmove"] = function (e){
};
this.m_oTopRuler_horRuler.HtmlElement["ontouchmove"] = function(e)
{
oThis.horRulerMouseMove(e.touches[0]);
return false;
}
this.m_oTopRuler_horRuler.HtmlElement["ontouchend"] = function (e){
};
this.m_oTopRuler_horRuler.HtmlElement["ontouchend"] = function(e)
{
oThis.horRulerMouseUp(e.changedTouches[0]);
return false;
}
};
this.m_oLeftRuler_vertRuler.HtmlElement["ontouchstart"] = function (e){
this.m_oLeftRuler_vertRuler.HtmlElement["ontouchstart"] = function(e)
{
oThis.verRulerMouseDown(e.touches[0]);
return false;
}
this.m_oLeftRuler_vertRuler.HtmlElement["ontouchmove"] = function (e){
};
this.m_oLeftRuler_vertRuler.HtmlElement["ontouchmove"] = function(e)
{
oThis.verRulerMouseMove(e.touches[0]);
return false;
}
this.m_oLeftRuler_vertRuler.HtmlElement["ontouchend"] = function (e){
};
this.m_oLeftRuler_vertRuler.HtmlElement["ontouchend"] = function(e)
{
oThis.verRulerMouseUp(e.changedTouches[0]);
return false;
}
};
if (this.m_oApi.isMobileVersion)
{
......@@ -680,66 +697,73 @@ function CEditorPage(api)
if (__hasTouch)
{
this.TextBoxBackground.HtmlElement["ontouchcancel"] = function (e){
this.TextBoxBackground.HtmlElement["ontouchcancel"] = function(e)
{
oThis.IsUpdateOverlayOnlyEndReturn = true;
oThis.StartUpdateOverlay();
var ret = oThis.MobileTouchManager.onTouchEnd(e);
oThis.IsUpdateOverlayOnlyEndReturn = false;
oThis.EndUpdateOverlay();
return ret;
}
};
this.TextBoxBackground.HtmlElement["ontouchstart"] = function (e){
this.TextBoxBackground.HtmlElement["ontouchstart"] = function(e)
{
oThis.IsUpdateOverlayOnlyEndReturn = true;
oThis.StartUpdateOverlay();
var ret = oThis.MobileTouchManager.onTouchStart(e);
oThis.IsUpdateOverlayOnlyEndReturn = false;
oThis.EndUpdateOverlay();
return ret;
}
this.TextBoxBackground.HtmlElement["ontouchmove"] = function (e){
};
this.TextBoxBackground.HtmlElement["ontouchmove"] = function(e)
{
oThis.IsUpdateOverlayOnlyEndReturn = true;
oThis.StartUpdateOverlay();
var ret = oThis.MobileTouchManager.onTouchMove(e);
oThis.IsUpdateOverlayOnlyEndReturn = false;
oThis.EndUpdateOverlay();
return ret;
}
this.TextBoxBackground.HtmlElement["ontouchend"] = function (e){
};
this.TextBoxBackground.HtmlElement["ontouchend"] = function(e)
{
oThis.IsUpdateOverlayOnlyEndReturn = true;
oThis.StartUpdateOverlay();
var ret = oThis.MobileTouchManager.onTouchEnd(e);
oThis.IsUpdateOverlayOnlyEndReturn = false;
oThis.EndUpdateOverlay();
return ret;
}
};
}
else
{
this.TextBoxBackground.HtmlElement["onmousedown"] = function (e){
this.TextBoxBackground.HtmlElement["onmousedown"] = function(e)
{
oThis.IsUpdateOverlayOnlyEndReturn = true;
oThis.StartUpdateOverlay();
var ret = oThis.MobileTouchManager.onTouchStart(e);
oThis.IsUpdateOverlayOnlyEndReturn = false;
oThis.EndUpdateOverlay();
return ret;
}
this.TextBoxBackground.HtmlElement["onmousemove"] = function (e){
};
this.TextBoxBackground.HtmlElement["onmousemove"] = function(e)
{
oThis.IsUpdateOverlayOnlyEndReturn = true;
oThis.StartUpdateOverlay();
var ret = oThis.MobileTouchManager.onTouchMove(e);
oThis.IsUpdateOverlayOnlyEndReturn = false;
oThis.EndUpdateOverlay();
return ret;
}
this.TextBoxBackground.HtmlElement["onmouseup"] = function (e){
};
this.TextBoxBackground.HtmlElement["onmouseup"] = function(e)
{
oThis.IsUpdateOverlayOnlyEndReturn = true;
oThis.StartUpdateOverlay();
var ret = oThis.MobileTouchManager.onTouchEnd(e);
oThis.IsUpdateOverlayOnlyEndReturn = false;
oThis.EndUpdateOverlay();
return ret;
}
};
}
if (AscBrowser.isAndroid)
......@@ -761,7 +785,8 @@ function CEditorPage(api)
};
*/
this.TextBoxBackground.HtmlElement["oncontextmenu"] = function(e){
this.TextBoxBackground.HtmlElement["oncontextmenu"] = function(e)
{
if (e.preventDefault)
e.preventDefault();
......@@ -769,7 +794,8 @@ function CEditorPage(api)
return false;
};
this.TextBoxBackground.HtmlElement["onselectstart"] = function(e){
this.TextBoxBackground.HtmlElement["onselectstart"] = function(e)
{
oThis.m_oLogicDocument.Select_All();
if (e.preventDefault)
......@@ -915,7 +941,7 @@ function CEditorPage(api)
};
*/
}
}
};
this.onButtonRulersClick = function()
{
if (false === oThis.m_oApi.bInit_word_control || true === oThis.m_oApi.isViewMode)
......@@ -924,7 +950,7 @@ function CEditorPage(api)
oThis.m_bIsRuler = !oThis.m_bIsRuler;
oThis.checkNeedRules();
oThis.OnResize(true);
}
};
this.HideRulers = function()
{
......@@ -937,7 +963,7 @@ function CEditorPage(api)
oThis.m_bIsRuler = !oThis.m_bIsRuler;
oThis.checkNeedRules();
oThis.OnResize(true);
}
};
this.calculate_zoom_FitToWidth = function()
{
......@@ -962,7 +988,7 @@ function CEditorPage(api)
}
}
return (Zoom - 0.5) >> 0;
}
};
this.zoom_FitToWidth = function()
{
......@@ -985,7 +1011,7 @@ function CEditorPage(api)
this.m_oApi.sync_zoomChangeCallback(this.m_nZoomValue, 1);
}
return false;
}
};
this.zoom_FitToPage = function()
{
var w = parseInt(this.m_oEditor.HtmlElement.width) * g_dKoef_pix_to_mm;
......@@ -1022,7 +1048,7 @@ function CEditorPage(api)
this.m_oApi.sync_zoomChangeCallback(this.m_nZoomValue, 2);
}
return false;
}
};
this.zoom_Fire = function(type, old_zoom)
{
......@@ -1087,7 +1113,7 @@ function CEditorPage(api)
oWordControl.OnScroll();
}
};
this.zoom_Out = function()
{
......@@ -1115,7 +1141,7 @@ function CEditorPage(api)
var _old_val = oThis.m_nZoomValue;
oThis.m_nZoomValue = _Zoom;
oThis.zoom_Fire(0, _old_val);
}
};
this.zoom_In = function()
{
......@@ -1143,7 +1169,7 @@ function CEditorPage(api)
var _old_val = oThis.m_nZoomValue;
oThis.m_nZoomValue = _Zoom;
oThis.zoom_Fire(0, _old_val);
}
};
this.ToSearchResult = function()
{
......@@ -1240,7 +1266,7 @@ function CEditorPage(api)
// и, в самом конце, перерисовываем оверлей
this.OnUpdateOverlay();
}
};
this.ScrollToPosition = function(x, y, PageNum)
{
......@@ -1302,7 +1328,7 @@ function CEditorPage(api)
this.OnScroll();
return;
}
}
};
this.onButtonTabsClick = function()
{
......@@ -1323,7 +1349,7 @@ function CEditorPage(api)
oWordControl
.onButtonTabsDraw();
}
}
};
this.onButtonTabsDraw = function()
{
......@@ -1372,7 +1398,7 @@ function CEditorPage(api)
_ctx.stroke();
_ctx.beginPath();
}
};
this.onPrevPage = function()
{
......@@ -1388,7 +1414,7 @@ function CEditorPage(api)
{
oWordControl.GoToPage(0);
}
}
};
this.onNextPage = function()
{
if (false === oThis.m_oApi.bInit_word_control)
......@@ -1403,7 +1429,7 @@ function CEditorPage(api)
{
oWordControl.GoToPage(oWordControl.m_oDrawingDocument.m_lPagesCount - 1);
}
}
};
this.horRulerMouseDown = function(e)
{
......@@ -1422,7 +1448,7 @@ function CEditorPage(api)
return;
oWordControl.m_oHorRuler.OnMouseDown(oWordControl.m_oDrawingDocument.m_arrPages[_cur_page].drawingPage.left, 0, e);
}
};
this.horRulerMouseUp = function(e)
{
if (false === oThis.m_oApi.bInit_word_control)
......@@ -1440,7 +1466,7 @@ function CEditorPage(api)
return;
oWordControl.m_oHorRuler.OnMouseUp(oWordControl.m_oDrawingDocument.m_arrPages[_cur_page].drawingPage.left, 0, e);
}
};
this.horRulerMouseMove = function(e)
{
if (false === oThis.m_oApi.bInit_word_control)
......@@ -1458,7 +1484,7 @@ function CEditorPage(api)
return;
oWordControl.m_oHorRuler.OnMouseMove(oWordControl.m_oDrawingDocument.m_arrPages[_cur_page].drawingPage.left, 0, e);
}
};
this.verRulerMouseDown = function(e)
{
......@@ -1477,7 +1503,7 @@ function CEditorPage(api)
return;
oWordControl.m_oVerRuler.OnMouseDown(0, oWordControl.m_oDrawingDocument.m_arrPages[_cur_page].drawingPage.top, e);
}
};
this.verRulerMouseUp = function(e)
{
if (false === oThis.m_oApi.bInit_word_control)
......@@ -1495,7 +1521,7 @@ function CEditorPage(api)
return;
oWordControl.m_oVerRuler.OnMouseUp(0, oWordControl.m_oDrawingDocument.m_arrPages[_cur_page].drawingPage.top, e);
}
};
this.verRulerMouseMove = function(e)
{
if (false === oThis.m_oApi.bInit_word_control)
......@@ -1513,7 +1539,7 @@ function CEditorPage(api)
return;
oWordControl.m_oVerRuler.OnMouseMove(0, oWordControl.m_oDrawingDocument.m_arrPages[_cur_page].drawingPage.top, e);
}
};
this.SelectWheel = function()
{
......@@ -1600,7 +1626,7 @@ function CEditorPage(api)
if (scrollXVal != 0 || scrollYVal != 0)
oWordControl.onMouseMove2();
}
};
this.onMouseDown = function(e)
{
......@@ -1699,7 +1725,7 @@ function CEditorPage(api)
}
oWordControl.EndUpdateOverlay();
}
};
this.onMouseMove = function(e)
{
......@@ -1753,7 +1779,7 @@ function CEditorPage(api)
}
oWordControl.EndUpdateOverlay();
}
};
this.onMouseMove2 = function()
{
if (false === oThis.m_oApi.bInit_word_control)
......@@ -1786,7 +1812,7 @@ function CEditorPage(api)
oWordControl.m_oLogicDocument.OnMouseMove(global_mouseEvent, pos.X, pos.Y, pos.Page);
oWordControl.EndUpdateOverlay();
}
};
this.onMouseUp = function(e, bIsWindow)
{
if (false === oThis.m_oApi.bInit_word_control)
......@@ -1819,11 +1845,11 @@ function CEditorPage(api)
if (oWordControl.m_oVerRuler.DragType != 0)
oWordControl.m_oVerRuler.OnMouseUpExternal();
if ( oWordControl.m_oScrollVerApi.getIsLockedMouse() )
if (oWordControl.m_oScrollVerApi.getIsLockedMouse())
{
oWordControl.m_oScrollVerApi.evt_mouseup(e);
}
if ( oWordControl.m_oScrollHorApi.getIsLockedMouse() )
if (oWordControl.m_oScrollHorApi.getIsLockedMouse())
{
oWordControl.m_oScrollHorApi.evt_mouseup(e);
}
......@@ -1884,7 +1910,7 @@ function CEditorPage(api)
oWordControl.m_oLogicDocument.Document_UpdateRulersState();
oWordControl.EndUpdateOverlay();
}
};
this.onMouseUpMainSimple = function()
{
......@@ -1908,7 +1934,7 @@ function CEditorPage(api)
clearInterval(oWordControl.m_oTimerScrollSelect);
oWordControl.m_oTimerScrollSelect = -1;
}
}
};
this.onMouseUpExternal = function(x, y)
{
......@@ -1931,14 +1957,14 @@ function CEditorPage(api)
if (oWordControl.m_oVerRuler.DragType != 0)
oWordControl.m_oVerRuler.OnMouseUpExternal();
if ( oWordControl.m_oScrollVerApi.getIsLockedMouse() )
if (oWordControl.m_oScrollVerApi.getIsLockedMouse())
{
var __e = { clientX : x, clientY : y };
var __e = {clientX : x, clientY : y};
oWordControl.m_oScrollVerApi.evt_mouseup(__e);
}
if ( oWordControl.m_oScrollHorApi.getIsLockedMouse() )
if (oWordControl.m_oScrollHorApi.getIsLockedMouse())
{
var __e = { clientX : x, clientY : y };
var __e = {clientX : x, clientY : y};
oWordControl.m_oScrollHorApi.evt_mouseup(__e);
}
......@@ -2008,7 +2034,7 @@ function CEditorPage(api)
oWordControl.m_oLogicDocument.Document_UpdateRulersState();
oWordControl.EndUpdateOverlay();
}
};
this.onMouseWhell = function(e)
{
......@@ -2114,7 +2140,7 @@ function CEditorPage(api)
e.returnValue = false;
return false;
}
};
this.checkViewerModeKeys = function(e)
{
......@@ -2141,7 +2167,7 @@ function CEditorPage(api)
oThis.m_oScrollVerApi.scrollTo(0, 0);
}
}
else if ( e.KeyCode == 37 ) // Left Arrow
else if (e.KeyCode == 37) // Left Arrow
{
if (oThis.m_bIsHorScrollVisible)
{
......@@ -2152,31 +2178,31 @@ function CEditorPage(api)
{
oThis.m_oScrollVerApi.scrollBy(0, -30, false);
}
else if ( e.KeyCode == 39 ) // Right Arrow
else if (e.KeyCode == 39) // Right Arrow
{
if (oThis.m_bIsHorScrollVisible)
{
oThis.m_oScrollHorApi.scrollBy(30, 0, false);
}
}
else if ( e.KeyCode == 40 ) // Bottom Arrow
else if (e.KeyCode == 40) // Bottom Arrow
{
oThis.m_oScrollVerApi.scrollBy(0, 30, false);
}
else if ( e.KeyCode == 65 && true === e.CtrlKey ) // Ctrl + A - выделяем все
else if (e.KeyCode == 65 && true === e.CtrlKey) // Ctrl + A - выделяем все
{
isSendEditor = true;
}
else if ( e.KeyCode == 67 && true === e.CtrlKey ) // Ctrl + C + ...
else if (e.KeyCode == 67 && true === e.CtrlKey) // Ctrl + C + ...
{
if ( false === e.ShiftKey )
if (false === e.ShiftKey)
{
AscCommon.Editor_Copy(oThis.m_oApi);
//не возвращаем true чтобы не было preventDefault
}
}
return isSendEditor;
}
};
this.ChangeReaderMode = function()
{
......@@ -2184,7 +2210,7 @@ function CEditorPage(api)
this.DisableReaderMode();
else
this.EnableReaderMode();
}
};
this.IncreaseReaderFontSize = function()
{
......@@ -2200,7 +2226,7 @@ function CEditorPage(api)
this.ReaderModeDiv.style.fontSize = this.ReaderFontSizes[this.ReaderFontSizeCur] + "pt";
this.ReaderTouchManager.ChangeFontSize();
}
};
this.DecreaseReaderFontSize = function()
{
if (null == this.ReaderModeDiv)
......@@ -2215,12 +2241,12 @@ function CEditorPage(api)
this.ReaderModeDiv.style.fontSize = this.ReaderFontSizes[this.ReaderFontSizeCur] + "pt";
this.ReaderTouchManager.ChangeFontSize();
}
};
this.IsReaderMode = function()
{
return (this.ReaderModeCurrent == 1);
}
};
this.UpdateReaderContent = function()
{
if (this.ReaderModeCurrent == 1 && this.ReaderModeDivWrapper != null)
......@@ -2229,7 +2255,7 @@ function CEditorPage(api)
this.ReaderFontSizes[this.ReaderFontSizeCur] + "pt;position:absolute;resize:none;-webkit-box-sizing:border-box;box-sizing:border-box;padding-left:5%;padding-right:5%;padding-top:10%;padding-bottom:10%;background-color:#FFFFFF;\">" +
this.m_oApi.ContentToHTML(true) + "</div>";
}
}
};
this.EnableReaderMode = function()
{
......@@ -2268,36 +2294,43 @@ function CEditorPage(api)
if (__hasTouch)
{
this.ReaderModeDivWrapper["ontouchcancel"] = function (e){
this.ReaderModeDivWrapper["ontouchcancel"] = function(e)
{
return oThis.ReaderTouchManager.onTouchEnd(e);
}
this.ReaderModeDivWrapper["ontouchstart"] = function (e){
this.ReaderModeDivWrapper["ontouchstart"] = function(e)
{
return oThis.ReaderTouchManager.onTouchStart(e);
}
this.ReaderModeDivWrapper["ontouchmove"] = function (e){
this.ReaderModeDivWrapper["ontouchmove"] = function(e)
{
return oThis.ReaderTouchManager.onTouchMove(e);
}
this.ReaderModeDivWrapper["ontouchend"] = function (e){
this.ReaderModeDivWrapper["ontouchend"] = function(e)
{
return oThis.ReaderTouchManager.onTouchEnd(e);
}
}
else
{
this.ReaderModeDivWrapper["onmousedown"] = function (e){
this.ReaderModeDivWrapper["onmousedown"] = function(e)
{
return oThis.ReaderTouchManager.onTouchStart(e);
}
this.ReaderModeDivWrapper["onmousemove"] = function (e){
this.ReaderModeDivWrapper["onmousemove"] = function(e)
{
return oThis.ReaderTouchManager.onTouchMove(e);
}
this.ReaderModeDivWrapper["onmouseup"] = function (e){
this.ReaderModeDivWrapper["onmouseup"] = function(e)
{
return oThis.ReaderTouchManager.onTouchEnd(e);
}
}
//this.m_oEditor.HtmlElement.style.display = "none";
//this.m_oOverlay.HtmlElement.style.display = "none";
}
};
this.DisableReaderMode = function()
{
......@@ -2308,7 +2341,7 @@ function CEditorPage(api)
this.TransformDivUseAnimation(this.ReaderModeDivWrapper, parseInt(this.ReaderModeDivWrapper.style.height) + 10);
setTimeout(this.CheckDestroyReader, 500);
return;
}
};
this.CheckDestroyReader = function()
{
......@@ -2334,14 +2367,14 @@ function CEditorPage(api)
setTimeout(oThis.CheckDestroyReader, 200);
}
}
}
};
this.TransformDivUseAnimation = function(_div, topPos)
{
_div.style[window.asc_sdk_transitionProperty] = "top";
_div.style[window.asc_sdk_transitionDuration] = "1000ms";
_div.style.top = topPos + "px";
}
};
this.onKeyDown = function(e)
{
......@@ -2462,7 +2495,7 @@ function CEditorPage(api)
}
}
*/
}
};
this.onKeyDownNoActiveControl = function(e)
{
......@@ -2482,7 +2515,7 @@ function CEditorPage(api)
}
return bSendToEditor;
}
};
this.onKeyDownTBIM = function(e)
{
......@@ -2565,7 +2598,7 @@ function CEditorPage(api)
if (global_keyboardEvent.CtrlKey == true && (global_keyboardEvent.KeyCode == 86 || global_keyboardEvent.KeyCode == 67))
oWordControl.bIsUseKeyPress = false;
}
};
this.DisableTextEATextboxAttack = function()
{
......@@ -2583,7 +2616,7 @@ function CEditorPage(api)
this.TextBoxInputFocus = false;
this.ReinitTB();
}
}
};
this.onKeyUp = function(e)
{
......@@ -2666,7 +2699,7 @@ function CEditorPage(api)
oWordControl.StartUpdateOverlay();
var retValue = oWordControl.m_oLogicDocument.OnKeyPress(global_keyboardEvent);
oWordControl.EndUpdateOverlay();
if ( true === retValue )
if (true === retValue)
{
e.preventDefault();
}
......@@ -2687,7 +2720,7 @@ function CEditorPage(api)
oWordControl.StartUpdateOverlay();
var retValue = oWordControl.m_oLogicDocument.OnKeyPress(global_keyboardEvent);
oWordControl.EndUpdateOverlay();
if ( true === retValue )
if (true === retValue)
{
e.preventDefault();
}
......@@ -2697,9 +2730,9 @@ function CEditorPage(api)
global_keyboardEvent.CtrlKey = _oldCtrl;
global_keyboardEvent.AltKey = _oldAlt;
}
}
};
this.verticalScroll = function(sender,scrollPositionY,maxY,isAtTop,isAtBottom)
this.verticalScroll = function(sender, scrollPositionY, maxY, isAtTop, isAtBottom)
{
if (false === oThis.m_oApi.bInit_word_control)
return;
......@@ -2717,14 +2750,14 @@ function CEditorPage(api)
{
oWordControl.MobileTouchManager.iScroll.y = -oWordControl.m_dScrollY;
}
}
};
this.CorrectSpeedVerticalScroll = function(newScrollPos)
{
// без понтов.
//return pos;
// понты
var res = { isChange : false, Pos : newScrollPos };
var res = {isChange : false, Pos : newScrollPos};
if (newScrollPos <= 0 || newScrollPos >= this.m_dScrollY_max)
return res;
......@@ -2762,9 +2795,9 @@ function CEditorPage(api)
res.Pos = this.m_dScrollY_max;
return res;
}
};
this.horizontalScroll = function(sender,scrollPositionX,maxX,isAtLeft,isAtRight)
this.horizontalScroll = function(sender, scrollPositionX, maxX, isAtLeft, isAtRight)
{
if (false === oThis.m_oApi.bInit_word_control)
return;
......@@ -2784,7 +2817,7 @@ function CEditorPage(api)
{
oWordControl.MobileTouchManager.iScroll.x = -oWordControl.m_dScrollX;
}
}
};
this.UpdateScrolls = function()
{
......@@ -2792,15 +2825,15 @@ function CEditorPage(api)
return;
var settings = {
showArrows: true,
animateScroll: false,
// scrollBackgroundColor: GlobalSkin.BackgroundScroll,
// scrollerColor:"#EDEDED",
screenW: this.m_oEditor.HtmlElement.width,
screenH: this.m_oEditor.HtmlElement.height,
vscrollStep: 45,
hscrollStep: 45,
isNeedInvertOnActive: GlobalSkin.isNeedInvertOnActive
showArrows : true,
animateScroll : false,
// scrollBackgroundColor: GlobalSkin.BackgroundScroll,
// scrollerColor:"#EDEDED",
screenW : this.m_oEditor.HtmlElement.width,
screenH : this.m_oEditor.HtmlElement.height,
vscrollStep : 45,
hscrollStep : 45,
isNeedInvertOnActive : GlobalSkin.isNeedInvertOnActive
};
if (this.bIsRetinaSupport)
......@@ -2811,39 +2844,49 @@ function CEditorPage(api)
if (this.m_oScrollHor_)
this.m_oScrollHor_.Repos(settings, this.m_bIsHorScrollVisible);
else {
this.m_oScrollHor_ = new AscCommon.ScrollObject( "id_horizontal_scroll", settings );
else
{
this.m_oScrollHor_ = new AscCommon.ScrollObject("id_horizontal_scroll", settings);
this.m_oScrollHor_.onLockMouse = function(evt){
this.m_oScrollHor_.onLockMouse = function(evt)
{
AscCommon.check_MouseDownEvent(evt, true);
global_mouseEvent.LockMouse();
}
this.m_oScrollHor_.offLockMouse = function(evt){
this.m_oScrollHor_.offLockMouse = function(evt)
{
AscCommon.check_MouseUpEvent(evt);
}
this.m_oScrollHor_.bind("scrollhorizontal",function(evt){
oThis.horizontalScroll(this,evt.scrollD,evt.maxScrollX);
this.m_oScrollHor_.bind("scrollhorizontal", function(evt)
{
oThis.horizontalScroll(this, evt.scrollD, evt.maxScrollX);
})
this.m_oScrollHorApi = this.m_oScrollHor_;
}
if (this.m_oScrollVer_){
if (this.m_oScrollVer_)
{
this.m_oScrollVer_.Repos(settings, undefined, true);
}
else {
this.m_oScrollVer_ = new AscCommon.ScrollObject( "id_vertical_scroll", settings );
else
{
this.m_oScrollVer_ = new AscCommon.ScrollObject("id_vertical_scroll", settings);
this.m_oScrollVer_.onLockMouse = function(evt){
this.m_oScrollVer_.onLockMouse = function(evt)
{
AscCommon.check_MouseDownEvent(evt, true);
global_mouseEvent.LockMouse();
}
this.m_oScrollVer_.offLockMouse = function(evt){
this.m_oScrollVer_.offLockMouse = function(evt)
{
AscCommon.check_MouseUpEvent(evt);
}
this.m_oScrollVer_.bind("scrollvertical",function(evt){
oThis.verticalScroll(this,evt.scrollD,evt.maxScrollY);
this.m_oScrollVer_.bind("scrollvertical", function(evt)
{
oThis.verticalScroll(this, evt.scrollD, evt.maxScrollY);
});
this.m_oScrollVer_.bind("correctVerticalScroll",function(yPos){
this.m_oScrollVer_.bind("correctVerticalScroll", function(yPos)
{
return oThis.CorrectSpeedVerticalScroll(yPos);
});
this.m_oScrollVerApi = this.m_oScrollVer_;
......@@ -2858,13 +2901,13 @@ function CEditorPage(api)
this.m_dScrollX = this.m_dScrollX_max;
if (this.m_dScrollY >= this.m_dScrollY_max)
this.m_dScrollY = this.m_dScrollY_max;
}
};
this.OnRePaintAttack = function()
{
this.m_bIsFullRepaint = true;
this.OnScroll();
}
};
this.OnResize = function(isAttack)
{
......@@ -2878,6 +2921,9 @@ function CEditorPage(api)
this.m_oBody.Resize(this.Width * g_dKoef_pix_to_mm, this.Height * g_dKoef_pix_to_mm, this);
this.onButtonTabsDraw();
if (AscCommon.g_inputContext)
AscCommon.g_inputContext.onResize("id_main_view");
if (this.TextBoxBackground != null)
{
// это мега заглушка. чтобы не показывалась клавиатура при тыкании на тулбар
......@@ -2933,7 +2979,7 @@ function CEditorPage(api)
this.OnScroll();
this.onTimerScroll2_sync();
}
};
this.checkNeedRules = function()
{
......@@ -2969,7 +3015,7 @@ function CEditorPage(api)
this.m_oOverlay.Bounds.T = 0;
*/
}
}
};
this.checkNeedHorScroll = function()
{
if (this.m_oApi.isMobileVersion)
......@@ -3024,25 +3070,25 @@ function CEditorPage(api)
return true;
}
return false;
}
};
this.getScrollMaxX = function(size)
{
if (size >= this.m_dDocumentWidth)
return 1;
return this.m_dDocumentWidth - size;
}
};
this.getScrollMaxY = function(size)
{
if (size >= this.m_dDocumentHeight)
return 1;
return this.m_dDocumentHeight - size;
}
};
this.StartUpdateOverlay = function()
{
this.IsUpdateOverlayOnlyEnd = true;
}
};
this.EndUpdateOverlay = function()
{
if (this.IsUpdateOverlayOnlyEndReturn)
......@@ -3052,7 +3098,7 @@ function CEditorPage(api)
if (this.IsUpdateOverlayOnEndCheck)
this.OnUpdateOverlay();
this.IsUpdateOverlayOnEndCheck = false;
}
};
this.OnUpdateOverlay = function()
{
......@@ -3246,7 +3292,7 @@ function CEditorPage(api)
}
return true;
}
};
this.OnUpdateSelection = function()
{
......@@ -3281,7 +3327,7 @@ function CEditorPage(api)
// нужно очистить набивку пата
this.m_oOverlayApi.m_oContext.beginPath();
}
}
};
this.OnCalculatePagesPlace = function()
{
......@@ -3378,7 +3424,7 @@ function CEditorPage(api)
if (this.m_bDocumentPlaceChangedEnabled)
this.m_oApi.asc_fireCallback("asc_onDocumentPlaceChanged");
}
};
this.OnPaint = function()
{
......@@ -3517,7 +3563,7 @@ function CEditorPage(api)
this.m_oDrawingDocument.UpdateTargetNoAttack();
this.m_bIsUpdateTargetNoAttack = false;
}
}
};
this.CheckRetinaElement = function(htmlElem)
{
......@@ -3531,12 +3577,12 @@ function CEditorPage(api)
return true;
}
return false;
}
};
this.GetDrawingPageInfo = function(nPageIndex)
{
return this.m_oDrawingDocument.m_arrPages[nPageIndex];
}
};
this.CheckFontCache = function()
{
......@@ -3551,18 +3597,18 @@ function CEditorPage(api)
oThis.m_oLogicDocument.Continue_CheckSpelling();
oThis.m_oLogicDocument.Continue_TrackRevisions();
oThis.m_oLogicDocument.Continue_FastCollaborativeEditing();
}
};
this.OnScroll = function()
{
this.OnCalculatePagesPlace();
this.m_bIsScroll = true;
}
};
this.CheckZoom = function()
{
if (!this.NoneRepaintPages)
this.m_oDrawingDocument.ClearCachePages();
}
};
this.ChangeHintProps = function()
{
......@@ -3599,7 +3645,7 @@ function CEditorPage(api)
}
return bFlag;
}
};
this.CalculateDocumentSize = function()
{
......@@ -3663,7 +3709,7 @@ function CEditorPage(api)
if (this.m_bIsRePaintOnScroll === true)
this.OnScroll();
}
};
this.InitDocument = function(bIsEmpty)
{
......@@ -3683,7 +3729,7 @@ function CEditorPage(api)
this.m_oVerRuler.CreateBackground(this.m_oDrawingDocument.m_arrPages[0]);
this.UpdateHorRuler();
this.UpdateVerRuler();
}
};
this.InitControl = function()
{
......@@ -3726,7 +3772,7 @@ function CEditorPage(api)
AscCommon.InitBrowserInputContext(this.m_oApi, "id_target_cursor");
//this.m_oDrawingDocument.CheckFontCache();
}
};
this.OpenDocument = function(info)
{
......@@ -3743,7 +3789,7 @@ function CEditorPage(api)
this.m_oVerRuler.CreateBackground(this.m_oDrawingDocument.m_arrPages[0]);
this.UpdateHorRuler();
this.UpdateVerRuler();
}
};
this.AnimationFrame = function()
{
......@@ -3754,7 +3800,7 @@ function CEditorPage(api)
oThis.onTimerScroll2(true);
}
oThis.RequestAnimationFrame.call(window, oThis.AnimationFrame);
}
};
this.onTimerScroll = function()
{
......@@ -3776,7 +3822,7 @@ function CEditorPage(api)
oWordControl.CheckFontCache();
oWordControl.m_oDrawingDocument.CheckTrackTable();
}
}
};
this.StartMainTimer = function()
{
......@@ -3787,7 +3833,7 @@ function CEditorPage(api)
}
if (-1 == this.m_nPaintTimerId)
this.onTimerScroll2();
}
};
this.onTimerScroll2_internal = function(is_no_timer)
{
......@@ -3857,7 +3903,7 @@ function CEditorPage(api)
oWordControl.m_oApi.asc_fireCallback("asc_onPaintTimer");
//window.requestAnimationFrame(oWordControl.onTimerScroll2);
}
};
this.onTimerScroll2 = function(is_no_timer)
{
try
......@@ -3870,7 +3916,7 @@ function CEditorPage(api)
if (true !== is_no_timer)
this.m_nPaintTimerId = setTimeout(oThis.onTimerScroll2, oThis.m_nTimerScrollInterval);
}
};
this.onTimerScroll2_sync = function()
{
......@@ -3900,7 +3946,7 @@ function CEditorPage(api)
oWordControl.m_oDrawingDocument.CheckTrackTable();
}
oWordControl.m_oDrawingDocument.Collaborative_TargetsUpdate(isRepaint);
}
};
this.UpdateHorRuler = function()
{
......@@ -3918,7 +3964,7 @@ function CEditorPage(api)
_left = this.m_oDrawingDocument.m_arrPages[this.m_oDrawingDocument.m_lPagesCount - 1].drawingPage.left;
}
this.m_oHorRuler.BlitToMain(_left, 0, this.m_oTopRuler_horRuler.HtmlElement);
}
};
this.UpdateVerRuler = function()
{
if (!this.m_bIsRuler)
......@@ -3935,7 +3981,7 @@ function CEditorPage(api)
_top = this.m_oDrawingDocument.m_arrPages[this.m_oDrawingDocument.m_lPagesCount - 1].drawingPage.top;
}
this.m_oVerRuler.BlitToMain(0, _top, this.m_oLeftRuler_vertRuler.HtmlElement);
}
};
this.SetCurrentPage = function(isNoUpdateRulers)
{
......@@ -3959,7 +4005,7 @@ function CEditorPage(api)
this.OnScroll();
this.m_oApi.sync_currentPageCallback(drDoc.m_lCurrentPage);
}
};
this.SetCurrentPage2 = function()
{
var drDoc = this.m_oDrawingDocument;
......@@ -3973,7 +4019,7 @@ function CEditorPage(api)
this.m_bIsUpdateVerRuler = true;
this.m_oApi.sync_currentPageCallback(drDoc.m_lCurrentPage);
}
};
this.UpdateHorRulerBack = function(isattack)
{
......@@ -3983,7 +4029,7 @@ function CEditorPage(api)
this.m_oHorRuler.CreateBackground(drDoc.m_arrPages[drDoc.m_lCurrentPage], isattack);
}
this.UpdateHorRuler();
}
};
this.UpdateVerRulerBack = function(isattack)
{
var drDoc = this.m_oDrawingDocument;
......@@ -3992,7 +4038,7 @@ function CEditorPage(api)
this.m_oVerRuler.CreateBackground(drDoc.m_arrPages[drDoc.m_lCurrentPage], isattack);
}
this.UpdateVerRuler();
}
};
this.GoToPage = function(lPageNum)
{
......@@ -4027,7 +4073,7 @@ function CEditorPage(api)
if (false === drDoc.IsFreezePage(drDoc.m_lCurrentPage))
{
this.m_oLogicDocument.Set_DocPosType(docpostype_Content);
this.m_oLogicDocument.Set_CurPage( drDoc.m_lCurrentPage );
this.m_oLogicDocument.Set_CurPage(drDoc.m_lCurrentPage);
this.m_oLogicDocument.Cursor_MoveAt(0, 0, false);
this.m_oLogicDocument.RecalculateCurPos();
this.m_oLogicDocument.Document_UpdateSelectionState();
......@@ -4039,7 +4085,7 @@ function CEditorPage(api)
{
this.m_oApi.sync_currentPageCallback(drDoc.m_lCurrentPage);
}
}
};
this.GetVerticalScrollTo = function(y, page)
{
......@@ -4053,13 +4099,13 @@ function CEditorPage(api)
lYPos += y * dKoef;
return lYPos;
}
};
this.GetHorizontalScrollTo = function(x, page)
{
var dKoef = g_dKoef_mm_to_pix * this.m_nZoomValue / 100;
return 5 + dKoef * x;
}
};
this.ReinitTB = function(bIsNoResetValue)
{
......@@ -4067,7 +4113,7 @@ function CEditorPage(api)
if (true !== bIsNoResetValue)
this.TextBoxInput.value = "";
this.TextBoxChangedValueEvent = true;
}
};
this.SetTextBoxMode = function(isEA)
{
......@@ -4151,7 +4197,7 @@ function CEditorPage(api)
this.TextBoxInput.focus();
}
}
}
};
this.TextBoxFocus = function()
{
......@@ -4163,7 +4209,7 @@ function CEditorPage(api)
oThis.CheckTextBoxInputPos();
this.ReinitTB(true);
oThis.TextBoxInput.style.zIndex = 90;
}
};
this.OnTextBoxInput = function()
{
......@@ -4172,7 +4218,7 @@ function CEditorPage(api)
oThis.TextBoxFocus();
oThis.CheckTextBoxSize();
}
};
this.CheckTextBoxSize = function()
{
......@@ -4227,7 +4273,7 @@ function CEditorPage(api)
var oldZindex = parseInt(this.TextBoxInput.style.zIndex);
var newZindex = (oldZindex == 90) ? "89" : "90";
this.TextBoxInput.style.zIndex = newZindex;
}
};
this.TextBoxOnKeyDown = function(e)
{
......@@ -4237,7 +4283,7 @@ function CEditorPage(api)
e.preventDefault();
return false;
}
}
};
this.onChangeTB = function()
{
......@@ -4318,7 +4364,7 @@ function CEditorPage(api)
this.ReinitTB();
}
}
}
};
this.CheckTextBoxInputPos = function()
{
if (this.TextBoxInput == null || !this.TextBoxInputFocus)
......@@ -4358,7 +4404,7 @@ function CEditorPage(api)
this.CheckTextBoxSize();
this.TextBoxInput.focus();
}
};
}
var _message_update = "zero_delay_update";
......
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