From 603c27f828a4db20eed63b9593b5bc579e8377fd Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 26 Aug 2005 07:56:00 +0100 Subject: [PATCH] inline feed editor, yay! --- backend.php | 59 ++++++++++++++++++++++++++++++++++++++++++++--------- prefs.js | 12 +++++++---- prefs.php | 11 +++++----- tt-rss.css | 7 +++++++ 4 files changed, 69 insertions(+), 20 deletions(-) diff --git a/backend.php b/backend.php index 83d86458f..c3805fc03 100644 --- a/backend.php +++ b/backend.php @@ -433,7 +433,7 @@ $subop = $_GET["subop"]; - if ($subop == "edit") { +/* if ($subop == "old_edit") { $feed_id = $_GET["id"]; @@ -460,7 +460,7 @@ Add feed "; - } + } */ if ($subop == "editSave") { $feed_title = pg_escape_string($_GET["t"]); @@ -517,7 +517,8 @@ print "

"; print " - "; + + "; $lnum = 0; @@ -526,7 +527,9 @@ $class = ($lnum % 2) ? "even" : "odd"; $feed_id = $line["id"]; - + + $edit_feed_id = $_GET["id"]; + print ""; $icon_file = ICONS_DIR . "/$feed_id.ico"; @@ -539,15 +542,26 @@ } print ""; - print ""; - - print ""; - print ""; + + print ""; + print ""; + } else { + + print ""; + + print ""; + print ""; + + } print ""; + print ""; ++$lnum; @@ -555,6 +569,31 @@ print "
 SelectTitleLinkLast Updated
 SelectTitleLinkLast Updated
$feed_icon" . - $line["title"] . "" . - $line["feed_url"] . "" . + $line["title"] . "" . + $line["feed_url"] . "" . $line["last_updated"] . "
"; + print "

"; + + if ($subop == "edit") { + print "Edit feed:  + Cancel  + Save"; + } else { + +// Edit  + +// Refresh"; + + print " + Selection:  + Remove  + Mark as read  + Mark as unread"; + + } + } pg_close($link); diff --git a/prefs.js b/prefs.js index 92bbd67d8..b468a362a 100644 --- a/prefs.js +++ b/prefs.js @@ -236,17 +236,19 @@ function feedEditCancel() { } -function feedEditSave(feed) { +function feedEditSave() { + + var feed = active_feed; if (!xmlhttp_ready(xmlhttp)) { printLockingError(); return } - notify("Saving feed."); + var link = document.getElementById("iedit_link").value; + var title = document.getElementById("iedit_title").value; - var link = document.getElementById("fedit_link").value; - var title = document.getElementById("fedit_title").value; +// notify("Saving feed."); if (link.length == 0) { notify("Feed link cannot be blank."); @@ -258,6 +260,8 @@ function feedEditSave(feed) { return; } + active_feed = false; + xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editSave&id=" + feed + "&l=" + param_escape(link) + "&t=" + param_escape(title) ,true); xmlhttp.onreadystatechange=feedlist_callback; diff --git a/prefs.php b/prefs.php index edbb728c3..8e63f99be 100644 --- a/prefs.php +++ b/prefs.php @@ -30,18 +30,17 @@

Feed Configuration

- -
 
- +
 
-

Selection:  +


diff --git a/tt-rss.css b/tt-rss.css index 104964472..2d3f07f53 100644 --- a/tt-rss.css +++ b/tt-rss.css @@ -356,3 +356,10 @@ img.feedIcon { margin : 3px; border : 1px solid #c0c0c0; } + +#iedit_title, #iedit_link { + width : 100%; + padding-left : 2px; +} + +