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

Last change on this file since 20337 was 20337, checked in by mistic100, 11 years ago

fixed: cannot create initial config, update Tumblr adapter

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