mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-24 09:21:29 +00:00
support opening articles in new tab, misc fixes
This commit is contained in:
@@ -793,7 +793,6 @@ function setFeedUnread(feed, is_cat, unread) {
|
|||||||
function setFeedValue(feed, is_cat, key, value) {
|
function setFeedValue(feed, is_cat, key, value) {
|
||||||
try {
|
try {
|
||||||
if (!value) value = '';
|
if (!value) value = '';
|
||||||
if (!treeModel) return;
|
|
||||||
|
|
||||||
if (is_cat)
|
if (is_cat)
|
||||||
treeItem = treeModel.store._itemsByIdentity['CAT:' + feed];
|
treeItem = treeModel.store._itemsByIdentity['CAT:' + feed];
|
||||||
@@ -804,7 +803,8 @@ function setFeedValue(feed, is_cat, key, value) {
|
|||||||
treeModel.store.setValue(treeItem, key, value);
|
treeModel.store.setValue(treeItem, key, value);
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
exception_error("setFeedValue", e);
|
console.log(e);
|
||||||
|
//exception_error("setFeedValue", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
10
functions.js
10
functions.js
@@ -394,8 +394,9 @@ function closeInfoBox(cleanup) {
|
|||||||
|
|
||||||
var dialog = dialogs.pop();
|
var dialog = dialogs.pop();
|
||||||
|
|
||||||
if (dialog)
|
if (dialog) {
|
||||||
dialog.hide();
|
dialog.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
//exception_error("closeInfoBox", e);
|
//exception_error("closeInfoBox", e);
|
||||||
@@ -408,6 +409,9 @@ function displayDlg(id, param, callback) {
|
|||||||
|
|
||||||
notify_progress("Loading, please wait...", true);
|
notify_progress("Loading, please wait...", true);
|
||||||
|
|
||||||
|
while (dialogs.length > 0)
|
||||||
|
closeInfoBox();
|
||||||
|
|
||||||
var query = "?op=dlg&id=" +
|
var query = "?op=dlg&id=" +
|
||||||
param_escape(id) + "¶m=" + param_escape(param);
|
param_escape(id) + "¶m=" + param_escape(param);
|
||||||
|
|
||||||
@@ -465,10 +469,12 @@ function infobox_callback2(transport) {
|
|||||||
style: "width: 600px",
|
style: "width: 600px",
|
||||||
onCancel: function() {
|
onCancel: function() {
|
||||||
dialogs.remove(this);
|
dialogs.remove(this);
|
||||||
|
this.destroy();
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
onExecute: function() {
|
onExecute: function() {
|
||||||
dialogs.remove(this);
|
dialogs.remove(this);
|
||||||
|
this.destroy();
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
onClose: function() {
|
onClose: function() {
|
||||||
|
|||||||
@@ -4577,8 +4577,10 @@
|
|||||||
</head><body>";
|
</head><body>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print "<div id=\"PTITLE-$id\" style=\"display : none\">" .
|
||||||
|
truncate_string(strip_tags($line['title']), 15) . "</div>";
|
||||||
|
|
||||||
print "<div class=\"postReply\">";
|
print "<div class=\"postReply\" id=\"POST-$id\">";
|
||||||
print "<div class=\"postHeader\">";
|
print "<div class=\"postHeader\">";
|
||||||
|
|
||||||
$entry_author = $line["author"];
|
$entry_author = $line["author"];
|
||||||
@@ -4615,7 +4617,7 @@
|
|||||||
print "<img src=\"".theme_image($link, 'images/art-zoom.png')."\"
|
print "<img src=\"".theme_image($link, 'images/art-zoom.png')."\"
|
||||||
class='tagsPic' style=\"cursor : pointer\"
|
class='tagsPic' style=\"cursor : pointer\"
|
||||||
onclick=\"zoomToArticle($id)\"
|
onclick=\"zoomToArticle($id)\"
|
||||||
alt='Zoom' title='".__('Show article summary in new window')."'>";
|
alt='Zoom' title='".__('Open article in new tab')."'>";
|
||||||
|
|
||||||
$note_escaped = htmlspecialchars($line['note'], ENT_QUOTES);
|
$note_escaped = htmlspecialchars($line['note'], ENT_QUOTES);
|
||||||
|
|
||||||
@@ -4631,6 +4633,11 @@
|
|||||||
alt='Zoom' title='".__('Forward by email')."'>";
|
alt='Zoom' title='".__('Forward by email')."'>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print "<img src=\"".theme_image($link, 'images/digest_checkbox.png')."\"
|
||||||
|
class='tagsPic' style=\"cursor : pointer\"
|
||||||
|
onclick=\"closeArticlePanel()\"
|
||||||
|
alt='Zoom' title='".__('Close this panel')."'>";
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$tags_str = strip_tags($tags_str);
|
$tags_str = strip_tags($tags_str);
|
||||||
print "<span id=\"ATSTR-$id\">$tags_str</span>";
|
print "<span id=\"ATSTR-$id\">$tags_str</span>";
|
||||||
@@ -5083,7 +5090,8 @@
|
|||||||
onmouseout='postMouseOut($id)'";
|
onmouseout='postMouseOut($id)'";
|
||||||
|
|
||||||
print "<div class=\"$class\"
|
print "<div class=\"$class\"
|
||||||
id=\"RROW-$id\"
|
id=\"RROW-$id\" onclick=\"return cdmClicked(event, $id);\"
|
||||||
|
|
||||||
$mouseover_attrs'>";
|
$mouseover_attrs'>";
|
||||||
|
|
||||||
print "<div class=\"cdmHeader\">";
|
print "<div class=\"cdmHeader\">";
|
||||||
@@ -5108,7 +5116,7 @@
|
|||||||
print "$published_pic";
|
print "$published_pic";
|
||||||
|
|
||||||
print "<span id=\"RTITLE-$id\"
|
print "<span id=\"RTITLE-$id\"
|
||||||
onclick=\"return cdmExpandArticle($id)\"
|
onclick=\"return false;\"
|
||||||
class=\"titleWrap$hlc_suffix\">
|
class=\"titleWrap$hlc_suffix\">
|
||||||
<a class=\"title\"
|
<a class=\"title\"
|
||||||
target=\"_blank\" href=\"".$line["link"]."\">".$line["title"]."</a>
|
target=\"_blank\" href=\"".$line["link"]."\">".$line["title"]."</a>
|
||||||
@@ -5123,13 +5131,11 @@
|
|||||||
$excerpt_hidden = "style=\"display : none\"";
|
$excerpt_hidden = "style=\"display : none\"";
|
||||||
|
|
||||||
print "<span $excerpt_hidden
|
print "<span $excerpt_hidden
|
||||||
onclick=\"return cdmExpandArticle($id)\"
|
|
||||||
id=\"CEXC-$id\" class=\"cdmExcerpt\"> - $content_preview</span>";
|
id=\"CEXC-$id\" class=\"cdmExcerpt\"> - $content_preview</span>";
|
||||||
|
|
||||||
print "</div>";
|
print "</div>";
|
||||||
|
|
||||||
print "<div class=\"cdmContent\" $content_hidden
|
print "<div class=\"cdmContent\" $content_hidden
|
||||||
onclick=\"return cdmClicked(event, $id);\"
|
|
||||||
id=\"CICD-$id\">";
|
id=\"CICD-$id\">";
|
||||||
|
|
||||||
print "<div class=\"cdmContentInner\">";
|
print "<div class=\"cdmContentInner\">";
|
||||||
@@ -5220,7 +5226,7 @@
|
|||||||
onclick=\"zoomToArticle($id)\"
|
onclick=\"zoomToArticle($id)\"
|
||||||
style=\"cursor : pointer\"
|
style=\"cursor : pointer\"
|
||||||
alt='Zoom'
|
alt='Zoom'
|
||||||
title='".__('Show article summary in new window')."'>";
|
title='".__('Open article in new tab')."'>";
|
||||||
|
|
||||||
if (DIGEST_ENABLE) {
|
if (DIGEST_ENABLE) {
|
||||||
print "<img src=\"".theme_image($link, 'images/art-email.png')."\"
|
print "<img src=\"".theme_image($link, 'images/art-email.png')."\"
|
||||||
|
|||||||
17
tt-rss.css
17
tt-rss.css
@@ -539,7 +539,7 @@ td.selectPrompt {
|
|||||||
}
|
}
|
||||||
|
|
||||||
div#headlines-toolbar {
|
div#headlines-toolbar {
|
||||||
border-width : 1px 0px 1px 1px;
|
border-width : 1px 0px 1px 0px;
|
||||||
background-color : #ecf4ff;
|
background-color : #ecf4ff;
|
||||||
border-color : #88b0f0 #88b0f0 #ecf4ff #88b0f0;
|
border-color : #88b0f0 #88b0f0 #ecf4ff #88b0f0;
|
||||||
font-size : 11px;
|
font-size : 11px;
|
||||||
@@ -1447,6 +1447,7 @@ div.fatalError textarea {
|
|||||||
#headlines-frame {
|
#headlines-frame {
|
||||||
padding : 0px;
|
padding : 0px;
|
||||||
border-color : #88b0f0;
|
border-color : #88b0f0;
|
||||||
|
border-left-width : 0px;
|
||||||
border-right-width : 0px;
|
border-right-width : 0px;
|
||||||
margin-top : 0px;
|
margin-top : 0px;
|
||||||
border-top-width : 0px;
|
border-top-width : 0px;
|
||||||
@@ -1460,8 +1461,19 @@ div.fatalError textarea {
|
|||||||
font-size : 12px;
|
font-size : 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#toolbar {
|
#content-tabs {
|
||||||
|
margin : 0px;
|
||||||
padding : 0px;
|
padding : 0px;
|
||||||
|
border-width : 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#content-tabs .dijitTab {
|
||||||
|
margin-top : 0px;
|
||||||
|
padding-top : 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#toolbar {
|
||||||
|
padding : 5px 0px 0px 5px;
|
||||||
margin : 0px;
|
margin : 0px;
|
||||||
border-width : 0px;
|
border-width : 0px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
@@ -1485,6 +1497,7 @@ div.fatalError textarea {
|
|||||||
border-color : #88b0f0;
|
border-color : #88b0f0;
|
||||||
border-bottom-width : 0px;
|
border-bottom-width : 0px;
|
||||||
border-right-width : 0px;
|
border-right-width : 0px;
|
||||||
|
border-left-width : 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dijitTreeLabel.Unread {
|
.dijitTreeLabel.Unread {
|
||||||
|
|||||||
@@ -281,6 +281,7 @@ function init() {
|
|||||||
Form.disable("main_toolbar_form");
|
Form.disable("main_toolbar_form");
|
||||||
|
|
||||||
dojo.require("dijit.layout.BorderContainer");
|
dojo.require("dijit.layout.BorderContainer");
|
||||||
|
dojo.require("dijit.layout.TabContainer");
|
||||||
dojo.require("dijit.layout.ContentPane");
|
dojo.require("dijit.layout.ContentPane");
|
||||||
dojo.require("dijit.Dialog");
|
dojo.require("dijit.Dialog");
|
||||||
dojo.require("dijit.form.Button");
|
dojo.require("dijit.form.Button");
|
||||||
@@ -290,9 +291,8 @@ function init() {
|
|||||||
dojo.require("dojo.parser");
|
dojo.require("dojo.parser");
|
||||||
|
|
||||||
dojo.addOnLoad(function() {
|
dojo.addOnLoad(function() {
|
||||||
|
|
||||||
updateFeedList();
|
updateFeedList();
|
||||||
|
closeArticlePanel();
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!genericSanityCheck())
|
if (!genericSanityCheck())
|
||||||
|
|||||||
@@ -126,7 +126,9 @@
|
|||||||
<div id="feedTree"></div>
|
<div id="feedTree"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div dojoType="dijit.layout.BorderContainer" region="center" id="content-wrap">
|
<div dojoType="dijit.layout.TabContainer" region="center" id="content-tabs">
|
||||||
|
<div dojoType="dijit.layout.BorderContainer" region="center" id="content-wrap"
|
||||||
|
title="News">
|
||||||
|
|
||||||
<div id="toolbar" dojoType="dijit.layout.ContentPane" region="top">
|
<div id="toolbar" dojoType="dijit.layout.ContentPane" region="top">
|
||||||
|
|
||||||
@@ -215,6 +217,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- <div id="footer" dojoType="dijit.layout.ContentPane" region="bottom">
|
<!-- <div id="footer" dojoType="dijit.layout.ContentPane" region="bottom">
|
||||||
<a href="http://tt-rss.org/">Tiny Tiny RSS</a>
|
<a href="http://tt-rss.org/">Tiny Tiny RSS</a>
|
||||||
|
|||||||
127
viewfeed.js
127
viewfeed.js
@@ -207,6 +207,9 @@ function render_article(article) {
|
|||||||
f.scrollTop = 0;
|
f.scrollTop = 0;
|
||||||
} catch (e) { };
|
} catch (e) { };
|
||||||
|
|
||||||
|
dijit.byId("headlines-wrap-inner").addChild(
|
||||||
|
dijit.byId("content-insert"));
|
||||||
|
|
||||||
var fi = $("content-insert");
|
var fi = $("content-insert");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -582,14 +585,14 @@ function moveToPost(mode) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleSelected(id) {
|
function toggleSelected(id, force_on) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
var cb = $("RCHK-" + id);
|
var cb = $("RCHK-" + id);
|
||||||
var row = $("RROW-" + id);
|
var row = $("RROW-" + id);
|
||||||
|
|
||||||
if (row) {
|
if (row) {
|
||||||
if (row.hasClassName('Selected')) {
|
if (row.hasClassName('Selected') && !force_on) {
|
||||||
row.removeClassName('Selected');
|
row.removeClassName('Selected');
|
||||||
if (cb) cb.checked = false;
|
if (cb) cb.checked = false;
|
||||||
} else {
|
} else {
|
||||||
@@ -1091,7 +1094,7 @@ function editTagsSave() {
|
|||||||
|
|
||||||
query = "?op=rpc&subop=setArticleTags&" + query;
|
query = "?op=rpc&subop=setArticleTags&" + query;
|
||||||
|
|
||||||
//console.log(query);
|
console.log(query);
|
||||||
|
|
||||||
new Ajax.Request("backend.php", {
|
new Ajax.Request("backend.php", {
|
||||||
parameters: query,
|
parameters: query,
|
||||||
@@ -1715,9 +1718,56 @@ function getArticleUnderPointer() {
|
|||||||
|
|
||||||
function zoomToArticle(id) {
|
function zoomToArticle(id) {
|
||||||
try {
|
try {
|
||||||
var w = window.open("backend.php?op=view&mode=zoom&id=" + param_escape(id),
|
/* var w = window.open("backend.php?op=view&mode=zoom&id=" + param_escape(id),
|
||||||
"ttrss_zoom_" + id,
|
"ttrss_zoom_" + id,
|
||||||
"status=0,toolbar=0,location=0,width=450,height=300,scrollbars=1,menubar=0");
|
"status=0,toolbar=0,location=0,width=450,height=300,scrollbars=1,menubar=0"); */
|
||||||
|
|
||||||
|
var cached_article = cache_find(id);
|
||||||
|
|
||||||
|
if (cached_article) {
|
||||||
|
|
||||||
|
var article_pane = new dijit.layout.ContentPane({
|
||||||
|
title: __("Loading...") , content: cached_article,
|
||||||
|
style: 'padding : 0px;',
|
||||||
|
closable: true });
|
||||||
|
|
||||||
|
dijit.byId("content-tabs").addChild(article_pane);
|
||||||
|
dijit.byId("content-tabs").selectChild(article_pane);
|
||||||
|
|
||||||
|
if ($("PTITLE-" + id))
|
||||||
|
article_pane.attr('title', $("PTITLE-" + id).innerHTML);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
var query = "?op=rpc&subop=getArticles&ids=" + param_escape(id);
|
||||||
|
|
||||||
|
notify_progress("Loading, please wait...", true);
|
||||||
|
|
||||||
|
new Ajax.Request("backend.php", {
|
||||||
|
parameters: query,
|
||||||
|
onComplete: function(transport) {
|
||||||
|
notify('');
|
||||||
|
|
||||||
|
if (transport.responseXML) {
|
||||||
|
closeArticlePanel();
|
||||||
|
|
||||||
|
var article = transport.responseXML.getElementsByTagName("article")[0];
|
||||||
|
var content = article.firstChild.nodeValue;
|
||||||
|
|
||||||
|
var article_pane = new dijit.layout.ContentPane({
|
||||||
|
title: "article-" + id , content: content,
|
||||||
|
style: 'padding : 0px;',
|
||||||
|
closable: true });
|
||||||
|
|
||||||
|
dijit.byId("content-tabs").addChild(article_pane);
|
||||||
|
dijit.byId("content-tabs").selectChild(article_pane);
|
||||||
|
|
||||||
|
if ($("PTITLE-" + id))
|
||||||
|
article_pane.attr('title', $("PTITLE-" + id).innerHTML);
|
||||||
|
}
|
||||||
|
|
||||||
|
} });
|
||||||
|
}
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
exception_error("zoomToArticle", e);
|
exception_error("zoomToArticle", e);
|
||||||
@@ -1971,36 +2021,43 @@ function cdmClicked(event, id) {
|
|||||||
hideAuxDlg();
|
hideAuxDlg();
|
||||||
|
|
||||||
if (!event.ctrlKey) {
|
if (!event.ctrlKey) {
|
||||||
selectArticles("none");
|
|
||||||
toggleSelected(id);
|
|
||||||
|
|
||||||
var elem = $("RROW-" + id);
|
if (!getInitParam("cdm_expanded")) {
|
||||||
|
return cdmExpandArticle(id);
|
||||||
|
} else {
|
||||||
|
|
||||||
if (elem)
|
selectArticles("none");
|
||||||
elem.removeClassName("Unread");
|
toggleSelected(id);
|
||||||
|
|
||||||
var upd_img_pic = $("FUPDPIC-" + id);
|
var elem = $("RROW-" + id);
|
||||||
|
|
||||||
if (upd_img_pic && (upd_img_pic.src.match("updated.png") ||
|
if (elem)
|
||||||
upd_img_pic.src.match("fresh_sign.png"))) {
|
elem.removeClassName("Unread");
|
||||||
|
|
||||||
upd_img_pic.src = "images/blank_icon.gif";
|
var upd_img_pic = $("FUPDPIC-" + id);
|
||||||
|
|
||||||
|
if (upd_img_pic && (upd_img_pic.src.match("updated.png") ||
|
||||||
|
upd_img_pic.src.match("fresh_sign.png"))) {
|
||||||
|
|
||||||
|
upd_img_pic.src = "images/blank_icon.gif";
|
||||||
|
}
|
||||||
|
|
||||||
|
active_post_id = id;
|
||||||
|
|
||||||
|
var query = "?op=rpc&subop=catchupSelected" +
|
||||||
|
"&cmode=0&ids=" + param_escape(id);
|
||||||
|
|
||||||
|
new Ajax.Request("backend.php", {
|
||||||
|
parameters: query,
|
||||||
|
onComplete: function(transport) {
|
||||||
|
handle_rpc_reply(transport);
|
||||||
|
} });
|
||||||
}
|
}
|
||||||
|
|
||||||
active_post_id = id;
|
|
||||||
|
|
||||||
var query = "?op=rpc&subop=catchupSelected" +
|
|
||||||
"&cmode=0&ids=" + param_escape(id);
|
|
||||||
|
|
||||||
new Ajax.Request("backend.php", {
|
|
||||||
parameters: query,
|
|
||||||
onComplete: function(transport) {
|
|
||||||
handle_rpc_reply(transport);
|
|
||||||
} });
|
|
||||||
|
|
||||||
return true;
|
|
||||||
} else {
|
} else {
|
||||||
toggleSelected(id);
|
toggleSelected(id, true);
|
||||||
|
toggleUnread(id, 0, false);
|
||||||
|
zoomToArticle(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -2017,7 +2074,9 @@ function hlClicked(event, id) {
|
|||||||
view(id);
|
view(id);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
toggleSelected(id);
|
toggleSelected(id, true);
|
||||||
|
toggleUnread(id, 0, false);
|
||||||
|
zoomToArticle(id);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2172,3 +2231,9 @@ function headlineActionsChange(elem) {
|
|||||||
exception_error("headlineActionsChange", e);
|
exception_error("headlineActionsChange", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function closeArticlePanel() {
|
||||||
|
if (dijit.byId("content-insert"))
|
||||||
|
dijit.byId("headlines-wrap-inner").removeChild(
|
||||||
|
dijit.byId("content-insert"));
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user