mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-14 02:06:48 +00:00
addLabel -> CommonDialogs
This commit is contained in:
@@ -651,6 +651,29 @@ const CommonDialogs = {
|
||||
});
|
||||
|
||||
dialog.show();
|
||||
},
|
||||
addLabel: function(select, callback) {
|
||||
const caption = prompt(__("Please enter label caption:"), "");
|
||||
|
||||
if (caption != undefined && caption.trim().length > 0) {
|
||||
|
||||
const query = {op: "pref-labels", method: "add", caption: caption.trim()};
|
||||
|
||||
if (select)
|
||||
Object.extend(query, {output: "select"});
|
||||
|
||||
notify_progress("Loading, please wait...", true);
|
||||
|
||||
xhrPost("backend.php", query, (transport) => {
|
||||
if (callback) {
|
||||
callback(transport);
|
||||
} else if (App.isPrefs()) {
|
||||
updateLabelList();
|
||||
} else {
|
||||
Feeds.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1067,31 +1090,6 @@ function uploadFeedIcon() {
|
||||
return false;
|
||||
}
|
||||
|
||||
function addLabel(select, callback) {
|
||||
const caption = prompt(__("Please enter label caption:"), "");
|
||||
|
||||
if (caption != undefined && caption.trim().length > 0) {
|
||||
|
||||
const query = { op: "pref-labels", method: "add", caption: caption.trim() };
|
||||
|
||||
if (select)
|
||||
Object.extend(query, {output: "select"});
|
||||
|
||||
notify_progress("Loading, please wait...", true);
|
||||
|
||||
xhrPost("backend.php", query, (transport) => {
|
||||
if (callback) {
|
||||
callback(transport);
|
||||
} else if (App.isPrefs()) {
|
||||
updateLabelList();
|
||||
} else {
|
||||
Feeds.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function createNewRuleElement(parentNode, replaceNode) {
|
||||
const form = document.forms["filter_new_rule_form"];
|
||||
const query = { op: "pref-filters", method: "printrulename", rule: dojo.formToJson(form) };
|
||||
|
||||
Reference in New Issue
Block a user