Skip to content

Commit

Permalink
Prepare for 3.7.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
galetahub committed May 14, 2012
1 parent 82cee8d commit 5221b09
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 34 deletions.
16 changes: 11 additions & 5 deletions lib/ckeditor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ module Backend
mattr_accessor :relative_path
@@relative_path = '/assets/ckeditor'

# Ckeditor assets for precompilation
mattr_accessor :assets
@@assets = nil

# Default way to setup Ckeditor. Run rails generate ckeditor to create
# a fresh initializer with all configuration values.
def self.setup
Expand All @@ -49,12 +53,14 @@ def self.root_path
end

def self.assets
Dir[root_path.join('vendor/assets/javascripts/ckeditor/**', '*.{js,css}')].inject([]) do |list, path|
unless path.include?("/ckeditor/filebrowser/")
list << Pathname.new(path).relative_path_from(root_path.join('vendor/assets/javascripts'))
@@assets ||= begin
Dir[root_path.join('vendor/assets/javascripts/ckeditor/**', '*.{js,css}')].inject([]) do |list, path|
unless path.include?("/ckeditor/filebrowser/")
list << Pathname.new(path).relative_path_from(root_path.join('vendor/assets/javascripts'))
end

list
end

list
end
end

Expand Down
3 changes: 2 additions & 1 deletion lib/ckeditor/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class Engine < ::Rails::Engine
end

initializer "ckeditor.hooks" do
if Object.const_defined?("Formtastic") && Formtastic.const_defined?("Inputs") # Don't load the hook for Formtastic < 2.0.0 that (it crashes), apparently, didn't define a Formtastic::Inputs.
# Don't load the hook for Formtastic < 2.0.0 that (it crashes), apparently, didn't define a Formtastic::Inputs.
if Object.const_defined?("Formtastic") && Formtastic.const_defined?("Inputs")
require "ckeditor/hooks/formtastic"
end

Expand Down
15 changes: 5 additions & 10 deletions lib/ckeditor/helpers/form_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,18 @@ module FormHelper

def cktext_area(object_name, method, options = {})
options = { :language => I18n.locale.to_s }.merge(options)
input_html = (options.delete(:input_html) || {})
hash = input_html.stringify_keys
input_html = (options.delete(:input_html) || {}).stringify_keys
js_content_for_section = options.delete(:js_content_for)

instance_tag = ActionView::Base::InstanceTag.new(object_name, method, self, options.delete(:object))
instance_tag.send(:add_default_name_and_id, hash)
instance_tag.send(:add_default_name_and_id, input_html)

output_buffer = ActiveSupport::SafeBuffer.new
output_buffer << instance_tag.to_text_area_tag(input_html)

js_content_for_section = options.delete(:js_content_for)
js = Utils.js_replace(hash['id'], options)
if js_content_for_section
content_for(js_content_for_section) { js.html_safe }
else
output_buffer << javascript_tag(js)
end
js = Utils.js_replace(input_html['id'], options)

output_buffer << (js_content_for_section ? content_for(js_content_for_section, js) : javascript_tag(js))
output_buffer
end
end
Expand Down
8 changes: 2 additions & 6 deletions lib/ckeditor/helpers/view_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,14 @@ def cktext_area_tag(name, content = nil, options = {})
element_id = sanitize_to_id(name)
options = { :language => I18n.locale.to_s }.merge(options)
input_html = { :id => element_id }.merge( options.delete(:input_html) || {} )
js_content_for_section = options.delete(:js_content_for)

output_buffer = ActiveSupport::SafeBuffer.new
output_buffer << text_area_tag(name, content, input_html)

js_content_for_section = options.delete(:js_content_for)
js = Utils.js_replace(element_id, options)
if js_content_for_section
content_for(js_content_for_section) { js.html_safe }
else
output_buffer << javascript_tag(js)
end

output_buffer << (js_content_for_section ? content_for(js_content_for_section, js) : javascript_tag(js))
output_buffer
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/ckeditor/version.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Ckeditor
module Version
GEM = "3.7.0.rc3".freeze
EDITOR = "3.6.2".freeze
GEM = "3.7.0".freeze
EDITOR = "3.6.3".freeze
end
end
2 changes: 1 addition & 1 deletion vendor/assets/javascripts/ckeditor/skins/kama/dialog.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions vendor/assets/javascripts/ckeditor/skins/kama/editor.css

Large diffs are not rendered by default.

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions vendor/assets/javascripts/ckeditor/skins/v2/editor.css

Large diffs are not rendered by default.

0 comments on commit 5221b09

Please sign in to comment.