Changeset 26604 for extensions/oAuth/template
- Timestamp:
- Jan 10, 2014, 9:51:32 PM (11 years ago)
- Location:
- extensions/oAuth/template
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/oAuth/template/auth.tpl
r26556 r26604 30 30 {elseif $REDIRECT_TO} 31 31 <script type="text/javascript"> 32 if (window.opener) window.opener.parent. redirect('{$REDIRECT_TO}');32 if (window.opener) window.opener.parent.oauth_redirect('{$REDIRECT_TO}'); 33 33 window.self.close(); 34 34 </script> -
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"> -
extensions/oAuth/template/identification_menubar.tpl
r26556 r26604 1 {if $id == "mbIdentification" and isset($U_LOGIN) and count($PROVIDERS)} 2 {if not $OAUTH_JS_LOADED} 3 {assign var=OAUTH_JS_LOADED value=true} 4 {include file=$OAUTH_ABS_PATH|cat:'template/identification_common.tpl'} 5 {/if} 1 {if $id == "mbIdentification" and isset($U_LOGIN)} 6 2 {html_style} 7 dl#mbIdentification dd:first-of-type { padding-bottom:0 !important;8 3 dl#mbIdentification dd:first-of-type { padding-bottom:0 !important; } 4 #mbIdentification .oauth { margin:0 1px; } 9 5 {/html_style} 10 6 … … 14 10 <legend>{'Or sign in with'|translate}</legend> 15 11 16 {foreach from=$PROVIDERS item=provider key=p}{strip} 17 <a href="#" class="oauth oauth_{$oauth.menubar_icon} {$p|strtolower}" data-idp="{$p}" title="{$provider.name}"></a> 12 {foreach from=$OAUTH.providers item=provider key=p}{strip} 13 {if $provider.enabled} 14 <a href="#" class="oauth oauth_{$OAUTH.conf.menubar_icon} {$p|strtolower}" data-idp="{$p}" title="{$provider.name}"></a> 15 {/if} 18 16 {/strip}{/foreach} 19 17 </fieldset> -
extensions/oAuth/template/identification_page.tpl
r26556 r26604 1 {if count($PROVIDERS)} 2 {if not $OAUTH_JS_LOADED} 3 {assign var=OAUTH_JS_LOADED value=true} 4 {include file=$OAUTH_ABS_PATH|cat:'template/identification_common.tpl'} 1 {html_style} 2 #oauth_wrap .oauth { margin:0 2px; } 3 {/html_style} 4 5 <fieldset style="text-align:center;" id="oauth_wrap"> 6 <legend>{'Or sign in with'|translate}</legend> 7 8 {foreach from=$OAUTH.providers item=provider key=p}{strip} 9 {if $provider.enabled} 10 <a href="#" class="oauth oauth_{$OAUTH.conf.identification_icon} {$p|strtolower}" data-idp="{$p}" title="{$provider.name}"></a> 5 11 {/if} 6 {html_style} 7 #oauth_wrap .oauth { margin:0 2px; } 8 {/html_style} 9 10 <fieldset style="text-align:center;" id="oauth_wrap"> 11 <legend>{'Or sign in with'|translate}</legend> 12 13 {foreach from=$PROVIDERS item=provider key=p}{strip} 14 <a href="#" class="oauth oauth_{$oauth.identification_icon} {$p|strtolower}" data-idp="{$p}" title="{$provider.name}"></a> 15 {/strip}{/foreach} 16 </fieldset> 17 {/if} 12 {/strip}{/foreach} 13 </fieldset> -
extensions/oAuth/template/profile.tpl
r26556 r26604 19 19 20 20 <div id="oauth"> 21 {if $OAUTH_ AVATAR}22 <img src="{$OAUTH_ AVATAR}" class="avatar">21 {if $OAUTH_USER.avatar} 22 <img src="{$OAUTH_USER.avatar}" class="avatar"> 23 23 {else} 24 24 <img src="{$ROOT_URL}{$OAUTH_PATH}template/images/avatar-default.png" class="avatar"> 25 25 {/if} 26 26 27 {'Logged with'|translate} : <b>{$OAUTH_ PROVIDER}</b><br>28 <b>{'Username'|translate}</b> : {$OAUTH_USER NAME}<br>29 {if $OAUTH_ PROFILE_URL}<b>{'Profile URL'|translate}</b> : <a href="{$OAUTH_PROFILE_URL}">{$OAUTH_PROFILE_URL|truncate:40:' ... ':true:true}</a>{/if}27 {'Logged with'|translate} : <b>{$OAUTH_USER.provider}</b><br> 28 <b>{'Username'|translate}</b> : {$OAUTH_USER.username}<br> 29 {if $OAUTH_USER.u_profile}<b>{'Profile URL'|translate}</b> : <a href="{$OAUTH_USER.u_profile}">{$OAUTH_USER.u_profile|truncate:40:' ... ':true:true}</a>{/if} 30 30 </div>
Note: See TracChangeset
for help on using the changeset viewer.