Changeset 26604 for extensions/oAuth/template/identification_common.tpl
- Timestamp:
- Jan 10, 2014, 9:51:32 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/oAuth/template/identification_common.tpl
r26556 r26604 12 12 {footer_script} 13 13 // redirect, called from the popup 14 function redirect(type) {15 var url = "{$REDIRECT_TO}";16 if (type of type != 'undefined'&& type != 'default') {17 url = "{$ABS_ROOT_URL}"+ type +".php";14 function oauth_redirect(type) { 15 var url = '{$OAUTH.u_redirect}'; 16 if (type && type != 'default') { 17 url = '{$ABS_ROOT_URL}'+ type +'.php'; 18 18 } 19 19 … … 24 24 function open_auth(url) { 25 25 window.open( 26 url + "&t="+ (new Date()).getTime(),27 "hybridauth_social_sing_on",28 "location=0,status=0,scrollbars=0,width=800,height=500"26 url + '&t=' + (new Date()).getTime(), 27 'hybridauth_social_sign_on', 28 'location=0,status=0,scrollbars=0,width=800,height=500' 29 29 ); 30 30 } 31 31 32 32 // click on a button 33 jQuery("a.oauth").click(function() { 33 jQuery('a.oauth').click(function(e) { 34 e.preventDefault(); 35 34 36 var idp = jQuery(this).data('idp'); 35 37 … … 38 40 switch(idp) { 39 41 case 'OpenID': 40 jQuery( "#openid_label").html('{'Please enter your OpenID URL'|translate|escape:javascript}'); break;42 jQuery('#openid_label').html('{'Please enter your OpenID URL'|translate|escape:javascript}'); break; 41 43 case 'Wordpress': case 'Flickr': case 'Steam': 42 jQuery( "#openid_label").html('{'Please enter your username'|translate|escape:javascript}'); break;44 jQuery('#openid_label').html('{'Please enter your username'|translate|escape:javascript}'); break; 43 45 } 44 46 … … 47 49 bg_color = $('body').css('background-color'); 48 50 } 49 jQuery( "#openid_form").css('background-color', bg_color);51 jQuery('#openid_form').css('background-color', bg_color); 50 52 51 jQuery( "#openid_form .oauth_38px").removeClass().addClass("oauth_38px "+ idp.toLowerCase());52 jQuery( "#openid_form h3").html(idp);53 jQuery( "#openid_form").data('idp', idp);53 jQuery('#openid_form .oauth_38px').removeClass().addClass('oauth_38px ' + idp.toLowerCase()); 54 jQuery('#openid_form h3').html(idp); 55 jQuery('#openid_form').data('idp', idp); 54 56 55 57 jQuery.colorbox({ 56 inline:true, 57 href:"#openid_form", 58 initialWidth:0, 59 initialHeight:0, 58 inline: true, 59 href: '#openid_form', 60 initialWidth: 0, 61 initialHeight: 0, 62 mawWidth: '100%', 60 63 onComplete: function(){ jQuery.colorbox.resize({ speed:0 }) } // prevent misalignement when icon not loaded 61 }) 64 }); 62 65 break; 63 66 64 67 default: 65 open_auth( "{$OAUTH_URL}"+ idp);68 open_auth('{$OAUTH.u_login}'+ idp); 66 69 } 67 68 return false;69 70 }); 70 71 71 jQuery("#openid_form").submit(function() { 72 jQuery('#openid_form').submit(function(e) { 73 e.preventDefault(); 74 72 75 var idp = jQuery(this).data('idp'); 73 var oi = jQuery( "#openid_form input[name='openid_identifier']").val();74 jQuery( "#openid_form input[name='openid_identifier']").val('');76 var oi = jQuery('#openid_form input[name=openid_identifier]').val(); 77 jQuery('#openid_form input[name=openid_identifier]').val(''); 75 78 76 jQuery( "#openid_label").removeClass('error');79 jQuery('#openid_label').removeClass('error'); 77 80 if (!oi) { 78 jQuery( "#openid_label").addClass('error');79 return false;81 jQuery('#openid_label').addClass('error'); 82 return; 80 83 } 81 84 82 85 switch(idp) { 83 case 'Wordpress': oi = "http://" + oi + ".wordpress.com"; break;84 case 'Flickr': oi = "http://www.flickr.com/photos/" + oi + "/"; break;85 case 'Steam': oi = "http://steamcommunity.com/openid/"+ oi; break;86 case 'Wordpress': oi = 'http://' + oi + '.wordpress.com'; break; 87 case 'Flickr': oi = 'http://www.flickr.com/photos/' + oi + '/'; break; 88 case 'Steam': oi = 'http://steamcommunity.com/openid/' + oi; break; 86 89 } 87 90 88 open_auth( "{$OAUTH_URL}OpenID&openid_identifier="+ encodeURI(oi));91 open_auth('{$OAUTH.u_login}OpenID&openid_identifier=' + encodeURI(oi)); 89 92 90 93 jQuery.colorbox.close(); 91 return false;92 94 }); 93 95 94 jQuery("#openid_cancel").click(function() { 95 jQuery("#openid_label").removeClass('error'); 96 jQuery('#openid_cancel').click(function(e) { 97 e.preventDefault(); 98 99 jQuery('#openid_label').removeClass('error'); 96 100 jQuery.colorbox.close(); 97 return false;98 101 }); 99 102 {/footer_script} … … 107 110 <div> 108 111 <br> 109 <label id="openid_label" for="openid_identifier"> Open ID URL</label>112 <label id="openid_label" for="openid_identifier"></label> 110 113 <br> 111 114 <input type="text" name="openid_identifier" id="openid_identifier" size="50">
Note: See TracChangeset
for help on using the changeset viewer.