summaryrefslogtreecommitdiff
path: root/js/PrefHelpers.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2019-11-01 15:03:57 +0300
committerAndrew Dolgov <[email protected]>2019-11-01 15:03:57 +0300
commit249130e58ddd20c5ad937f75e0e6cf3e4f6792a3 (patch)
tree8e896bc621989df3b8c1baae8078a7fb9371d6b2 /js/PrefHelpers.js
parentb158103f2f6a3295d00dc4a1344b8bc38bcb43a4 (diff)
implement app password checking / management UI
Diffstat (limited to 'js/PrefHelpers.js')
-rw-r--r--js/PrefHelpers.js38
1 files changed, 38 insertions, 0 deletions
diff --git a/js/PrefHelpers.js b/js/PrefHelpers.js
index a3d122029..6a62cb593 100644
--- a/js/PrefHelpers.js
+++ b/js/PrefHelpers.js
@@ -1,5 +1,43 @@
define(["dojo/_base/declare"], function (declare) {
Helpers = {
+ AppPasswords: {
+ getSelected: function() {
+ return Tables.getSelected("app-password-list");
+ },
+ updateContent: function(data) {
+ $("app_passwords_holder").innerHTML = data;
+ dojo.parser.parse("app_passwords_holder");
+ },
+ removeSelected: function() {
+ const rows = this.getSelected();
+
+ if (rows.length == 0) {
+ alert("No passwords selected.");
+ } else {
+ if (confirm(__("Remove selected app passwords?"))) {
+
+ xhrPost("backend.php", {op: "pref-prefs", method: "deleteAppPassword", ids: rows.toString()}, (transport) => {
+ this.updateContent(transport.responseText);
+ Notify.close();
+ });
+
+ Notify.progress("Loading, please wait...");
+ }
+ }
+ },
+ generate: function() {
+ const title = prompt("Password description:")
+
+ if (title) {
+ xhrPost("backend.php", {op: "pref-prefs", method: "generateAppPassword", title: title}, (transport) => {
+ this.updateContent(transport.responseText);
+ Notify.close();
+ });
+
+ Notify.progress("Loading, please wait...");
+ }
+ },
+ },
clearFeedAccessKeys: function() {
if (confirm(__("This will invalidate all previously generated feed URLs. Continue?"))) {
Notify.progress("Clearing URLs...");