]> git.wh0rd.org - tt-rss.git/commitdiff
add net-alert icon
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 14 Jan 2013 10:16:55 +0000 (14:16 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 14 Jan 2013 10:16:55 +0000 (14:16 +0400)
images/alert.png [new file with mode: 0644]
images/alert.svg [new file with mode: 0644]
index.php
js/tt-rss.js
js/viewfeed.js

diff --git a/images/alert.png b/images/alert.png
new file mode 100644 (file)
index 0000000..9687c4c
Binary files /dev/null and b/images/alert.png differ
diff --git a/images/alert.svg b/images/alert.svg
new file mode 100644 (file)
index 0000000..237f66c
--- /dev/null
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="16px"
+   height="16px"
+   id="svg2985"
+   version="1.1"
+   inkscape:version="0.48.4 r9939"
+   inkscape:export-filename="Y:\public_html\testbox\tt-irc\images\alert.png"
+   inkscape:export-xdpi="102.17"
+   inkscape:export-ydpi="102.17"
+   sodipodi:docname="alert.svg">
+  <defs
+     id="defs2987" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="22.197802"
+     inkscape:cx="0.97227717"
+     inkscape:cy="13.508447"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:grid-bbox="true"
+     inkscape:document-units="px"
+     inkscape:window-width="1600"
+     inkscape:window-height="1137"
+     inkscape:window-x="-8"
+     inkscape:window-y="-8"
+     inkscape:window-maximized="1" />
+  <metadata
+     id="metadata2990">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     id="layer1"
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer">
+    <path
+       sodipodi:type="star"
+       style="opacity:1;fill:#d40000;fill-opacity:1"
+       id="path2993"
+       sodipodi:sides="3"
+       sodipodi:cx="4.7752476"
+       sodipodi:cy="2.3499999"
+       sodipodi:r1="8.1370182"
+       sodipodi:r2="4.0685091"
+       sodipodi:arg1="0.52359878"
+       sodipodi:arg2="1.5707963"
+       inkscape:flatsided="false"
+       inkscape:rounded="0"
+       inkscape:randomized="0"
+       d="m 11.822112,6.418509 -7.0468643,0 -7.0468646,0 3.5234322,-6.10276355 3.5234323,-6.10276375 3.5234322,6.10276356 z"
+       inkscape:transform-center-y="-2.0342545"
+       transform="translate(3.2247524,7.6842546)" />
+    <text
+       xml:space="preserve"
+       style="font-size:11px;font-style:normal;font-weight:bold;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;font-family:Times New Roman;-inkscape-font-specification:Sans Bold"
+       x="6.1657715"
+       y="12.508285"
+       id="text3767"
+       sodipodi:linespacing="125%"><tspan
+         sodipodi:role="line"
+         id="tspan3769"
+         x="6.1657715"
+         y="12.508285">!</tspan></text>
+  </g>
+</svg>
index 24ab0912c4fe050a80e19683d0f695d2b4a81040..f07ee056a7f9f75d7e3c4bba181dc110570de472 100644 (file)
--- a/index.php
+++ b/index.php
 </div>
 
 <div id="header">
+       <img id="net-alert" style="display : none"
+               title="<?php echo __("Communication problem with server.") ?>"
+               src="<?php echo theme_image($link, 'images/alert.png') ?>"/>
+
        <?php if (!$_SESSION["hide_hello"]) { ?>
                        <?php echo __('Hello,') ?> <b><?php echo $_SESSION["name"] ?></b> |
        <?php } ?>
index 5cbfbfa6e91e0b25b4b58ff97fa1aa8aa14f738f..3a83644d40b7eeb2fe6d090e592b657b996443b5 100644 (file)
@@ -961,12 +961,16 @@ function handle_rpc_json(transport, scheduled_call) {
 
                        hideOrShowFeeds(getInitParam("hide_read_feeds") == 1);
 
+                       Element.hide("net-alert");
+
                } else {
-                       notify_error("Error communicating with server.");
+                       //notify_error("Error communicating with server.");
+                       Element.show("net-alert");
                }
 
        } catch (e) {
-               notify_error("Error communicating with server.");
+               Element.show("net-alert");
+               //notify_error("Error communicating with server.");
                console.log(e);
                //exception_error("handle_rpc_json", e, transport);
        }
index 225c12312be3c3091a8fb8353971268d0953ac95..d6801a186a1e8a201e63a91397d26d9a785b7311 100644 (file)
@@ -210,7 +210,8 @@ function headlines_callback2(transport, offset, background, infscroll_req) {
                                        __('Could not update headlines (invalid object received - see error console for details)') +
                                        "</div>");
                } else {
-                       notify_error("Error communicating with server.");
+                       //notify_error("Error communicating with server.");
+                       Element.show("net-alert");
                }
 
                _infscroll_request_sent = 0;
@@ -315,11 +316,13 @@ function article_callback2(transport, id) {
 //                             return;
 //                     }
 
-               } else {
+               } else if (transport.responseText) {
                        console.error("Invalid object received: " + transport.responseText);
 
                        render_article("<div class='whiteBox'>" +
                                        __('Could not display article (invalid object received - see error console for details)') + "</div>");
+               } else {
+                       Element.show("net-alert");
                }
 
                request_counters();