Commit d175f69a authored by Oleg Korshul's avatar Oleg Korshul

onResize input bug

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