]> git.wh0rd.org - tt-rss.git/blobdiff - functions.js
replace some theme-specific frontend hooks with theme options
[tt-rss.git] / functions.js
index aa9bdcefe30897820cf73dc492d160ee60a4405f..0c4eaf353760d89990a956cc4b3665819fcf14a0 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_option").match('no_highlights')) { 
                                                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));
 
@@ -2224,7 +2225,7 @@ function feedArchiveRemove() {
 
                if (selected.length > 0) {
 
-                       var pr = __("Remove selected feeds from archive?");
+                       var pr = __("Remove selected feeds from the archive? Feeds with stored articles will not be removed.");
 
                        if (confirm(pr)) {
                                Element.show('feed_browser_spinner');
@@ -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);
+       }
+}
+