summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid A. Madore <david+git@madore.org>2014-10-17 13:49:57 (GMT)
committerDavid A. Madore <david+git@madore.org>2014-10-17 13:49:57 (GMT)
commit091a8a525b668761f721cb51167a1bd8acf6b423 (patch)
treed6926c4f88edf13af9c4c26503940197308f0db2
parent6c4cab0a9f5dbc019d81eeaeae46c8f17c7bdca7 (diff)
downloaddamlengine-091a8a525b668761f721cb51167a1bd8acf6b423.zip
damlengine-091a8a525b668761f721cb51167a1bd8acf6b423.tar.gz
damlengine-091a8a525b668761f721cb51167a1bd8acf6b423.tar.bz2
Make the link to continue reading a parent of the main div, not at the cut-here level.
-rw-r--r--org/madore/damlengine/TodoCutHere.java28
-rw-r--r--org/madore/damlengine/TodoEntryElement.java1
2 files changed, 17 insertions, 12 deletions
diff --git a/org/madore/damlengine/TodoCutHere.java b/org/madore/damlengine/TodoCutHere.java
index 51935e7..4438b5f 100644
--- a/org/madore/damlengine/TodoCutHere.java
+++ b/org/madore/damlengine/TodoCutHere.java
@@ -38,7 +38,23 @@ public final class TodoCutHere extends TodoDefaultElement {
div.appendChild(ctx.doc.createComment(" EMPTY "));
node.getParentNode().replaceChild(div, node);
} else {
+ // Remove every node that follows.
+ Node killPoint = node;
+ while ( ! killPoint.isSameNode(ctx.ent.mainDivNode) ) {
+ Node parent = killPoint.getParentNode();
+ while ( killPoint.getNextSibling() != null )
+ parent.removeChild(killPoint.getNextSibling());
+ // FIXME: deleted node may already have found its way
+ // in the todo deque, which means it could cause a
+ // null pointer exception by trying to access its
+ // parent node. Do something about this!
+ killPoint = parent;
+ }
+ // Remove the cut-point node itself.
+ node.getParentNode().removeChild(node);
+ // Now add the link to the full content.
Element p = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "p");
+ ctx.ent.mainDivNode.appendChild(p);
Element a = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "a");
p.appendChild(a);
final String baseDir = ((ctx.gc.uriToTop==null)?"":(ctx.gc.uriToTop+"weblog/"));
@@ -56,18 +72,6 @@ public final class TodoCutHere extends TodoDefaultElement {
a.appendChild(ctx.doc.createTextNode("[Leger ultra\u2026]"));
else
a.appendChild(ctx.doc.createTextNode("[\u2026]"));
- node.getParentNode().replaceChild(p, node);
- Node killPoint = p;
- while ( ! killPoint.isSameNode(ctx.ent.mainDivNode) ) {
- Node parent = killPoint.getParentNode();
- while ( killPoint.getNextSibling() != null )
- parent.removeChild(killPoint.getNextSibling());
- // FIXME: deleted node may already have found its way
- // in the todo deque, which means it could cause a
- // null pointer exception by trying to access its
- // parent node. Do something about this!
- killPoint = parent;
- }
}
}
diff --git a/org/madore/damlengine/TodoEntryElement.java b/org/madore/damlengine/TodoEntryElement.java
index fa29ebe..c41237b 100644
--- a/org/madore/damlengine/TodoEntryElement.java
+++ b/org/madore/damlengine/TodoEntryElement.java
@@ -161,6 +161,7 @@ public final class TodoEntryElement extends TodoDefaultElement {
Element footer = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "footer");
article.appendChild(footer);
article.appendChild(ctx.doc.createTextNode("\n"));
+ footer.setAttributeNS(null, "class", "entry-footer cleared");
if ( entryCatList.size() > 0 ) {
Element token = ctx.doc.createElementNS(DamlEngine.DAML_NS,
"d:implicit-do-categories");