Skip to content

Commit

Permalink
use the asset pipeline to generate the path to the editor.css file
Browse files Browse the repository at this point in the history
  • Loading branch information
bastiaanterhorst committed Aug 21, 2012
1 parent 40f24da commit e02c277
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
10 changes: 5 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
rich (1.1.0)
rich (1.2.0)
jquery-rails
kaminari
mime-types
Expand Down Expand Up @@ -50,7 +50,7 @@ GEM
jquery-rails (2.0.2)
railties (>= 3.2.0, < 5.0)
thor (~> 0.14)
json (1.6.6)
json (1.7.3)
kaminari (0.13.0)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
Expand All @@ -60,7 +60,7 @@ GEM
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.18)
multi_json (1.3.2)
multi_json (1.3.5)
paperclip (2.7.0)
activerecord (>= 2.3.0)
activesupport (>= 2.3.2)
Expand Down Expand Up @@ -94,12 +94,12 @@ GEM
rake (0.9.2.2)
rdoc (3.12)
json (~> 1.4)
sass (3.1.16)
sass (3.1.18)
sass-rails (3.2.5)
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
sprockets (2.1.2)
sprockets (2.1.3)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
Expand Down
15 changes: 7 additions & 8 deletions lib/rich.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
require "rich/engine"

module Rich

# configure image styles
def self.image_styles
@@image_styles.merge({ :rich_thumb => "100x100#" })
Expand Down Expand Up @@ -61,7 +61,7 @@ def self.image_styles=(image_styles)
:stylesSet => [],
:extraPlugins => 'stylesheetparser,richfile,MediaEmbed,audio',
:removePlugins => 'scayt,menubutton,contextmenu,image,forms',
:contentsCss => '/assets/rich/editor.css',
:contentsCss => :default,
:removeDialogTabs => 'link:advanced;link:target',
:startupOutlineBlocks => true,
:forcePasteAsPlainText => true,
Expand Down Expand Up @@ -94,7 +94,11 @@ def self.options(overrides={}, scope_type=nil, scope_id=nil)

# merge in local overrides
editor_options.merge!(overrides) if overrides


# if the contentcss is set to :default, use the asset pipeline
editor_options[:contentsCss] = ActionController::Base.helpers.stylesheet_path('rich/editor.css') if editor_options[:contentsCss] == :default


# update the language to the currently selected locale
editor_options[:language] = I18n.locale

Expand Down Expand Up @@ -163,11 +167,6 @@ def self.setup
end

def self.insert





# manually inject into Formtastic 1. V2 is extended autmatically.
if Object.const_defined?("Formtastic")
if(Gem.loaded_specs["formtastic"].version.version[0,1] == "1")
Expand Down

0 comments on commit e02c277

Please sign in to comment.