Ignore:
Timestamp:
Jan 25, 2013, 12:26:05 PM (11 years ago)
Author:
mistic100
Message:

fix OpenID

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/oAuth/template/identification_common.tpl

    r20337 r20369  
    1 {html_head}{literal}
    2 <style type="text/css">
     1{html_style}{literal}
    32  #openid_form {
    43    padding:20px;
     
    1312    font-weight:bold;
    1413  }
    15 </style>
    16 {/literal}{/html_head}
     14{/literal}{/html_style}
    1715
    1816{combine_script id='jquery.colorbox' load='footer' require='jquery' path='themes/default/js/plugins/jquery.colorbox.min.js'}
    1917{combine_css path="themes/default/js/plugins/colorbox/style2/colorbox.css"}
    2018
    21 {footer_script}
     19{footer_script}{literal}
    2220// redirect, called from the popup
    23 function redirect(type) {ldelim}
     21function redirect(type) {
     22{/literal}
    2423  url = "{$REDIRECT_TO}";
    2524  if (typeof type != 'undefined' && type != 'default') {ldelim}
    2625    url = "{$ABS_ROOT_URL}"+ type +".php";
    2726  }
     27{literal}
    2828  window.location.href = url;
    2929}
    3030
    3131// open authentication popup
    32 function open_auth(url) {ldelim}
     32function open_auth(url) {
    3333  window.open(
    3434    url+ "&t=" + (new Date()).getTime(),
     
    3939
    4040// click on a button
    41 $("a.oauth").click(function() {ldelim}
     41$("a.oauth").click(function() {
    4242  var idp = $(this).attr('title');
    4343 
    44   switch(idp) {ldelim}
     44  switch(idp) {
    4545    case 'OpenID': case 'Wordpress': case 'Flickr':
    46       switch(idp) {ldelim}
     46      switch(idp) {
     47{/literal}
    4748        case 'OpenID':
    4849          $("#openid_label").html('{'Please enter your OpenID URL'|@translate|escape:javascript}'); break;
     
    5051          $("#openid_label").html('{'Please enter your username'|@translate|escape:javascript}'); break;
    5152      }
    52  
     53     
    5354      $("#openid_form").css('background-color', $("#the_page #content").css('background-color'));
    5455      $("#openid_form img").attr('src', '{$ROOT_URL}{$OAUTH_PATH}template/icons/38px/'+ idp.toLowerCase() +'.png');
    5556      $("#openid_form h3").html(idp);
    5657      $("#openid_form").data('idp', idp);
    57      
    58       $.colorbox({ldelim}
     58{literal} 
     59      $.colorbox({
    5960        inline:true,
    6061        href:"#openid_form",
    6162        initialWidth:0,
    62         initialHeight:0
     63        initialHeight:0,
     64        onComplete:function(){ $.colorbox.resize({speed:0}) } // prevent misalignement when icon not loaded
    6365      })
    6466      break;
    6567     
    6668    default:
     69{/literal}
    6770      open_auth("{$OAUTH_URL}"+ idp);
     71{literal}
    6872  }
    6973 
     
    7175});
    7276
    73 $("#openid_form").submit(function() {ldelim}
     77$("#openid_form").submit(function() {
    7478  var idp = $(this).data('idp');
    7579  var oi = $("#openid_form input[name='openid_identifier']").val();
     
    7781 
    7882  $("#openid_label").removeClass('error');
    79   if (!oi) {ldelim}
     83  if (!oi) {
    8084    $("#openid_label").addClass('error');
    8185    return false;
    8286  }
    8387 
    84   switch(idp) {ldelim}
     88  switch(idp) {
    8589    case 'Wordpress': oi = "http://" + oi + ".wordpress.com"; break;
    8690    case 'Flickr': oi = "http://www.flickr.com/photos/" + oi + "/"; break;
    8791  }
    88  
     92{/literal} 
    8993  open_auth("{$OAUTH_URL}OpenID&openid_identifier="+ encodeURI(oi));
     94{literal}
    9095  $.colorbox.close();
    9196  return false;
    9297});
    9398
    94 $("#openid_cancel").click(function() {ldelim}
     99$("#openid_cancel").click(function() {
    95100  $("#openid_label").removeClass('error');
    96101  $.colorbox.close();
    97102  return false;
    98103});
    99 {/footer_script}
     104{/literal}{/footer_script}
    100105
    101106<div style="display:none;">
    102107  <form id="openid_form" action="">
    103108    <div>
    104       <img src="{$ROOT_URL}{$OAUTH_PATH}template/icons/openid_big.png">
     109      <img src="{$ROOT_URL}{$OAUTH_PATH}template/icons/openid_big.png" style="width:38px:height:38px;">
    105110      <h3>OpendID</h3>
    106111    </div>
Note: See TracChangeset for help on using the changeset viewer.