summaryrefslogtreecommitdiffstats
path: root/extensions/BrowserID/template/en/default
diff options
context:
space:
mode:
authorGervase Markham <gerv@mozilla.com>2012-04-04 19:00:01 +0200
committerDave Lawrence <dlawrence@mozilla.com>2012-04-04 19:00:01 +0200
commit49495810ea07c10504c894fbf979568af7363f14 (patch)
tree442153a76948d89d139ce544e2b92ae07868e2f9 /extensions/BrowserID/template/en/default
parentab94d342547caaf0335a54d843a5251ba23fedae (diff)
downloadbugzilla-49495810ea07c10504c894fbf979568af7363f14.tar.gz
bugzilla-49495810ea07c10504c894fbf979568af7363f14.tar.xz
Bug 672841 - Make BMO support BrowserID
r=dkl
Diffstat (limited to 'extensions/BrowserID/template/en/default')
-rw-r--r--extensions/BrowserID/template/en/default/hook/account/auth/login-additional_methods.html.tmpl23
-rw-r--r--extensions/BrowserID/template/en/default/hook/account/auth/login-small-additional_methods.html.tmpl20
2 files changed, 43 insertions, 0 deletions
diff --git a/extensions/BrowserID/template/en/default/hook/account/auth/login-additional_methods.html.tmpl b/extensions/BrowserID/template/en/default/hook/account/auth/login-additional_methods.html.tmpl
new file mode 100644
index 000000000..4d8d8d3f0
--- /dev/null
+++ b/extensions/BrowserID/template/en/default/hook/account/auth/login-additional_methods.html.tmpl
@@ -0,0 +1,23 @@
+[% IF Param('user_info_class').split(',').contains('BrowserID') %]
+<script src="https://browserid.org/include.js" type="text/javascript"></script>
+
+<script type="text/javascript">
+function browserid_sign_in() {
+ navigator.id.getVerifiedEmail(function(assertion) {
+ if (assertion) {
+ // This code will be invoked once the user has successfully
+ // selected an email address they control to sign in with.
+ window.location.href = "[% target FILTER none %]index.cgi?browserid_assertion=" + assertion;
+ } else {
+ // something went wrong! the user isn't logged in.
+ alert("Oh no! Something went wrong...");
+ }
+ });
+}
+</script>
+
+<p>
+Or, you could login using BrowserID:
+<img src="extensions/BrowserID/web/sign_in_orange.png" onclick="browserid_sign_in()">
+</p>
+[% END %] \ No newline at end of file
diff --git a/extensions/BrowserID/template/en/default/hook/account/auth/login-small-additional_methods.html.tmpl b/extensions/BrowserID/template/en/default/hook/account/auth/login-small-additional_methods.html.tmpl
new file mode 100644
index 000000000..12bff015b
--- /dev/null
+++ b/extensions/BrowserID/template/en/default/hook/account/auth/login-small-additional_methods.html.tmpl
@@ -0,0 +1,20 @@
+[% IF Param('user_info_class').split(',').contains('BrowserID') %]
+<script src="https://browserid.org/include.js" type="text/javascript"></script>
+
+<script type="text/javascript">
+function browserid_sign_in() {
+ navigator.id.getVerifiedEmail(function(assertion) {
+ if (assertion) {
+ // This code will be invoked once the user has successfully
+ // selected an email address they control to sign in with.
+ window.location.href = "[% login_target FILTER none %]?browserid_assertion=" + assertion;
+ } else {
+ // something went wrong! the user isn't logged in.
+ alert("Oh no! Something went wrong...");
+ }
+ });
+}
+</script>
+
+<img src="extensions/BrowserID/web/sign_in_orange.png" onclick="browserid_sign_in()" style="margin-bottom: -8px"> or
+[% END %] \ No newline at end of file