Sha256: c06dd201cf54b817416850f34f110eff2feff1ff32509c8f8005ab67b9cbd4e0

Contents?: true

Size: 751 Bytes

Versions: 23

Compression:

Stored size: 751 Bytes

Contents

module Celerity
  class Link < Element
    include ClickableElement

    TAGS = [ Identifier.new('a') ]
    ATTRIBUTES = BASE_ATTRIBUTES | [:charset, :type, :name, :href, :hreflang,
                                    :target, :rel, :rev, :accesskey, :shape,
                                    :coords, :tabindex, :onfocus, :onblur]
    DEFAULT_HOW = :href

    #
    # Returns the absolute URL for this link (Celerity-specific)
    #
    # (Watir/IE does this for href(), but we don't want that.)
    #

    def absolute_url
      assert_exists
      href = @object.getAttribute('href')

      unless href.empty? || URI.parse(href).absolute?
        href = URI.join(browser.url, href).to_s
      end

      href
    end


  end # Link
end # Celerity

Version data entries

23 entries across 23 versions & 6 rubygems

Version Path
caius-celerity-0.0.6.10 lib/celerity/elements/link.rb
caius-celerity-0.0.6.11 lib/celerity/elements/link.rb
drnic-celerity-0.0.6.17 lib/celerity/elements/link.rb
jarib-celerity-0.0.6.10 lib/celerity/elements/link.rb
jarib-celerity-0.0.6.11 lib/celerity/elements/link.rb
jarib-celerity-0.0.6.12 lib/celerity/elements/link.rb
jarib-celerity-0.0.6.14 lib/celerity/elements/link.rb
jarib-celerity-0.0.6.15 lib/celerity/elements/link.rb
jarib-celerity-0.0.6.16 lib/celerity/elements/link.rb
jarib-celerity-0.0.6.17 lib/celerity/elements/link.rb
jarib-celerity-0.0.6.18 lib/celerity/elements/link.rb
jarib-celerity-0.0.6.19 lib/celerity/elements/link.rb
jarib-celerity-0.0.6.8 lib/celerity/elements/link.rb
jarib-celerity-0.0.6.9 lib/celerity/elements/link.rb
jarib-celerity-0.0.7.1 lib/celerity/elements/link.rb
regularfry-celerity-0.0.6.12 lib/celerity/elements/link.rb
walidhalabi-celerity-0.0.6.11 lib/celerity/elements/link.rb
walidhalabi-celerity-0.0.6.12 lib/celerity/elements/link.rb
walidhalabi-celerity-0.0.6.13 lib/celerity/elements/link.rb
celerity-0.7.4 lib/celerity/elements/link.rb