From f3fb416b89dab8d7b565b174bdc1116a519ab18d Mon Sep 17 00:00:00 2001 From: "Andrey A.I. Sitnik" Date: Thu, 5 Apr 2012 15:32:37 +0400 Subject: Remove unnecessary in HTML 5 type attribute with default value --- actionpack/lib/action_view/base.rb | 2 +- .../lib/action_view/helpers/asset_tag_helper.rb | 12 ++--- .../asset_tag_helpers/javascript_tag_helpers.rb | 56 +++++++++++----------- .../asset_tag_helpers/stylesheet_tag_helpers.rb | 44 ++++++++--------- .../lib/action_view/helpers/capture_helper.rb | 2 +- .../lib/action_view/helpers/javascript_helper.rb | 6 +-- actionpack/lib/action_view/helpers/url_helper.rb | 4 +- 7 files changed, 63 insertions(+), 63 deletions(-) (limited to 'actionpack/lib/action_view') diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index f3315948b4..5f81f24a2e 100644 --- a/actionpack/lib/action_view/base.rb +++ b/actionpack/lib/action_view/base.rb @@ -139,7 +139,7 @@ module ActionView #:nodoc: # How to complete the streaming when an exception occurs. # This is our best guess: first try to close the attribute, then the tag. cattr_accessor :streaming_completion_on_exception - @@streaming_completion_on_exception = %(">) + @@streaming_completion_on_exception = %(">) # Specify whether rendering within namespaced controllers should prefix # the partial paths for ActiveModel objects with the namespace. diff --git a/actionpack/lib/action_view/helpers/asset_tag_helper.rb b/actionpack/lib/action_view/helpers/asset_tag_helper.rb index 2f8b28c82b..d4d09e2ee9 100644 --- a/actionpack/lib/action_view/helpers/asset_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/asset_tag_helper.rb @@ -15,7 +15,7 @@ module ActionView # image_tag("rails.png") # # => Rails # stylesheet_link_tag("application") - # # => + # # => # # === Using asset hosts # @@ -34,7 +34,7 @@ module ActionView # image_tag("rails.png") # # => Rails # stylesheet_link_tag("application") - # # => + # # => # # Browsers typically open at most two simultaneous connections to a single # host, which means your assets often have to wait for other assets to finish @@ -47,7 +47,7 @@ module ActionView # image_tag("rails.png") # # => Rails # stylesheet_link_tag("application") - # # => + # # => # # To do this, you can either setup four actual hosts, or you can use wildcard # DNS to CNAME the wildcard to a single asset host. You can read more about @@ -66,7 +66,7 @@ module ActionView # image_tag("rails.png") # # => Rails # stylesheet_link_tag("application") - # # => + # # => # # The example above generates "http://assets1.example.com" and # "http://assets2.example.com". This option is useful for example if @@ -86,7 +86,7 @@ module ActionView # image_tag("rails.png") # # => Rails # stylesheet_link_tag("application") - # # => + # # => # # Alternatively you may ask for a second parameter +request+. That one is # particularly useful for serving assets from an SSL-protected page. The @@ -163,7 +163,7 @@ module ActionView # image_tag("rails.png") # # => Rails # stylesheet_link_tag("application") - # # => + # # => # # Changing the asset_path does require that your web servers have # knowledge of the asset template paths that you rewrite to so it's not diff --git a/actionpack/lib/action_view/helpers/asset_tag_helpers/javascript_tag_helpers.rb b/actionpack/lib/action_view/helpers/asset_tag_helpers/javascript_tag_helpers.rb index c67f81dcf4..e3329c0345 100644 --- a/actionpack/lib/action_view/helpers/asset_tag_helpers/javascript_tag_helpers.rb +++ b/actionpack/lib/action_view/helpers/asset_tag_helpers/javascript_tag_helpers.rb @@ -16,7 +16,7 @@ module ActionView end def asset_tag(source, options) - content_tag("script", "", { "type" => Mime::JS, "src" => path_to_asset(source) }.merge(options)) + content_tag("script", "", { "src" => path_to_asset(source) }.merge(options)) end def custom_dir @@ -60,9 +60,9 @@ module ActionView # ActionView::Helpers::AssetTagHelper.register_javascript_expansion :monkey => ["head", "body", "tail"] # # javascript_include_tag :monkey # => - # - # - # + # + # + # def register_javascript_expansion(expansions) js_expansions = JavascriptIncludeTag.expansions expansions.each do |key, values| @@ -116,36 +116,36 @@ module ActionView # # ==== Examples # javascript_include_tag "xmlhr" - # # => + # # => # # javascript_include_tag "xmlhr.js" - # # => + # # => # # javascript_include_tag "common.javascript", "/elsewhere/cools" - # # => - # # + # # => + # # # # javascript_include_tag "http://www.example.com/xmlhr" - # # => + # # => # # javascript_include_tag "http://www.example.com/xmlhr.js" - # # => + # # => # # javascript_include_tag :defaults - # # => - # # - # # + # # => + # # + # # # # * = The application.js file is only referenced if it exists # # You can also include all JavaScripts in the +javascripts+ directory using :all as the source: # # javascript_include_tag :all - # # => - # # - # # - # # - # # + # # => + # # + # # + # # + # # # # Note that your defaults of choice will be included first, so they will be available to all subsequently # included files. @@ -166,25 +166,25 @@ module ActionView # # # assuming config.perform_caching is false # javascript_include_tag :all, :cache => true - # # => - # # - # # - # # - # # + # # => + # # + # # + # # + # # # # # assuming config.perform_caching is true # javascript_include_tag :all, :cache => true - # # => + # # => # # # assuming config.perform_caching is false # javascript_include_tag "jquery", "cart", "checkout", :cache => "shop" - # # => - # # - # # + # # => + # # + # # # # # assuming config.perform_caching is true # javascript_include_tag "jquery", "cart", "checkout", :cache => "shop" - # # => + # # => # # The :recursive option is also available for caching: # diff --git a/actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb b/actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb index 2584b67548..60d4af178a 100644 --- a/actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb +++ b/actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb @@ -17,7 +17,7 @@ module ActionView def asset_tag(source, options) # We force the :request protocol here to avoid a double-download bug in IE7 and IE8 - tag("link", { "rel" => "stylesheet", "type" => Mime::CSS, "media" => "screen", "href" => path_to_asset(source, :protocol => :request) }.merge(options)) + tag("link", { "rel" => "stylesheet", "media" => "screen", "href" => path_to_asset(source, :protocol => :request) }.merge(options)) end def custom_dir @@ -38,9 +38,9 @@ module ActionView # ActionView::Helpers::AssetTagHelper.register_stylesheet_expansion :monkey => ["head", "body", "tail"] # # stylesheet_link_tag :monkey # => - # - # - # + # + # + # def register_stylesheet_expansion(expansions) style_expansions = StylesheetIncludeTag.expansions expansions.each do |key, values| @@ -81,30 +81,30 @@ module ActionView # # ==== Examples # stylesheet_link_tag "style" # => - # + # # # stylesheet_link_tag "style.css" # => - # + # # # stylesheet_link_tag "http://www.example.com/style.css" # => - # + # # # stylesheet_link_tag "style", :media => "all" # => - # + # # # stylesheet_link_tag "style", :media => "print" # => - # + # # # stylesheet_link_tag "random.styles", "/css/stylish" # => - # - # + # + # # # You can also include all styles in the stylesheets directory using :all as the source: # # stylesheet_link_tag :all # => - # - # - # + # + # + # # # If you want Rails to search in all the subdirectories under stylesheets, you should explicitly set :recursive: # @@ -119,20 +119,20 @@ module ActionView # # ==== Examples # stylesheet_link_tag :all, :cache => true # when config.perform_caching is false => - # - # - # + # + # + # # # stylesheet_link_tag :all, :cache => true # when config.perform_caching is true => - # + # # # stylesheet_link_tag "shop", "cart", "checkout", :cache => "payment" # when config.perform_caching is false => - # - # - # + # + # + # # # stylesheet_link_tag "shop", "cart", "checkout", :cache => "payment" # when config.perform_caching is true => - # + # # # The :recursive option is also available for caching: # diff --git a/actionpack/lib/action_view/helpers/capture_helper.rb b/actionpack/lib/action_view/helpers/capture_helper.rb index 278139cadb..d9d6f90211 100644 --- a/actionpack/lib/action_view/helpers/capture_helper.rb +++ b/actionpack/lib/action_view/helpers/capture_helper.rb @@ -96,7 +96,7 @@ module ActionView # Please login! # # <% content_for :script do %> - # + # # <% end %> # # Then, in another view, you could to do something like this: diff --git a/actionpack/lib/action_view/helpers/javascript_helper.rb b/actionpack/lib/action_view/helpers/javascript_helper.rb index d88f5babb9..5a869d6303 100644 --- a/actionpack/lib/action_view/helpers/javascript_helper.rb +++ b/actionpack/lib/action_view/helpers/javascript_helper.rb @@ -37,7 +37,7 @@ module ActionView # javascript_tag "alert('All is good')" # # Returns: - # + # # => # # Instead of passing the content as an argument, you can also use a block # in which case, you pass your +html_options+ as the first parameter. @@ -62,7 +62,7 @@ module ActionView content_or_options_with_block end - content_tag(:script, javascript_cdata_section(content), html_options.merge(:type => Mime::JS)) + content_tag(:script, javascript_cdata_section(content), html_options) end def javascript_cdata_section(content) #:nodoc: diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb index 4a641fada3..d0f716cc80 100644 --- a/actionpack/lib/action_view/helpers/url_helper.rb +++ b/actionpack/lib/action_view/helpers/url_helper.rb @@ -481,7 +481,7 @@ module ActionView # # => me@domain.com # # mail_to "me@domain.com", "My email", :encode => "javascript" - # # => + # # => # # mail_to "me@domain.com", "My email", :encode => "hex" # # => My email @@ -515,7 +515,7 @@ module ActionView "document.write('#{html}');".each_byte do |c| string << sprintf("%%%x", c) end - "".html_safe + "".html_safe when "hex" email_address_encoded = email_address_obfuscated.unpack('C*').map {|c| sprintf("&#%d;", c) -- cgit v1.2.3