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,
|
||||
|
||||
40
library/server/wsf_html/form/wsf_form_number_input.e
Normal file
40
library/server/wsf_html/form/wsf_form_number_input.e
Normal file
@@ -0,0 +1,40 @@
|
||||
note
|
||||
description: "[
|
||||
Represent the input type number.
|
||||
Example:
|
||||
<input type="number" min="5" max="18" step="0.5" value="9" name="shoe-size">
|
||||
]"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
EIS: "name= Number", "src=https://html.spec.whatwg.org/multipage/forms.html#number-state-(type=number)"
|
||||
|
||||
class
|
||||
WSF_FORM_NUMBER_INPUT
|
||||
|
||||
inherit
|
||||
|
||||
WSF_FORM_INPUT
|
||||
redefine
|
||||
specific_input_attributes_string
|
||||
end
|
||||
|
||||
WSF_FORM_FIELD_WITH_NUMERIC_ATTRIBUTE
|
||||
|
||||
create
|
||||
make,
|
||||
make_with_text
|
||||
|
||||
feature -- Access
|
||||
|
||||
input_type: STRING = "number"
|
||||
|
||||
feature {NONE} -- Conversion
|
||||
|
||||
specific_input_attributes_string: detachable STRING_8
|
||||
-- Specific input attributes if any.
|
||||
-- To redefine if needed
|
||||
do
|
||||
create Result.make_empty
|
||||
append_numeric_input_attributes_to (Result)
|
||||
end
|
||||
end
|
||||
40
library/server/wsf_html/form/wsf_form_range_input.e
Normal file
40
library/server/wsf_html/form/wsf_form_range_input.e
Normal file
@@ -0,0 +1,40 @@
|
||||
note
|
||||
description: "[
|
||||
Represent an input type range
|
||||
Example
|
||||
<input type="range" min=0 max=100 step=20 value=50>
|
||||
]"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
WSF_FORM_RANGE_INPUT
|
||||
|
||||
inherit
|
||||
|
||||
WSF_FORM_INPUT
|
||||
redefine
|
||||
specific_input_attributes_string
|
||||
end
|
||||
|
||||
WSF_FORM_FIELD_WITH_NUMERIC_ATTRIBUTE
|
||||
|
||||
create
|
||||
make,
|
||||
make_with_text
|
||||
|
||||
feature -- Access
|
||||
|
||||
input_type: STRING = "range"
|
||||
|
||||
|
||||
feature {NONE} -- Conversion
|
||||
|
||||
specific_input_attributes_string: detachable STRING_8
|
||||
-- Specific input attributes if any.
|
||||
-- To redefine if needed
|
||||
do
|
||||
create Result.make_empty
|
||||
append_numeric_input_attributes_to (Result)
|
||||
end
|
||||
end
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user