isCdmMode -> isCombinedMode

master
Andrew Dolgov 6 years ago
parent 32d36d439c
commit 3325979bf0

@ -335,7 +335,7 @@ function init_hotkey_actions() {
scrollArticle(-40); scrollArticle(-40);
}; };
hotkey_actions["close_article"] = function() { hotkey_actions["close_article"] = function() {
if (isCdmMode()) { if (isCombinedMode()) {
cdmCollapseActive(); cdmCollapseActive();
} else { } else {
closeArticlePanel(); closeArticlePanel();
@ -477,7 +477,7 @@ function init_hotkey_actions() {
} }
}; };
hotkey_actions["toggle_widescreen"] = function() { hotkey_actions["toggle_widescreen"] = function() {
if (!isCdmMode()) { if (!isCombinedMode()) {
_widescreen_mode = !_widescreen_mode; _widescreen_mode = !_widescreen_mode;
// reset stored sizes because geometry changed // reset stored sizes because geometry changed
@ -495,7 +495,7 @@ function init_hotkey_actions() {
hotkey_actions["toggle_combined_mode"] = function() { hotkey_actions["toggle_combined_mode"] = function() {
notify_progress("Loading, please wait..."); notify_progress("Loading, please wait...");
const value = isCdmMode() ? "false" : "true"; const value = isCombinedMode() ? "false" : "true";
xhrPost("backend.php", {op: "rpc", method: "setpref", key: "COMBINED_DISPLAY_MODE", value: value}, () => { xhrPost("backend.php", {op: "rpc", method: "setpref", key: "COMBINED_DISPLAY_MODE", value: value}, () => {
setInitParam("combined_display_mode", setInitParam("combined_display_mode",
@ -643,7 +643,7 @@ function quickMenuGo(opid) {
toggleDispRead(); toggleDispRead();
break; break;
case "qmcToggleWidescreen": case "qmcToggleWidescreen":
if (!isCdmMode()) { if (!isCombinedMode()) {
_widescreen_mode = !_widescreen_mode; _widescreen_mode = !_widescreen_mode;
// reset stored sizes because geometry changed // reset stored sizes because geometry changed
@ -851,7 +851,7 @@ function handle_rpc_json(transport, scheduled_call) {
} }
function switchPanelMode(wide) { function switchPanelMode(wide) {
if (isCdmMode()) return; if (isCombinedMode()) return;
const article_id = getActiveArticleId(); const article_id = getActiveArticleId();

@ -54,7 +54,7 @@ function headlines_callback2(transport, offset, background, infscroll_req) {
$("headlines-frame").removeClassName("cdm"); $("headlines-frame").removeClassName("cdm");
$("headlines-frame").removeClassName("normal"); $("headlines-frame").removeClassName("normal");
$("headlines-frame").addClassName(isCdmMode() ? "cdm" : "normal"); $("headlines-frame").addClassName(isCombinedMode() ? "cdm" : "normal");
const headlines_count = reply['headlines-info']['count']; const headlines_count = reply['headlines-info']['count'];
@ -524,7 +524,7 @@ function moveToPost(mode, noscroll, noexpand) {
if (mode == "next") { if (mode == "next") {
if (next_id || getActiveArticleId()) { if (next_id || getActiveArticleId()) {
if (isCdmMode()) { if (isCombinedMode()) {
const article = $("RROW-" + getActiveArticleId()); const article = $("RROW-" + getActiveArticleId());
const ctr = $("headlines-frame"); const ctr = $("headlines-frame");
@ -548,7 +548,7 @@ function moveToPost(mode, noscroll, noexpand) {
if (mode == "prev") { if (mode == "prev") {
if (prev_id || getActiveArticleId()) { if (prev_id || getActiveArticleId()) {
if (isCdmMode()) { if (isCombinedMode()) {
const article = $("RROW-" + getActiveArticleId()); const article = $("RROW-" + getActiveArticleId());
const prev_article = $("RROW-" + prev_id); const prev_article = $("RROW-" + prev_id);
@ -654,7 +654,7 @@ function selectionRemoveLabel(id, ids) {
xhrPost("backend.php", query, (transport) => { xhrPost("backend.php", query, (transport) => {
handle_rpc_json(transport); handle_rpc_json(transport);
show_labels_in_headlines(transport); updateHeadlineLabels(transport);
}); });
} }
@ -671,7 +671,7 @@ function selectionAssignLabel(id, ids) {
xhrPost("backend.php", query, (transport) => { xhrPost("backend.php", query, (transport) => {
handle_rpc_json(transport); handle_rpc_json(transport);
show_labels_in_headlines(transport); updateHeadlineLabels(transport);
}); });
} }
@ -1156,7 +1156,7 @@ function postMouseOut(id) {
} }
function unpackVisibleHeadlines() { function unpackVisibleHeadlines() {
if (!isCdmMode() || !getInitParam("cdm_expanded")) return; if (!isCombinedMode() || !getInitParam("cdm_expanded")) return;
const rows = $$("#headlines-frame div[id*=RROW][data-content]"); const rows = $$("#headlines-frame div[id*=RROW][data-content]");
const threshold = $("headlines-frame").scrollTop + $("headlines-frame").offsetHeight + 300; const threshold = $("headlines-frame").scrollTop + $("headlines-frame").offsetHeight + 300;
@ -1195,7 +1195,7 @@ function headlines_scroll_handler(e) {
unpackVisibleHeadlines(); unpackVisibleHeadlines();
// set topmost child in the buffer as active // set topmost child in the buffer as active
if (isCdmMode() && getInitParam("cdm_expanded") && getInitParam("cdm_auto_catchup") == 1) { if (isCombinedMode() && getInitParam("cdm_expanded") && getInitParam("cdm_auto_catchup") == 1) {
const rows = $$("#headlines-frame > div[id*=RROW]"); const rows = $$("#headlines-frame > div[id*=RROW]");
@ -1236,7 +1236,7 @@ function headlines_scroll_handler(e) {
} }
} }
if (isCdmMode()) { if (isCombinedMode()) {
updateFloatingTitle(); updateFloatingTitle();
} }
@ -1384,7 +1384,7 @@ function getArticleUnderPointer() {
} }
function scrollArticle(offset) { function scrollArticle(offset) {
if (!isCdmMode()) { if (!isCombinedMode()) {
const ci = $("content-insert"); const ci = $("content-insert");
if (ci) { if (ci) {
ci.scrollTop += offset; ci.scrollTop += offset;
@ -1398,7 +1398,7 @@ function scrollArticle(offset) {
} }
} }
function show_labels_in_headlines(transport) { function updateHeadlineLabels(transport) {
const data = JSON.parse(transport.responseText); const data = JSON.parse(transport.responseText);
if (data) { if (data) {
@ -1508,7 +1508,7 @@ function openArticleInNewWindow(id) {
w.location = "backend.php?op=article&method=redirect&id=" + id; w.location = "backend.php?op=article&method=redirect&id=" + id;
} }
function isCdmMode() { function isCombinedMode() {
return getInitParam("combined_display_mode"); return getInitParam("combined_display_mode");
} }
@ -1914,7 +1914,7 @@ function scrollToRowId(id) {
} }
function updateFloatingTitle(unread_only) { function updateFloatingTitle(unread_only) {
if (!isCdmMode() || !getInitParam("cdm_expanded")) return; if (!isCombinedMode() || !getInitParam("cdm_expanded")) return;
const hf = $("headlines-frame"); const hf = $("headlines-frame");
const elems = $$("#headlines-frame > div[id*=RROW]"); const elems = $$("#headlines-frame > div[id*=RROW]");

@ -9,7 +9,7 @@ function embedOriginalArticle(id) {
let c = false; let c = false;
if (isCdmMode()) { if (isCombinedMode()) {
c = $$("div#RROW-" + id + " div[class=content-inner]")[0]; c = $$("div#RROW-" + id + " div[class=content-inner]")[0];
} else if (id == getActiveArticleId()) { } else if (id == getActiveArticleId()) {
c = $$(".post .content")[0]; c = $$(".post .content")[0];
@ -22,7 +22,7 @@ function embedOriginalArticle(id) {
Element.show(c); Element.show(c);
c.parentNode.removeChild(iframe); c.parentNode.removeChild(iframe);
if (isCdmMode()) { if (isCombinedMode()) {
cdmScrollToArticleId(id, true); cdmScrollToArticleId(id, true);
} }
@ -47,7 +47,7 @@ function embedOriginalArticle(id) {
Element.hide(c); Element.hide(c);
c.parentNode.insertBefore(iframe, c); c.parentNode.insertBefore(iframe, c);
if (isCdmMode()) { if (isCombinedMode()) {
cdmScrollToArticleId(id, true); cdmScrollToArticleId(id, true);
} }
} }

Loading…
Cancel
Save