File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 ( ) {
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 ">
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 >
You can’t perform that action at this time.
0 commit comments