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