Commit 17fa4579 authored by Oleg Korshul's avatar Oleg Korshul

.

parent 78945eba
......@@ -1873,9 +1873,6 @@ Indicator.prototype = {
e.preventDefault();
e.stopPropagation();
// !!!
this._execEvent('scroll');
},
_end: function (e) {
......
......@@ -3081,6 +3081,8 @@ function CThumbnailsManager()
this.MouseThumbnailsAnimateScrollTopTimer = -1;
this.MouseThumbnailsAnimateScrollBottomTimer = -1;
this.ScrollerHeight = 0;
this.m_oWordControl = null;
var oThis = this;
......@@ -3943,6 +3945,12 @@ function CThumbnailsManager()
word_control.m_oScrollThumbApi.scrollToY(lPosition);
}
this.ScrollerHeight = nHeightPix;
if (word_control.MobileTouchManagerThumbnails)
{
word_control.MobileTouchManagerThumbnails.Resize();
}
this.CalculatePlaces();
this.m_bIsUpdate = true;
}
......
......@@ -187,6 +187,9 @@ function CEditorPage(api)
this.m_oScrollThumbApi = null;
this.m_oScrollNotesApi = null;
this.MobileTouchManager = null;
this.MobileTouchManagerThumbnails = null;
// properties
this.m_bIsHorScrollVisible = false;
this.m_bIsCheckHeedHorScrollRepeat = false;
......@@ -406,6 +409,11 @@ function CEditorPage(api)
this.m_oThumbnailsContainer.AddControl(this.m_oThumbnails_scroll);
// ----------------
if (this.m_oApi.isMobileVersion)
{
this.m_oThumbnails_scroll.HtmlElement.style.display = "none";
}
// main content -------------------------------------------------------------
this.m_oMainContent = CreateControlContainer("id_main");
......@@ -537,6 +545,15 @@ function CEditorPage(api)
this.m_oDrawingDocument.TargetHtmlElement = document.getElementById('id_target_cursor');
if (this.m_oApi.isMobileVersion)
{
this.MobileTouchManager = new AscCommon.CMobileTouchManager();
this.MobileTouchManager.Init(this.m_oApi);
this.MobileTouchManagerThumbnails = new AscCommon.CMobileTouchManagerThumbnails();
this.MobileTouchManagerThumbnails.Init(this.m_oApi);
}
this.m_oOverlayApi.m_oControl = this.m_oOverlay;
this.m_oOverlayApi.m_oHtmlPage = this;
this.m_oOverlayApi.Clear();
......@@ -673,70 +690,268 @@ function CEditorPage(api)
this.initEvents2MobileAdvances = function()
{
this.m_oEditor.HtmlElement["ontouchstart"] = function(e)
if (!this.m_oApi.isMobileVersion)
{
this.m_oEditor.HtmlElement["ontouchstart"] = function (e)
{
oThis.onMouseDown(e.touches[0]);
return false;
};
this.m_oEditor.HtmlElement["ontouchmove"] = function(e)
this.m_oEditor.HtmlElement["ontouchmove"] = function (e)
{
oThis.onMouseMove(e.touches[0]);
return false;
};
this.m_oEditor.HtmlElement["ontouchend"] = function(e)
this.m_oEditor.HtmlElement["ontouchend"] = function (e)
{
oThis.onMouseUp(e.changedTouches[0]);
return false;
};
this.m_oOverlay.HtmlElement["ontouchstart"] = function(e)
this.m_oOverlay.HtmlElement["ontouchstart"] = function (e)
{
oThis.onMouseDown(e.touches[0]);
return false;
};
this.m_oOverlay.HtmlElement["ontouchmove"] = function(e)
this.m_oOverlay.HtmlElement["ontouchmove"] = function (e)
{
oThis.onMouseMove(e.touches[0]);
return false;
};
this.m_oOverlay.HtmlElement["ontouchend"] = function(e)
this.m_oOverlay.HtmlElement["ontouchend"] = function (e)
{
oThis.onMouseUp(e.changedTouches[0]);
return false;
};
this.m_oTopRuler_horRuler.HtmlElement["ontouchstart"] = function(e)
this.m_oTopRuler_horRuler.HtmlElement["ontouchstart"] = function (e)
{
oThis.horRulerMouseDown(e.touches[0]);
return false;
};
this.m_oTopRuler_horRuler.HtmlElement["ontouchmove"] = function(e)
this.m_oTopRuler_horRuler.HtmlElement["ontouchmove"] = function (e)
{
oThis.horRulerMouseMove(e.touches[0]);
return false;
};
this.m_oTopRuler_horRuler.HtmlElement["ontouchend"] = function(e)
this.m_oTopRuler_horRuler.HtmlElement["ontouchend"] = function (e)
{
oThis.horRulerMouseUp(e.changedTouches[0]);
return false;
};
this.m_oLeftRuler_vertRuler.HtmlElement["ontouchstart"] = function(e)
this.m_oLeftRuler_vertRuler.HtmlElement["ontouchstart"] = function (e)
{
oThis.verRulerMouseDown(e.touches[0]);
return false;
};
this.m_oLeftRuler_vertRuler.HtmlElement["ontouchmove"] = function(e)
this.m_oLeftRuler_vertRuler.HtmlElement["ontouchmove"] = function (e)
{
oThis.verRulerMouseMove(e.touches[0]);
return false;
};
this.m_oLeftRuler_vertRuler.HtmlElement["ontouchend"] = function(e)
this.m_oLeftRuler_vertRuler.HtmlElement["ontouchend"] = function (e)
{
oThis.verRulerMouseUp(e.changedTouches[0]);
return false;
};
}
};
this.initEventsMobile = function()
{
if (this.m_oApi.isMobileVersion)
{
this.TextBoxBackground = CreateControl(AscCommon.g_inputContext.HtmlArea.id);
this.TextBoxBackground.HtmlElement.parentNode.parentNode.style.zIndex = 10;
var __hasTouch = 'ontouchstart' in window;
if (__hasTouch)
{
this.TextBoxBackground.HtmlElement["ontouchcancel"] = function(e)
{
if (!oThis.MobileTouchManager)
return false;
oThis.IsUpdateOverlayOnlyEndReturn = true;
oThis.StartUpdateOverlay();
var ret = oThis.MobileTouchManager.onTouchEnd(e);
oThis.IsUpdateOverlayOnlyEndReturn = false;
oThis.EndUpdateOverlay();
return ret;
};
this.TextBoxBackground.HtmlElement["ontouchstart"] = function(e)
{
if (AscCommon.g_inputContext && AscCommon.g_inputContext.externalChangeFocus())
return;
if (!oThis.IsFocus)
oThis.m_oApi.asc_enableKeyEvents(true);
if (!oThis.MobileTouchManager)
return false;
oThis.IsUpdateOverlayOnlyEndReturn = true;
oThis.StartUpdateOverlay();
var ret = oThis.MobileTouchManager.onTouchStart(e);
oThis.IsUpdateOverlayOnlyEndReturn = false;
oThis.EndUpdateOverlay();
return ret;
};
this.TextBoxBackground.HtmlElement["ontouchmove"] = function(e)
{
if (!oThis.MobileTouchManager)
return false;
oThis.IsUpdateOverlayOnlyEndReturn = true;
oThis.StartUpdateOverlay();
var ret = oThis.MobileTouchManager.onTouchMove(e);
oThis.IsUpdateOverlayOnlyEndReturn = false;
oThis.EndUpdateOverlay();
return ret;
};
this.TextBoxBackground.HtmlElement["ontouchend"] = function(e)
{
if (!oThis.MobileTouchManager)
return false;
oThis.IsUpdateOverlayOnlyEndReturn = true;
oThis.StartUpdateOverlay();
var ret = oThis.MobileTouchManager.onTouchEnd(e);
oThis.IsUpdateOverlayOnlyEndReturn = false;
oThis.EndUpdateOverlay();
return ret;
};
//
this.m_oThumbnails.HtmlElement["ontouchstart"] = function(e)
{
if (AscCommon.g_inputContext && AscCommon.g_inputContext.externalChangeFocus())
return;
if (!oThis.MobileTouchManagerThumbnails)
return false;
return oThis.MobileTouchManagerThumbnails.onTouchStart(e);
};
this.m_oThumbnails.HtmlElement["ontouchmove"] = function(e)
{
if (!oThis.MobileTouchManagerThumbnails)
return false;
return oThis.MobileTouchManagerThumbnails.onTouchMove(e);
};
this.m_oThumbnails.HtmlElement["ontouchend"] = function(e)
{
if (!oThis.MobileTouchManagerThumbnails)
return false;
return oThis.MobileTouchManagerThumbnails.onTouchEnd(e);
};
this.m_oThumbnails.HtmlElement["ontouchcancel"] = function(e)
{
if (!oThis.MobileTouchManagerThumbnails)
return false;
return oThis.MobileTouchManagerThumbnails.onTouchEnd(e);
};
}
else
{
this.TextBoxBackground.HtmlElement["onmousedown"] = function(e)
{
if (AscCommon.g_inputContext && AscCommon.g_inputContext.externalChangeFocus())
return;
if (!oThis.MobileTouchManager)
return false;
oThis.IsUpdateOverlayOnlyEndReturn = true;
oThis.StartUpdateOverlay();
var ret = oThis.MobileTouchManager.onTouchStart(e);
oThis.IsUpdateOverlayOnlyEndReturn = false;
oThis.EndUpdateOverlay();
return ret;
};
this.TextBoxBackground.HtmlElement["onmousemove"] = function(e)
{
if (!oThis.MobileTouchManager)
return false;
oThis.IsUpdateOverlayOnlyEndReturn = true;
oThis.StartUpdateOverlay();
var ret = oThis.MobileTouchManager.onTouchMove(e);
oThis.IsUpdateOverlayOnlyEndReturn = false;
oThis.EndUpdateOverlay();
return ret;
};
this.TextBoxBackground.HtmlElement["onmouseup"] = function(e)
{
if (!oThis.MobileTouchManager)
return false;
oThis.IsUpdateOverlayOnlyEndReturn = true;
oThis.StartUpdateOverlay();
var ret = oThis.MobileTouchManager.onTouchEnd(e);
oThis.IsUpdateOverlayOnlyEndReturn = false;
oThis.EndUpdateOverlay();
return ret;
};
//
this.m_oThumbnails.HtmlElement["onmousedown"] = function(e)
{
if (AscCommon.g_inputContext && AscCommon.g_inputContext.externalChangeFocus())
return;
if (!oThis.MobileTouchManagerThumbnails)
return false;
return oThis.MobileTouchManagerThumbnails.onTouchStart(e);
};
this.m_oThumbnails.HtmlElement["onmousemove"] = function(e)
{
if (!oThis.MobileTouchManagerThumbnails)
return false;
return oThis.MobileTouchManagerThumbnails.onTouchMove(e);
};
this.m_oThumbnails.HtmlElement["onmouseup"] = function(e)
{
if (!oThis.MobileTouchManagerThumbnails)
return false;
return oThis.MobileTouchManagerThumbnails.onTouchEnd(e);
};
}
if (AscCommon.AscBrowser.isAndroid)
{
this.TextBoxBackground.HtmlElement["oncontextmenu"] = function(e)
{
if (e.preventDefault)
e.preventDefault();
e.returnValue = false;
return false;
};
this.TextBoxBackground.HtmlElement["onselectstart"] = function(e)
{
oThis.m_oLogicDocument.Select_All();
if (e.preventDefault)
e.preventDefault();
e.returnValue = false;
return false;
};
}
}
};
this.onButtonRulersClick = function()
{
if (false === oThis.m_oApi.bInit_word_control || true === oThis.m_oApi.isViewMode)
......@@ -3039,19 +3254,14 @@ function CEditorPage(api)
this.m_oApi.syncOnThumbnailsShow();
if (!this.m_oApi.isMobileVersion)
if (true)
{
AscCommon.InitBrowserInputContext(this.m_oApi, "id_target_cursor");
if (AscCommon.g_inputContext)
AscCommon.g_inputContext.onResize("id_main_view");
}
else
{
window.onkeydown = this.onKeyDown;
window.onkeypress = this.onKeyPress;
window.onkeyup = this.onKeyUp;
window['AscCommon'].g_clipboardBase.Init(api);
if (this.m_oApi.isMobileVersion)
this.initEventsMobile();
}
};
......
......@@ -1428,6 +1428,9 @@ background-repeat: no-repeat;\
{
this.WordControl.m_oLogicDocument = new AscCommonSlide.CPresentation(this.WordControl.m_oDrawingDocument);
this.WordControl.m_oDrawingDocument.m_oLogicDocument = this.WordControl.m_oLogicDocument;
if (this.WordControl.MobileTouchManager)
this.WordControl.MobileTouchManager.delegate.LogicDocument = this.WordControl.m_oLogicDocument;
};
asc_docs_api.prototype.SetInterfaceDrawImagePlaceSlide = function(div_id)
......
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