]> git.wh0rd.org - tt-rss.git/blobdiff - functions.js
neon updates; make more icons themeable; misc fixes
[tt-rss.git] / functions.js
index 1b676a9ef245580150c1f66ab30063634c33481a..7a43212dce3c76dad0fe1765b723453fd913ff40 100644 (file)
@@ -162,13 +162,13 @@ function notify_real(msg, no_hide, n_type) {
                n.className = "notify";
        } else if (n_type == 2) {
                n.className = "notifyProgress";
-               msg = "<img src='images/indicator_white.gif'> " + msg;
+               msg = "<img src='"+getInitParam("sign_progress")+"'> " + msg;
        } else if (n_type == 3) {
                n.className = "notifyError";
-               msg = "<img src='images/sign_excl.gif'> " + msg;
+               msg = "<img src='"+getInitParam("sign_excl")+"'> " + msg;
        } else if (n_type == 4) {
                n.className = "notifyInfo";
-               msg = "<img src='images/sign_info.gif'> " + msg;
+               msg = "<img src='"+getInitParam("sign_info")+"'> " + msg;
        }
 
 //     msg = "<img src='images/live_com_loading.gif'> " + msg;
@@ -526,7 +526,8 @@ function parse_counters(reply, scheduled_call) {
                                                
                                        }
 
-                                       if (row_needs_hl) { 
+                                       if (row_needs_hl && getInitParam("theme") != 'neon' &&
+                                                       getInitParam("theme") != 'lejla') { 
                                                new Effect.Highlight(feedr, {duration: 1, startcolor: "#fff7d5",
                                                        queue: { position:'end', scope: 'EFQ-' + id, limit: 1 } } );
 
@@ -2162,7 +2163,7 @@ function displayNewContentPrompt(id) {
        try {
 
                var msg = "<a href='#' onclick='viewfeed("+id+")'>" +
-                       __("New articles available (Click to show)") + "</a>";
+                       __("New articles available in this feed (click to show)") + "</a>";
 
                msg = msg.replace("%s", getFeedName(id));
 
@@ -2248,3 +2249,78 @@ function feedArchiveRemove() {
        }
 }
 
+function uploadIconHandler(rc) {
+       try {
+               switch (rc) {
+                       case 0:
+                               notify_info("Upload complete.");
+                               if (inPreferences()) {
+                                       updateFeedList();
+                               } else {
+                                       setTimeout('updateFeedList(false, false)', 50);
+                               }
+                               break;
+                       case 1:
+                               notify_error("Upload failed: icon is too big.");
+                               break;
+                       case 2:
+                               notify_error("Upload failed.");
+                               break;
+               }
+
+       } catch (e) {
+               exception_error("uploadIconHandler", e);
+       }
+}
+
+function removeFeedIcon(id) {
+
+       try {
+
+               if (confirm(__("Remove stored feed icon?"))) {
+                       var query = "backend.php?op=pref-feeds&subop=removeicon&feed_id=" + param_escape(id);
+
+                       debug(query);
+
+                       notify_progress("Removing feed icon...", true);
+
+                       new Ajax.Request("backend.php", {
+                               parameters: query,
+                               onComplete: function(transport) { 
+                                       notify_info("Feed icon removed.");
+                                       if (inPreferences()) {
+                                               updateFeedList();
+                                       } else {
+                                               setTimeout('updateFeedList(false, false)', 50);
+                                       }
+                               } }); 
+               }
+
+               return false;
+       } catch (e) {
+               exception_error("uploadFeedIcon", e);
+       }
+}
+
+function uploadFeedIcon() {
+
+       try {
+
+               var file = $("icon_file");
+
+               if (file.value.length == 0) {
+                       alert(__("Please select an image file to upload."));
+               } else {
+                       if (confirm(__("Upload new icon for this feed?"))) {
+                               notify_progress("Uploading, please wait...", true);
+                               return true;
+                       }
+               }
+
+               return false;
+
+       } catch (e) {
+               exception_error("uploadFeedIcon", e);
+       }
+}
+