From d17d1b111341f2c8979cf8fbd63ec7ec9db7c3ad Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 6 Mar 2009 03:56:38 +0000 Subject: * {ext,lib,test}/**/*.rb: removed trailing spaces. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/cgi/html.rb | 116 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 58 insertions(+), 58 deletions(-) (limited to 'lib/cgi/html.rb') diff --git a/lib/cgi/html.rb b/lib/cgi/html.rb index 62f1fc189..8ee38000c 100644 --- a/lib/cgi/html.rb +++ b/lib/cgi/html.rb @@ -66,7 +66,7 @@ class CGI # Modules Http3, Http4, etc., contain more basic HTML-generation methods # (:title, :center, etc.). # - # See class CGI for a detailed example. + # See class CGI for a detailed example. # module HtmlExtension @@ -99,7 +99,7 @@ class CGI end end - # Generate a Document Base URI element as a String. + # Generate a Document Base URI element as a String. # # +href+ can either by a string, giving the base URL for the HREF # attribute, or it can be a has of the element's attributes. @@ -179,10 +179,10 @@ class CGI # # checkbox("name") # # = checkbox("NAME" => "name") - # + # # checkbox("name", "value") # # = checkbox("NAME" => "name", "VALUE" => "value") - # + # # checkbox("name", "value", true) # # = checkbox("NAME" => "name", "VALUE" => "value", "CHECKED" => true) def checkbox(name = "", value = nil, checked = nil) @@ -220,23 +220,23 @@ class CGI # # foo # # bar # # baz - # + # # checkbox_group("name", ["foo"], ["bar", true], "baz") # # foo # # bar # # baz - # + # # checkbox_group("name", ["1", "Foo"], ["2", "Bar", true], "Baz") # # Foo # # Bar # # Baz - # + # # checkbox_group("NAME" => "name", # "VALUES" => ["foo", "bar", "baz"]) - # + # # checkbox_group("NAME" => "name", # "VALUES" => [["foo"], ["bar", true], "baz"]) - # + # # checkbox_group("NAME" => "name", # "VALUES" => [["1", "Foo"], ["2", "Bar", true], "Baz"]) def checkbox_group(name = "", *values) @@ -272,13 +272,13 @@ class CGI # # file_field("name") # # - # + # # file_field("name", 40) # # - # + # # file_field("name", 40, 100) # # - # + # # file_field("NAME" => "name", "SIZE" => 40) # # def file_field(name = "", size = 20, maxlength = nil) @@ -298,7 +298,7 @@ class CGI # # +method+ should be either "get" or "post", and defaults to the latter. # +action+ defaults to the current CGI script name. +enctype+ - # defaults to "application/x-www-form-urlencoded". + # defaults to "application/x-www-form-urlencoded". # # Alternatively, the attributes can be specified as a hash. # @@ -306,19 +306,19 @@ class CGI # # form{ "string" } # #
string
- # + # # form("get") { "string" } # #
string
- # + # # form("get", "url") { "string" } # #
string
- # + # # form("METHOD" => "post", "ENCTYPE" => "enctype") { "string" } # #
string
def form(method = "post", action = script_name, enctype = "application/x-www-form-urlencoded") attributes = if method.kind_of?(String) { "METHOD" => method, "ACTION" => action, - "ENCTYPE" => enctype } + "ENCTYPE" => enctype } else unless method.has_key?("METHOD") method["METHOD"] = "post" @@ -350,10 +350,10 @@ class CGI # # hidden("name") # # - # + # # hidden("name", "value") # # - # + # # hidden("NAME" => "name", "VALUE" => "reset", "ID" => "foo") # # def hidden(name = "", value = nil) @@ -376,36 +376,36 @@ class CGI # should include the entire text of this tag, including angle brackets. # # The body of the html element is supplied as a block. - # + # # html{ "string" } # # string - # + # # html("LANG" => "ja") { "string" } # # string - # + # # html("DOCTYPE" => false) { "string" } # # string - # + # # html("DOCTYPE" => '') { "string" } # # string - # + # # html("PRETTY" => " ") { "" } # # # # # # # # # # - # + # # html("PRETTY" => "\t") { "" } # # # # # # # # # # - # + # # html("PRETTY") { "" } # # = html("PRETTY" => " ") { "" } - # + # # html(if $VERBOSE then "PRETTY" end) { "HTML string" } # def html(attributes = {}) # :yield: @@ -444,17 +444,17 @@ class CGI # Generate an Image Button Input element as a string. # - # +src+ is the URL of the image to use for the button. +name+ + # +src+ is the URL of the image to use for the button. +name+ # is the input name. +alt+ is the alternative text for the image. # # Alternatively, the attributes can be specified as a hash. - # + # # image_button("url") # # - # + # # image_button("url", "name", "string") # # - # + # # image_button("SRC" => "url", "ATL" => "strng") # # def image_button(src = "", name = nil, alt = nil) @@ -480,7 +480,7 @@ class CGI # # img("src", "alt", 100, 50) # # alt - # + # # img("SRC" => "src", "ALT" => "alt", "WIDTH" => 100, "HEIGHT" => 50) # # alt def img(src = "", alt = "", width = nil, height = nil) @@ -506,15 +506,15 @@ class CGI # # multipart_form{ "string" } # #
string
- # + # # multipart_form("url") { "string" } # #
string
def multipart_form(action = nil, enctype = "multipart/form-data") attributes = if action == nil - { "METHOD" => "post", "ENCTYPE" => enctype } + { "METHOD" => "post", "ENCTYPE" => enctype } elsif action.kind_of?(String) { "METHOD" => "post", "ACTION" => action, - "ENCTYPE" => enctype } + "ENCTYPE" => enctype } else unless action.has_key?("METHOD") action["METHOD"] = "post" @@ -542,13 +542,13 @@ class CGI # # password_field("name") # # - # + # # password_field("name", "value") # # - # + # # password_field("password", "value", 80, 200) # # - # + # # password_field("NAME" => "name", "VALUE" => "value") # # def password_field(name = "", value = nil, size = 40, maxlength = nil) @@ -584,21 +584,21 @@ class CGI # # # # # # - # + # # popup_menu("name", ["foo"], ["bar", true], "baz") # # - # + # # popup_menu("name", ["1", "Foo"], ["2", "Bar", true], "Baz") # # - # + # # popup_menu("NAME" => "name", "SIZE" => 2, "MULTIPLE" => true, # "VALUES" => [["1", "Foo"], ["2", "Bar", true], "Baz"]) # # - # + # # radio_button("name", "value", true) # # - # + # # radio_button("NAME" => "name", "VALUE" => "value", "ID" => "foo") # # def radio_button(name = "", value = nil, checked = nil) @@ -670,28 +670,28 @@ class CGI # # This works the same as #checkbox_group(). However, it is not valid # to have more than one radiobutton in a group checked. - # + # # radio_group("name", "foo", "bar", "baz") # # foo # # bar # # baz - # + # # radio_group("name", ["foo"], ["bar", true], "baz") # # foo # # bar # # baz - # + # # radio_group("name", ["1", "Foo"], ["2", "Bar", true], "Baz") # # Foo # # Bar # # Baz - # + # # radio_group("NAME" => "name", # "VALUES" => ["foo", "bar", "baz"]) - # + # # radio_group("NAME" => "name", # "VALUES" => [["foo"], ["bar", true], "baz"]) - # + # # radio_group("NAME" => "name", # "VALUES" => [["1", "Foo"], ["2", "Bar", true], "Baz"]) def radio_group(name = "", *values) @@ -723,10 +723,10 @@ class CGI # # reset # # - # + # # reset("reset") # # - # + # # reset("VALUE" => "reset", "ID" => "foo") # # def reset(value = nil, name = nil) @@ -750,13 +750,13 @@ class CGI # # submit # # - # + # # submit("ok") # # - # + # # submit("ok", "button1") # # - # + # # submit("VALUE" => "ok", "NAME" => "button1", "ID" => "foo") # # def submit(value = nil, name = nil) @@ -779,16 +779,16 @@ class CGI # # text_field("name") # # - # + # # text_field("name", "value") # # - # + # # text_field("name", "value", 80) # # - # + # # text_field("name", "value", 80, 200) # # - # + # # text_field("NAME" => "name", "VALUE" => "value") # # def text_field(name = "", value = nil, size = 40, maxlength = nil) -- cgit