escape html tag
parent
0ceaffc7b0
commit
7f8d508c00
|
@ -68,7 +68,7 @@ class Mechanize::Form
|
||||||
elements_with "checkbox", "checkboxes"
|
elements_with "checkbox", "checkboxes"
|
||||||
elements_with "button"
|
elements_with "button"
|
||||||
|
|
||||||
# Returns all fields of <input type="textarea">
|
# Returns all fields of <input type="textarea">
|
||||||
def textareas
|
def textareas
|
||||||
fields.select { |f| f.class == FormContent::Textarea }.map &.as(FormContent::Textarea)
|
fields.select { |f| f.class == FormContent::Textarea }.map &.as(FormContent::Textarea)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# This class represents button related html element.
|
# This class represents button related html element.
|
||||||
# <button>, and <input> whose type is button, reset, image, submit.
|
# <button>, and <input> whose type is button, reset, image, submit.
|
||||||
class Mechanize::FormContent::Button < Mechanize::FormContent::Field
|
class Mechanize::FormContent::Button < Mechanize::FormContent::Field
|
||||||
getter form_node : Node | Lexbor::Node
|
getter form_node : Node | Lexbor::Node
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# This class represents <input type="checkbox">
|
# This class represents <input type="checkbox">
|
||||||
class Mechanize::FormContent::CheckBox < Mechanize::FormContent::RadioButton
|
class Mechanize::FormContent::CheckBox < Mechanize::FormContent::RadioButton
|
||||||
# set checkbox checked
|
# set checkbox checked
|
||||||
def check
|
def check
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# This class represents <input> elements in the form.
|
# This class represents <input> elements in the form.
|
||||||
class Mechanize::FormContent::Field
|
class Mechanize::FormContent::Field
|
||||||
# returns field's 'value' attribute
|
# returns field's 'value' attribute
|
||||||
property value : String?
|
property value : String?
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
# This class represents <input type="hidden">
|
# This class represents <input type="hidden">
|
||||||
class Mechanize::FormContent::Hidden < Mechanize::FormContent::Field
|
class Mechanize::FormContent::Hidden < Mechanize::FormContent::Field
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
# This class represents <input type="image">
|
# This class represents <input type="image">
|
||||||
class Mechanize::FormContent::ImageButton < Mechanize::FormContent::Button
|
class Mechanize::FormContent::ImageButton < Mechanize::FormContent::Button
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
require "./option"
|
require "./option"
|
||||||
|
|
||||||
# This class represents <select multiple>
|
# This class represents <select multiple>
|
||||||
class Mechanize::FormContent::MultiSelectList
|
class Mechanize::FormContent::MultiSelectList
|
||||||
getter node : Lexbor::Node
|
getter node : Lexbor::Node
|
||||||
getter name : String
|
getter name : String
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# This class represents <option> of <select>
|
||||||
class Mechanize::FormContent::Option
|
class Mechanize::FormContent::Option
|
||||||
getter select_list : FormContent::MultiSelectList
|
getter select_list : FormContent::MultiSelectList
|
||||||
getter node : Lexbor::Node
|
getter node : Lexbor::Node
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# This class represents <input type="radio">
|
# This class represents <input type="radio">
|
||||||
class Mechanize::FormContent::RadioButton < Mechanize::FormContent::Field
|
class Mechanize::FormContent::RadioButton < Mechanize::FormContent::Field
|
||||||
property :checked, :form
|
property :checked, :form
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
# This class represents <input type="reset">
|
# This class represents <input type="reset">
|
||||||
class Mechanize::FormContent::ResetButton < Mechanize::FormContent::Button
|
class Mechanize::FormContent::ResetButton < Mechanize::FormContent::Button
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
require "./multi_select_list"
|
require "./multi_select_list"
|
||||||
|
|
||||||
# This class represents <select> which is not multiple
|
# This class represents <select> which is not multiple
|
||||||
class Mechanize::FormContent::SelectList < Mechanize::FormContent::MultiSelectList
|
class Mechanize::FormContent::SelectList < Mechanize::FormContent::MultiSelectList
|
||||||
def initialize(node)
|
def initialize(node)
|
||||||
super node
|
super node
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
# This class represents <input type="submit">
|
# This class represents <input type="submit">
|
||||||
class Mechanize::FormContent::SubmitButton < Mechanize::FormContent::Button
|
class Mechanize::FormContent::SubmitButton < Mechanize::FormContent::Button
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
# This class represents <input type="text">
|
# This class represents <input type="text">
|
||||||
class Mechanize::FormContent::Text < Mechanize::FormContent::Field
|
class Mechanize::FormContent::Text < Mechanize::FormContent::Field
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
# This class represents <input type="textarea">
|
# This class represents <input type="textarea">
|
||||||
class Mechanize::FormContent::Textarea < Mechanize::FormContent::Field
|
class Mechanize::FormContent::Textarea < Mechanize::FormContent::Field
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue