aboutsummaryrefslogtreecommitdiff
path: root/p/scripts
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-08-01 18:10:46 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-08-01 18:10:46 +0200
commitc6fd65ef7639cd67487c831db10dd79e4510efa6 (patch)
tree2c825413c26df7d0c5394d01c2599003cab87c0b /p/scripts
parent93f7f849874dcdf1263370ff08c72a962f8de56f (diff)
parent17c3e616e8c3b927ee46258a8b8b20371bf59592 (diff)
Resolve git conflict
Diffstat (limited to 'p/scripts')
-rw-r--r--p/scripts/install.js8
-rw-r--r--p/scripts/persona.js76
2 files changed, 1 insertions, 83 deletions
diff --git a/p/scripts/install.js b/p/scripts/install.js
index 9a49e6031..57fc2450a 100644
--- a/p/scripts/install.js
+++ b/p/scripts/install.js
@@ -24,18 +24,12 @@ function auth_type_change() {
var auth_type = document.getElementById('auth_type');
if (auth_type) {
var auth_value = auth_type.value,
- password_input = document.getElementById('passwordPlain'),
- mail_input = document.getElementById('mail_login');
+ password_input = document.getElementById('passwordPlain');
if (auth_value === 'form') {
password_input.required = true;
- mail_input.required = false;
- } else if (auth_value === 'persona') {
- password_input.required = false;
- mail_input.required = true;
} else {
password_input.required = false;
- mail_input.required = false;
}
}
}
diff --git a/p/scripts/persona.js b/p/scripts/persona.js
deleted file mode 100644
index 63ab43795..000000000
--- a/p/scripts/persona.js
+++ /dev/null
@@ -1,76 +0,0 @@
-"use strict";
-
-function init_persona() {
- if (!(navigator.id && window.$ && window.url)) {
- if (window.console) {
- console.log('FreshRSS (Persona) waiting for JS…');
- }
- window.setTimeout(init_persona, 100);
- return;
- }
-
- $('a.signin').click(function() {
- navigator.id.request();
- return false;
- });
-
- $('a.signout').click(function() {
- navigator.id.logout();
- return false;
- });
-
- navigator.id.watch({
- loggedInUser: context['current_user_mail'],
-
- onlogin: function(assertion) {
- // A user has logged in! Here you need to:
- // 1. Send the assertion to your backend for verification and to create a session.
- // 2. Update your UI.
- $.ajax ({
- type: 'POST',
- url: url['login'],
- data: {assertion: assertion},
- success: function(res, status, xhr) {
- if (res.status === 'failure') {
- openNotification(res.reason, 'bad');
- } else if (res.status === 'okay') {
- location.href = url['index'];
- }
- },
- error: function(res, status, xhr) {
- // alert(res);
- }
- });
- },
- onlogout: function() {
- // A user has logged out! Here you need to:
- // Tear down the user's session by redirecting the user or making a call to your backend.
- // Also, make sure loggedInUser will get set to null on the next page load.
- // (That's a literal JavaScript null. Not false, 0, or undefined. null.)
- $.ajax ({
- type: 'POST',
- url: url['logout'],
- success: function(res, status, xhr) {
- location.href = url['index'];
- },
- error: function(res, status, xhr) {
- // alert(res);
- }
- });
- }
- });
-}
-
-if (document.readyState && document.readyState !== 'loading') {
- if (window.console) {
- console.log('FreshRSS (Persona) immediate init…');
- }
- init_persona();
-} else if (document.addEventListener) {
- document.addEventListener('DOMContentLoaded', function () {
- if (window.console) {
- console.log('FreshRSS (Persona) waiting for DOMContentLoaded…');
- }
- init_persona();
- }, false);
-}