lib/hatemile/implementation/accessible_navigation_implementation.rb
##
# Generate the list of heading links of page.
Generate the list of heading links of page.
Generate the list of heading links of page .
def generate_list_heading
        local = @parser.find('body').first_result
        return if local.nil?
        container_before = @parser.find(
          "##{ID_CONTAINER_HEADING_BEFORE}"
        ).first_result
        if container_before.nil? && !@elements_heading_before.empty?
          container_before = @parser.create_element('div')
          container_before.set_attribute('id', ID_CONTAINER_HEADING_BEFORE)
          text_container_before = @parser.create_element('span')
          text_container_before.set_attribute('class', CLASS_TEXT_HEADING)
          text_container_before.append_text(@elements_heading_before)
          container_before.append_element(text_container_before)
          local.prepend_element(container_before)
        end
        unless container_before.nil?
          @list_heading_before = @parser.find(
            container_before
          ).find_children('ol').first_result
          if @list_heading_before.nil?
            @list_heading_before = @parser.create_element('ol')
            container_before.append_element(@list_heading_before)
          end
        end
        container_after = @parser.find(
          "##{ID_CONTAINER_HEADING_AFTER}"
        ).first_result
        if container_after.nil? && !@elements_heading_after.empty?
          container_after = @parser.create_element('div')
          container_after.set_attribute('id', ID_CONTAINER_HEADING_AFTER)
          text_container_after = @parser.create_element('span')
          text_container_after.set_attribute('class', CLASS_TEXT_HEADING)
          text_container_after.append_text(@elements_heading_after)
          container_after.append_element(text_container_after)
          local.append_element(container_after)
        end
        unless container_after.nil?
          @list_heading_after = @parser.find(
            container_after
          ).find_children('ol').first_result
          if @list_heading_after.nil?
            @list_heading_after = @parser.create_element('ol')
            container_after.append_element(@list_heading_after)
          end
        end
        @list_heading_added = true
      end
def generate_list_heading local = @parser . find ( 'body' ) . first_result return if local . nil? container_before = @parser . find ( "##{ID_CONTAINER_HEADING_BEFORE}" ) . first_result if container_before . nil? && ! @elements_heading_before . empty? container_before = @parser . create_element ( 'div' ) container_before . set_attribute ( 'id' , ID_CONTAINER_HEADING_BEFORE ) text_container_before = @parser . create_element ( 'span' ) text_container_before . set_attribute ( 'class' , CLASS_TEXT_HEADING ) text_container_before . append_text ( @elements_heading_before ) container_before . append_element ( text_container_before ) local . prepend_element ( container_before ) end unless container_before . nil? @list_heading_before = @parser . find ( container_before ) . find_children ( 'ol' ) . first_result if @list_heading_before . nil? @list_heading_before = @parser . create_element ( 'ol' ) container_before . append_element ( @list_heading_before ) end end container_after = @parser . find ( "##{ID_CONTAINER_HEADING_AFTER}" ) . first_result if container_after . nil? && ! @elements_heading_after . empty? container_after = @parser . create_element ( 'div' ) container_after . set_attribute ( 'id' , ID_CONTAINER_HEADING_AFTER ) text_container_after = @parser . create_element ( 'span' ) text_container_after . set_attribute ( 'class' , CLASS_TEXT_HEADING ) text_container_after . append_text ( @elements_heading_after ) container_after . append_element ( text_container_after ) local . append_element ( container_after ) end unless container_after . nil? @list_heading_after = @parser . find ( container_after ) . find_children ( 'ol' ) . first_result if @list_heading_after . nil? @list_heading_after = @parser . create_element ( 'ol' ) container_after . append_element ( @list_heading_after ) end end @list_heading_added = true end
Generate the list of heading links of page.
Generate the list of heading links of page .