summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org/madore/damlengine/TodoDamlElement.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/org/madore/damlengine/TodoDamlElement.java b/org/madore/damlengine/TodoDamlElement.java
index f5b4a7f..7cd94e3 100644
--- a/org/madore/damlengine/TodoDamlElement.java
+++ b/org/madore/damlengine/TodoDamlElement.java
@@ -58,7 +58,12 @@ public final class TodoDamlElement extends TodoDefaultElement {
Element bodyNode = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "body");
htmlNode.appendChild(bodyNode);
htmlNode.appendChild(ctx.doc.createTextNode("\n"));
- bodyNode.setAttributeNS(null, "onload", "onLoad()");
+ bodyNode.setAttributeNS(null, "onload", "if (onLoad) { onLoad(); }");
+ Element earlyScript = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "script");
+ earlyScript.setAttributeNS(null, "type", "text/javascript");
+ earlyScript.appendChild(ctx.doc.createTextNode("if (onEarly) { onEarly(); }"));
+ bodyNode.appendChild(ctx.doc.createTextNode("\n"));
+ bodyNode.appendChild(earlyScript);
ctx.gc.styleContent = new StringBuffer();
try {