mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 08:55:55 +00:00
prefs: move other tree-related functions to respective trees
This commit is contained in:
@@ -1255,7 +1255,7 @@ class Pref_Feeds extends Handler_Protected {
|
|||||||
<script type=\"dojo/method\" event=\"onLoad\" args=\"item\">
|
<script type=\"dojo/method\" event=\"onLoad\" args=\"item\">
|
||||||
Element.hide(\"feedlistLoading\");
|
Element.hide(\"feedlistLoading\");
|
||||||
|
|
||||||
checkInactiveFeeds();
|
dijit.byId('feedTree').checkInactiveFeeds();
|
||||||
</script>
|
</script>
|
||||||
</div>";
|
</div>";
|
||||||
|
|
||||||
|
|||||||
@@ -800,17 +800,17 @@ class Pref_Filters extends Handler_Protected {
|
|||||||
print "<button dojoType=\"dijit.form.Button\" onclick=\"return Filters.quickAddFilter()\">".
|
print "<button dojoType=\"dijit.form.Button\" onclick=\"return Filters.quickAddFilter()\">".
|
||||||
__('Create filter')."</button> ";
|
__('Create filter')."</button> ";
|
||||||
|
|
||||||
print "<button dojoType=\"dijit.form.Button\" onclick=\"return joinSelectedFilters()\">".
|
print "<button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('filterTree').joinSelectedFilters()\">".
|
||||||
__('Combine')."</button> ";
|
__('Combine')."</button> ";
|
||||||
|
|
||||||
print "<button dojoType=\"dijit.form.Button\" onclick=\"return editSelectedFilter()\">".
|
print "<button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('filterTree').editSelectedFilter()\">".
|
||||||
__('Edit')."</button> ";
|
__('Edit')."</button> ";
|
||||||
|
|
||||||
print "<button dojoType=\"dijit.form.Button\" onclick=\"return resetFilterOrder()\">".
|
print "<button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('filterTree').resetFilterOrder()\">".
|
||||||
__('Reset sort order')."</button> ";
|
__('Reset sort order')."</button> ";
|
||||||
|
|
||||||
|
|
||||||
print "<button dojoType=\"dijit.form.Button\" onclick=\"return removeSelectedFilters()\">".
|
print "<button dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('filterTree').removeSelectedFilters()\">".
|
||||||
__('Remove')."</button> ";
|
__('Remove')."</button> ";
|
||||||
|
|
||||||
print "</div>"; # toolbar
|
print "</div>"; # toolbar
|
||||||
@@ -840,7 +840,7 @@ class Pref_Filters extends Handler_Protected {
|
|||||||
var bare_id = id.substr(id.indexOf(':')+1);
|
var bare_id = id.substr(id.indexOf(':')+1);
|
||||||
|
|
||||||
if (id.match('FILTER:')) {
|
if (id.match('FILTER:')) {
|
||||||
editFilter(bare_id);
|
dijit.byId('filterTree').editFilter(bare_id);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -310,7 +310,7 @@ class Pref_Labels extends Handler_Protected {
|
|||||||
var bare_id = id.substr(id.indexOf(':')+1);
|
var bare_id = id.substr(id.indexOf(':')+1);
|
||||||
|
|
||||||
if (id.match('LABEL:')) {
|
if (id.match('LABEL:')) {
|
||||||
editLabel(bare_id);
|
dijit.byId('labelTree').editLabel(bare_id);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</div>";
|
</div>";
|
||||||
|
|||||||
@@ -436,7 +436,7 @@ class Pref_Prefs extends Handler_Protected {
|
|||||||
onComplete: function(transport) {
|
onComplete: function(transport) {
|
||||||
var msg = transport.responseText;
|
var msg = transport.responseText;
|
||||||
if (quit) {
|
if (quit) {
|
||||||
gotoMain();
|
document.location.href = 'index.php';
|
||||||
} else {
|
} else {
|
||||||
if (msg == 'PREFS_NEED_RELOAD') {
|
if (msg == 'PREFS_NEED_RELOAD') {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
|
|||||||
@@ -147,6 +147,13 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
checkInactiveFeeds: function() {
|
||||||
|
xhrPost("backend.php", {op: "pref-feeds", method: "getinactivefeeds"}, (transport) => {
|
||||||
|
if (parseInt(transport.responseText) > 0) {
|
||||||
|
Element.show(dijit.byId("pref_feeds_inactive_btn").domNode);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
getSelectedCategories: function() {
|
getSelectedCategories: function() {
|
||||||
const tree = this;
|
const tree = this;
|
||||||
const items = tree.model.getCheckedItems();
|
const items = tree.model.getCheckedItems();
|
||||||
|
|||||||
@@ -75,8 +75,180 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
|
|||||||
this.inherited(arguments);
|
this.inherited(arguments);
|
||||||
this.tree.model.store.save();
|
this.tree.model.store.save();
|
||||||
},
|
},
|
||||||
|
getSelectedFilters: function() {
|
||||||
|
const tree = this;
|
||||||
|
const items = tree.model.getCheckedItems();
|
||||||
|
const rv = [];
|
||||||
|
|
||||||
|
items.each(function (item) {
|
||||||
|
rv.push(tree.model.store.getValue(item, 'bare_id'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return rv;
|
||||||
|
},
|
||||||
|
resetFilterOrder: function() {
|
||||||
|
notify_progress("Loading, please wait...");
|
||||||
|
|
||||||
|
xhrPost("backend.php", {op: "pref-filters", method: "filtersortreset"}, () => {
|
||||||
|
updateFilterList();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
joinSelectedFilters: function() {
|
||||||
|
const rows = getSelectedFilters();
|
||||||
|
|
||||||
|
if (rows.length == 0) {
|
||||||
|
alert(__("No filters are selected."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (confirm(__("Combine selected filters?"))) {
|
||||||
|
notify_progress("Joining filters...");
|
||||||
|
|
||||||
|
xhrPost("backend.php", {op: "pref-filters", method: "join", ids: rows.toString()}, () => {
|
||||||
|
updateFilterList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
editSelectedFilter: function() {
|
||||||
|
const rows = this.getSelectedFilters();
|
||||||
|
|
||||||
|
if (rows.length == 0) {
|
||||||
|
alert(__("No filters are selected."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rows.length > 1) {
|
||||||
|
alert(__("Please select only one filter."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
notify("");
|
||||||
|
|
||||||
|
this.editFilter(rows[0]);
|
||||||
|
},
|
||||||
|
editFilter: function(id) {
|
||||||
|
|
||||||
|
const query = "backend.php?op=pref-filters&method=edit&id=" + param_escape(id);
|
||||||
|
|
||||||
|
if (dijit.byId("feedEditDlg"))
|
||||||
|
dijit.byId("feedEditDlg").destroyRecursive();
|
||||||
|
|
||||||
|
if (dijit.byId("filterEditDlg"))
|
||||||
|
dijit.byId("filterEditDlg").destroyRecursive();
|
||||||
|
|
||||||
|
const dialog = new dijit.Dialog({
|
||||||
|
id: "filterEditDlg",
|
||||||
|
title: __("Edit Filter"),
|
||||||
|
style: "width: 600px",
|
||||||
|
|
||||||
|
test: function () {
|
||||||
|
const query = "backend.php?" + dojo.formToQuery("filter_edit_form") + "&savemode=test";
|
||||||
|
|
||||||
|
Filters.editFilterTest(query);
|
||||||
|
},
|
||||||
|
selectRules: function (select) {
|
||||||
|
$$("#filterDlg_Matches input[type=checkbox]").each(function (e) {
|
||||||
|
e.checked = select;
|
||||||
|
if (select)
|
||||||
|
e.parentNode.addClassName("Selected");
|
||||||
|
else
|
||||||
|
e.parentNode.removeClassName("Selected");
|
||||||
|
});
|
||||||
|
},
|
||||||
|
selectActions: function (select) {
|
||||||
|
$$("#filterDlg_Actions input[type=checkbox]").each(function (e) {
|
||||||
|
e.checked = select;
|
||||||
|
|
||||||
|
if (select)
|
||||||
|
e.parentNode.addClassName("Selected");
|
||||||
|
else
|
||||||
|
e.parentNode.removeClassName("Selected");
|
||||||
|
|
||||||
|
});
|
||||||
|
},
|
||||||
|
editRule: function (e) {
|
||||||
|
const li = e.parentNode;
|
||||||
|
const rule = li.getElementsByTagName("INPUT")[1].value;
|
||||||
|
Filters.addFilterRule(li, rule);
|
||||||
|
},
|
||||||
|
editAction: function (e) {
|
||||||
|
const li = e.parentNode;
|
||||||
|
const action = li.getElementsByTagName("INPUT")[1].value;
|
||||||
|
Filters.addFilterAction(li, action);
|
||||||
|
},
|
||||||
|
removeFilter: function () {
|
||||||
|
const msg = __("Remove filter?");
|
||||||
|
|
||||||
|
if (confirm(msg)) {
|
||||||
|
this.hide();
|
||||||
|
|
||||||
|
notify_progress("Removing filter...");
|
||||||
|
|
||||||
|
const query = {op: "pref-filters", method: "remove", ids: this.attr('value').id};
|
||||||
|
|
||||||
|
xhrPost("backend.php", query, () => {
|
||||||
|
updateFilterList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
addAction: function () {
|
||||||
|
Filters.addFilterAction();
|
||||||
|
},
|
||||||
|
addRule: function () {
|
||||||
|
Filters.addFilterRule();
|
||||||
|
},
|
||||||
|
deleteAction: function () {
|
||||||
|
$$("#filterDlg_Actions li[class*=Selected]").each(function (e) {
|
||||||
|
e.parentNode.removeChild(e)
|
||||||
|
});
|
||||||
|
},
|
||||||
|
deleteRule: function () {
|
||||||
|
$$("#filterDlg_Matches li[class*=Selected]").each(function (e) {
|
||||||
|
e.parentNode.removeChild(e)
|
||||||
|
});
|
||||||
|
},
|
||||||
|
execute: function () {
|
||||||
|
if (this.validate()) {
|
||||||
|
|
||||||
|
notify_progress("Saving data...", true);
|
||||||
|
|
||||||
|
xhrPost("backend.php", dojo.formToObject("filter_edit_form"), () => {
|
||||||
|
dialog.hide();
|
||||||
|
updateFilterList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
href: query
|
||||||
|
});
|
||||||
|
|
||||||
|
dialog.show();
|
||||||
|
},
|
||||||
|
removeSelectedFilters: function() {
|
||||||
|
const sel_rows = this.getSelectedFilters();
|
||||||
|
|
||||||
|
if (sel_rows.length > 0) {
|
||||||
|
if (confirm(__("Remove selected filters?"))) {
|
||||||
|
notify_progress("Removing selected filters...");
|
||||||
|
|
||||||
|
const query = {
|
||||||
|
op: "pref-filters", method: "remove",
|
||||||
|
ids: sel_rows.toString()
|
||||||
|
};
|
||||||
|
|
||||||
|
xhrPost("backend.php", query, () => {
|
||||||
|
updateFilterList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
alert(__("No filters are selected."));
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,69 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f
|
|||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
},
|
},
|
||||||
|
editLabel: function(id) {
|
||||||
|
const query = "backend.php?op=pref-labels&method=edit&id=" +
|
||||||
|
param_escape(id);
|
||||||
|
|
||||||
|
if (dijit.byId("labelEditDlg"))
|
||||||
|
dijit.byId("labelEditDlg").destroyRecursive();
|
||||||
|
|
||||||
|
const dialog = new dijit.Dialog({
|
||||||
|
id: "labelEditDlg",
|
||||||
|
title: __("Label Editor"),
|
||||||
|
style: "width: 600px",
|
||||||
|
setLabelColor: function (id, fg, bg) {
|
||||||
|
|
||||||
|
let kind = '';
|
||||||
|
let color = '';
|
||||||
|
|
||||||
|
if (fg && bg) {
|
||||||
|
kind = 'both';
|
||||||
|
} else if (fg) {
|
||||||
|
kind = 'fg';
|
||||||
|
color = fg;
|
||||||
|
} else if (bg) {
|
||||||
|
kind = 'bg';
|
||||||
|
color = bg;
|
||||||
|
}
|
||||||
|
|
||||||
|
const e = $("LICID-" + id);
|
||||||
|
|
||||||
|
if (e) {
|
||||||
|
if (fg) e.style.color = fg;
|
||||||
|
if (bg) e.style.backgroundColor = bg;
|
||||||
|
}
|
||||||
|
|
||||||
|
const query = {
|
||||||
|
op: "pref-labels", method: "colorset", kind: kind,
|
||||||
|
ids: id, fg: fg, bg: bg, color: color
|
||||||
|
};
|
||||||
|
|
||||||
|
xhrPost("backend.php", query, () => {
|
||||||
|
updateFilterList(); // maybe there's labels in there
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
execute: function () {
|
||||||
|
if (this.validate()) {
|
||||||
|
const caption = this.attr('value').caption;
|
||||||
|
const fg_color = this.attr('value').fg_color;
|
||||||
|
const bg_color = this.attr('value').bg_color;
|
||||||
|
|
||||||
|
dijit.byId('labelTree').setNameById(id, caption);
|
||||||
|
this.setLabelColor(id, fg_color, bg_color);
|
||||||
|
this.hide();
|
||||||
|
|
||||||
|
xhrPost("backend.php", this.attr('value'), () => {
|
||||||
|
updateFilterList(); // maybe there's labels in there
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
href: query
|
||||||
|
});
|
||||||
|
|
||||||
|
dialog.show();
|
||||||
|
},
|
||||||
resetColors: function() {
|
resetColors: function() {
|
||||||
const labels = this.getSelectedLabels();
|
const labels = this.getSelectedLabels();
|
||||||
|
|
||||||
|
|||||||
280
js/prefs.js
280
js/prefs.js
@@ -148,14 +148,6 @@ function updateFeedList() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkInactiveFeeds() {
|
|
||||||
xhrPost("backend.php", { op: "pref-feeds", method: "getinactivefeeds" }, (transport) => {
|
|
||||||
if (parseInt(transport.responseText) > 0) {
|
|
||||||
Element.show(dijit.byId("pref_feeds_inactive_btn").domNode);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateUsersList(sort_key) {
|
function updateUsersList(sort_key) {
|
||||||
const user_search = $("user_search");
|
const user_search = $("user_search");
|
||||||
const search = user_search ? user_search.value : "";
|
const search = user_search ? user_search.value : "";
|
||||||
@@ -218,120 +210,10 @@ function editUser(id) {
|
|||||||
dialog.show();
|
dialog.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
function editFilter(id) {
|
|
||||||
|
|
||||||
const query = "backend.php?op=pref-filters&method=edit&id=" + param_escape(id);
|
|
||||||
|
|
||||||
if (dijit.byId("feedEditDlg"))
|
|
||||||
dijit.byId("feedEditDlg").destroyRecursive();
|
|
||||||
|
|
||||||
if (dijit.byId("filterEditDlg"))
|
|
||||||
dijit.byId("filterEditDlg").destroyRecursive();
|
|
||||||
|
|
||||||
const dialog = new dijit.Dialog({
|
|
||||||
id: "filterEditDlg",
|
|
||||||
title: __("Edit Filter"),
|
|
||||||
style: "width: 600px",
|
|
||||||
|
|
||||||
test: function () {
|
|
||||||
const query = "backend.php?" + dojo.formToQuery("filter_edit_form") + "&savemode=test";
|
|
||||||
|
|
||||||
editFilterTest(query);
|
|
||||||
},
|
|
||||||
selectRules: function (select) {
|
|
||||||
$$("#filterDlg_Matches input[type=checkbox]").each(function (e) {
|
|
||||||
e.checked = select;
|
|
||||||
if (select)
|
|
||||||
e.parentNode.addClassName("Selected");
|
|
||||||
else
|
|
||||||
e.parentNode.removeClassName("Selected");
|
|
||||||
});
|
|
||||||
},
|
|
||||||
selectActions: function (select) {
|
|
||||||
$$("#filterDlg_Actions input[type=checkbox]").each(function (e) {
|
|
||||||
e.checked = select;
|
|
||||||
|
|
||||||
if (select)
|
|
||||||
e.parentNode.addClassName("Selected");
|
|
||||||
else
|
|
||||||
e.parentNode.removeClassName("Selected");
|
|
||||||
|
|
||||||
});
|
|
||||||
},
|
|
||||||
editRule: function (e) {
|
|
||||||
const li = e.parentNode;
|
|
||||||
const rule = li.getElementsByTagName("INPUT")[1].value;
|
|
||||||
Filters.addFilterRule(li, rule);
|
|
||||||
},
|
|
||||||
editAction: function (e) {
|
|
||||||
const li = e.parentNode;
|
|
||||||
const action = li.getElementsByTagName("INPUT")[1].value;
|
|
||||||
Filters.addFilterAction(li, action);
|
|
||||||
},
|
|
||||||
removeFilter: function () {
|
|
||||||
const msg = __("Remove filter?");
|
|
||||||
|
|
||||||
if (confirm(msg)) {
|
|
||||||
this.hide();
|
|
||||||
|
|
||||||
notify_progress("Removing filter...");
|
|
||||||
|
|
||||||
const query = { op: "pref-filters", method: "remove", ids: this.attr('value').id };
|
|
||||||
|
|
||||||
xhrPost("backend.php", query, () => {
|
|
||||||
updateFilterList();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
addAction: function () {
|
|
||||||
Filters.addFilterAction();
|
|
||||||
},
|
|
||||||
addRule: function () {
|
|
||||||
Filters.addFilterRule();
|
|
||||||
},
|
|
||||||
deleteAction: function () {
|
|
||||||
$$("#filterDlg_Actions li[class*=Selected]").each(function (e) {
|
|
||||||
e.parentNode.removeChild(e)
|
|
||||||
});
|
|
||||||
},
|
|
||||||
deleteRule: function () {
|
|
||||||
$$("#filterDlg_Matches li[class*=Selected]").each(function (e) {
|
|
||||||
e.parentNode.removeChild(e)
|
|
||||||
});
|
|
||||||
},
|
|
||||||
execute: function () {
|
|
||||||
if (this.validate()) {
|
|
||||||
|
|
||||||
notify_progress("Saving data...", true);
|
|
||||||
|
|
||||||
xhrPost("backend.php", dojo.formToObject("filter_edit_form"), () => {
|
|
||||||
dialog.hide();
|
|
||||||
updateFilterList();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
href: query
|
|
||||||
});
|
|
||||||
|
|
||||||
dialog.show();
|
|
||||||
}
|
|
||||||
|
|
||||||
function getSelectedUsers() {
|
function getSelectedUsers() {
|
||||||
return Tables.getSelected("prefUserList");
|
return Tables.getSelected("prefUserList");
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSelectedFilters() {
|
|
||||||
const tree = dijit.byId("filterTree");
|
|
||||||
const items = tree.model.getCheckedItems();
|
|
||||||
const rv = [];
|
|
||||||
|
|
||||||
items.each(function(item) {
|
|
||||||
rv.push(tree.model.store.getValue(item, 'bare_id'));
|
|
||||||
});
|
|
||||||
|
|
||||||
return rv;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function removeSelectedUsers() {
|
function removeSelectedUsers() {
|
||||||
|
|
||||||
@@ -357,28 +239,6 @@ function removeSelectedUsers() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeSelectedFilters() {
|
|
||||||
|
|
||||||
const sel_rows = getSelectedFilters();
|
|
||||||
|
|
||||||
if (sel_rows.length > 0) {
|
|
||||||
if (confirm(__("Remove selected filters?"))) {
|
|
||||||
notify_progress("Removing selected filters...");
|
|
||||||
|
|
||||||
const query = { op: "pref-filters", method: "remove",
|
|
||||||
ids: sel_rows.toString() };
|
|
||||||
|
|
||||||
xhrPost("backend.php", query, () => {
|
|
||||||
updateFilterList();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
alert(__("No filters are selected."));
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function editSelectedUser() {
|
function editSelectedUser() {
|
||||||
const rows = getSelectedUsers();
|
const rows = getSelectedUsers();
|
||||||
|
|
||||||
@@ -455,43 +315,6 @@ function selectedUserDetails() {
|
|||||||
dialog.show();
|
dialog.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function editSelectedFilter() {
|
|
||||||
const rows = getSelectedFilters();
|
|
||||||
|
|
||||||
if (rows.length == 0) {
|
|
||||||
alert(__("No filters are selected."));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rows.length > 1) {
|
|
||||||
alert(__("Please select only one filter."));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
notify("");
|
|
||||||
|
|
||||||
editFilter(rows[0]);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function joinSelectedFilters() {
|
|
||||||
const rows = getSelectedFilters();
|
|
||||||
|
|
||||||
if (rows.length == 0) {
|
|
||||||
alert(__("No filters are selected."));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (confirm(__("Combine selected filters?"))) {
|
|
||||||
notify_progress("Joining filters...");
|
|
||||||
|
|
||||||
xhrPost("backend.php", { op: "pref-filters", method: "join", ids: rows.toString() }, () => {
|
|
||||||
updateFilterList();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function opmlImportComplete(iframe) {
|
function opmlImportComplete(iframe) {
|
||||||
if (!iframe.contentDocument.body.innerHTML) return false;
|
if (!iframe.contentDocument.body.innerHTML) return false;
|
||||||
|
|
||||||
@@ -774,30 +597,6 @@ function editProfiles() {
|
|||||||
dialog.show();
|
dialog.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
function activatePrefProfile() {
|
|
||||||
|
|
||||||
const sel_rows = getSelectedFeedCats();
|
|
||||||
|
|
||||||
if (sel_rows.length == 1) {
|
|
||||||
|
|
||||||
const ok = confirm(__("Activate selected profile?"));
|
|
||||||
|
|
||||||
if (ok) {
|
|
||||||
notify_progress("Loading, please wait...");
|
|
||||||
|
|
||||||
xhrPost("backend.php", { op: "rpc", method: "setprofile", id: sel_rows.toString() }, () => {
|
|
||||||
window.location.reload();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
alert(__("Please choose a profile to activate."));
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
} */
|
|
||||||
|
|
||||||
function clearFeedAccessKeys() {
|
function clearFeedAccessKeys() {
|
||||||
|
|
||||||
if (confirm(__("This will invalidate all previously generated feed URLs. Continue?"))) {
|
if (confirm(__("This will invalidate all previously generated feed URLs. Continue?"))) {
|
||||||
@@ -811,14 +610,6 @@ function clearFeedAccessKeys() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function resetFilterOrder() {
|
|
||||||
notify_progress("Loading, please wait...");
|
|
||||||
|
|
||||||
xhrPost("backend.php", { op: "pref-filters", method: "filtersortreset" }, () => {
|
|
||||||
updateFilterList();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function editCat(id, item) {
|
function editCat(id, item) {
|
||||||
const new_name = prompt(__('Rename category to:'), item.name);
|
const new_name = prompt(__('Rename category to:'), item.name);
|
||||||
|
|
||||||
@@ -832,69 +623,6 @@ function editCat(id, item) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function editLabel(id) {
|
|
||||||
const query = "backend.php?op=pref-labels&method=edit&id=" +
|
|
||||||
param_escape(id);
|
|
||||||
|
|
||||||
if (dijit.byId("labelEditDlg"))
|
|
||||||
dijit.byId("labelEditDlg").destroyRecursive();
|
|
||||||
|
|
||||||
const dialog = new dijit.Dialog({
|
|
||||||
id: "labelEditDlg",
|
|
||||||
title: __("Label Editor"),
|
|
||||||
style: "width: 600px",
|
|
||||||
setLabelColor: function (id, fg, bg) {
|
|
||||||
|
|
||||||
let kind = '';
|
|
||||||
let color = '';
|
|
||||||
|
|
||||||
if (fg && bg) {
|
|
||||||
kind = 'both';
|
|
||||||
} else if (fg) {
|
|
||||||
kind = 'fg';
|
|
||||||
color = fg;
|
|
||||||
} else if (bg) {
|
|
||||||
kind = 'bg';
|
|
||||||
color = bg;
|
|
||||||
}
|
|
||||||
|
|
||||||
const e = $("LICID-" + id);
|
|
||||||
|
|
||||||
if (e) {
|
|
||||||
if (fg) e.style.color = fg;
|
|
||||||
if (bg) e.style.backgroundColor = bg;
|
|
||||||
}
|
|
||||||
|
|
||||||
const query = { op: "pref-labels", method: "colorset", kind: kind,
|
|
||||||
ids: id, fg: fg, bg: bg, color: color };
|
|
||||||
|
|
||||||
xhrPost("backend.php", query, () => {
|
|
||||||
updateFilterList(); // maybe there's labels in there
|
|
||||||
});
|
|
||||||
|
|
||||||
},
|
|
||||||
execute: function () {
|
|
||||||
if (this.validate()) {
|
|
||||||
const caption = this.attr('value').caption;
|
|
||||||
const fg_color = this.attr('value').fg_color;
|
|
||||||
const bg_color = this.attr('value').bg_color;
|
|
||||||
|
|
||||||
dijit.byId('labelTree').setNameById(id, caption);
|
|
||||||
this.setLabelColor(id, fg_color, bg_color);
|
|
||||||
this.hide();
|
|
||||||
|
|
||||||
xhrPost("backend.php", this.attr('value'), () => {
|
|
||||||
updateFilterList(); // maybe there's labels in there
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
href: query
|
|
||||||
});
|
|
||||||
|
|
||||||
dialog.show();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function customizeCSS() {
|
function customizeCSS() {
|
||||||
const query = "backend.php?op=pref-prefs&method=customizeCSS";
|
const query = "backend.php?op=pref-prefs&method=customizeCSS";
|
||||||
|
|
||||||
@@ -951,11 +679,3 @@ function clearSqlLog() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateSelectedPrompt() {
|
|
||||||
// no-op shim for toggleSelectedRow()
|
|
||||||
}
|
|
||||||
|
|
||||||
function gotoMain() {
|
|
||||||
document.location.href = "index.php";
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -127,7 +127,7 @@
|
|||||||
|
|
||||||
<div id="header" dojoType="dijit.layout.ContentPane" region="top">
|
<div id="header" dojoType="dijit.layout.ContentPane" region="top">
|
||||||
<!-- <a href='#' onclick="showHelp()"><?php echo __("Keyboard shortcuts") ?></a> | -->
|
<!-- <a href='#' onclick="showHelp()"><?php echo __("Keyboard shortcuts") ?></a> | -->
|
||||||
<a href="#" onclick="gotoMain()"><?php echo __('Exit preferences') ?></a>
|
<a href="#" onclick="document.location.href = 'index.php'"><?php echo __('Exit preferences') ?></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="main" dojoType="dijit.layout.BorderContainer">
|
<div id="main" dojoType="dijit.layout.BorderContainer">
|
||||||
|
|||||||
Reference in New Issue
Block a user