mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 22:35:55 +00:00
prefs: more of the same, really
This commit is contained in:
@@ -37,7 +37,7 @@ class Pref_System extends Handler_Protected {
|
|||||||
LIMIT 100");
|
LIMIT 100");
|
||||||
|
|
||||||
print "<button dojoType=\"dijit.form.Button\"
|
print "<button dojoType=\"dijit.form.Button\"
|
||||||
onclick=\"updateSystemList()\">".__('Refresh')."</button> ";
|
onclick=\"Prefs.updateEventLog()\">".__('Refresh')."</button> ";
|
||||||
|
|
||||||
print " <button dojoType=\"dijit.form.Button\"
|
print " <button dojoType=\"dijit.form.Button\"
|
||||||
class=\"btn-danger\" onclick=\"Prefs.clearEventLog()\">".__('Clear')."</button> ";
|
class=\"btn-danger\" onclick=\"Prefs.clearEventLog()\">".__('Clear')."</button> ";
|
||||||
|
|||||||
@@ -86,11 +86,21 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
|
|||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
},
|
},
|
||||||
|
reload: function() {
|
||||||
|
const user_search = $("filter_search");
|
||||||
|
let search = "";
|
||||||
|
if (user_search) { search = user_search.value; }
|
||||||
|
|
||||||
|
xhrPost("backend.php", { op: "pref-filters", search: search }, (transport) => {
|
||||||
|
dijit.byId('filterConfigTab').attr('content', transport.responseText);
|
||||||
|
notify("");
|
||||||
|
});
|
||||||
|
},
|
||||||
resetFilterOrder: function() {
|
resetFilterOrder: function() {
|
||||||
notify_progress("Loading, please wait...");
|
notify_progress("Loading, please wait...");
|
||||||
|
|
||||||
xhrPost("backend.php", {op: "pref-filters", method: "filtersortreset"}, () => {
|
xhrPost("backend.php", {op: "pref-filters", method: "filtersortreset"}, () => {
|
||||||
updateFilterList();
|
this.reload();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
joinSelectedFilters: function() {
|
joinSelectedFilters: function() {
|
||||||
@@ -105,7 +115,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
|
|||||||
notify_progress("Joining filters...");
|
notify_progress("Joining filters...");
|
||||||
|
|
||||||
xhrPost("backend.php", {op: "pref-filters", method: "join", ids: rows.toString()}, () => {
|
xhrPost("backend.php", {op: "pref-filters", method: "join", ids: rows.toString()}, () => {
|
||||||
updateFilterList();
|
this.reload();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -187,7 +197,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
|
|||||||
const query = {op: "pref-filters", method: "remove", ids: this.attr('value').id};
|
const query = {op: "pref-filters", method: "remove", ids: this.attr('value').id};
|
||||||
|
|
||||||
xhrPost("backend.php", query, () => {
|
xhrPost("backend.php", query, () => {
|
||||||
updateFilterList();
|
dijit.byId("filterTree").reload();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -214,7 +224,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
|
|||||||
|
|
||||||
xhrPost("backend.php", dojo.formToObject("filter_edit_form"), () => {
|
xhrPost("backend.php", dojo.formToObject("filter_edit_form"), () => {
|
||||||
dialog.hide();
|
dialog.hide();
|
||||||
updateFilterList();
|
dijit.byId("filterTree").reload();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -236,7 +246,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
|
|||||||
};
|
};
|
||||||
|
|
||||||
xhrPost("backend.php", query, () => {
|
xhrPost("backend.php", query, () => {
|
||||||
updateFilterList();
|
this.reload();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -48,6 +48,12 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f
|
|||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
},
|
},
|
||||||
|
reload: function() {
|
||||||
|
xhrPost("backend.php", { op: "pref-labels" }, (transport) => {
|
||||||
|
dijit.byId('labelConfigTab').attr('content', transport.responseText);
|
||||||
|
notify("");
|
||||||
|
});
|
||||||
|
},
|
||||||
editLabel: function(id) {
|
editLabel: function(id) {
|
||||||
const query = "backend.php?op=pref-labels&method=edit&id=" +
|
const query = "backend.php?op=pref-labels&method=edit&id=" +
|
||||||
param_escape(id);
|
param_escape(id);
|
||||||
@@ -87,7 +93,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f
|
|||||||
};
|
};
|
||||||
|
|
||||||
xhrPost("backend.php", query, () => {
|
xhrPost("backend.php", query, () => {
|
||||||
updateFilterList(); // maybe there's labels in there
|
dijit.byId("filterTree").reload(); // maybe there's labels in there
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -102,7 +108,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f
|
|||||||
this.hide();
|
this.hide();
|
||||||
|
|
||||||
xhrPost("backend.php", this.attr('value'), () => {
|
xhrPost("backend.php", this.attr('value'), () => {
|
||||||
updateFilterList(); // maybe there's labels in there
|
dijit.byId("filterTree").reload(); // maybe there's labels in there
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -123,7 +129,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f
|
|||||||
};
|
};
|
||||||
|
|
||||||
xhrPost("backend.php", query, () => {
|
xhrPost("backend.php", query, () => {
|
||||||
updateLabelList();
|
this.reload();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,7 +150,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f
|
|||||||
};
|
};
|
||||||
|
|
||||||
xhrPost("backend.php", query, () => {
|
xhrPost("backend.php", query, () => {
|
||||||
updateLabelList();
|
this.reload();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -739,7 +739,7 @@ const CommonDialogs = {
|
|||||||
if (callback) {
|
if (callback) {
|
||||||
callback(transport);
|
callback(transport);
|
||||||
} else if (App.isPrefs()) {
|
} else if (App.isPrefs()) {
|
||||||
updateLabelList();
|
dijit.byId("labelTree").reload();
|
||||||
} else {
|
} else {
|
||||||
Feeds.reload();
|
Feeds.reload();
|
||||||
}
|
}
|
||||||
@@ -1442,7 +1442,7 @@ const Filters = {
|
|||||||
|
|
||||||
xhrPost("backend.php", query, () => {
|
xhrPost("backend.php", query, () => {
|
||||||
if (App.isPrefs()) {
|
if (App.isPrefs()) {
|
||||||
updateFilterList();
|
dijit.byId("filterTree").reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
dialog.hide();
|
dialog.hide();
|
||||||
|
|||||||
36
js/prefs.js
36
js/prefs.js
@@ -131,6 +131,7 @@ const App = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// noinspection JSUnusedGlobalSymbols
|
||||||
const Prefs = {
|
const Prefs = {
|
||||||
clearFeedAccessKeys: function() {
|
clearFeedAccessKeys: function() {
|
||||||
if (confirm(__("This will invalidate all previously generated feed URLs. Continue?"))) {
|
if (confirm(__("This will invalidate all previously generated feed URLs. Continue?"))) {
|
||||||
@@ -143,13 +144,19 @@ const Prefs = {
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
updateEventLog: function() {
|
||||||
|
xhrPost("backend.php", { op: "pref-system" }, (transport) => {
|
||||||
|
dijit.byId('systemConfigTab').attr('content', transport.responseText);
|
||||||
|
notify("");
|
||||||
|
});
|
||||||
|
},
|
||||||
clearEventLog: function() {
|
clearEventLog: function() {
|
||||||
if (confirm(__("Clear event log?"))) {
|
if (confirm(__("Clear event log?"))) {
|
||||||
|
|
||||||
notify_progress("Loading, please wait...");
|
notify_progress("Loading, please wait...");
|
||||||
|
|
||||||
xhrPost("backend.php", {op: "pref-system", method: "clearLog"}, () => {
|
xhrPost("backend.php", {op: "pref-system", method: "clearLog"}, () => {
|
||||||
updateSystemList();
|
this.updateEventLog();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -160,6 +167,7 @@ const Prefs = {
|
|||||||
|
|
||||||
const query = "backend.php?op=pref-prefs&method=editPrefProfiles";
|
const query = "backend.php?op=pref-prefs&method=editPrefProfiles";
|
||||||
|
|
||||||
|
// noinspection JSUnusedGlobalSymbols
|
||||||
const dialog = new dijit.Dialog({
|
const dialog = new dijit.Dialog({
|
||||||
id: "profileEditDlg",
|
id: "profileEditDlg",
|
||||||
title: __("Settings Profiles"),
|
title: __("Settings Profiles"),
|
||||||
@@ -275,6 +283,7 @@ const Prefs = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// noinspection JSUnusedGlobalSymbols
|
||||||
const Users = {
|
const Users = {
|
||||||
reload: function(sort) {
|
reload: function(sort) {
|
||||||
const user_search = $("user_search");
|
const user_search = $("user_search");
|
||||||
@@ -434,31 +443,6 @@ function opmlImport() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateFilterList() {
|
|
||||||
const user_search = $("filter_search");
|
|
||||||
let search = "";
|
|
||||||
if (user_search) { search = user_search.value; }
|
|
||||||
|
|
||||||
xhrPost("backend.php", { op: "pref-filters", search: search }, (transport) => {
|
|
||||||
dijit.byId('filterConfigTab').attr('content', transport.responseText);
|
|
||||||
notify("");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateLabelList() {
|
|
||||||
xhrPost("backend.php", { op: "pref-labels" }, (transport) => {
|
|
||||||
dijit.byId('labelConfigTab').attr('content', transport.responseText);
|
|
||||||
notify("");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateSystemList() {
|
|
||||||
xhrPost("backend.php", { op: "pref-system" }, (transport) => {
|
|
||||||
dijit.byId('systemConfigTab').attr('content', transport.responseText);
|
|
||||||
notify("");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function opmlRegenKey() {
|
function opmlRegenKey() {
|
||||||
if (confirm(__("Replace current OPML publishing address with a new one?"))) {
|
if (confirm(__("Replace current OPML publishing address with a new one?"))) {
|
||||||
notify_progress("Trying to change address...", true);
|
notify_progress("Trying to change address...", true);
|
||||||
|
|||||||
Reference in New Issue
Block a user