diff options
author | unknown <Benjamin.Kellermann@gmx.de> | 2008-10-22 08:21:35 +0200 |
---|---|---|
committer | unknown <Benjamin.Kellermann@gmx.de> | 2008-10-22 08:21:35 +0200 |
commit | ce900f909cd52b735f5c5bd0f3c70ff2e09f2f90 (patch) | |
tree | b00e9237f0b585401a9ec326ed16fd12cc502999 /index.cgi | |
parent | c978d889f9f9087b3887f8bc9e7d9396adc5eb64 (diff) |
added utf - ascii switch
Diffstat (limited to 'index.cgi')
-rwxr-xr-x | index.cgi | 27 |
1 files changed, 16 insertions, 11 deletions
@@ -287,19 +287,23 @@ CONTENTTYPE = "text/html; charset=utf-8" puts "Content-type: #{CONTENTTYPE}" -if $cgi.include?("__utf") || $cgi.cookies["utf"][0] +if ($cgi.include?("__utf") || $cgi.cookies["utf"][0]) && !$cgi.include?("__ascii") puts "Set-Cookie: utf=true; path=; expires=#{(Time.now+1*60*60*24*365).getgm.strftime("%a, %d %b %Y %H:%M:%S %Z")}" - YES = CGI.escapeHTML('✔') - NO = CGI.escapeHTML('✘') - MAYBE = CGI.escapeHTML('?') - UNKNOWN = CGI.escapeHTML("-") - BACK = CGI.escapeHTML("↩") + YES = CGI.escapeHTML('✔') + NO = CGI.escapeHTML('✘') + MAYBE = CGI.escapeHTML('?') + UNKNOWN = CGI.escapeHTML("–") + BACK = CGI.escapeHTML("↩") + UTFASCII = "<a href='?__ascii' style='text-decoration:none'>A</a>" else - YES = CGI.escapeHTML('OK') - NO = CGI.escapeHTML('NO') - MAYBE = CGI.escapeHTML('?') - UNKNOWN = CGI.escapeHTML("-") - BACK = CGI.escapeHTML("<-") + puts "Set-Cookie: utf=true; path=; expires=#{(Time.now-1*60*60*24*365).getgm.strftime("%a, %d %b %Y %H:%M:%S %Z")}" + YES = CGI.escapeHTML('✔') + YES = CGI.escapeHTML('OK') + NO = CGI.escapeHTML('NO') + MAYBE = CGI.escapeHTML('?') + UNKNOWN = CGI.escapeHTML("-") + BACK = CGI.escapeHTML("<-") + UTFASCII = "<a href='?__utf' style='text-decoration:none'>#{CGI.escapeHTML('✔')}</a>" end puts <<HEAD @@ -411,6 +415,7 @@ HEAD end puts "<fieldset><legend>Available Polls</legend>" + puts UTFASCII puts "<table><tr><th>Poll</th><th>Last change</th></tr>" Dir.glob("*.yaml").sort_by{|f| File.new(f).mtime |