]> git.wh0rd.org Git - tt-rss.git/commitdiff
inline feed editor, yay!
authorAndrew Dolgov <fox@madoka.spb.ru>
Fri, 26 Aug 2005 06:56:00 +0000 (07:56 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Fri, 26 Aug 2005 06:56:00 +0000 (07:56 +0100)
backend.php
prefs.js
prefs.php
tt-rss.css

index 83d86458fd21e577e8afcf9f3e29c47c266617bb..c3805fc03401d4f3b0cbc186b8b3c5c58ee214a8 100644 (file)
        
                $subop = $_GET["subop"];
 
-               if ($subop == "edit") {
+/*             if ($subop == "old_edit") {
 
                        $feed_id = $_GET["id"];
 
                                <a class=\"button\" href=\"javascript:addFeed()\">Add feed</a></td></tr>
                        </table>";
 
-               }
+               } */
 
                if ($subop == "editSave") {
                        $feed_title = pg_escape_string($_GET["t"]);
 
                print "<p><table width=\"100%\" class=\"prefFeedList\" id=\"prefFeedList\">";
                print "<tr class=\"title\">
-                                       <td>&nbsp;</td><td>Select</td><td>Title</td><td>Link</td><td>Last Updated</td></tr>";
+                                       <td>&nbsp;</td><td>Select</td><td width=\"40%\">Title</td>
+                                       <td width=\"40%\">Link</td><td>Last Updated</td></tr>";
                
                $lnum = 0;
                
                        $class = ($lnum % 2) ? "even" : "odd";
                        
                        $feed_id = $line["id"];
-                       
+
+                       $edit_feed_id = $_GET["id"];
+
                        print "<tr class=\"$class\" id=\"FEEDR-$feed_id\">";
 
                        $icon_file = ICONS_DIR . "/$feed_id.ico";
                        }
                        print "<td align='center'>$feed_icon</td>";             
 
-                       print "<td><input onclick='toggleSelectRow(this);' 
+                       if ($feed_id != $edit_feed_id || $subop != "edit" ) {
+
+                               print "<td><input onclick='toggleSelectRow(this);' 
                                type=\"checkbox\" id=\"FRCHK-".$line["id"]."\"></td>";
-               
-                       print "<td><a href=\"javascript:editFeed($feed_id);\">" . 
-                               $line["title"] . "</td>";               
-                       print "<td><a href=\"javascript:editFeed($feed_id);\">" . 
-                               $line["feed_url"] . "</td>";            
+
+                               print "<td><a href=\"javascript:editFeed($feed_id);\">" . 
+                                       $line["title"] . "</td>";               
+                               print "<td><a href=\"javascript:editFeed($feed_id);\">" . 
+                                       $line["feed_url"] . "</td>";            
+                       } else {
+
+                               print "<td><input disabled=\"true\" type=\"checkbox\" id=\"FRCHK-".$line["id"]."\"></td>";
+
+                               print "<td><input id=\"iedit_title\" value=\"".$line["title"]."\"></td>";
+                               print "<td><input id=\"iedit_link\" value=\"".$line["feed_url"]."\"></td>";
+                                               
+                       }
                                
                        print "<td>" . $line["last_updated"] . "</td>";
+                       
                        print "</tr>";
 
                        ++$lnum;
 
                print "</table>";
 
+               print "<p>";
+
+               if ($subop == "edit") {
+                       print "Edit feed:&nbsp;
+                                       <a class=\"button\" href=\"javascript:feedEditCancel()\">Cancel</a>&nbsp;
+                                       <a class=\"button\" href=\"javascript:feedEditSave()\">Save</a>";
+                       } else {
+
+//                     <a class=\"button\" 
+//                             href=\"javascript:editSelectedFeed()\">Edit</a>&nbsp;
+
+//                     <a class=\"button\" 
+//                             href=\"javascript:updateFeedList()\">Refresh</a>";
+
+                       print "
+                               Selection:&nbsp;
+                       <a class=\"buttonWarn\" 
+                               href=\"javascript:removeSelectedFeeds()\">Remove</a>&nbsp;
+                       <a class=\"button\" 
+                               href=\"javascript:readSelectedFeeds()\">Mark as read</a>&nbsp;
+                       <a class=\"button\" 
+                               href=\"javascript:unreadSelectedFeeds()\">Mark as unread</a>";
+
+                       }
+
        }
 
        pg_close($link);
index 92bbd67d838c816fdacd38a0372e3392d70eac38..b468a362ad33d73d733623fc96578ae352a4722f 100644 (file)
--- 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;
index edbb728c32a545b119e7739db5ff8f4c95525370..8e63f99be6a9774250e9dda3c7cb1246bfb3f927 100644 (file)
--- a/prefs.php
+++ b/prefs.php
        <td id="prefContent" class="prefContent" valign="top" colspan="2">
                <h2>Feed Configuration</h2>
 
-<!--
+               <div id="piggie">&nbsp;</div>
+
                <table class="prefAddFeed">
                        <td><input id="fadd_link"></td>
                        <td colspan="4" align="right">
                                <a class="button" href="javascript:addFeed()">Add feed</a></td></tr>
                </table> 
--->
-               <div id="piggie">&nbsp;</div>
-
+               
                <div id="feeds">&nbsp;</div>
 
-               <p>Selection:&nbsp;
+<!--           <p>Selection:&nbsp;
                        <a class="button" 
                                href="javascript:editSelectedFeed()">Edit</a>&nbsp;
                        <a class="buttonWarn" 
@@ -51,7 +50,7 @@
                        <a class="button" 
                                href="javascript:unreadSelectedFeeds()">Mark as unread</a>&nbsp;
                        <a class="button" 
-                               href="javascript:updateFeedList()">Refresh</a>&nbsp;
+                               href="javascript:updateFeedList()">Refresh</a>&nbsp; -->
 
                <hr>
 
index 104964472a7ea0a58fc90c44fa2ef59e53d02d7b..2d3f07f53bceda026f0e757c62fa056bf5e3e611 100644 (file)
@@ -356,3 +356,10 @@ img.feedIcon {
        margin : 3px;
        border : 1px solid #c0c0c0;
 }
+
+#iedit_title, #iedit_link {
+       width : 100%;
+       padding-left : 2px;
+}
+
+