Updated html5 classes based on review
This commit is contained in:
@@ -16,7 +16,7 @@ inherit
|
|||||||
specific_input_attributes_string
|
specific_input_attributes_string
|
||||||
end
|
end
|
||||||
|
|
||||||
WSF_FORM_WITH_NUMERIC_ATTRIBUTE
|
WSF_FORM_FIELD_WITH_NUMERIC_ATTRIBUTE
|
||||||
|
|
||||||
create
|
create
|
||||||
make,
|
make,
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ inherit
|
|||||||
specific_input_attributes_string
|
specific_input_attributes_string
|
||||||
end
|
end
|
||||||
|
|
||||||
WSF_FORM_WITH_NUMERIC_ATTRIBUTE
|
WSF_FORM_FIELD_WITH_NUMERIC_ATTRIBUTE
|
||||||
|
|
||||||
create
|
create
|
||||||
make,
|
make,
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ inherit
|
|||||||
specific_input_attributes_string
|
specific_input_attributes_string
|
||||||
end
|
end
|
||||||
|
|
||||||
WSF_FORM_WITH_NUMERIC_ATTRIBUTE
|
WSF_FORM_FIELD_WITH_NUMERIC_ATTRIBUTE
|
||||||
|
|
||||||
create
|
create
|
||||||
make,
|
make,
|
||||||
|
|||||||
@@ -5,17 +5,18 @@ note
|
|||||||
]"
|
]"
|
||||||
date: "$Date$"
|
date: "$Date$"
|
||||||
revision: "$Revision$"
|
revision: "$Revision$"
|
||||||
|
EIS: "name=numeric attributes", "src=https://html.spec.whatwg.org/multipage/forms.html#common-input-element-attributes"
|
||||||
|
|
||||||
class
|
class
|
||||||
WSF_FORM_WITH_NUMERIC_ATTRIBUTE
|
WSF_FORM_FIELD_WITH_NUMERIC_ATTRIBUTE
|
||||||
|
|
||||||
feature -- Access
|
feature -- Access
|
||||||
|
|
||||||
min: detachable READABLE_STRING_32
|
min: detachable READABLE_STRING_32
|
||||||
-- Represent the minimun value the field will accept
|
-- minimun value accepted by Current field.
|
||||||
|
|
||||||
max: detachable READABLE_STRING_32
|
max: detachable READABLE_STRING_32
|
||||||
-- Represent the maximun value the field will accept.
|
-- maximun value accepted by Current field.
|
||||||
|
|
||||||
step: detachable READABLE_STRING_32
|
step: detachable READABLE_STRING_32
|
||||||
-- step is the increment that the value should adjust up or down, with the default step value being 1.
|
-- step is the increment that the value should adjust up or down, with the default step value being 1.
|
||||||
@@ -79,21 +80,21 @@ feature {NONE} -- Conversion
|
|||||||
--min
|
--min
|
||||||
if attached min as l_min then
|
if attached min as l_min then
|
||||||
a_target.append (" min=%"")
|
a_target.append (" min=%"")
|
||||||
a_target.append (l_min)
|
a_target.append ((create {HTML_ENCODER}).encoded_string (l_min))
|
||||||
a_target.append_character ('%"')
|
a_target.append_character ('%"')
|
||||||
end
|
end
|
||||||
|
|
||||||
--max
|
--max
|
||||||
if attached max as l_max then
|
if attached max as l_max then
|
||||||
a_target.append (" max=%"")
|
a_target.append (" max=%"")
|
||||||
a_target.append (l_max)
|
a_target.append ((create {HTML_ENCODER}).encoded_string (l_max))
|
||||||
a_target.append_character ('%"')
|
a_target.append_character ('%"')
|
||||||
end
|
end
|
||||||
|
|
||||||
--step
|
--step
|
||||||
if attached step as l_step then
|
if attached step as l_step then
|
||||||
a_target.append (" step=%"")
|
a_target.append (" step=%"")
|
||||||
a_target.append (l_step)
|
a_target.append ((create {HTML_ENCODER}).encoded_string (l_step))
|
||||||
a_target.append_character ('%"')
|
a_target.append_character ('%"')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -12,7 +12,7 @@ inherit
|
|||||||
redefine
|
redefine
|
||||||
specific_input_attributes_string
|
specific_input_attributes_string
|
||||||
end
|
end
|
||||||
WSF_FORM_WITH_ATLERNATIVE_ACTIONS
|
WSF_FORM_WITH_ALTERNATIVE_ACTIONS
|
||||||
|
|
||||||
|
|
||||||
create
|
create
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ feature -- Change element
|
|||||||
placeholder_set: attached placeholder as l_placeholder implies l_placeholder = a_placeholder
|
placeholder_set: attached placeholder as l_placeholder implies l_placeholder = a_placeholder
|
||||||
end
|
end
|
||||||
|
|
||||||
set_autofocus
|
enable_autofocus
|
||||||
-- Set autofocus in True.
|
-- Set autofocus in True.
|
||||||
do
|
do
|
||||||
autofocus := True
|
autofocus := True
|
||||||
@@ -47,7 +47,7 @@ feature -- Change element
|
|||||||
autofocus_true: autofocus
|
autofocus_true: autofocus
|
||||||
end
|
end
|
||||||
|
|
||||||
unset_autofocus
|
disable_autofocus
|
||||||
-- Set autofocus in False
|
-- Set autofocus in False
|
||||||
do
|
do
|
||||||
autofocus := False
|
autofocus := False
|
||||||
@@ -55,7 +55,7 @@ feature -- Change element
|
|||||||
autofocus_false: not autofocus
|
autofocus_false: not autofocus
|
||||||
end
|
end
|
||||||
|
|
||||||
turn_off_autocomplete
|
disable_autocomplete
|
||||||
-- Turn off the autocompelte. The default behavior is on.
|
-- Turn off the autocompelte. The default behavior is on.
|
||||||
do
|
do
|
||||||
autocomplete := True
|
autocomplete := True
|
||||||
@@ -63,7 +63,7 @@ feature -- Change element
|
|||||||
autocomplete_true: autocomplete
|
autocomplete_true: autocomplete
|
||||||
end
|
end
|
||||||
|
|
||||||
turn_on_autocomplete
|
enable_autocomplete
|
||||||
-- Set autocomplete in False, Set default behavior.
|
-- Set autocomplete in False, Set default behavior.
|
||||||
do
|
do
|
||||||
autocomplete := False
|
autocomplete := False
|
||||||
@@ -71,7 +71,7 @@ feature -- Change element
|
|||||||
autocomplete_false: not autocomplete
|
autocomplete_false: not autocomplete
|
||||||
end
|
end
|
||||||
|
|
||||||
set_required
|
enable_required
|
||||||
-- Set required to True.
|
-- Set required to True.
|
||||||
do
|
do
|
||||||
required := True
|
required := True
|
||||||
@@ -79,7 +79,7 @@ feature -- Change element
|
|||||||
required_true: required
|
required_true: required
|
||||||
end
|
end
|
||||||
|
|
||||||
unset_required
|
disable_required
|
||||||
-- Set rquired to False.
|
-- Set rquired to False.
|
||||||
do
|
do
|
||||||
required := False
|
required := False
|
||||||
@@ -147,7 +147,7 @@ feature -- Conversion
|
|||||||
do
|
do
|
||||||
if attached placeholder as l_placeholder then
|
if attached placeholder as l_placeholder then
|
||||||
a_target.append (" placeholder=%"")
|
a_target.append (" placeholder=%"")
|
||||||
a_target.append (l_placeholder)
|
a_target.append ((create {HTML_ENCODER}).encoded_string (l_placeholder))
|
||||||
a_target.append_character ('%"')
|
a_target.append_character ('%"')
|
||||||
end
|
end
|
||||||
--TODO check how we can add xhtml5 support
|
--TODO check how we can add xhtml5 support
|
||||||
@@ -166,7 +166,7 @@ feature -- Conversion
|
|||||||
end
|
end
|
||||||
if attached pattern as l_pattern then
|
if attached pattern as l_pattern then
|
||||||
a_target.append (" pattern=%"")
|
a_target.append (" pattern=%"")
|
||||||
a_target.append (l_pattern)
|
a_target.append ((create {HTML_ENCODER}).encoded_string (l_pattern))
|
||||||
a_target.append_character ('%"')
|
a_target.append_character ('%"')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ inherit
|
|||||||
specific_input_attributes_string
|
specific_input_attributes_string
|
||||||
end
|
end
|
||||||
|
|
||||||
WSF_FORM_WITH_NUMERIC_ATTRIBUTE
|
WSF_FORM_FIELD_WITH_NUMERIC_ATTRIBUTE
|
||||||
|
|
||||||
create
|
create
|
||||||
make,
|
make,
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ inherit
|
|||||||
specific_input_attributes_string
|
specific_input_attributes_string
|
||||||
end
|
end
|
||||||
|
|
||||||
WSF_FORM_WITH_NUMERIC_ATTRIBUTE
|
WSF_FORM_FIELD_WITH_NUMERIC_ATTRIBUTE
|
||||||
|
|
||||||
create
|
create
|
||||||
make,
|
make,
|
||||||
@@ -17,7 +17,7 @@ inherit
|
|||||||
specific_input_attributes_string
|
specific_input_attributes_string
|
||||||
end
|
end
|
||||||
|
|
||||||
WSF_FORM_WITH_NUMERIC_ATTRIBUTE
|
WSF_FORM_FIELD_WITH_NUMERIC_ATTRIBUTE
|
||||||
|
|
||||||
create
|
create
|
||||||
make,
|
make,
|
||||||
@@ -12,7 +12,7 @@ inherit
|
|||||||
redefine
|
redefine
|
||||||
specific_input_attributes_string
|
specific_input_attributes_string
|
||||||
end
|
end
|
||||||
WSF_FORM_WITH_ATLERNATIVE_ACTIONS
|
WSF_FORM_WITH_ALTERNATIVE_ACTIONS
|
||||||
|
|
||||||
create
|
create
|
||||||
make,
|
make,
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ inherit
|
|||||||
specific_input_attributes_string
|
specific_input_attributes_string
|
||||||
end
|
end
|
||||||
|
|
||||||
WSF_FORM_WITH_NUMERIC_ATTRIBUTE
|
WSF_FORM_FIELD_WITH_NUMERIC_ATTRIBUTE
|
||||||
|
|
||||||
create
|
create
|
||||||
make,
|
make,
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ inherit
|
|||||||
specific_input_attributes_string
|
specific_input_attributes_string
|
||||||
end
|
end
|
||||||
|
|
||||||
WSF_FORM_WITH_NUMERIC_ATTRIBUTE
|
WSF_FORM_FIELD_WITH_NUMERIC_ATTRIBUTE
|
||||||
|
|
||||||
create
|
create
|
||||||
make,
|
make,
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
note
|
note
|
||||||
description: "[
|
description: "[
|
||||||
Represent alternative actions for forms
|
Represent alternative actions for forms
|
||||||
The formaction, formenctype, formmethod, and formtarget attributes.
|
The formaction, formenctype, formmethod, and formtarget attributes.
|
||||||
]"
|
]"
|
||||||
date: "$Date$"
|
date: "$Date$"
|
||||||
revision: "$Revision$"
|
revision: "$Revision$"
|
||||||
|
EIS: "name=form submission", "src=https://html.spec.whatwg.org/multipage/forms.html#form-submission"
|
||||||
|
|
||||||
class
|
class
|
||||||
WSF_FORM_WITH_ATLERNATIVE_ACTIONS
|
WSF_FORM_WITH_ALTERNATIVE_ACTIONS
|
||||||
|
|
||||||
feature -- Access
|
feature -- Access
|
||||||
|
|
||||||
@@ -44,21 +44,21 @@ feature {NONE} -- Initialization
|
|||||||
|
|
||||||
-- autofocus
|
-- autofocus
|
||||||
create l_text_input.make ("fullname")
|
create l_text_input.make ("fullname")
|
||||||
l_text_input.set_autofocus
|
l_text_input.enable_autofocus
|
||||||
print (l_text_input.to_html (l_theme))
|
print (l_text_input.to_html (l_theme))
|
||||||
|
|
||||||
io.put_new_line
|
io.put_new_line
|
||||||
|
|
||||||
-- autocomplete
|
-- autocomplete
|
||||||
create l_text_input.make ("fullname")
|
create l_text_input.make ("fullname")
|
||||||
l_text_input.turn_off_autocomplete
|
l_text_input.disable_autocomplete
|
||||||
print (l_text_input.to_html (l_theme))
|
print (l_text_input.to_html (l_theme))
|
||||||
|
|
||||||
io.put_new_line
|
io.put_new_line
|
||||||
|
|
||||||
-- required
|
-- required
|
||||||
create l_text_input.make ("fullname")
|
create l_text_input.make ("fullname")
|
||||||
l_text_input.set_required
|
l_text_input.enable_required
|
||||||
print (l_text_input.to_html (l_theme))
|
print (l_text_input.to_html (l_theme))
|
||||||
|
|
||||||
io.put_new_line
|
io.put_new_line
|
||||||
|
|||||||
@@ -43,11 +43,11 @@ feature -- Test routines
|
|||||||
create l_theme.make
|
create l_theme.make
|
||||||
|
|
||||||
create l_text_input.make ("fullname")
|
create l_text_input.make ("fullname")
|
||||||
l_text_input.set_autofocus
|
l_text_input.enable_autofocus
|
||||||
|
|
||||||
assert ("expected input with autofocus",l_text_input.to_html (l_theme).is_case_insensitive_equal_general (l_autofocus) )
|
assert ("expected input with autofocus",l_text_input.to_html (l_theme).is_case_insensitive_equal_general (l_autofocus) )
|
||||||
|
|
||||||
l_text_input.unset_autofocus
|
l_text_input.disable_autofocus
|
||||||
l_autofocus := "<div><input type=%"text%" name=%"fullname%"/></div>"
|
l_autofocus := "<div><input type=%"text%" name=%"fullname%"/></div>"
|
||||||
assert ("expected input without autofocus",l_text_input.to_html (l_theme).is_case_insensitive_equal_general (l_autofocus) )
|
assert ("expected input without autofocus",l_text_input.to_html (l_theme).is_case_insensitive_equal_general (l_autofocus) )
|
||||||
|
|
||||||
@@ -65,10 +65,10 @@ feature -- Test routines
|
|||||||
create l_theme.make
|
create l_theme.make
|
||||||
|
|
||||||
create l_text_input.make ("fullname")
|
create l_text_input.make ("fullname")
|
||||||
l_text_input.turn_off_autocomplete
|
l_text_input.disable_autocomplete
|
||||||
assert ("expected input with autocomplete in off",l_text_input.to_html (l_theme).is_case_insensitive_equal_general (l_autocomplete) )
|
assert ("expected input with autocomplete in off",l_text_input.to_html (l_theme).is_case_insensitive_equal_general (l_autocomplete) )
|
||||||
|
|
||||||
l_text_input.turn_on_autocomplete
|
l_text_input.enable_autocomplete
|
||||||
l_autocomplete := "<div><input type=%"text%" name=%"fullname%"/></div>"
|
l_autocomplete := "<div><input type=%"text%" name=%"fullname%"/></div>"
|
||||||
assert ("expected input without autocomplete",l_text_input.to_html (l_theme).is_case_insensitive_equal_general (l_autocomplete) )
|
assert ("expected input without autocomplete",l_text_input.to_html (l_theme).is_case_insensitive_equal_general (l_autocomplete) )
|
||||||
|
|
||||||
@@ -85,11 +85,11 @@ feature -- Test routines
|
|||||||
create l_theme.make
|
create l_theme.make
|
||||||
|
|
||||||
create l_text_input.make ("fullname")
|
create l_text_input.make ("fullname")
|
||||||
l_text_input.set_required
|
l_text_input.enable_required
|
||||||
|
|
||||||
assert ("expected input with required",l_text_input.to_html (l_theme).is_case_insensitive_equal_general (l_required) )
|
assert ("expected input with required",l_text_input.to_html (l_theme).is_case_insensitive_equal_general (l_required) )
|
||||||
|
|
||||||
l_text_input.unset_required
|
l_text_input.disable_required
|
||||||
l_required := "<div><input type=%"text%" name=%"fullname%"/></div>"
|
l_required := "<div><input type=%"text%" name=%"fullname%"/></div>"
|
||||||
assert ("expected input without required",l_text_input.to_html (l_theme).is_case_insensitive_equal_general (l_required) )
|
assert ("expected input without required",l_text_input.to_html (l_theme).is_case_insensitive_equal_general (l_required) )
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user