Sha256: 0328ddd73c16c72146d46d296271118ab56ad525d03d2aab5e58602cddb81eca

Contents?: true

Size: 780 Bytes

Versions: 7

Compression:

Stored size: 780 Bytes

Contents

module RailsKindeditor
  module Helper
    def include_kindeditor_if_needed
      if @use_kindeditor
        output = ""
        if ::Rails.version < "3.1.0"
          path = "/javascripts"
        else # Rails3.1+
          path = "#{request.protocol}#{request.host_with_port}"
        end
        if config.perform_caching && ::Rails.version < "3.1.0"
          output << javascript_include_tag("#{path}/kindeditor/kindeditor-min.js", "#{path}/kindeditor/kindeditor-init.js", :cache => "kindeditor/kindeditor-cache")
        else
          output << javascript_include_tag("#{path}/kindeditor/kindeditor-min.js", "#{path}/kindeditor/kindeditor-init.js")
        end
        output.html_safe
      end
    end
  end
end

ActionView::Base.send(:include, RailsKindeditor::Helper)

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rails_kindeditor-0.2.8 lib/rails_kindeditor/helper.rb
rails_kindeditor-0.2.7 lib/rails_kindeditor/helper.rb
rails_kindeditor-0.2.6 lib/rails_kindeditor/helper.rb
rails_kindeditor-0.2.5 lib/rails_kindeditor/helper.rb
rails_kindeditor-0.2.3 lib/rails_kindeditor/helper.rb
rails_kindeditor-0.2.2 lib/rails_kindeditor/helper.rb
rails_kindeditor-0.2.1 lib/rails_kindeditor/helper.rb