make a separate headline button to collapse current article in
unexpanded cdm mode; modify a q hotkey to collapse article in unexpanded mode and dismiss article in expanded mode
This commit is contained in:
parent
b799dc8b0d
commit
414191d428
|
@ -548,6 +548,10 @@ class Feeds extends Handler_Protected {
|
||||||
|
|
||||||
$reply['content'] .= $labels_str;
|
$reply['content'] .= $labels_str;
|
||||||
|
|
||||||
|
$reply['content'] .= "<span class='collapseBtn' style='display : none'>
|
||||||
|
<img src=\"images/collapse.png\" onclick=\"cdmCollapseArticle(event, $id)\"
|
||||||
|
title=\"".__("Collapse article")."\"/></span>";
|
||||||
|
|
||||||
if (!$expand_cdm)
|
if (!$expand_cdm)
|
||||||
$content_hidden = "style=\"display : none\"";
|
$content_hidden = "style=\"display : none\"";
|
||||||
else
|
else
|
||||||
|
@ -555,7 +559,6 @@ class Feeds extends Handler_Protected {
|
||||||
|
|
||||||
$reply['content'] .= "<span $excerpt_hidden
|
$reply['content'] .= "<span $excerpt_hidden
|
||||||
id=\"CEXC-$id\" class=\"cdmExcerpt\"> - $content_preview</span>";
|
id=\"CEXC-$id\" class=\"cdmExcerpt\"> - $content_preview</span>";
|
||||||
|
|
||||||
$reply['content'] .= "</span>";
|
$reply['content'] .= "</span>";
|
||||||
|
|
||||||
if (!get_pref($this->link, 'VFEED_GROUP_BY_FEED')) {
|
if (!get_pref($this->link, 'VFEED_GROUP_BY_FEED')) {
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 186 B |
|
@ -1889,7 +1889,7 @@
|
||||||
"article_scroll_up" => __("Scroll up"),
|
"article_scroll_up" => __("Scroll up"),
|
||||||
"select_article_cursor" => __("Select article under cursor"),
|
"select_article_cursor" => __("Select article under cursor"),
|
||||||
"email_article" => __("Email article"),
|
"email_article" => __("Email article"),
|
||||||
"close_article" => __("Close article"),
|
"close_article" => __("Close/collapse article"),
|
||||||
"toggle_widescreen" => __("Toggle widescreen mode")),
|
"toggle_widescreen" => __("Toggle widescreen mode")),
|
||||||
__("Article selection") => array(
|
__("Article selection") => array(
|
||||||
"select_all" => __("Select all articles"),
|
"select_all" => __("Select all articles"),
|
||||||
|
|
|
@ -669,7 +669,15 @@ function hotkey_handler(e) {
|
||||||
scrollArticle(-ctr.offsetHeight/3);
|
scrollArticle(-ctr.offsetHeight/3);
|
||||||
return false;
|
return false;
|
||||||
case "close_article":
|
case "close_article":
|
||||||
|
if (isCdmMode()) {
|
||||||
|
if (!getInitParam("cdm_expanded")) {
|
||||||
|
cdmCollapseArticle(false, getActiveArticleId());
|
||||||
|
} else {
|
||||||
|
dismissArticle(getActiveArticleId());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
closeArticlePanel();
|
closeArticlePanel();
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
case "email_article":
|
case "email_article":
|
||||||
if (typeof emailArticle != "undefined") {
|
if (typeof emailArticle != "undefined") {
|
||||||
|
|
|
@ -1312,6 +1312,35 @@ function catchupRelativeToArticle(below, id) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function cdmCollapseArticle(event, id) {
|
||||||
|
try {
|
||||||
|
var row = $("RROW-" + id);
|
||||||
|
var elem = $("CICD-" + id);
|
||||||
|
|
||||||
|
if (elem && row) {
|
||||||
|
row.removeClassName("Selected");
|
||||||
|
|
||||||
|
var collapse = $$("div#RROW-" + id +
|
||||||
|
" span[class='collapseBtn']")[0];
|
||||||
|
|
||||||
|
Element.hide(elem);
|
||||||
|
Element.show("CEXC-" + id);
|
||||||
|
Element.hide(collapse);
|
||||||
|
|
||||||
|
markHeadline(id, false);
|
||||||
|
|
||||||
|
if (id == getActiveArticleId()) {
|
||||||
|
setActiveArticleId(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event) Event.stop(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (e) {
|
||||||
|
exception_error("cdmCollapseArticle", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function cdmExpandArticle(id) {
|
function cdmExpandArticle(id) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
@ -1327,17 +1356,25 @@ function cdmExpandArticle(id) {
|
||||||
var old_offset = $("RROW-" + id).offsetTop;
|
var old_offset = $("RROW-" + id).offsetTop;
|
||||||
|
|
||||||
if (getActiveArticleId() && elem && !getInitParam("cdm_expanded")) {
|
if (getActiveArticleId() && elem && !getInitParam("cdm_expanded")) {
|
||||||
|
var collapse = $$("div#RROW-" + getActiveArticleId() +
|
||||||
|
" span[class='collapseBtn']")[0];
|
||||||
|
|
||||||
Element.hide(elem);
|
Element.hide(elem);
|
||||||
Element.show("CEXC-" + getActiveArticleId());
|
Element.show("CEXC-" + getActiveArticleId());
|
||||||
|
Element.hide(collapse);
|
||||||
}
|
}
|
||||||
|
|
||||||
setActiveArticleId(id);
|
setActiveArticleId(id);
|
||||||
|
|
||||||
elem = $("CICD-" + id);
|
elem = $("CICD-" + id);
|
||||||
|
|
||||||
|
var collapse = $$("div#RROW-" + id +
|
||||||
|
" span[class='collapseBtn']")[0];
|
||||||
|
|
||||||
if (!Element.visible(elem)) {
|
if (!Element.visible(elem)) {
|
||||||
Element.show(elem);
|
Element.show(elem);
|
||||||
Element.hide("CEXC-" + id);
|
Element.hide("CEXC-" + id);
|
||||||
|
Element.show(collapse);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* var new_offset = $("RROW-" + id).offsetTop;
|
/* var new_offset = $("RROW-" + id).offsetTop;
|
||||||
|
@ -1514,6 +1551,7 @@ function cdmClicked(event, id) {
|
||||||
if (!event.ctrlKey) {
|
if (!event.ctrlKey) {
|
||||||
|
|
||||||
if (!getInitParam("cdm_expanded")) {
|
if (!getInitParam("cdm_expanded")) {
|
||||||
|
if (event) Event.stop(event);
|
||||||
return cdmExpandArticle(id);
|
return cdmExpandArticle(id);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -1609,13 +1647,15 @@ function isCdmMode() {
|
||||||
return getInitParam("combined_display_mode");
|
return getInitParam("combined_display_mode");
|
||||||
}
|
}
|
||||||
|
|
||||||
function markHeadline(id) {
|
function markHeadline(id, marked) {
|
||||||
|
if (marked == undefined) marked = true;
|
||||||
|
|
||||||
var row = $("RROW-" + id);
|
var row = $("RROW-" + id);
|
||||||
if (row) {
|
if (row) {
|
||||||
var check = dijit.byId("RCHK-" + id);
|
var check = dijit.byId("RCHK-" + id);
|
||||||
|
|
||||||
if (check) {
|
if (check) {
|
||||||
check.attr("checked", true);
|
check.attr("checked", marked);
|
||||||
}
|
}
|
||||||
|
|
||||||
row.addClassName("Selected");
|
row.addClassName("Selected");
|
||||||
|
|
|
@ -1189,3 +1189,7 @@ ul.helpKbList h2 {
|
||||||
.dijitTreeNode .loadingNode {
|
.dijitTreeNode .loadingNode {
|
||||||
margin-left : 3px;
|
margin-left : 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
span.collapseBtn {
|
||||||
|
cursor : pointer;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue