Sha256: 579d3abdcf9bfd3222dd49a998d327e491120c0baa99ee35587055e578648692

Contents?: true

Size: 690 Bytes

Versions: 10

Compression:

Stored size: 690 Bytes

Contents

module Middleman
  module Minified
    module Javascript
      include ::Haml::Filters::Base
      def render_with_options(text, options)
        if Middleman::Base.respond_to?(:minify_javascript?) && Middleman::Base.minify_javascript?
          compressor = ::YUI::JavaScriptCompressor.new(:munge => true)
          data = compressor.compress(text)
          %Q{<script type=#{options[:attr_wrapper]}text/javascript#{options[:attr_wrapper]}>#{data.chomp}</script>}
        else
          <<END
<script type=#{options[:attr_wrapper]}text/javascript#{options[:attr_wrapper]}>
  //<![CDATA[
    #{text.rstrip.gsub("\n", "\n    ")}
  //]]>
</script>
END
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
middleman-0.14.1 lib/middleman/features/minify_javascript.rb
middleman-0.14.0 lib/middleman/features/minify_javascript.rb
middleman-0.14.0.pre2 lib/middleman/features/minify_javascript.rb
middleman-0.13.2.pre lib/middleman/features/minify_javascript.rb
middleman-0.13.1 lib/middleman/features/minify_javascript.rb
middleman-0.12.2 lib/middleman/features/minify_javascript.rb
middleman-0.12.1 lib/middleman/features/minify_javascript.rb
middleman-0.12.0.pre3 lib/middleman/features/minify_javascript.rb
middleman-0.12.0.pre2 lib/middleman/features/minify_javascript.rb
middleman-0.12.0.pre lib/middleman/features/minify_javascript.rb