1
1
var WebGLInput = {
2
2
$instances : [ ] ,
3
3
WebGLInputInit : function ( ) {
4
- // use WebAssembly.Table : makeDynCall
5
- // when enable. dynCall is undefined
6
- if ( typeof dynCall === "undefined" )
7
- {
8
- // make Runtime.dynCall to undefined
9
- Runtime = { dynCall : undefined }
10
- }
11
- else
12
- {
13
- // Remove the `Runtime` object from "v1.37.27: 12/24/2017"
14
- // if Runtime not defined. create and add functon!!
15
- if ( typeof Runtime === "undefined" ) Runtime = { dynCall : dynCall }
16
- }
17
4
} ,
18
5
WebGLInputCreate : function ( canvasId , x , y , width , height , fontsize , text , placeholder , isMultiLine , isPassword , isHidden , isMobile ) {
19
6
@@ -112,7 +99,7 @@ var WebGLInput = {
112
99
input . setSelectionRange ( start + 1 , start + 1 ) ;
113
100
input . oninput ( ) ; // call oninput to exe ValueChange function!!
114
101
} else {
115
- ( ! ! Runtime . dynCall ) ? Runtime . dynCall ( "vii" , cb , [ id , e . shiftKey ? - 1 : 1 ] ) : { { { makeDynCall ( "vii" , "cb" ) } } } ( id , e . shiftKey ? - 1 : 1 ) ;
102
+ { { { makeDynCall ( "vii" , "cb" ) } } } ( id , e . shiftKey ? - 1 : 1 ) ;
116
103
}
117
104
}
118
105
} ) ;
@@ -124,13 +111,13 @@ var WebGLInput = {
124
111
WebGLInputOnFocus : function ( id , cb ) {
125
112
var input = instances [ id ] ;
126
113
input . onfocus = function ( ) {
127
- ( ! ! Runtime . dynCall ) ? Runtime . dynCall ( "vi" , cb , [ id ] ) : { { { makeDynCall ( "vi" , "cb" ) } } } ( id ) ;
114
+ { { { makeDynCall ( "vi" , "cb" ) } } } ( id ) ;
128
115
} ;
129
116
} ,
130
117
WebGLInputOnBlur : function ( id , cb ) {
131
118
var input = instances [ id ] ;
132
119
input . onblur = function ( ) {
133
- ( ! ! Runtime . dynCall ) ? Runtime . dynCall ( "vi" , cb , [ id ] ) : { { { makeDynCall ( "vi" , "cb" ) } } } ( id ) ;
120
+ { { { makeDynCall ( "vi" , "cb" ) } } } ( id ) ;
134
121
} ;
135
122
} ,
136
123
WebGLInputIsFocus : function ( id ) {
@@ -143,7 +130,7 @@ var WebGLInput = {
143
130
var bufferSize = lengthBytesUTF8 ( returnStr ) + 1 ;
144
131
var buffer = _malloc ( bufferSize ) ;
145
132
stringToUTF8 ( returnStr , buffer , bufferSize ) ;
146
- ( ! ! Runtime . dynCall ) ? Runtime . dynCall ( "vii" , cb , [ id , buffer ] ) : { { { makeDynCall ( "vii" , "cb" ) } } } ( id , buffer ) ;
133
+ { { { makeDynCall ( "vii" , "cb" ) } } } ( id , buffer ) ;
147
134
} ;
148
135
} ,
149
136
WebGLInputOnEditEnd :function ( id , cb ) {
@@ -153,7 +140,7 @@ var WebGLInput = {
153
140
var bufferSize = lengthBytesUTF8 ( returnStr ) + 1 ;
154
141
var buffer = _malloc ( bufferSize ) ;
155
142
stringToUTF8 ( returnStr , buffer , bufferSize ) ;
156
- ( ! ! Runtime . dynCall ) ? Runtime . dynCall ( "vii" , cb , [ id , buffer ] ) : { { { makeDynCall ( "vii" , "cb" ) } } } ( id , buffer ) ;
143
+ { { { makeDynCall ( "vii" , "cb" ) } } } ( id , buffer ) ;
157
144
} ;
158
145
} ,
159
146
WebGLInputOnKeyboardEvent :function ( id , cb ) {
@@ -167,7 +154,7 @@ var WebGLInput = {
167
154
var shift = e . shiftKey ? 1 : 0 ;
168
155
var ctrl = e . ctrlKey ? 1 : 0 ;
169
156
var alt = e . altKey ? 1 : 0 ;
170
- ( ! ! Runtime . dynCall ) ? Runtime . dynCall ( "viiiiiii" , cb , [ id , mode , key , code , shift , ctrl , alt ] ) : { { { makeDynCall ( "viiiiiii" , "cb" ) } } } ( id , mode , key , code , shift , ctrl , alt ) ;
157
+ { { { makeDynCall ( "viiiiiii" , "cb" ) } } } ( id , mode , key , code , shift , ctrl , alt ) ;
171
158
}
172
159
}
173
160
input . addEventListener ( 'keydown' , function ( e ) { func ( 1 , e ) ; } ) ;
0 commit comments