Now we can log in with AOL too
authorArt Cancro <ajc@uncensored.citadel.org>
Thu, 1 Dec 2011 20:24:35 +0000 (15:24 -0500)
committerArt Cancro <ajc@uncensored.citadel.org>
Thu, 1 Dec 2011 20:24:35 +0000 (15:24 -0500)
webcit/static/authmethods.js
webcit/static/t/get_logged_in.html

index 85e9626dbdc4e534219c4aed9bb8b37e3a3159db..ef800dd4ea668604975fcbea93f8e8878a128054 100644 (file)
@@ -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;
+}
+
+
index 95f49d2f9b34d572fe32a0619546b1dc6db2ce49..7b847228bf340c02c0d7207542e41b74b933a0d1 100644 (file)
         Yahoo
     </span></a>
 </li><??("X", 3)>
-<li class="ib_button">
-</li>
+<?!("COND:SERV:OPENID",4)><li class="ib_button" style='background-image: url("/static/webcit_icons/openid-32x32.gif");'>
+    <a class="ib_button_link" href="javascript:authtoggle('authbox_aol');" title="AOL"><span>
+        AOL/AIM
+    </span></a>
+</li><??("X", 4)>
 <li class="ib_button">
 </li>
 <li class="ib_button">
 <div class="logbuttons"><a href="javascript:ajax_try_yahoo();"><?_("Log in")></a></div>
 </div>
 
+<div class="authbox" id="authbox_aol" style="display: none">
+<h2><?_("Log in using AOL or AIM")></h2>
+<form id="ajax_aol_form" method="POST" action="ajax_login_aol">
+<?_("Enter your AOL or AIM screen name:")>
+<input type="text" name="aol_screenname" id="aol_screenname" class="openid_urlarea" onKeyPress="return aol_onkeypress(event);">
+</form>
+<div class="logbuttons"><a href="javascript:ajax_try_aol();"><?_("Log in")></a></div>
+</div>
+
 </div>
 </body>
 </html>