diff options
Diffstat (limited to 'org/madore/damlengine/TodoDamlElement.java')
-rw-r--r-- | org/madore/damlengine/TodoDamlElement.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/org/madore/damlengine/TodoDamlElement.java b/org/madore/damlengine/TodoDamlElement.java index 50c39bb..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 { @@ -113,7 +118,7 @@ public final class TodoDamlElement extends TodoDefaultElement { final WeblogSummary wsum = WeblogSummary.getSummary(ctx.dc); if ( wsum != null ) { final WeblogSummary.EntrySummary esum - = wsum.entries.get(new Integer(((Context.WeblogSingleSelectionContext)(ctx.wsc)).number)); + = wsum.entries.get(Integer.valueOf(((Context.WeblogSingleSelectionContext)(ctx.wsc)).number)); if ( esum != null && esum.title != null ) { meta = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "meta"); meta.setAttributeNS(null, "name", "twitter:title"); |