]> git.wh0rd.org - tt-rss.git/commitdiff
use dijit form widget for attachments dropdown
authorAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Tue, 11 Aug 2015 11:53:07 +0000 (14:53 +0300)
committerAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Tue, 11 Aug 2015 11:53:07 +0000 (14:53 +0300)
classes/feeds.php
css/tt-rss.css
include/functions2.php
js/viewfeed.js

index ced6bbb4ab59ce2770fb6317e56bed53ecdbd0cc..afc720957ac01563e35b73afb1d6d8d26af395e2 100644 (file)
@@ -701,12 +701,13 @@ class Feeds extends Handler_Protected {
 
                                        $always_display_enclosures = sql_bool_to_bool($line["always_display_enclosures"]);
 
-                                       $reply['content'] .= format_article_enclosures($id, $always_display_enclosures, $line["content"], sql_bool_to_bool($line["hide_images"]));
-
                                        $reply['content'] .= "</div>";
 
                                        $reply['content'] .= "<div class=\"cdmFooter\" onclick=\"cdmFooterClick(event)\">";
 
+                                       $reply['content'] .= format_article_enclosures($id, $always_display_enclosures, $line["content"], sql_bool_to_bool($line["hide_images"]));
+                                       $reply['content'] .= "<br/>";
+
                                        foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_ARTICLE_LEFT_BUTTON) as $p) {
                                                $reply['content'] .= $p->hook_article_left_button($line);
                                        }
index 38c2559500809dd8c93609753583370e5bd1b8f0..789319ccb7c99f1d52ec41af63218d3b0e00e750 100644 (file)
@@ -52,7 +52,6 @@ div.postReply div.postContent video {
 }
 
 div.postReply div.postEnclosures {
-       margin-top : 1em;
        color : #555;
 }
 
@@ -1114,3 +1113,7 @@ body#ttrssMain #feedTree .dijitTreeRow img.dijitTreeExpandoLeaf {
 :focus {
        outline: none; 
 }
+
+.dijitDropDownButton.attachments {
+       margin-bottom : 10px;
+}
\ No newline at end of file
index 03b65b7b1dca32e605c57644135974d9283bfcf1..a6cb019f85cc6eec100ef1194fd86cc0c166f1aa 100644 (file)
                                                <link rel=\"shortcut icon\" type=\"image/png\" href=\"images/favicon.png\">
                                                <link rel=\"icon\" type=\"image/png\" sizes=\"72x72\" href=\"images/favicon-72px.png\">
 
-                                               <script type=\"text/javascript\">
-                                               function openSelectedAttachment(elem) {
-                                                       try {
-                                                               var url = elem[elem.selectedIndex].value;
-
-                                                               if (url) {
-                                                                       window.open(url);
-                                                                       elem.selectedIndex = 0;
-                                                               }
-
-                                                       } catch (e) {
-                                                               exception_error(\"openSelectedAttachment\", e);
-                                                       }
-                                               }
-                                       </script>
                                        </head><body id=\"ttrssZoom\">";
                        }
 
                        $rv['content'] .= "<div class=\"postContent\" lang=\"".$line['lang']."\">";
 
                        $rv['content'] .= $line["content"];
-                       $rv['content'] .= format_article_enclosures($id,
-                               sql_bool_to_bool($line["always_display_enclosures"]),
-                               $line["content"],
-                               sql_bool_to_bool($line["hide_images"]));
+
+                       if (!$zoom_mode) {
+                               $rv['content'] .= format_article_enclosures($id,
+                                       sql_bool_to_bool($line["always_display_enclosures"]),
+                                       $line["content"],
+                                       sql_bool_to_bool($line["hide_images"]));
+                       }
 
                        $rv['content'] .= "</div>";
 
                                $rv .= "<hr clear='both'/>";
                        }
 
-                       $rv .= "<select class=\"attachments\" onchange=\"openSelectedAttachment(this)\">".
-                               "<option value=''>" . __('Attachments')."</option>";
+                       $rv .= "<div class=\"attachments\" dojoType=\"dijit.form.DropDownButton\">".
+                               "<span>" . __('Attachments')."</span>";
+
+                       $rv .= "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
 
                        foreach ($entries as $entry) {
                                if ($entry["title"])
                                else
                                        $title = "";
 
-                               $rv .= "<option value=\"".htmlspecialchars($entry["url"])."\">" . htmlspecialchars($entry["filename"]) . "$title</option>";
+                               $rv .= "<div onclick='window.open(\"".htmlspecialchars($entry["url"])."\")'
+                                       dojoType=\"dijit.MenuItem\">".htmlspecialchars($entry["filename"])."$title</div>";
 
                        };
 
-                       $rv .= "</select>";
+                       $rv .= "</div>";
+                       $rv .= "</div>";
                }
 
                return $rv;
index 16b3bb1ee38d54cbd73d4a6341ccffd7b46c0198..85872556ea21b59427e6dce831b46c7e3e288018 100644 (file)
@@ -2347,20 +2347,6 @@ function displayArticleUrl(id) {
        }
 }
 
-function openSelectedAttachment(elem) {
-       try {
-               var url = elem[elem.selectedIndex].value;
-
-               if (url) {
-                       window.open(url);
-                       elem.selectedIndex = 0;
-               }
-
-       } catch (e) {
-               exception_error("openSelectedAttachment", e);
-       }
-}
-
 function scrollToRowId(id) {
        try {
                var row = $(id);