Support Google and Yahoo login without the user needing to know that OpenID is in...
authorArt Cancro <ajc@uncensored.citadel.org>
Thu, 1 Dec 2011 20:16:24 +0000 (15:16 -0500)
committerArt Cancro <ajc@uncensored.citadel.org>
Thu, 1 Dec 2011 20:16:24 +0000 (15:16 -0500)
webcit/static/authmethods.js
webcit/static/t/get_logged_in.html

index 3362a5185b5ed256d9846fd77a06859c5f3565c3..85e9626dbdc4e534219c4aed9bb8b37e3a3159db 100644 (file)
@@ -58,6 +58,8 @@ function authtoggle(show_which_div) {
        $('authbox_userpass').style.display = 'none';
        $('authbox_newuser').style.display = 'none';
        $('authbox_openid').style.display = 'none';
+       $('authbox_google').style.display = 'none';
+       $('authbox_yahoo').style.display = 'none';
        $(show_which_div).style.display = 'block';
 }
 
@@ -182,3 +184,27 @@ function openid_onkeypress(e) {
 }
 
 
+/****************** GOOGLE ***********************/
+
+/*
+ * Attempt login with Google, called from modal dialog
+ */
+function ajax_try_google() {
+       $('login_errmsg').innerHTML = "";
+       openid_url = encodeURI("https://www.google.com/accounts/o8/id");
+       do_auth_popout("openid_login?openid_url=" + openid_url);
+}
+
+
+/****************** GOOGLE ***********************/
+
+/*
+ * Attempt login with Google, called from modal dialog
+ */
+function ajax_try_yahoo() {
+       $('login_errmsg').innerHTML = "";
+       openid_url = encodeURI("http://yahoo.com");
+       do_auth_popout("openid_login?openid_url=" + openid_url);
+}
+
+
index c2e7b89eda3b1fb5854512975f7d43b823d1704f..95f49d2f9b34d572fe32a0619546b1dc6db2ce49 100644 (file)
     <a class="ib_button_link" href="javascript:authtoggle('authbox_openid');" title="OpenID"><span>
         OpenID
     </span></a>
+
 </li><??("X", 1)>
-<??("COND:SERV:OPENID",2)>
-<li class="ib_button">
-</li>
+<?!("COND:SERV:OPENID",2)><li class="ib_button" style='background-image: url("/static/webcit_icons/openid-32x32.gif");'>
+    <a class="ib_button_link" href="javascript:authtoggle('authbox_google');" title="Google"><span>
+        Google
+    </span></a>
 </li><??("X", 2)>
-<li class="ib_button">
-</li>
+<?!("COND:SERV:OPENID",3)><li class="ib_button" style='background-image: url("/static/webcit_icons/openid-32x32.gif");'>
+    <a class="ib_button_link" href="javascript:authtoggle('authbox_yahoo');" title="Yahoo"><span>
+        Yahoo
+    </span></a>
+</li><??("X", 3)>
 <li class="ib_button">
 </li>
 <li class="ib_button">
 <div class="logbuttons"><a href="javascript:ajax_try_openid();"><?_("Log in")></a></div>
 </div>
 
+<div class="authbox" id="authbox_google" style="display: none">
+<h2><?_("Log in using Google")></h2>
+<div class="logbuttons"><a href="javascript:ajax_try_google();"><?_("Log in")></a></div>
+</div>
+
+<div class="authbox" id="authbox_yahoo" style="display: none">
+<h2><?_("Log in using Yahoo")></h2>
+<div class="logbuttons"><a href="javascript:ajax_try_yahoo();"><?_("Log in")></a></div>
+</div>
+
 </div>
 </body>
 </html>