mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 22:45:56 +00:00
refactor feed edit dialog
This commit is contained in:
48
functions.js
48
functions.js
@@ -1330,7 +1330,7 @@ function has_local_storage() {
|
||||
|
||||
function catSelectOnChange(elem) {
|
||||
try {
|
||||
var value = elem[elem.selectedIndex].value;
|
||||
/* var value = elem[elem.selectedIndex].value;
|
||||
var def = elem.getAttribute('default');
|
||||
|
||||
if (value == "ADD_CAT") {
|
||||
@@ -1341,7 +1341,7 @@ function catSelectOnChange(elem) {
|
||||
elem.selectedIndex = 0;
|
||||
|
||||
quickAddCat(elem);
|
||||
}
|
||||
} */
|
||||
|
||||
} catch (e) {
|
||||
exception_error("catSelectOnChange", e);
|
||||
@@ -1563,3 +1563,47 @@ function getSelectedTableRowIds(id) {
|
||||
return rows;
|
||||
}
|
||||
|
||||
function editFeed(feed, event) {
|
||||
|
||||
try {
|
||||
var query = "backend.php?op=pref-feeds&subop=editfeed&id=" +
|
||||
param_escape(feed);
|
||||
|
||||
console.log(query);
|
||||
|
||||
if (dijit.byId("feedEditDlg"))
|
||||
dijit.byId("feedEditDlg").destroyRecursive();
|
||||
|
||||
dialog = new dijit.Dialog({
|
||||
id: "feedEditDlg",
|
||||
title: __("Edit Feed"),
|
||||
style: "width: 600px",
|
||||
execute: function() {
|
||||
if (this.validate()) {
|
||||
console.log(dojo.objectToQuery(this.attr('value')));
|
||||
|
||||
notify_progress("Saving data...", true);
|
||||
|
||||
new Ajax.Request("backend.php", {
|
||||
parameters: dojo.objectToQuery(dialog.attr('value')),
|
||||
onComplete: function(transport) {
|
||||
dialog.hide();
|
||||
if (inPreferences()) {
|
||||
updateFeedList();
|
||||
} else {
|
||||
notify('');
|
||||
dlg_frefresh_callback(transport);
|
||||
}
|
||||
}})
|
||||
}
|
||||
},
|
||||
href: query});
|
||||
|
||||
dialog.show();
|
||||
|
||||
} catch (e) {
|
||||
exception_error("editFeed", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user