}
+ if ($op == "dlg") {
+ $id = $_GET["id"];
+
+ if ($id == "quickAddFeed") {
+ print "Feed URL: <input id=\"qafInput\">
+ <input class=\"button\"
+ type=\"submit\" onclick=\"javascript:qafAdd()\" value=\"Add feed\">
+ <input class=\"button\"
+ type=\"submit\" onclick=\"javascript:closeDlg()\"
+ value=\"Cancel\">";
+ }
+ }
+
db_close($link);
?>
}
function qaf_add_callback() {
- var container = document.getElementById('feeds');
if (xmlhttp.readyState == 4) {
updateFeedList(false, false);
- var qafDialog = document.getElementById("qafDialog");
- qafDialog.style.display = "none";
-
+ closeDlg();
}
}
+function dialog_refresh_callback() {
+ if (xmlhttp.readyState == 4) {
+ var dlg = document.getElementById("userDlg");
+
+ dlg.innerHTML = xmlhttp.responseText;
+ dlg.style.display = "block";
+ }
+}
function refetch_callback() {
if (xmlhttp.readyState == 4) {
}
if (opname == "Add new feed") {
- var qafDialog = document.getElementById("qafDialog");
- qafDialog.style.display = "block";
+ displayDlg("quickAddFeed");
}
}
link.value = "";
}
+}
+
+function displayDlg(id) {
+ xmlhttp.open("GET", "backend.php?op=dlg&id=" +
+ param_escape(id), true);
+ xmlhttp.onreadystatechange=dialog_refresh_callback;
+ xmlhttp.send(null);
}
+
+function closeDlg() {
+ var dlg = document.getElementById("userDlg");
+ dlg.style.display = "none";
+}
+
</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>
+ <div id="userDlg"> </div>
+
</td>
</tr>
<? } ?>