Files
ionic-framework/js/ext/angular/test/input.html

160 lines
4.8 KiB
HTML

<html ng-app="navTest">
<head>
<meta charset="utf-8">
<title>Checkbox</title>
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<link rel="stylesheet" href="../../../../dist/css/ionic.css">
<style>
.dot {
position: absolute;
width: 3px;
height: 3px;
background-color: red;
z-index: 1000;
pointer-events: none;
}
</style>
</head>
<body ng-controller="AppCtrl">
<ion-view id="view">
<header>
<label class="item item-input">
<span class="input-label">Header</span>
<input type="text" value="header input">
</label>
</header>
<ion-content class="has-header" padding="true" overflow-scroll="false">
<div class="list">
<label class="item item-input">
<span class="input-label">Your Name</span>
<input type="text" value="name input">
</label>
<div class="item item-checkbox">
<span class="input-label">Remember me</span>
<label class="checkbox">
<input type="checkbox">
</label>
</div>
</div>
<label class="item item-input">
<span class="input-label">From</span>
<input type="text" value="from input">
</label>
<label class="item item-input">
<span class="input-label">To</span>
<input type="text" value="to input">
</label>
<label class="item item-input item-stacked-label">
<span class="input-label">Comment</span>
<textarea id="textarea">comment textarea</textarea>
</label>
<button class="button button-block button-energized" ng-click="openModal()">
Open Modal
</button>
<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 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;
console.debug = function() {
var msg = [];
for (var i = 0, j = arguments.length; i < j; i++){
msg.push(arguments[i]);
}
msg.push(getTime());
msgs.push(msg.join(', '));
clearTimeout(timerId);
timerId = setTimeout(function(){
document.getElementById('view').style.display = 'none';
document.writeln(msgs.join('<br>'));
console.debug = function(){};
}, 2000);
};
document.addEventListener('touchstart', function(e){
console.debug('touchstart');
});
document.addEventListener('touchstart', function(e){
console.debug('touchend');
});
document.addEventListener('click', function(event){
console.debug('click', 'clientX: ' + event.clientX, 'clientY: ' + event.clientY);
});
function getTime() {
var d = new Date();
return d.getSeconds() + '.' + d.getMilliseconds();
}
angular.module('navTest', ['ionic'])
.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
});
})
.controller('ModalCtrl', function($scope) {
$scope.closeModal = function() {
$scope.modal.hide();
}
});
</script>
</body>
</html>