]> git.wh0rd.org Git - tt-rss.git/commitdiff
quick feed add dialog + related interface tweaks
authorAndrew Dolgov <fox@madoka.spb.ru>
Fri, 28 Oct 2005 05:38:06 +0000 (06:38 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Fri, 28 Oct 2005 05:38:06 +0000 (06:38 +0100)
tt-rss.css
tt-rss.js
tt-rss.php

index 5c81a3154bb2571d2db0337898c45a259b6ff19f..d72ccf949bfea7a00f0909a458146fc253b272a7 100644 (file)
@@ -387,3 +387,18 @@ pre {
        padding : 5px;
        background : #f0f0f0;
 }
+
+#qafDialog {
+       left : 400px;
+       top : 18px;
+       background : #fffff0;
+       z-index : 3;
+       position : absolute;
+       border : 1px solid #c0c0c0;
+       padding : 10px;
+       display : none;
+}
+
+#qafInput {
+       width : 300px;
+}
index d75157ae782115420542804fe941460ff87c9a25..664e5c8a5eb27db5b223d1d1dba7ab61aa0525d4 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -48,24 +48,16 @@ function toggleTags() {
        updateFeedList();
 }
 
-/*
-function feedlist_callback() {
+function qaf_add_callback() {
        var container = document.getElementById('feeds');
        if (xmlhttp.readyState == 4) {
-               container.innerHTML=xmlhttp.responseText;
+               updateFeedList(false, false);
+               var qafDialog = document.getElementById("qafDialog");
+               qafDialog.style.display = "none";
 
-               if (first_run) {
-                       scheduleFeedUpdate(false);
-                       if (getCookie("ttrss_vf_actfeed")) {
-                               viewfeed(getCookie("ttrss_vf_actfeed"), 0, "");
-                       }
-                       first_run = false;
-               } else {
-                       notify("");
-               } 
        } 
 }
-*/
+
 
 function refetch_callback() {
        if (xmlhttp.readyState == 4) {
@@ -426,4 +418,47 @@ function init() {
 
 }
 
+function quickMenuGo() {
+       var chooser = document.getElementById("quickMenuChooser");
+
+       var opname = chooser[chooser.selectedIndex].text;
+
+       if (opname == "Preferences") {
+               gotoPreferences();
+       }
+
+       if (opname == "Add new feed") {
+               var qafDialog = document.getElementById("qafDialog");
+               qafDialog.style.display = "block";
+       }
+}
+
+function qafAdd() {
 
+       if (!xmlhttp_ready(xmlhttp)) {
+               printLockingError();
+               return
+       }
+
+       var link = document.getElementById("qafInput");
+
+       if (link.value.length == 0) {
+               notify("Missing feed URL.");
+       } else {
+               notify("Adding feed...");
+               
+               var feeds_doc = window.frames["feeds-frame"].document;
+
+               feeds_doc.location.href = "backend.php?op=error&msg=Loading,%20please wait...";
+
+               xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=add&link=" +
+                       param_escape(link.value), true);
+               xmlhttp.onreadystatechange=qaf_add_callback;
+               xmlhttp.send(null);
+
+               link.value = "";
+
+       }
+
+
+}
index 018ab865947c5f5225f56a6818570f9bff251d6c..cf11e564d51d568ad73c7f4acc33919de6e8abeb 100644 (file)
                                <div id="notify"><span id="notify_body"></div>
                        </td>
                </tr></table>
+
+               <div id="qafDialog">
+                       Feed URL: <input id="qafInput">
+                       <input class="button"
+                               type="submit" onclick="javascript:qafAdd()" value="Add feed">
+                       <input class="button"
+                               type="submit" onclick="javascript:cancelDialog(this)" value="Cancel">
+               </div>
        </td>
 </tr>
 <? } ?>
 
                </td>
                <td align="right">
-                       <input type="submit" onclick="gotoPreferences()" 
-                               class="button" value="Preferences"></td>
+                       <select id="quickMenuChooser">
+                               <option selected>Preferences</option>
+                               <option>Add new feed</option>
+                               <!-- <option>Edit this feed</option> -->
+                       </select>
+                       <input type="submit" class="button" onclick="quickMenuGo()" value="Go">
                </td>
                </tr>
                </table>