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
42c2da31
Commit
42c2da31
authored
Oct 11, 2016
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new mobile version (input)
parent
4c9e7857
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
144 deletions
+52
-144
common/browser.js
common/browser.js
+3
-0
common/text_input.js
common/text_input.js
+31
-1
word/Drawing/HtmlPage.js
word/Drawing/HtmlPage.js
+18
-143
No files found.
common/browser.js
View file @
42c2da31
...
@@ -113,6 +113,9 @@ AscBrowser.zoom = 1;
...
@@ -113,6 +113,9 @@ AscBrowser.zoom = 1;
AscBrowser
.
checkZoom
=
function
()
AscBrowser
.
checkZoom
=
function
()
{
{
if
(
AscBrowser
.
isAndroid
)
return
;
if
(
AscBrowser
.
isChrome
&&
!
AscBrowser
.
isOpera
&&
document
&&
document
.
firstElementChild
&&
document
.
body
)
if
(
AscBrowser
.
isChrome
&&
!
AscBrowser
.
isOpera
&&
document
&&
document
.
firstElementChild
&&
document
.
body
)
{
{
document
.
firstElementChild
.
style
.
zoom
=
"
reset
"
;
document
.
firstElementChild
.
style
.
zoom
=
"
reset
"
;
...
...
common/text_input.js
View file @
42c2da31
...
@@ -207,6 +207,7 @@
...
@@ -207,6 +207,7 @@
_style
+=
"
overflow:hidden;padding:0px;margin:0px;font-family:arial;font-size:12pt;resize:none;font-weight:normal;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;
"
;
_style
+=
"
overflow:hidden;padding:0px;margin:0px;font-family:arial;font-size:12pt;resize:none;font-weight:normal;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;
"
;
this
.
HtmlArea
.
setAttribute
(
"
style
"
,
_style
);
this
.
HtmlArea
.
setAttribute
(
"
style
"
,
_style
);
this
.
HtmlArea
.
setAttribute
(
"
spellcheck
"
,
false
);
this
.
HtmlArea
.
setAttribute
(
"
spellcheck
"
,
false
);
this
.
HtmlArea
.
setAttribute
(
"
autocapitalize
"
,
"
none
"
);
this
.
HtmlDiv
.
appendChild
(
this
.
HtmlArea
);
this
.
HtmlDiv
.
appendChild
(
this
.
HtmlArea
);
...
@@ -334,6 +335,29 @@
...
@@ -334,6 +335,29 @@
_elem
.
style
.
width
=
_width
;
_elem
.
style
.
width
=
_width
;
_elem
.
style
.
height
=
_elemSrc
.
style
.
height
;
_elem
.
style
.
height
=
_elemSrc
.
style
.
height
;
}
}
if
(
this
.
Api
.
isMobileVersion
)
{
var
_elem1
=
document
.
getElementById
(
"
area_id_parent
"
);
var
_elem2
=
document
.
getElementById
(
"
area_id
"
);
_elem1
.
parentNode
.
style
.
pointerEvents
=
""
;
_elem1
.
style
.
left
=
"
-100px
"
;
_elem1
.
style
.
top
=
"
-100px
"
;
_elem1
.
style
.
right
=
"
-100px
"
;
_elem1
.
style
.
bottom
=
"
-100px
"
;
_elem1
.
style
.
width
=
"
auto
"
;
_elem1
.
style
.
height
=
"
auto
"
;
_elem2
.
style
.
left
=
"
0px
"
;
_elem2
.
style
.
top
=
"
0px
"
;
_elem2
.
style
.
right
=
"
0px
"
;
_elem2
.
style
.
bottom
=
"
0px
"
;
_elem2
.
style
.
width
=
"
100%
"
;
_elem2
.
style
.
height
=
"
100%
"
;
}
},
},
checkFocus
:
function
()
checkFocus
:
function
()
...
@@ -347,6 +371,9 @@
...
@@ -347,6 +371,9 @@
move
:
function
(
x
,
y
)
move
:
function
(
x
,
y
)
{
{
if
(
this
.
Api
.
isMobileVersion
)
return
;
var
oTarget
=
document
.
getElementById
(
this
.
TargetId
);
var
oTarget
=
document
.
getElementById
(
this
.
TargetId
);
var
xPos
=
x
?
x
:
parseInt
(
oTarget
.
style
.
left
);
var
xPos
=
x
?
x
:
parseInt
(
oTarget
.
style
.
left
);
var
yPos
=
(
y
?
y
:
parseInt
(
oTarget
.
style
.
top
))
+
parseInt
(
oTarget
.
style
.
height
);
var
yPos
=
(
y
?
y
:
parseInt
(
oTarget
.
style
.
top
))
+
parseInt
(
oTarget
.
style
.
height
);
...
@@ -1486,6 +1513,10 @@
...
@@ -1486,6 +1513,10 @@
ti_console_log
(
"
ti: onCompositionEnd -> onCompositionUpdate
"
);
ti_console_log
(
"
ti: onCompositionEnd -> onCompositionUpdate
"
);
this
.
onCompositionUpdate
(
e
,
false
,
_data
,
true
);
this
.
onCompositionUpdate
(
e
,
false
,
_data
,
true
);
//if (AscCommon.AscBrowser.isAndroid)
// this.onCompositionUpdate(e, false, "", true);
var
_max
=
this
.
Api
.
Get_MaxCursorPosInCompositeText
();
var
_max
=
this
.
Api
.
Get_MaxCursorPosInCompositeText
();
this
.
Api
.
Set_CursorPosInCompositeText
(
_max
);
// max
this
.
Api
.
Set_CursorPosInCompositeText
(
_max
);
// max
...
@@ -1733,7 +1764,6 @@
...
@@ -1733,7 +1764,6 @@
t
.
HtmlArea
.
focus
();
t
.
HtmlArea
.
focus
();
t
.
nativeFocusElement
=
_elem
;
t
.
nativeFocusElement
=
_elem
;
t
.
Api
.
asc_enableKeyEvents
(
true
,
true
);
t
.
Api
.
asc_enableKeyEvents
(
true
,
true
);
},
true
);
},
true
);
// send focus
// send focus
...
...
word/Drawing/HtmlPage.js
View file @
42c2da31
...
@@ -429,40 +429,6 @@ function CEditorPage(api)
...
@@ -429,40 +429,6 @@ function CEditorPage(api)
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
);
if
(
this
.
m_oApi
.
isMobileVersion
)
{
var
_tag_background
=
"
textarea
"
;
if
(
AscBrowser
.
isAndroid
)
_tag_background
=
"
input
"
;
var
_text_bx_back
=
document
.
createElement
(
_tag_background
);
_text_bx_back
.
id
=
"
id_text_box_background
"
;
_text_bx_back
.
setAttribute
(
"
style
"
,
"
background:transparent;border-style:none;border-color:transparent;overflow:hidden;z-index:4;font-family:arial;font-size:12pt;position:absolute;resize:none;padding:0px;margin:0px;font-weight:normal;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;
"
);
_text_bx_back
.
setAttribute
(
"
spellcheck
"
,
"
false
"
);
if
(
AscBrowser
.
isAndroid
)
{
_text_bx_back
.
setAttribute
(
"
autocomplete
"
,
"
off
"
);
_text_bx_back
.
setAttribute
(
"
type
"
,
"
password
"
);
}
// в некоторых браузерах - readonly
try
{
_text_bx_back
.
willValidate
=
false
;
}
catch
(
err
)
{
}
this
.
m_oMainView
.
HtmlElement
.
appendChild
(
_text_bx_back
);
this
.
TextBoxBackground
=
CreateControl
(
"
id_text_box_background
"
);
this
.
TextBoxBackground
.
Bounds
.
SetParams
(
-
100
,
0
,
1100
,
1000
,
false
,
false
,
false
,
false
,
-
1
,
-
1
);
this
.
TextBoxBackground
.
Anchor
=
(
g_anchor_left
|
g_anchor_top
|
g_anchor_right
|
g_anchor_bottom
);
this
.
m_oMainView
.
AddControl
(
this
.
TextBoxBackground
);
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
);
...
@@ -817,9 +783,15 @@ function CEditorPage(api)
...
@@ -817,9 +783,15 @@ function CEditorPage(api)
return
_ret
;
return
_ret
;
};
};
}
}
};
if
(
this
.
m_oApi
.
isMobileVersion
)
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
;
var
__hasTouch
=
'
ontouchstart
'
in
window
;
if
(
__hasTouch
)
if
(
__hasTouch
)
...
@@ -836,6 +808,9 @@ function CEditorPage(api)
...
@@ -836,6 +808,9 @@ function CEditorPage(api)
this
.
TextBoxBackground
.
HtmlElement
[
"
ontouchstart
"
]
=
function
(
e
)
this
.
TextBoxBackground
.
HtmlElement
[
"
ontouchstart
"
]
=
function
(
e
)
{
{
if
(
AscCommon
.
g_inputContext
)
AscCommon
.
g_inputContext
.
externalChangeFocus
();
if
(
!
oThis
.
IsFocus
)
if
(
!
oThis
.
IsFocus
)
oThis
.
m_oApi
.
asc_enableKeyEvents
(
true
);
oThis
.
m_oApi
.
asc_enableKeyEvents
(
true
);
...
@@ -869,6 +844,9 @@ function CEditorPage(api)
...
@@ -869,6 +844,9 @@ function CEditorPage(api)
{
{
this
.
TextBoxBackground
.
HtmlElement
[
"
onmousedown
"
]
=
function
(
e
)
this
.
TextBoxBackground
.
HtmlElement
[
"
onmousedown
"
]
=
function
(
e
)
{
{
if
(
AscCommon
.
g_inputContext
)
AscCommon
.
g_inputContext
.
externalChangeFocus
();
oThis
.
IsUpdateOverlayOnlyEndReturn
=
true
;
oThis
.
IsUpdateOverlayOnlyEndReturn
=
true
;
oThis
.
StartUpdateOverlay
();
oThis
.
StartUpdateOverlay
();
var
ret
=
oThis
.
MobileTouchManager
.
onTouchStart
(
e
);
var
ret
=
oThis
.
MobileTouchManager
.
onTouchStart
(
e
);
...
@@ -917,108 +895,10 @@ function CEditorPage(api)
...
@@ -917,108 +895,10 @@ function CEditorPage(api)
e
.
returnValue
=
false
;
e
.
returnValue
=
false
;
return
false
;
return
false
;
};
};
this
.
TextBoxBackground
.
HtmlElement
[
"
oninput
"
]
=
function
(
e
)
{
var
val
=
oThis
.
TextBoxBackground
.
HtmlElement
.
value
;
oThis
.
TextBoxBackground
.
HtmlElement
.
value
=
"
a
"
;
if
(
val
.
length
==
2
)
{
var
_e
=
{
altKey
:
global_keyboardEvent
.
AltKey
,
ctrlKey
:
global_keyboardEvent
.
CtrlKey
,
shiftKey
:
global_keyboardEvent
.
ShiftKey
,
srcElement
:
global_keyboardEvent
.
Sender
,
charCode
:
global_keyboardEvent
.
CharCode
,
keyCode
:
global_keyboardEvent
.
KeyCode
,
which
:
val
.
charCodeAt
(
1
)
};
_e
.
preventDefault
=
function
()
{
};
if
(
_e
.
which
==
32
)
{
_e
.
keyCode
=
32
;
oThis
.
onKeyDown
(
_e
);
}
else
{
oThis
.
onKeyPress
(
_e
);
}
}
else
if
(
0
==
val
.
length
)
{
// пришла пустая. следом ждем "aa"
//window.IS_USE_INPUT = false;
var
_e
=
{
altKey
:
global_keyboardEvent
.
AltKey
,
ctrlKey
:
global_keyboardEvent
.
CtrlKey
,
shiftKey
:
global_keyboardEvent
.
ShiftKey
,
srcElement
:
global_keyboardEvent
.
Sender
,
charCode
:
global_keyboardEvent
.
CharCode
,
keyCode
:
global_keyboardEvent
.
KeyCode
,
which
:
8
};
_e
.
preventDefault
=
function
()
{
};
if
(
_e
.
which
==
8
)
{
_e
.
keyCode
=
8
;
oThis
.
onKeyDown
(
_e
);
}
}
else
{
var
_len
=
val
.
length
;
for
(
var
i
=
1
;
i
<
_len
;
i
++
)
{
var
_e
=
{
altKey
:
global_keyboardEvent
.
AltKey
,
ctrlKey
:
global_keyboardEvent
.
CtrlKey
,
shiftKey
:
global_keyboardEvent
.
ShiftKey
,
srcElement
:
global_keyboardEvent
.
Sender
,
charCode
:
global_keyboardEvent
.
CharCode
,
keyCode
:
global_keyboardEvent
.
KeyCode
,
which
:
val
.
charCodeAt
(
i
)
};
_e
.
preventDefault
=
function
()
{
};
if
(
_e
.
which
==
32
)
{
_e
.
keyCode
=
32
;
oThis
.
onKeyDown
(
_e
);
}
else
{
oThis
.
onKeyPress
(
_e
);
}
}
}
if
(
e
.
preventDefault
)
e
.
preventDefault
();
e
.
returnValue
=
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
)
...
@@ -3679,19 +3559,14 @@ function CEditorPage(api)
...
@@ -3679,19 +3559,14 @@ function CEditorPage(api)
window
[
"
AutoTester
"
][
"
RunTest
"
]();
window
[
"
AutoTester
"
][
"
RunTest
"
]();
}
}
if
(
!
this
.
m_oApi
.
isMobileVersion
)
if
(
true
)
{
{
AscCommon
.
InitBrowserInputContext
(
this
.
m_oApi
,
"
id_target_cursor
"
);
AscCommon
.
InitBrowserInputContext
(
this
.
m_oApi
,
"
id_target_cursor
"
);
if
(
AscCommon
.
g_inputContext
)
if
(
AscCommon
.
g_inputContext
)
AscCommon
.
g_inputContext
.
onResize
(
"
id_main_view
"
);
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
();
}
}
//this.m_oDrawingDocument.CheckFontCache();
//this.m_oDrawingDocument.CheckFontCache();
...
...
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