]> git.wh0rd.org - tt-rss.git/blobdiff - classes/feeds.php
bind headlines menu to a selector to avoid remaking it unnecessarily
[tt-rss.git] / classes / feeds.php
index afbeb249b3be25f4768505909aca751ead890b3b..500c50a74c1e962c3918a3aad0a7e0952b05ead3 100755 (executable)
@@ -86,17 +86,23 @@ class Feeds extends Handler_Protected {
                $reply .= "<span class=\"main\">";
                $reply .= "<span id='selected_prompt'></span>";
 
-               $reply .= "<span class=\"sel_links\">
+               /*$reply .= "<span class=\"sel_links\">
                        <a href=\"#\" onclick=\"$sel_all_link\">".__('All')."</a>,
                        <a href=\"#\" onclick=\"$sel_unread_link\">".__('Unread')."</a>,
                        <a href=\"#\" onclick=\"$sel_inv_link\">".__('Invert')."</a>,
                        <a href=\"#\" onclick=\"$sel_none_link\">".__('None')."</a></li>";
 
-               $reply .= "</span> ";
+               $reply .= "</span> "; */
 
                $reply .= "<select dojoType=\"dijit.form.Select\"
                        onchange=\"headlineActionsChange(this)\">";
-               $reply .= "<option value=\"false\">".__('More...')."</option>";
+
+               $reply .= "<option value=\"0\" disabled='1'>".__('Select...')."</option>";
+
+               $reply .= "<option value=\"$sel_all_link\">".__('All')."</option>";
+               $reply .= "<option value=\"$sel_unread_link\">".__('Unread')."</option>";
+               $reply .= "<option value=\"$sel_inv_link\">".__('Invert')."</option>";
+               $reply .= "<option value=\"$sel_none_link\">".__('None')."</option>";
 
                $reply .= "<option value=\"0\" disabled=\"1\">".__('Selection toggle:')."</option>";
 
@@ -392,7 +398,7 @@ class Feeds extends Handler_Protected {
                                                alt=\"Publish article\" onclick='togglePub($id)'>";
                                }
 
-#                              $content_link = "<a target=\"_blank\" href=\"".$line["link"]."\">" .
+#                              $content_link = "<a target=\"_blank\" rel=\"noopener noreferrer\" href=\"".$line["link"]."\">" .
 #                                      $line["title"] . "</a>";
 
 #                              $content_link = "<a
@@ -478,7 +484,7 @@ class Feeds extends Handler_Protected {
                                        $mouseover_attrs = "onmouseover='postMouseIn(event, $id)'
                                                onmouseout='postMouseOut($id)'";
 
-                                       $reply['content'] .= "<div class='hl $class' data-orig-feed-id='$feed_id' data-article-id='$id' id='RROW-$id' $mouseover_attrs>";
+                                       $reply['content'] .= "<div class='hl hlMenuAttach $class' data-orig-feed-id='$feed_id' data-article-id='$id' id='RROW-$id' $mouseover_attrs>";
 
                                        $reply['content'] .= "<div class='hlLeft'>";
 
@@ -607,10 +613,10 @@ class Feeds extends Handler_Protected {
 
                                        $reply['content'] .= "<span id=\"RTITLE-$id\"
                                                onclick=\"return cdmClicked(event, $id);\"
-                                               class=\"titleWrap $hlc_suffix\">
+                                               class=\"titleWrap hlMenuAttach $hlc_suffix\">
                                                <a class=\"title $hlc_suffix\"
                                                title=\"".htmlspecialchars($line["title"])."\"
-                                               target=\"_blank\" href=\"".
+                                               target=\"_blank\" rel=\"noopener noreferrer\" href=\"".
                                                htmlspecialchars($line["link"])."\">".
                                                $line["title"] .
                                                "</a> <span class=\"author\">$entry_author</span>";
@@ -685,13 +691,13 @@ class Feeds extends Handler_Protected {
 
                                                        $tmp_line = $this->dbh->fetch_assoc($tmp_result);
 
-                                                       $reply['content'] .= "<a target='_blank'
+                                                       $reply['content'] .= "<a target='_blank' rel='noopener noreferrer'
                                                                href=' " . htmlspecialchars($tmp_line['site_url']) . "'>" .
                                                                $tmp_line['title'] . "</a>";
 
                                                        $reply['content'] .= "&nbsp;";
 
-                                                       $reply['content'] .= "<a target='_blank' href='" . htmlspecialchars($tmp_line['feed_url']) . "'>";
+                                                       $reply['content'] .= "<a target='_blank' rel='noopener noreferrer' href='" . htmlspecialchars($tmp_line['feed_url']) . "'>";
                                                        $reply['content'] .= "<img title='".__('Feed URL')."'class='tinyFeedIcon' src='images/pub_unset.png'></a>";
 
                                                        $reply['content'] .= "</div>";
@@ -700,14 +706,9 @@ class Feeds extends Handler_Protected {
 
                                        $reply['content'] .= "<span id=\"CWRAP-$id\">";
 
-//                                     if (!$expand_cdm) {
-                                               $reply['content'] .= "<span id=\"CENCW-$id\" style=\"display : none\">";
-                                               $reply['content'] .= htmlspecialchars($line["content"]);
-                                               $reply['content'] .= "</span.";
-
-//                                     } else {
-//                                             $reply['content'] .= $line["content"];
-//                                     }
+                                       $reply['content'] .= "<span id=\"CENCW-$id\" class=\"cencw\" style=\"display : none\">";
+                                       $reply['content'] .= htmlspecialchars($line["content"]);
+                                       $reply['content'] .= "</span>";
 
                                        $reply['content'] .= "</span>";
 
@@ -735,7 +736,7 @@ class Feeds extends Handler_Protected {
                                                <a title=\"".__('Edit tags for this article')."\"
                                                href=\"#\" onclick=\"editArticleTags($id)\">(+)</a>";
 
-                                       $num_comments = $line["num_comments"];
+                                       $num_comments = (int) $line["num_comments"];
                                        $entry_comments = "";
 
                                        if ($num_comments > 0) {
@@ -745,12 +746,12 @@ class Feeds extends Handler_Protected {
                                                        $comments_url = htmlspecialchars($line["link"]);
                                                }
                                                $entry_comments = "<a class=\"postComments\"
-                                                       target='_blank' href=\"$comments_url\">$num_comments ".
+                                                       target='_blank' rel='noopener noreferrer' href=\"$comments_url\">$num_comments ".
                                                        _ngettext("comment", "comments", $num_comments)."</a>";
 
                                        } else {
                                                if ($line["comments"] && $line["link"] != $line["comments"]) {
-                                                       $entry_comments = "<a class=\"postComments\" target='_blank' href=\"".htmlspecialchars($line["comments"])."\">".__("comments")."</a>";
+                                                       $entry_comments = "<a class=\"postComments\" target='_blank' rel='noopener noreferrer' href=\"".htmlspecialchars($line["comments"])."\">".__("comments")."</a>";
                                                }
                                        }
 
@@ -1026,8 +1027,10 @@ class Feeds extends Handler_Protected {
        }
 
        function quickAddFeed() {
-               print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">";
-               print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"addfeed\">";
+               print_hidden("op", "rpc");
+               print_hidden("method", "addfeed");
+
+               print "<div id='fadd_error_message' style='display : none' class='alert alert-danger'></div>";
 
                print "<div id='fadd_multiple_notify' style='display : none'>";
                print_notice("Provided URL is a HTML page referencing multiple feeds, please select required feed from the dropdown menu below.");
@@ -1108,8 +1111,8 @@ class Feeds extends Handler_Protected {
 
                $browser_search = $this->dbh->escape_string($_REQUEST["search"]);
 
-               print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">";
-               print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"updateFeedBrowser\">";
+               print_hidden("op", "rpc");
+               print_hidden("method", "updateFeedBrowser");
 
                print "<div dojoType=\"dijit.Toolbar\">
                        <div style='float : right'>