Skip to content

Commit 0d57b0c

Browse files
author
Hovhannes Babayan
committed
fixed login.html
1 parent a969fe5 commit 0d57b0c

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

examples/browser/login.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
<title>Login example</title>
66
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css"/>
77

8+
<!-- The script below is not needed if your browser supports ES6 promises -->
89
<script src="https://www.promisejs.org/polyfills/promise-6.0.0.min.js"></script>
10+
911
<script src="/dist/attask.js"></script>
1012
<script>
1113
function doLogin() {
@@ -14,17 +16,16 @@
1416
var username = document.getElementById('username').value;
1517
var password = document.getElementById('password').value;
1618

17-
var instance = window.AtTask.ApiFactory.getInstance({hostname: host, version: '5.0', port: port});
19+
var instance = new window.AtTask.Api({hostname: host, version: '5.0', port: port});
1820
instance.login(username, password).then(function(data){
1921
console.log(data)
2022
}, console.error);
21-
return false;
2223
}
2324
</script>
2425
</head>
2526
<body>
2627
<div class="container">
27-
<form onsubmit="return doLogin()" action="">
28+
<div>
2829
<div class="form-group">
2930
<label for="hostname">Hostname</label>
3031
<input type="text" class="form-control" id="hostname" value="localhost" placeholder="Hostname to use for connection to AtTask">
@@ -43,8 +44,8 @@
4344
<input type="text" class="form-control" id="password" value="user" placeholder="Your AtTask password">
4445
</div>
4546

46-
<button type="submit" class="btn btn-default">Login</button>
47-
</form>
47+
<button type="submit" class="btn btn-default" onclick="doLogin()">Login</button>
48+
</div>
4849
</div>
4950
</body>
5051
</html>

0 commit comments

Comments
 (0)