lib/pagebuilder/script_manager.rb
# Adds a script to be loaded if it doesn't exist
# or updates stored tag attributes if it does
# @param uri [String] the src of the script
# @return [Boolean] true if script is added, false if uri already existed
Adds a script to be loaded if it doesn't exist
or updates stored tag attributes if it does
Adds a script to be loaded if it doesn ' t exist or updates stored tag attributes if it does
def add_script(uri, **attributes)
      uri_for_index = uri.downcase
      if attrs = @scripts[uri_for_index]
        attrs.merge!(attributes)
        false
      else
        attributes[:src] = uri
        @scripts[uri_for_index] = attributes
        @index << uri_for_index
        true
      end
    end
def add_script ( uri , ** attributes ) uri_for_index = uri . downcase if attrs = @scripts [ uri_for_index ] attrs . merge! ( attributes ) false else attributes [ :src ] = uri @scripts [ uri_for_index ] = attributes @index << uri_for_index true end end
Adds a script to be loaded if it doesn't exist
or updates stored tag attributes if it does
Adds a script to be loaded if it doesn ' t exist or updates stored tag attributes if it does
true if script is added, false if uri already existed
true if script is added false if uri already existed
Boolean
uri
the src of the script
the src of the script
attributes
<not_specific>