lib/hatemile/implementation/accessible_navigation_implementation.rb
##
# Replace the shortcut of elements, that has the shortcut passed.
#
# @param shortcut [String] The shortcut.
# @return [void]
Replace the shortcut of elements, that has the shortcut passed.
Replace the shortcut of elements that has the shortcut passed .
def free_shortcut(shortcut)
        found = false
        alpha_numbers = '1234567890abcdefghijklmnopqrstuvwxyz'
        elements = @parser.find('[accesskey]').list_results
        elements.each do |element|
          shortcuts = element.get_attribute('accesskey').downcase
          unless Hatemile::Util::CommonFunctions.in_list?(shortcuts, shortcut)
            next
          end
          (0..alpha_numbers.length - 1).each do |i|
            key = alpha_numbers[i, i + 1]
            found = true
            elements.each do |element_with_shortcuts|
              shortcuts = element_with_shortcuts.get_attribute(
                'accesskey'
              ).downcase
              unless Hatemile::Util::CommonFunctions.in_list?(shortcuts, key)
                next
              end
              element.set_attribute('accesskey', key)
              found = false
              break
            end
            break if found
          end
          break if found
        end
      end
def free_shortcut ( shortcut ) found = false alpha_numbers = '1234567890abcdefghijklmnopqrstuvwxyz' elements = @parser . find ( '[accesskey]' ) . list_results elements . each do | element | shortcuts = element . get_attribute ( 'accesskey' ) . downcase unless Hatemile :: Util :: CommonFunctions . in_list? ( shortcuts , shortcut ) next end ( 0 .. alpha_numbers . length - 1 ) . each do | i | key = alpha_numbers [ i , i + 1 ] found = true elements . each do | element_with_shortcuts | shortcuts = element_with_shortcuts . get_attribute ( 'accesskey' ) . downcase unless Hatemile :: Util :: CommonFunctions . in_list? ( shortcuts , key ) next end element . set_attribute ( 'accesskey' , key ) found = false break end break if found end break if found end end
Replace the shortcut of elements, that has the shortcut passed.
Replace the shortcut of elements that has the shortcut passed .
None
void
shortcut
None