source: extensions/oAuth/template/identification_common.tpl @ 24142

Last change on this file since 24142 was 24142, checked in by mistic100, 7 years ago

fix lightbow conflict

File size: 3.6 KB
Line 
1{combine_css path=$OAUTH_PATH|cat:'template/oauth_sprites.css'}
2
3{html_style}{literal}
4  #openid_form {
5    padding:20px;
6  }
7  #openid_form h3, #openid_form .oauth_38px {
8    display:inline-block;
9    vertical-align:middle;
10    margin:0;
11  }
12  #openid_label.error {
13    color:red;
14    font-weight:bold;
15  }
16{/literal}{/html_style}
17
18{if not isset($OAUTH_NO_LIGHTBOX)}
19{combine_script id='jquery.colorbox' load='footer' require='jquery' path='themes/default/js/plugins/jquery.colorbox.min.js'}
20{combine_css path="themes/default/js/plugins/colorbox/style2/colorbox.css"}
21{/if}
22
23{footer_script}{literal}
24// redirect, called from the popup
25function redirect(type) {
26{/literal}
27  url = "{$REDIRECT_TO}";
28  if (typeof type != 'undefined' && type != 'default') {ldelim}
29    url = "{$ABS_ROOT_URL}"+ type +".php";
30  }
31{literal}
32  window.location.href = url;
33}
34
35// open authentication popup
36function open_auth(url) {
37  window.open(
38    url+ "&t=" + (new Date()).getTime(),
39    "hybridauth_social_sing_on",
40    "location=0,status=0,scrollbars=0,width=800,height=500"
41  ); 
42}
43
44// click on a button
45jQuery("a.oauth").click(function() {
46  var idp = jQuery(this).data('idp');
47 
48  switch(idp) {
49    case 'OpenID': case 'Wordpress': case 'Flickr': case 'Steam':
50      switch(idp) {
51{/literal}
52        case 'OpenID':
53          jQuery("#openid_label").html('{'Please enter your OpenID URL'|@translate|escape:javascript}'); break;
54        case 'Wordpress': case 'Flickr': case 'Steam':
55          jQuery("#openid_label").html('{'Please enter your username'|@translate|escape:javascript}'); break;
56      }
57     
58      jQuery("#openid_form").css('background-color', $("#the_page #content").css('background-color'));
59      jQuery("#openid_form .oauth_38px").removeClass().addClass("oauth_38px " + idp.toLowerCase());
60      jQuery("#openid_form h3").html(idp);
61      jQuery("#openid_form").data('idp', idp);
62{literal} 
63      jQuery.colorbox({
64        inline:true,
65        href:"#openid_form",
66        initialWidth:0,
67        initialHeight:0,
68        onComplete:function(){ jQuery.colorbox.resize({speed:0}) } // prevent misalignement when icon not loaded
69      })
70      break;
71     
72    default:
73{/literal}
74      open_auth("{$OAUTH_URL}"+ idp);
75{literal}
76  }
77 
78  return false;
79});
80
81jQuery("#openid_form").submit(function() {
82  var idp = jQuery(this).data('idp');
83  var oi = jQuery("#openid_form input[name='openid_identifier']").val();
84  jQuery("#openid_form input[name='openid_identifier']").val('');
85 
86  jQuery("#openid_label").removeClass('error');
87  if (!oi) {
88    jQuery("#openid_label").addClass('error');
89    return false;
90  }
91 
92  switch(idp) {
93    case 'Wordpress': oi = "http://" + oi + ".wordpress.com"; break;
94    case 'Flickr': oi = "http://www.flickr.com/photos/" + oi + "/"; break;
95    case 'Steam': oi = "http://steamcommunity.com/openid/" + oi; break;
96  }
97{/literal} 
98  open_auth("{$OAUTH_URL}OpenID&openid_identifier="+ encodeURI(oi));
99{literal}
100  jQuery.colorbox.close();
101  return false;
102});
103
104jQuery("#openid_cancel").click(function() {
105  jQuery("#openid_label").removeClass('error');
106  jQuery.colorbox.close();
107  return false;
108});
109{/literal}{/footer_script}
110
111<div style="display:none;">
112  <form id="openid_form" action="">
113    <div>
114      <span class="oauth_38px"></span>
115      <h3>OpendID</h3>
116    </div>
117    <div>
118      <br>
119      <label id="openid_label" for="openid_identifier">Open ID URL</label>
120      <br>
121      <input type="text" name="openid_identifier" id="openid_identifier" size="50">
122    </div>
123    <div>
124      <br>
125      <input type="submit" name="{'Submit'|@translate}">
126      <a href="#" id="openid_cancel">{'Cancel'|@translate}</a>
127    </div>
128  </form>
129</div>
Note: See TracBrowser for help on using the repository browser.