lib/hatemile/implementation/accessible_display_implementation.rb
##
# Force the screen reader display an information of element with prefixes
# or suffixes.
#
# @param element [Hatemile::Util::Html::HTMLDOMElement] The reference
#   element.
# @param value [String] The value to be show.
# @param text_prefix_before [String] The prefix of value to show before
#   the element.
# @param text_suffix_before [String] The suffix of value to show before
#   the element.
# @param text_prefix_after [String] The prefix of value to show after the
#   element.
# @param text_suffix_after [String] The suffix of value to show after the
#   element.
# @param data_of [String] The name of attribute that links the content
#   with element.
# @return [void]
Force the screen reader display an information of element with prefixes
or suffixes.
Force the screen reader display an information of element with prefixes or suffixes .
def force_read(
        element,
        value,
        text_prefix_before,
        text_suffix_before,
        text_prefix_after,
        text_suffix_after,
        data_of
      )
        text_before = if !text_prefix_before.empty? ||
                         !text_suffix_before.empty?
                        text_prefix_before + value + text_suffix_before
                      else
                        ''
                      end
        text_after = if !text_prefix_after.empty? || !text_suffix_after.empty?
                       text_prefix_after + value + text_suffix_after
                     else
                       ''
                     end
        force_read_simple(element, text_before, text_after, data_of)
      end
def force_read ( element , value , text_prefix_before , text_suffix_before , text_prefix_after , text_suffix_after , data_of ) text_before = if ! text_prefix_before . empty? || ! text_suffix_before . empty? text_prefix_before + value + text_suffix_before else '' end text_after = if ! text_prefix_after . empty? || ! text_suffix_after . empty? text_prefix_after + value + text_suffix_after else '' end force_read_simple ( element , text_before , text_after , data_of ) end
Force the screen reader display an information of element with prefixes
or suffixes.
Force the screen reader display an information of element with prefixes or suffixes .
None
void
element
The reference element.
The reference element .
value
The value to be show.
The value to be show .
text_prefix_before
The prefix of value to show before the element.
The prefix of value to show before the element .
text_suffix_before
The suffix of value to show before the element.
The suffix of value to show before the element .
text_prefix_after
The prefix of value to show after the element.
The prefix of value to show after the element .
text_suffix_after
The suffix of value to show after the element.
The suffix of value to show after the element .
data_of
The name of attribute that links the content with element.
The name of attribute that links the content with element .