mirror of
https://tt-rss.org/git/tt-rss.git
synced 2024-06-28 12:10:52 +02:00
Implement the last part of #276: show the list of available feeds in the frontend and let the user select one of them (refs #276)
This commit is contained in:
parent
9a8ce9561d
commit
5eeb387497
24
functions.js
24
functions.js
|
@ -1322,9 +1322,31 @@ function subscribeToFeed() {
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
case 3:
|
case 3:
|
||||||
case 4:
|
|
||||||
alert(__("Can't subscribe to the specified URL."));
|
alert(__("Can't subscribe to the specified URL."));
|
||||||
break;
|
break;
|
||||||
|
case 4:
|
||||||
|
new Ajax.Request("backend.php", {
|
||||||
|
parameters: 'op=rpc&subop=extractfeedurls&url=' + encodeURIComponent(feed_url),
|
||||||
|
onComplete: function(transport) {
|
||||||
|
var result = transport.responseXML.getElementsByTagName('urls')[0];
|
||||||
|
var feeds = JSON.parse(result.firstChild.nodeValue);
|
||||||
|
var select = document.getElementById("faad_feeds_container_select");
|
||||||
|
|
||||||
|
while (select.hasChildNodes()) {
|
||||||
|
select.removeChild(elem.firstChild);
|
||||||
|
}
|
||||||
|
var count = 0;
|
||||||
|
for (var feedUrl in feeds) {
|
||||||
|
select.insert(new Option(feeds[feedUrl], feedUrl, false));
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
if (count > 5) count = 5;
|
||||||
|
select.size = count;
|
||||||
|
|
||||||
|
Effect.Appear('fadd_feeds_container', {duration : 0.5});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
case 0:
|
case 0:
|
||||||
alert(__("You are already subscribed to this feed."));
|
alert(__("You are already subscribed to this feed."));
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -263,6 +263,14 @@
|
||||||
|
|
||||||
print "</div>";
|
print "</div>";
|
||||||
|
|
||||||
|
print '<div id="fadd_feeds_container" style="display:none">
|
||||||
|
|
||||||
|
<div class="dlgSec">' . __('Available feeds') . '</div>
|
||||||
|
<div class="dlgSecCont">'
|
||||||
|
|
||||||
|
. ' <select name="feed" id="faad_feeds_container_select" size="3"></select>'
|
||||||
|
. '</div></div>';
|
||||||
|
|
||||||
print "<div id='fadd_login_container' style='display:none'>
|
print "<div id='fadd_login_container' style='display:none'>
|
||||||
|
|
||||||
<div class=\"dlgSec\">".__("Authentication")."</div>
|
<div class=\"dlgSec\">".__("Authentication")."</div>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user