vendor/gems/gems/firewatir-1.2.1/MozillaBaseElement.rb
#
# Description:
#   Sets and clears the colored highlighting on the currently active element.
#
# Input:
#   set_or_clear - this can have following two values
#   :set - To set the color of the element.
#   :clear - To clear the color of the element.
#

Sets and clears the colored highlighting on the currently active element.

this can have following two values
:set - To set the color of the element.
:clear - To clear the color of the element.
Sets and clears the colored highlighting on the currently active element . this can have following two values : set - To set the color of the element . : clear - To clear the color of the element .
def highlight(set_or_clear)
            if set_or_clear == :set
                jssh_command = " var original_color = #{element_object}.style.background;"
                jssh_command += " #{element_object}.style.background = \"#{DEFAULT_HIGHLIGHT_COLOR}\"; original_color;"
                jssh_socket.send("#{jssh_command}\n", 0)
                @original_color = read_socket()
            else 
                begin
                    jssh_socket.send("#{element_object}.style.background = \"#{@original_color}\";\n", 0)
                    read_socket()
                rescue
                ensure
                    @original_color = nil
                end
            end
        end
def highlight ( set_or_clear ) if set_or_clear == :set jssh_command = " var original_color = #{element_object}.style.background;" jssh_command += " #{element_object}.style.background = \"#{DEFAULT_HIGHLIGHT_COLOR}\"; original_color;" jssh_socket . send ( "#{jssh_command}\n" , 0 ) @original_color = read_socket ( ) else begin jssh_socket . send ( "#{element_object}.style.background = \"#{@original_color}\";\n" , 0 ) read_socket ( ) rescue ensure @original_color = nil end end end
Description:
Sets and clears the colored highlighting on the currently active element.
Description : Sets and clears the colored highlighting on the currently active element .
#puts "element_name is : #{element_object}"
 # TODO: Need to change this so that it would work if user sets any other color.
 #puts "color is : #{DEFAULT_HIGHLIGHT_COLOR}"
 # BUG: assumes is :clear, but could actually be anything
 # we could be here for a number of reasons...
 # e.g. page may have reloaded and the reference is no longer valid

set_or_clear
<not_specific>