From f761d3d44a41dd9313924cd418bec4cde39efc1a Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 1 Dec 2011 15:24:35 -0500 Subject: [PATCH] Now we can log in with AOL too --- webcit/static/authmethods.js | 34 +++++++++++++++++++++++++++++- webcit/static/t/get_logged_in.html | 16 ++++++++++++-- 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/webcit/static/authmethods.js b/webcit/static/authmethods.js index 85e9626db..ef800dd4e 100644 --- a/webcit/static/authmethods.js +++ b/webcit/static/authmethods.js @@ -60,6 +60,7 @@ function authtoggle(show_which_div) { $('authbox_openid').style.display = 'none'; $('authbox_google').style.display = 'none'; $('authbox_yahoo').style.display = 'none'; + $('authbox_aol').style.display = 'none'; $(show_which_div).style.display = 'block'; } @@ -199,7 +200,7 @@ function ajax_try_google() { /****************** GOOGLE ***********************/ /* - * Attempt login with Google, called from modal dialog + * Attempt login with Yahoo, called from modal dialog */ function ajax_try_yahoo() { $('login_errmsg').innerHTML = ""; @@ -208,3 +209,34 @@ function ajax_try_yahoo() { } +/****************** AOL ***********************/ + +/* + * Attempt login with AOL, called from modal dialog + */ +function ajax_try_aol() { + $('login_errmsg').innerHTML = ""; + openid_url = encodeURI($('ajax_aol_form').elements["aol_screenname"].value); + do_auth_popout("openid_login?openid_url=http://openid.aol.com/" + openid_url); +} + + +/* + * The user pressed a key while in the AOL login box. + * Is it the enter/return key? Submit the form. + */ +function aol_onkeypress(e) { + if (window.event) { /* IE */ + keynum = e.keyCode; + } + else if (e.which) { /* real browsers */ + keynum = e.which; + } + if (keynum == 13) { /* enter/return key */ + ajax_try_aol(); + return false; + } + return true; +} + + diff --git a/webcit/static/t/get_logged_in.html b/webcit/static/t/get_logged_in.html index 95f49d2f9..7b847228b 100644 --- a/webcit/static/t/get_logged_in.html +++ b/webcit/static/t/get_logged_in.html @@ -35,8 +35,11 @@ Yahoo -
  • -
  • +
  • + + AOL/AIM + +
  • @@ -93,6 +96,15 @@
    + + -- 2.30.2