Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/twofactor_totp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2016-06-06 23:35:27 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2016-06-06 23:43:16 +0300
commit2af718fd5400f389a930c9782bfd27f8b1ff6aaa (patch)
tree14353620e57129717fb25ceaf10c73e4ccd1e5ab /js
parentf17c4dbc97815e4827b07dd22fc942730dbf7df3 (diff)
use integrated QR code generator
fixes #4
Diffstat (limited to 'js')
-rw-r--r--js/settingsview.js22
1 files changed, 13 insertions, 9 deletions
diff --git a/js/settingsview.js b/js/settingsview.js
index 7da1397..ce3fda5 100644
--- a/js/settingsview.js
+++ b/js/settingsview.js
@@ -7,14 +7,17 @@
OC.Settings.TwoFactorTotp = OC.Settings.TwoFactorTotp || {};
var TEMPLATE = '<div>'
- + '<input type="checkbox" class="checkbox" id="totp-enabled">'
- + '<label for="totp-enabled">Enable TOTP</label>'
+ + ' <input type="checkbox" class="checkbox" id="totp-enabled">'
+ + ' <label for="totp-enabled">' + t('twofactor_totp', 'Enable TOTP') + '</label>'
+ '</div>'
- + '{{#if qr}}'
+ + '{{#if secret}}'
+ + '<div>'
+ + ' <span>' + t('twofactor_totp', 'This is your new TOTP secret:') + ' {{secret}}</span>'
+ + '</div>'
+ '<div>'
- + '<a href="{{qr}}" target="_blank">Scan QR code with your TOTP app</a><br>'
- + '<img src="{{qr}}>'
- + '</div>'
+ + ' <span>' + t('twofactor_totp', 'Scan this QR code with your TOTP app') + '<span><br>'
+ + ' <img src="{{qr}}">'
+ + ' </div>'
+ '{{/if}}';
var View = Backbone.View.extend({
@@ -68,7 +71,7 @@
var _this = this;
$.when(updating).done(function(data) {
_this._enabled = data.enabled;
- _this._showQr(data.qr);
+ _this._showQr(data);
_this.$('#totp-enabled').attr('checked', data.enabled);
});
$.when(updating).always(function () {
@@ -77,9 +80,10 @@
this._enabled = enabled;
}
},
- _showQr: function(qr) {
+ _showQr: function(data) {
this.render({
- qr: qr
+ secret: data.secret,
+ qr: data.qr
});
}
});