Skip to content

Instantly share code, notes, and snippets.

@jberthet
Forked from joegaudet/autofill_login.js
Last active December 11, 2015 22:18
Show Gist options
  • Select an option

  • Save jberthet/4668668 to your computer and use it in GitHub Desktop.

Select an option

Save jberthet/4668668 to your computer and use it in GitHub Desktop.
MyApp.MainPage.MainPain: SC.MainPane.create({
testView: SC.View.extend( {
render: function(ctx) {
ctx.push('<form id="login-test" action="http://www.logx.ch" method="POST">');
ctx.push('<input name="username" type="text" id="login-name" />');
ctx.push('<input name="password" type="password" id="login-passwd" />');
ctx.push('<input type="submit" />');
ctx.push('</form>');
}
}),
didCreateLayer: function(){
setTimeout(function(){AuthAo.loginController.setFieldsWithBrowserDefault()},3000);
}
});
AuthAo.loginController = SC.Controller.create({
setFieldsWithBrowserDefault: function() {
this.set('username', $('#login-name').val());
this.set('password', $('#login-passwd').val());
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment