summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/functions.js35
-rw-r--r--js/tt-rss.js24
-rw-r--r--js/viewfeed.js26
3 files changed, 71 insertions, 14 deletions
diff --git a/js/functions.js b/js/functions.js
index 4840bcbe1..a9367da60 100644
--- a/js/functions.js
+++ b/js/functions.js
@@ -201,13 +201,13 @@ function notify_real(msg, no_hide, n_type) {
n.className = "notify";
} else if (n_type == 2) {
n.className = "notifyProgress";
- msg = "<img src='"+getInitParam("sign_progress")+"'> " + msg;
+ msg = "<img src='images/indicator_white.gif'> " + msg;
} else if (n_type == 3) {
n.className = "notifyError";
- msg = "<img src='"+getInitParam("sign_excl")+"'> " + msg;
+ msg = "<img src='images/sign_excl.svg'> " + msg;
} else if (n_type == 4) {
n.className = "notifyInfo";
- msg = "<img src='"+getInitParam("sign_info")+"'> " + msg;
+ msg = "<img src='images/sign_info.svg'> " + msg;
}
// msg = "<img src='images/live_com_loading.gif'> " + msg;
@@ -1216,20 +1216,31 @@ function quickAddFilter() {
var lh = dojo.connect(dialog, "onLoad", function(){
dojo.disconnect(lh);
- var title = $("PTITLE-FULL-" + getActiveArticleId());
+ var query = "op=rpc&method=getlinktitlebyid&id=" + getActiveArticleId();
- if (title || getActiveFeedId() || activeFeedIsCat()) {
- if (title) title = title.innerHTML;
+ new Ajax.Request("backend.php", {
+ parameters: query,
+ onComplete: function(transport) {
+ var reply = JSON.parse(transport.responseText);
- console.log(title + " " + getActiveFeedId());
+ var title = false;
- var feed_id = activeFeedIsCat() ? 'CAT:' + parseInt(getActiveFeedId()) :
- getActiveFeedId();
+ if (reply && reply) title = reply.title;
- var rule = { reg_exp: title, feed_id: feed_id, filter_type: 1 };
+ if (title || getActiveFeedId() || activeFeedIsCat()) {
+
+ console.log(title + " " + getActiveFeedId());
+
+ var feed_id = activeFeedIsCat() ? 'CAT:' + parseInt(getActiveFeedId()) :
+ getActiveFeedId();
+
+ var rule = { reg_exp: title, feed_id: feed_id, filter_type: 1 };
+
+ addFilterRule(null, dojo.toJson(rule));
+ }
+
+ } });
- addFilterRule(null, dojo.toJson(rule));
- }
});
}
diff --git a/js/tt-rss.js b/js/tt-rss.js
index bced92674..b7bb9319b 100644
--- a/js/tt-rss.js
+++ b/js/tt-rss.js
@@ -178,10 +178,14 @@ function search() {
}
function updateTitle() {
- var tmp = "Tiny Tiny RSS";
+ var tmp = document.title;
+
+ if (tmp.indexOf(")") > 0) {
+ tmp = tmp.substr(tmp.indexOf(")") + 1);
+ }
if (global_unread > 0) {
- tmp = tmp + " (" + global_unread + ")";
+ tmp = "(" + global_unread + ") " + tmp;
}
if (window.fluid) {
@@ -446,6 +450,12 @@ function parse_runtime_info(data) {
return;
}
+ if (k == "dep_ts" && parseInt(getInitParam("dep_ts")) > 0) {
+ if (parseInt(getInitParam("dep_ts")) < parseInt(v)) {
+ window.location.reload();
+ }
+ }
+
if (k == "daemon_is_running" && v != 1) {
notify_error("<span onclick=\"javascript:explainError(1)\">Update daemon is not running.</span>", true);
return;
@@ -786,6 +796,14 @@ function hotkey_handler(e) {
case "collapse_sidebar":
collapse_feedlist();
return false;
+ case "toggle_embed_original":
+ if (typeof embedOriginalArticle != "undefined") {
+ if (getActiveArticleId())
+ embedOriginalArticle(getActiveArticleId());
+ } else {
+ alert(__("Please enable embed_original plugin first."));
+ }
+ return false;
case "toggle_widescreen":
if (!isCdmMode()) {
_widescreen_mode = !_widescreen_mode;
@@ -928,6 +946,8 @@ function handle_rpc_json(transport, scheduled_call) {
function switchPanelMode(wide) {
try {
+ if (isCdmMode()) return;
+
article_id = getActiveArticleId();
if (wide) {
diff --git a/js/viewfeed.js b/js/viewfeed.js
index 5567c717a..e32d3a990 100644
--- a/js/viewfeed.js
+++ b/js/viewfeed.js
@@ -1392,6 +1392,7 @@ function cdmExpandArticle(id) {
Element.hide(elem);
Element.show("CEXC-" + getActiveArticleId());
Element.hide(collapse);
+ $("RROW-" + getActiveArticleId()).removeClassName("active");
}
setActiveArticleId(id);
@@ -1413,6 +1414,7 @@ function cdmExpandArticle(id) {
Element.show(elem);
Element.hide("CEXC-" + id);
Element.show(collapse);
+ $("RROW-" + id).addClassName("active");
}
var new_offset = $("RROW-" + id).offsetTop;
@@ -1824,6 +1826,12 @@ function initHeadlinesMenu() {
openArticleInNewWindow(this.getParent().callerRowId);
}}));
+ menu.addChild(new dijit.MenuItem({
+ label: __("Display article URL"),
+ onClick: function(event) {
+ displayArticleUrl(this.getParent().callerRowId);
+ }}));
+
menu.addChild(new dijit.MenuSeparator());
menu.addChild(new dijit.MenuItem({
@@ -2035,3 +2043,21 @@ function changeScore(id, pic) {
exception_error("changeScore", e);
}
}
+
+function displayArticleUrl(id) {
+ try {
+ var query = "op=rpc&method=getlinktitlebyid&id=" + param_escape(id);
+
+ new Ajax.Request("backend.php", {
+ parameters: query,
+ onComplete: function(transport) {
+ var reply = JSON.parse(transport.responseText);
+
+ if (reply && reply.link) {
+ prompt(__("Article URL:"), reply.link);
+ }
+ } });
+ } catch (e) {
+ exception_error("changeScore", e);
+ }
+}