From 045daaf0bdba1d80f230661fd09757ce0c0d160c Mon Sep 17 00:00:00 2001 From: Benjamin Kellermann Date: Mon, 25 Jan 2010 15:09:49 +0100 Subject: add possibility to add javascript --- html.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'html.rb') diff --git a/html.rb b/html.rb index 5dbb3e6..57f69a6 100644 --- a/html.rb +++ b/html.rb @@ -31,6 +31,7 @@ class HTML end @body = "" + @htmlheader = '' @css = [] @atom = [] end @@ -52,6 +53,8 @@ HEAD ret += "\n" } + ret += @htmlheader + ret += "" ret end @@ -72,9 +75,19 @@ HEAD @header["cookie"] ||= [] @header["cookie"] << c end + def add_head_script(file) + add_html_head("") + end + def add_script(file) + self << "" + end def << (bodycontent) @body += bodycontent.chomp + "\n" end + def add_html_head(headercontent) + @htmlheader += headercontent.chomp + "\n" + end + def out(cgi) #FIXME: quick and dirty fix for encoding problem { -- cgit v1.2.3