Changeset 20369 for extensions/oAuth/template/identification_common.tpl
- Timestamp:
- Jan 25, 2013, 12:26:05 PM (11 years ago)
- 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} 3 2 #openid_form { 4 3 padding:20px; … … 13 12 font-weight:bold; 14 13 } 15 </style> 16 {/literal}{/html_head} 14 {/literal}{/html_style} 17 15 18 16 {combine_script id='jquery.colorbox' load='footer' require='jquery' path='themes/default/js/plugins/jquery.colorbox.min.js'} 19 17 {combine_css path="themes/default/js/plugins/colorbox/style2/colorbox.css"} 20 18 21 {footer_script} 19 {footer_script}{literal} 22 20 // redirect, called from the popup 23 function redirect(type) {ldelim} 21 function redirect(type) { 22 {/literal} 24 23 url = "{$REDIRECT_TO}"; 25 24 if (typeof type != 'undefined' && type != 'default') {ldelim} 26 25 url = "{$ABS_ROOT_URL}"+ type +".php"; 27 26 } 27 {literal} 28 28 window.location.href = url; 29 29 } 30 30 31 31 // open authentication popup 32 function open_auth(url) { ldelim}32 function open_auth(url) { 33 33 window.open( 34 34 url+ "&t=" + (new Date()).getTime(), … … 39 39 40 40 // click on a button 41 $("a.oauth").click(function() { ldelim}41 $("a.oauth").click(function() { 42 42 var idp = $(this).attr('title'); 43 43 44 switch(idp) { ldelim}44 switch(idp) { 45 45 case 'OpenID': case 'Wordpress': case 'Flickr': 46 switch(idp) {ldelim} 46 switch(idp) { 47 {/literal} 47 48 case 'OpenID': 48 49 $("#openid_label").html('{'Please enter your OpenID URL'|@translate|escape:javascript}'); break; … … 50 51 $("#openid_label").html('{'Please enter your username'|@translate|escape:javascript}'); break; 51 52 } 52 53 53 54 $("#openid_form").css('background-color', $("#the_page #content").css('background-color')); 54 55 $("#openid_form img").attr('src', '{$ROOT_URL}{$OAUTH_PATH}template/icons/38px/'+ idp.toLowerCase() +'.png'); 55 56 $("#openid_form h3").html(idp); 56 57 $("#openid_form").data('idp', idp); 57 58 $.colorbox({ ldelim}58 {literal} 59 $.colorbox({ 59 60 inline:true, 60 61 href:"#openid_form", 61 62 initialWidth:0, 62 initialHeight:0 63 initialHeight:0, 64 onComplete:function(){ $.colorbox.resize({speed:0}) } // prevent misalignement when icon not loaded 63 65 }) 64 66 break; 65 67 66 68 default: 69 {/literal} 67 70 open_auth("{$OAUTH_URL}"+ idp); 71 {literal} 68 72 } 69 73 … … 71 75 }); 72 76 73 $("#openid_form").submit(function() { ldelim}77 $("#openid_form").submit(function() { 74 78 var idp = $(this).data('idp'); 75 79 var oi = $("#openid_form input[name='openid_identifier']").val(); … … 77 81 78 82 $("#openid_label").removeClass('error'); 79 if (!oi) { ldelim}83 if (!oi) { 80 84 $("#openid_label").addClass('error'); 81 85 return false; 82 86 } 83 87 84 switch(idp) { ldelim}88 switch(idp) { 85 89 case 'Wordpress': oi = "http://" + oi + ".wordpress.com"; break; 86 90 case 'Flickr': oi = "http://www.flickr.com/photos/" + oi + "/"; break; 87 91 } 88 92 {/literal} 89 93 open_auth("{$OAUTH_URL}OpenID&openid_identifier="+ encodeURI(oi)); 94 {literal} 90 95 $.colorbox.close(); 91 96 return false; 92 97 }); 93 98 94 $("#openid_cancel").click(function() { ldelim}99 $("#openid_cancel").click(function() { 95 100 $("#openid_label").removeClass('error'); 96 101 $.colorbox.close(); 97 102 return false; 98 103 }); 99 {/ footer_script}104 {/literal}{/footer_script} 100 105 101 106 <div style="display:none;"> 102 107 <form id="openid_form" action=""> 103 108 <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;"> 105 110 <h3>OpendID</h3> 106 111 </div>
Note: See TracChangeset
for help on using the changeset viewer.