<table id="login_openid_buttons">
<tr>
- <td><%= link_to_function(image_tag("openid.png", :alt => t("user.login.openid_providers.openid.title")), "showOpenidUrl()", :title => t("user.login.openid_providers.openid.title")) %></td>
+ <td><%= link_to image_tag("openid.png", :alt => t("user.login.openid_providers.openid.title")), "#", :id => "openid_open_url", :title => t("user.login.openid_providers.openid.title") %></td>
<td><%= openid_button "google", "gmail.com" %></td>
<td><%= openid_button "yahoo", "me.yahoo.com" %></td>
<td><%= openid_button "myopenid", "myopenid.com" %></td>
</div>
<script type="text/javascript">
-function showOpenidUrl() {
- $("#openid_url").val("http://");
- $("#login_openid_buttons").hide();
- $("#login_openid_url").show();
- $("#login_openid_submit").show();
-}
+$(document).ready(function() {
+ $("#openid_open_url").click(function() {
+ $("#openid_url").val("http://");
+ $("#login_openid_buttons").hide();
+ $("#login_openid_url").show();
+ $("#login_openid_submit").show();
+ });
-function submitOpenidUrl(url) {
- $("#openid_url").val(url);
- $("#login_form").submit();
-}
+ $(".openid_button").click(function() {
+ $("#openid_url").val($(this).attr("data-url"));
+ $("#login_form").submit();
+ });
-$("#login_openid_url").hide();
-$("#login_openid_submit").hide();
+ $("#login_openid_url").hide();
+ $("#login_openid_submit").hide();
+});
</script>