Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
78945eba
Commit
78945eba
authored
Dec 08, 2016
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
95cb8f9c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
128 additions
and
72 deletions
+128
-72
common/Scrolls/mobileTouchManagerBase.js
common/Scrolls/mobileTouchManagerBase.js
+23
-4
word/Drawing/HtmlPage.js
word/Drawing/HtmlPage.js
+5
-4
word/Drawing/mobileTouchManager.js
word/Drawing/mobileTouchManager.js
+100
-64
No files found.
common/Scrolls/mobileTouchManagerBase.js
View file @
78945eba
...
...
@@ -479,6 +479,8 @@
this
.
delegate
=
null
;
}
// создание вспомогательного элемента, для прокрутки. по идее потом можно изменить
// просто на сдвиги. но пока так
CMobileTouchManagerBase
.
prototype
.
CreateScrollerDiv
=
function
(
_wrapper
)
{
var
_scroller
=
document
.
createElement
(
'
div
'
);
...
...
@@ -492,6 +494,8 @@
_wrapper
.
appendChild
(
_scroller
);
};
// здесь загрузка нужных картинок. пока только для таблицы (движение)
// грузим в конструкторе, используем тогда, когда загружено (asc_complete)
CMobileTouchManagerBase
.
prototype
.
LoadMobileImages
=
function
()
{
window
.
g_table_track_mobile_move
=
new
Image
();
...
...
@@ -503,6 +507,7 @@
window
.
g_table_track_mobile_move
.
src
=
"
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAArlJREFUeNqMlc9rWkEQx8ffGqMJBJpSUEIISInxpCfT1krioQQ85xISEKGBkGuhpxwEL4GAoOBJ8V9IxJCQ1l4SkFKxQvEfKEXQ0Nb4IxLtfBefvMeriQPj7ps377Mzu7OjZjgckoYlGo2+tFqtcZ1OFyAiG00nfx8eHj7f3d19SKfTP5g11LBRs7u761lYWPiytbVl9/l8ZDKZpqL1ej0qlUp0enr6p9FovM5kMhU92w02my0OmN/vJ0TcbreJVxZzCH9ARqORQqGQCurxeAC2n52dxfkxDOCMXq9/5fV6aTAYEIc/BkHYkWKx2Ni2ubn5X+j5+fkbweIf5GdFmoAhMkny+TzF43GyWCzi+ejoSIA3NjYUQA4IA5xMmGnhBO33+4rowuEwbW9vKz7Gdtzf36uiHH2n1eJQkCoE0WFeKBTE2O12qdlsKhQ2vLu6uhKjXMHSyuhivLi4oEQiQVLUk/T4+JiKxaLCJtKXQNDLy0tKJpM0NzcnrThR4HNyciLm6+vraiAEB8P1KE9hoqCMzGYzGQwG4asASoZAIEDz8/OUSqWeBGLxg4MDWl1dHe+rKkKUDWpqf3//SeDh4SG5XC5x6nKGYg+lW+J2u6nT6TwKBEzuo0pZPiJSyPX1NWWz2bFdy1UWiUQIt0rykUSe8pDrr837MCMvakgwGCSHw0G5XE487+3t0dLSkip6FDozumABOODVvt3c3PiXl5cVjq1Wi1ZWVmhnZ0dcL6fTqYoMUqlUYP8Klg7dhlNp3N7evuM7a0DZcE9UrL64uEh2u318APJ35XIZl6HN0I/1er2GfmhkfcGb/JYP4/3s7OwaL2Ceph/yvnU5i+/VajVVq9U+semnaLCjTvGM9TkuAaKesmP3WX+z/mKts3Y00l/ACDIzamfa0UKPCU4QR9tDEwIcfwH/BBgAl4G4NBf6Z6AAAAAASUVORK5CYII=
"
;
};
// onTouchStart => попали ли в якорьки селекта, чтобы не начинать скроллы/зумы
CMobileTouchManagerBase
.
prototype
.
CheckSelectTrack
=
function
()
{
if
(
!
this
.
SelectEnabled
)
...
...
@@ -550,6 +555,7 @@
return
(
this
.
Mode
==
AscCommon
.
MobileTouchMode
.
Select
);
};
// onTouchStart => попали ли в якорьки таблицы, чтобы не начинать скроллы/зумы
CMobileTouchManagerBase
.
prototype
.
CheckTableTrack
=
function
()
{
if
(
!
this
.
TableTrackEnabled
)
...
...
@@ -795,6 +801,7 @@
return
bIsTable
;
};
// onTouchStart => попали ли в якорьки трека объекта (шейп, картинка), чтобы не начинать скроллы/зумы
CMobileTouchManagerBase
.
prototype
.
CheckObjectTrack
=
function
()
{
var
pos
=
this
.
delegate
.
ConvertCoordsFromCursor
(
global_mouseEvent
.
X
,
global_mouseEvent
.
Y
);
...
...
@@ -814,6 +821,7 @@
return
(
AscCommon
.
MobileTouchMode
.
FlowObj
==
this
.
Mode
);
};
// в мобильной версии - меньше, чем "по ширине" - не делаем
CMobileTouchManagerBase
.
prototype
.
CheckZoomCriticalValues
=
function
(
zoomMin
)
{
if
(
zoomMin
!==
undefined
)
...
...
@@ -832,6 +840,7 @@
}
};
// изменился размер документа/экрана => нужно перескитать вспомогательный элемент для скролла
CMobileTouchManagerBase
.
prototype
.
Resize
=
function
()
{
if
(
this
.
iScroll
!=
null
)
...
...
@@ -844,6 +853,7 @@
}
};
// есть ли тач или анимационный скролл/зум
CMobileTouchManagerBase
.
prototype
.
IsWorkedPosition
=
function
()
{
if
(
this
.
IsTouching
)
...
...
@@ -855,6 +865,7 @@
return
false
;
};
// удаление вспомогательного элемента
CMobileTouchManagerBase
.
prototype
.
Destroy
=
function
()
{
var
_scroller
=
document
.
getElementById
(
this
.
iScrollElement
);
...
...
@@ -911,6 +922,7 @@
this
.
Api
.
sendEvent
(
"
asc_onHidePopMenu
"
);
};
// закончился скролл
CMobileTouchManagerBase
.
prototype
.
OnScrollAnimationEnd
=
function
()
{
if
(
this
.
Api
.
isViewMode
)
...
...
@@ -919,7 +931,7 @@
this
.
CheckContextMenuTouchEnd
(
false
);
};
/
* select rects */
/
/ обновление ректов для селекта текстового
CMobileTouchManagerBase
.
prototype
.
CheckSelectRects
=
function
()
{
this
.
RectSelect1
=
null
;
...
...
@@ -950,8 +962,12 @@
this
.
PageSelect2
=
_rect2
.
Page
;
};
// отрисовка текстового селекта
CMobileTouchManagerBase
.
prototype
.
CheckSelect
=
function
(
overlay
)
{
if
(
!
this
.
SelectEnabled
)
return
;
this
.
CheckSelectRects
();
if
(
null
==
this
.
RectSelect1
||
null
==
this
.
RectSelect2
)
return
;
...
...
@@ -1048,6 +1064,8 @@
}
};
// отрисовка табличного селекта
// заточка на определенного делегата
CMobileTouchManagerBase
.
prototype
.
CheckTableRules
=
function
(
overlay
)
{
if
(
this
.
Api
.
isViewMode
||
!
this
.
TableTrackEnabled
)
...
...
@@ -1360,7 +1378,7 @@
}
};
/*
viewer methods
*/
/*
document renderer mode (заточка на делегата)
*/
CMobileTouchManagerBase
.
prototype
.
onTouchStart_renderer
=
function
(
e
)
{
AscCommon
.
check_MouseDownEvent
(
e
.
touches
?
e
.
touches
[
0
]
:
e
,
true
);
...
...
@@ -1504,7 +1522,7 @@
case
AscCommon
.
MobileTouchMode
.
Zoom
:
{
// здесь нужно запускать отрисовку, если есть анимация зума
this
.
delegate
.
HtmlPage
.
NoneRepaintP
delegate
.
ages
=
false
;
this
.
delegate
.
HtmlPage
.
NoneRepaintPages
=
false
;
this
.
delegate
.
HtmlPage
.
m_bIsFullRepaint
=
true
;
this
.
delegate
.
HtmlPage
.
OnScroll
();
...
...
@@ -1521,7 +1539,7 @@
e
.
returnValue
=
false
;
};
/*
simple click
*/
/*
перемещение курсора (именно курсора!) до ближайщей позиции. заточка на делегата
*/
CMobileTouchManagerBase
.
prototype
.
MoveCursorToPoint
=
function
(
isHalfHeight
)
{
var
pos
=
this
.
delegate
.
ConvertCoordsFromCursor
(
global_mouseEvent
.
X
,
global_mouseEvent
.
Y
);
...
...
@@ -1543,6 +1561,7 @@
};
//--------------------------------------------------------export----------------------------------------------------
AscCommon
.
CMobileDelegateSimple
=
CMobileDelegateSimple
;
AscCommon
.
CMobileTouchManagerBase
=
CMobileTouchManagerBase
;
AscCommon
.
CMobileDelegateEditor
=
CMobileDelegateEditor
;
})(
window
);
word/Drawing/HtmlPage.js
View file @
78945eba
...
...
@@ -444,7 +444,7 @@ function CEditorPage(api)
if
(
this
.
m_oApi
.
isMobileVersion
)
{
this
.
MobileTouchManager
=
new
AscCommon
.
CMobileTouchManager
(
{}
);
this
.
MobileTouchManager
=
new
AscCommon
.
CMobileTouchManager
();
this
.
MobileTouchManager
.
Init
(
this
.
m_oApi
);
}
...
...
@@ -2278,7 +2278,7 @@ function CEditorPage(api)
}
this
.
ReaderTouchManager
=
new
AscCommon
.
CReaderTouchManager
();
this
.
ReaderTouchManager
.
Init
(
this
);
this
.
ReaderTouchManager
.
Init
(
this
.
m_oApi
);
this
.
TransformDivUseAnimation
(
this
.
ReaderModeDivWrapper
,
0
);
...
...
@@ -2353,8 +2353,9 @@ function CEditorPage(api)
if
(
oThis
.
m_oApi
.
isMobileVersion
)
{
oThis
.
MobileTouchManager
=
new
AscCommon
.
CMobileTouchManager
({});
oThis
.
MobileTouchManager
.
Init
(
oThis
);
oThis
.
MobileTouchManager
=
new
AscCommon
.
CMobileTouchManager
();
oThis
.
MobileTouchManager
.
Init
(
oThis
.
m_oApi
);
oThis
.
MobileTouchManager
.
Resize
();
}
return
;
...
...
word/Drawing/mobileTouchManager.js
View file @
78945eba
...
...
@@ -45,7 +45,7 @@
*/
function
CMobileTouchManager
(
_config
)
{
CMobileTouchManager
.
superclass
.
constructor
.
call
(
this
,
_config
);
CMobileTouchManager
.
superclass
.
constructor
.
call
(
this
,
_config
||
{}
);
}
AscCommon
.
extendClass
(
CMobileTouchManager
,
AscCommon
.
CMobileTouchManagerBase
);
...
...
@@ -610,80 +610,116 @@
this
.
CheckContextMenuTouchEnd
(
isCheckContextMenuMode
);
};
function
CReaderTouchManager
()
/*************************************** READER ******************************************/
/**
* @extends {AscCommon.CMobileDelegateSimple}
*/
function
CMobileDelegateEditorReader
(
_manager
)
{
CMobileDelegateEditorReader
.
superclass
.
constructor
.
call
(
this
,
_manager
);
this
.
HtmlPage
=
this
.
Api
.
WordControl
;
}
AscCommon
.
extendClass
(
CMobileDelegateEditorReader
,
AscCommon
.
CMobileDelegateSimple
);
CMobileDelegateEditorReader
.
prototype
.
GetZoom
=
function
()
{
return
this
.
HtmlPage
.
m_nZoomValue
;
};
CMobileDelegateEditorReader
.
prototype
.
SetZoom
=
function
(
_value
)
{
this
.
HtmlPage
.
m_oApi
.
zoom
(
_value
);
};
CMobileDelegateEditorReader
.
prototype
.
GetScrollerParent
=
function
()
{
return
this
.
HtmlPage
.
m_oMainView
.
HtmlElement
;
};
/**
* @extends {AscCommon.CMobileTouchManagerBase}
*/
function
CReaderTouchManager
(
_config
)
{
this
.
HtmlPage
=
null
;
this
.
iScroll
=
null
;
CReaderTouchManager
.
superclass
.
constructor
.
call
(
this
,
_config
||
{});
this
.
SelectEnabled
=
false
;
this
.
TableTrackEnabled
=
false
;
this
.
bIsLock
=
false
;
this
.
bIsMoveAfterDown
=
false
;
}
AscCommon
.
extendClass
(
CReaderTouchManager
,
AscCommon
.
CMobileTouchManagerBase
);
this
.
Init
=
function
(
ctrl
)
{
this
.
HtmlPage
=
ctrl
;
this
.
LogicDocument
=
ctrl
.
m_oLogicDocument
;
this
.
DrawingDocument
=
ctrl
.
m_oDrawingDocument
;
this
.
iScroll
=
new
window
.
IScroll
(
this
.
HtmlPage
.
m_oMainView
.
HtmlElement
,
{
scrollbars
:
true
,
mouseWheel
:
true
,
interactiveScrollbars
:
true
,
shrinkScrollbars
:
'
scale
'
,
fadeScrollbars
:
true
,
scrollX
:
true
,
scroller_id
:
"
reader_id
"
,
bounce
:
false
});
this
.
iScroll
.
manager
=
this
;
this
.
HtmlPage
.
m_oApi
.
sendEvent
(
"
asc_onHidePopMenu
"
);
};
this
.
onTouchStart
=
function
(
e
)
{
this
.
iScroll
.
_start
(
e
);
this
.
bIsLock
=
true
;
this
.
bIsMoveAfterDown
=
false
;
};
this
.
onTouchMove
=
function
(
e
)
{
if
(
!
this
.
bIsLock
)
return
;
this
.
iScroll
.
_move
(
e
);
this
.
bIsMoveAfterDown
=
true
;
};
this
.
onTouchEnd
=
function
(
e
)
{
this
.
iScroll
.
_end
(
e
);
this
.
bIsLock
=
false
;
CReaderTouchManager
.
prototype
.
Init
=
function
(
_api
)
{
this
.
Api
=
_api
;
this
.
iScrollElement
=
"
reader_id
"
;
if
(
this
.
bIsMoveAfterDown
===
false
)
{
this
.
HtmlPage
.
m_oApi
.
sendEvent
(
"
asc_onTapEvent
"
,
e
);
}
};
// создаем делегата. инициализация его - ПОСЛЕ создания iScroll
this
.
delegate
=
new
CMobileDelegateEditorReader
(
this
);
this
.
Resize
=
function
()
{
this
.
HtmlPage
.
ReaderModeDivWrapper
.
style
.
width
=
this
.
HtmlPage
.
m_oMainView
.
HtmlElement
.
style
.
width
;
this
.
HtmlPage
.
ReaderModeDivWrapper
.
style
.
height
=
this
.
HtmlPage
.
m_oMainView
.
HtmlElement
.
style
.
height
;
this
.
iScroll
=
new
window
.
IScroll
(
this
.
delegate
.
GetScrollerParent
(),
{
scrollbars
:
true
,
mouseWheel
:
true
,
interactiveScrollbars
:
true
,
shrinkScrollbars
:
'
scale
'
,
fadeScrollbars
:
true
,
scrollX
:
true
,
scroller_id
:
this
.
iScrollElement
,
bounce
:
true
});
if
(
this
.
iScroll
!=
null
)
this
.
iScroll
.
refresh
();
};
// создаем делегата. инициализация его - ПОСЛЕ создания iScroll
this
.
delegate
.
Init
(
this
);
this
.
ChangeFontSize
=
function
()
{
if
(
this
.
iScroll
!=
null
)
this
.
iScroll
.
refresh
();
};
this
.
Api
.
sendEvent
(
"
asc_onHidePopMenu
"
);
};
CReaderTouchManager
.
prototype
.
onTouchStart
=
function
(
e
)
{
this
.
iScroll
.
_start
(
e
);
this
.
bIsLock
=
true
;
this
.
bIsMoveAfterDown
=
false
;
};
CReaderTouchManager
.
prototype
.
onTouchMove
=
function
(
e
)
{
if
(
!
this
.
bIsLock
)
return
;
this
.
iScroll
.
_move
(
e
);
this
.
bIsMoveAfterDown
=
true
;
};
CReaderTouchManager
.
prototype
.
onTouchEnd
=
function
(
e
)
{
this
.
iScroll
.
_end
(
e
);
this
.
bIsLock
=
false
;
this
.
Destroy
=
function
(
)
if
(
this
.
bIsMoveAfterDown
===
false
)
{
if
(
this
.
iScroll
!=
null
)
this
.
iScroll
.
destroy
();
};
}
this
.
Api
.
sendEvent
(
"
asc_onTapEvent
"
,
e
);
}
};
CReaderTouchManager
.
prototype
.
Resize
=
function
()
{
var
HtmlPage
=
this
.
delegate
.
HtmlPage
;
HtmlPage
.
ReaderModeDivWrapper
.
style
.
width
=
HtmlPage
.
m_oMainView
.
HtmlElement
.
style
.
width
;
HtmlPage
.
ReaderModeDivWrapper
.
style
.
height
=
HtmlPage
.
m_oMainView
.
HtmlElement
.
style
.
height
;
if
(
this
.
iScroll
!=
null
)
this
.
iScroll
.
refresh
();
};
CReaderTouchManager
.
prototype
.
ChangeFontSize
=
function
()
{
if
(
this
.
iScroll
!=
null
)
this
.
iScroll
.
refresh
();
};
CReaderTouchManager
.
prototype
.
Destroy
=
function
()
{
if
(
this
.
iScroll
!=
null
)
this
.
iScroll
.
destroy
();
};
//--------------------------------------------------------export----------------------------------------------------
window
[
'
AscCommon
'
]
=
window
[
'
AscCommon
'
]
||
{};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment