mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 13:35:56 +00:00
bring back (debloated) version of unexpanded combined mode
This commit is contained in:
20
js/tt-rss.js
20
js/tt-rss.js
@@ -335,7 +335,11 @@ function init_hotkey_actions() {
|
||||
scrollArticle(-40);
|
||||
};
|
||||
hotkey_actions["close_article"] = function() {
|
||||
closeArticlePanel();
|
||||
if (isCdmMode()) {
|
||||
cdmCollapseActive();
|
||||
} else {
|
||||
closeArticlePanel();
|
||||
}
|
||||
};
|
||||
hotkey_actions["email_article"] = function() {
|
||||
if (typeof emailArticle != "undefined") {
|
||||
@@ -501,6 +505,20 @@ function init_hotkey_actions() {
|
||||
viewCurrentFeed();
|
||||
})
|
||||
};
|
||||
hotkey_actions["toggle_cdm_expanded"] = function() {
|
||||
notify_progress("Loading, please wait...");
|
||||
|
||||
const value = getInitParam("cdm_expanded") ? "false" : "true";
|
||||
const query = "?op=rpc&method=setpref&key=CDM_EXPANDED&value=" + value;
|
||||
|
||||
new Ajax.Request("backend.php", {
|
||||
parameters: query,
|
||||
onComplete: function(transport) {
|
||||
setInitParam("cdm_expanded", !getInitParam("cdm_expanded"));
|
||||
viewCurrentFeed();
|
||||
} });
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
function init_second_stage() {
|
||||
|
||||
@@ -535,8 +535,8 @@ function moveToPost(mode, noscroll, noexpand) {
|
||||
scrollArticle(ctr.offsetHeight/4);
|
||||
|
||||
} else if (next_id) {
|
||||
cdmScrollToArticleId(next_id, true);
|
||||
setActiveArticleId(next_id);
|
||||
cdmScrollToArticleId(next_id, true);
|
||||
}
|
||||
|
||||
} else if (next_id) {
|
||||
@@ -560,8 +560,8 @@ function moveToPost(mode, noscroll, noexpand) {
|
||||
prev_article.offsetTop < ctr.scrollTop) {
|
||||
scrollArticle(-ctr.offsetHeight/4);
|
||||
} else if (prev_id) {
|
||||
cdmScrollToArticleId(prev_id, noscroll);
|
||||
setActiveArticleId(prev_id);
|
||||
cdmScrollToArticleId(prev_id, noscroll);
|
||||
}
|
||||
|
||||
} else if (prev_id) {
|
||||
@@ -1162,8 +1162,8 @@ function unpackVisibleHeadlines() {
|
||||
PluginHost.run(PluginHost.HOOK_ARTICLE_RENDERED_CDM, row);
|
||||
|
||||
// i wonder if this is a good idea?
|
||||
if (!getActiveArticleId() && !row.hasClassName("Unread"))
|
||||
setActiveArticleId(row.getAttribute("data-article-id"));
|
||||
//if (!getActiveArticleId() && !row.hasClassName("Unread"))
|
||||
// setActiveArticleId(row.getAttribute("data-article-id"));
|
||||
|
||||
} else {
|
||||
break;
|
||||
@@ -1184,7 +1184,7 @@ function headlines_scroll_handler(e) {
|
||||
unpackVisibleHeadlines();
|
||||
|
||||
// set topmost child in the buffer as active
|
||||
if (isCdmMode() && getInitParam("cdm_auto_catchup") == 1) {
|
||||
if (isCdmMode() && getInitParam("cdm_expanded") && getInitParam("cdm_auto_catchup") == 1) {
|
||||
|
||||
const rows = $$("#headlines-frame > div[id*=RROW]");
|
||||
|
||||
@@ -1400,12 +1400,16 @@ function show_labels_in_headlines(transport) {
|
||||
}
|
||||
|
||||
function cdmClicked(event, id, in_body) {
|
||||
if (event.ctrlKey && !in_body || !in_body) {
|
||||
|
||||
if (!in_body && (event.ctrlKey || id == getActiveArticleId() || getInitParam("cdm_expanded"))) {
|
||||
openArticleInNewWindow(id);
|
||||
}
|
||||
|
||||
setActiveArticleId(id);
|
||||
|
||||
if (!getInitParam("cdm_expanded"))
|
||||
cdmScrollToArticleId(id);
|
||||
|
||||
//var shift_key = event.shiftKey;
|
||||
|
||||
/* if (!event.ctrlKey && !event.metaKey) {
|
||||
@@ -1563,6 +1567,25 @@ function headlineActionsChange(elem) {
|
||||
elem.attr('value', 'false');
|
||||
}
|
||||
|
||||
function cdmCollapseActive(event) {
|
||||
const row = $("RROW-" + getActiveArticleId());
|
||||
|
||||
if (row) {
|
||||
row.removeClassName("active");
|
||||
const cb = dijit.getEnclosingWidget(row.select(".rchk")[0]);
|
||||
|
||||
if (cb && !row.hasClassName("Selected"))
|
||||
cb.attr("checked", false);
|
||||
|
||||
setActiveArticleId(0);
|
||||
|
||||
if (event)
|
||||
event.stopPropagation();
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function closeArticlePanel() {
|
||||
if (dijit.byId("content-insert"))
|
||||
dijit.byId("headlines-wrap-inner").removeChild(
|
||||
@@ -1880,7 +1903,7 @@ function scrollToRowId(id) {
|
||||
}
|
||||
|
||||
function updateFloatingTitle(unread_only) {
|
||||
if (!isCdmMode()) return;
|
||||
if (!isCdmMode() || !getInitParam("cdm_expanded")) return;
|
||||
|
||||
const hf = $("headlines-frame");
|
||||
const elems = $$("#headlines-frame > div[id*=RROW]");
|
||||
|
||||
Reference in New Issue
Block a user