forked from ionic-team/ionic-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinput.html
More file actions
503 lines (407 loc) · 15.3 KB
/
input.html
File metadata and controls
503 lines (407 loc) · 15.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
<!DOCTYPE html>
<html ng-app="navTest">
<head>
<meta charset="utf-8">
<title>Inputs</title>
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width, height=device-height">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<link rel="stylesheet" href="../../dist/css/ionic.css">
<style>
input,
textarea {
background: #ddd !important;
}
input[type=text],
textarea {
background: orange !important;
}
input[type=text]:focus,
textarea:focus {
background: yellow !important;
}
input[type=text].cloned-text-input,
textarea.cloned-text-input {
background: red !important;
}
header .item {
background: lightblue !important;
}
body {
background: purple;
}
.pane {
background: black;
}
.scroll-content {
background: pink;
overflow: hidden !important;
}
.scroll {
background: lightgreen;
}
.keyboard-open .scroll-content{
background: green;
}
input,
textarea {
border: 1px solid blue !important;
}
</style>
</head>
<body ng-controller="AppCtrl">
<div id="logs" style="position:fixed; top:0; left:0; z-index:9999; background: #eee; font-size:8px; line-height:10px; display:block; "></div>
<ion-nav-view></ion-nav-view>
<script id="input1.html" type="text/ng-template">
<ion-view id="view">
<ion-header-bar>
<div class="buttons">
</div>
<h1 class="title">Input Tests</h1>
<div class="buttons">
<a class="button" href="#/input2">Page 2</a>
</div>
</ion-header-bar>
<ion-content class="padding">
<form ng-submit="formSubmit()">
<div class="list">
<label class="item item-input item-stacked-label">
<span class="input-label">Email</span>
<textarea>
Line 1
Line 2
Line 3
Line 4
Line 5
</textarea>
</label>
<label class="item item-input">
<span class="input-label">Your Name</span>
<input type="text" value="name input" id="name">
</label>
<div class="item item-checkbox">
<span class="input-label">Remember me</span>
<label class="checkbox">
<input type="checkbox" id="remember-me">
</label>
</div>
<label class="item item-input">
<span class="input-label">From 1</span>
<input type="text" value="from input" id="from1">
</label>
<label class="item item-input">
<span class="input-label">To 1</span>
<input type="text" value="to input" id="to1">
</label>
<label class="item item-input item-stacked-label">
<span class="input-label">Comment 1</span>
<textarea id="textarea" id="comment1">comment textarea</textarea>
</label>
<label class="item item-input">
<span class="input-label">From 2</span>
<input type="text" value="" id="from2">
</label>
<label class="item item-input">
<span class="input-label">To 2</span>
<input type="text" value="" id="to2">
</label>
<label class="item item-input item-stacked-label">
<span class="input-label">Comment 2</span>
<textarea id="textarea" id="comment2"></textarea>
</label>
<label class="item item-input">
<span class="input-label">From 3</span>
<input type="text" value="">
</label>
<label class="item item-input">
<span class="input-label">To 3</span>
<input type="text" value="">
</label>
<label class="item item-input item-stacked-label">
<span class="input-label">Comment 3</span>
<textarea id="textarea"></textarea>
</label>
<label class="item item-input">
<span class="input-label">From 4</span>
<input type="text" value="">
</label>
<label class="item item-input">
<span class="input-label">To 4</span>
<input type="text" value="">
</label>
<label class="item item-input item-stacked-label">
<span class="input-label">Comment 4</span>
<textarea id="textarea"></textarea>
</label>
<label class="item item-input">
<span class="input-label">From 5</span>
<input type="text" value="">
</label>
<label class="item item-input">
<span class="input-label">To 5</span>
<input type="text" value="">
</label>
<label class="item item-input item-stacked-label">
<span class="input-label">Comment 5</span>
<textarea id="textarea"></textarea>
</label>
<button type="button" class="button button-block button-energized" ng-click="openModal()">
Open Modal
</button>
<button type="submit" class="button button-block button-calm">
Submit!
</button>
</div>
</form>
<p>
<a href="clickTests.html">Click Tests</a> -
<a href="tapInputs.html">Tap Inputs</a> -
<a href="/test/">CSS Tests</a>
</p>
</ion-content>
</ion-view>
</script>
<script id="input2.html" type="text/ng-template">
<ion-view id="view">
<ion-header-bar>
<label class="item item-input">
<span class="input-label">Header</span>
<input type="text" value="header input">
</label>
</ion-header-bar>
<ion-content class="padding">
<form ng-submit="formSubmit()">
<div class="list">
<label class="item item-input item-stacked-label">
<span class="input-label">Email</span>
<textarea>
Line 1
Line 2
Line 3
Line 4
Line 5
</textarea>
</label>
<label class="item item-input">
<span class="input-label">Your Name</span>
<input type="text" value="name input" id="name">
</label>
<div class="item item-checkbox">
<span class="input-label">Remember me</span>
<label class="checkbox">
<input type="checkbox" id="remember-me">
</label>
</div>
<label class="item item-input">
<span class="input-label">From 1</span>
<input type="text" value="from input" id="from1">
</label>
<label class="item item-input">
<span class="input-label">To 1</span>
<input type="text" value="to input" id="to1">
</label>
<label class="item item-input item-stacked-label">
<span class="input-label">Comment 1</span>
<textarea id="textarea" id="comment1">comment textarea</textarea>
</label>
<label class="item item-input">
<span class="input-label">From 2</span>
<input type="text" value="" id="from2">
</label>
<label class="item item-input">
<span class="input-label">To 2</span>
<input type="text" value="" id="to2">
</label>
<label class="item item-input item-stacked-label">
<span class="input-label">Comment 2</span>
<textarea id="textarea" id="comment2"></textarea>
</label>
<label class="item item-input">
<span class="input-label">From 3</span>
<input type="text" value="">
</label>
<label class="item item-input">
<span class="input-label">To 3</span>
<input type="text" value="">
</label>
<label class="item item-input item-stacked-label">
<span class="input-label">Comment 3</span>
<textarea id="textarea"></textarea>
</label>
<label class="item item-input">
<span class="input-label">From 4</span>
<input type="text" value="">
</label>
<label class="item item-input">
<span class="input-label">To 4</span>
<input type="text" value="">
</label>
<label class="item item-input item-stacked-label">
<span class="input-label">Comment 4</span>
<textarea id="textarea"></textarea>
</label>
<label class="item item-input">
<span class="input-label">From 5</span>
<input type="text" value="">
</label>
<label class="item item-input">
<span class="input-label">To 5</span>
<input type="text" value="">
</label>
<label class="item item-input item-stacked-label">
<span class="input-label">Comment 5</span>
<textarea id="textarea"></textarea>
</label>
<button type="button" class="button button-block button-energized" ng-click="openModal()">
Open Modal
</button>
<button type="submit" class="button button-block button-calm">
Submit!
</button>
</div>
</form>
<p>
<a href="clickTests.html">Click Tests</a> -
<a href="tapInputs.html">Tap Inputs</a> -
<a href="/test/">CSS Tests</a>
</p>
</ion-content>
</ion-view>
</script>
<script id="modal.html" type="text/ng-template">
<div class="modal" ng-controller="ModalCtrl">
<header class="bar bar-header bar-positive">
<h1 class="title">New Contact</h1>
<button class="button button-clear button-primary" ng-click="closeModal()" ion-stop-event="click">Cancel</button>
</header>
<ion-content class='has-header'>
<div class="padding">
<div class="list">
<label class="item item-input">
<span class="input-label">First Name</span>
<input type="text" placeholder="">
</label>
<label class="item item-input">
<span class="input-label">Last Name</span>
<input type="text" placeholder="">
</label>
<label class="item item-input">
<span class="input-label">Email</span>
<input type="text" placeholder="">
</label>
<button class="button button-full button-positive" ng-click="closeModal()">Create</button>
</div>
</div>
</ion-content>
</div>
</script>
<script src="../../../../dist/js/ionic.bundle.js"></script>
<script>
var msgs = [];
var timerId;
document.addEventListener('touchstart', function(e){
console.log('touchstart');
});
document.addEventListener('touchstart', function(e){
console.log('touchend');
});
document.addEventListener('mousedown', function(e){
console.log('mousedown');
});
document.addEventListener('mouseup', function(e){
console.log('mouseup');
});
document.addEventListener('MSPointerDown', function(e){
console.log('MSPointerDown');
});
document.addEventListener('MSPointerUp', function(e){
console.log('MSPointerUp');
});
document.addEventListener('click', function(event){
console.log('click', 'clientX: ' + event.clientX, 'clientY: ' + event.clientY);
});
function getTime() {
var d = new Date();
return d.getSeconds() + '.' + d.getMilliseconds();
}
angular.module('navTest', ['ionic'])
.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('input1', {
url: "/input1",
templateUrl: "input1.html"
})
.state('input2', {
url: "/input2",
templateUrl: "input2.html"
});
$urlRouterProvider.otherwise("/input1");
})
.controller('AppCtrl', function($scope, $ionicModal) {
$scope.openModal = function() {
$scope.modal.show();
};
$ionicModal.fromTemplateUrl('modal.html', function(modal) {
$scope.modal = modal;
}, {
animation: 'slide-in-up',
focusFirstInput: true
});
$scope.formSubmit = function(){
alert('SUBMIT!');
};
})
.controller('ModalCtrl', function($scope) {
$scope.closeModal = function() {
$scope.modal.hide();
}
});
var msgs = [];
var index = 0;
var timeId;
var consoleDebug = console.log;
var consoleError = console.log;
function getTime() {
var d = new Date();
return d.getMilliseconds();
}
console.error = function() {
consoleError.apply(this, arguments);
var args = ['ERROR!'];
for (var i = 0, j = arguments.length; i < j; i++){
args.push(arguments[i]);
}
console.log.apply(this, args);
};
console.log = function() {
index++;
var msg = [];
msg.push(index);
for (var i = 0, j = arguments.length; i < j; i++){
msg.push(arguments[i]);
}
//msg.push(getTime());
msg = msg.join(', ');
if(arguments[0] === 'ERROR!') msg = '<span style="color:red;font-weight:bold">' + msg + '</span>';
if(arguments[0] === 'touchstart') msg = '<span style="color:pink">' + msg + '</span>';
if(arguments[0] === 'touchend') msg = '<span style="color:red">' + msg + '</span>';
if(arguments[0] === 'mousedown') msg = '<span style="color:lightblue">' + msg + '</span>';
if(arguments[0] === 'mouseup') msg = '<span style="color:blue">' + msg + '</span>';
if(arguments[0] === 'focusin') msg = '<span style="color:orange">' + msg + '</span>';
if(arguments[0] === 'focusout') msg = '<span style="color:orangered">' + msg + '</span>';
if(arguments[0] === 'click') msg = '<span style="color:green;font-weight:bold">' + msg + '</span>';
if(arguments[0] === 'clickPrevent') msg = '<span style="color:gray;">' + msg + '</span>';
msgs.unshift( msg );
if(msgs.length > 30) {
msgs.splice(40);
}
// do this so we try not to interfere with the device performance
clearTimeout(timeId);
timeId = setTimeout(function(){
document.getElementById('logs').innerHTML = msgs.join('<br>');
}, 150);
consoleDebug.apply(this, arguments);
}
</script>
</body>
</html>