aboutsummaryrefslogtreecommitdiff
path: root/html.rb
diff options
context:
space:
mode:
authorBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2010-02-12 22:37:05 +0100
committerBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2010-02-12 22:37:05 +0100
commit6ff1f342c6ac1f3c9c1c31fb050af3fda0850d2d (patch)
treeea52cc09609085450f0f6b6bad1e30cccb21ec0a /html.rb
parentb0c6b677c6ffed2a1497257290e1393c6fb39cd7 (diff)
add possibility to add javascript (no file)
Diffstat (limited to 'html.rb')
-rw-r--r--html.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/html.rb b/html.rb
index 57f69a6..b555eb0 100644
--- a/html.rb
+++ b/html.rb
@@ -78,9 +78,18 @@ HEAD
def add_head_script(file)
add_html_head("<script type='text/javascript' src='#{file}'></script>")
end
- def add_script(file)
+ def add_script_file(file)
self << "<script type='text/javascript' src='#{file}'></script>"
end
+ def add_script(script)
+ self << <<SCRIPT
+<script type="text/javascript">
+// <![CDATA[
+#{script}
+// ]]>
+</script>
+SCRIPT
+ end
def << (bodycontent)
@body += bodycontent.chomp + "\n"
end