diff --git a/formtastic-epiceditor.gemspec b/formtastic-epiceditor.gemspec index d8e6412..6e51e63 100644 --- a/formtastic-epiceditor.gemspec +++ b/formtastic-epiceditor.gemspec @@ -15,6 +15,4 @@ Gem::Specification.new do |s| s.files = `git ls-files`.split("\n") s.test_files = Dir["test/**/*"] - s.add_dependency "rails", "~> 4.0.0" - end diff --git a/lib/formtastic-epiceditor.rb b/lib/formtastic-epiceditor.rb index ec41f0c..5b4781a 100644 --- a/lib/formtastic-epiceditor.rb +++ b/lib/formtastic-epiceditor.rb @@ -9,6 +9,7 @@ class Engine < ::Rails::Engine initializer "formtastic-epiceditor.assets.precompile" do |app| app.config.assets.precompile += %w(epiceditor/themes/**/*) + app.config.assets.precompile += %w(epiceditor/*.png) end end end diff --git a/lib/formtastic-epiceditor/inputs/epic_editor_input.rb b/lib/formtastic-epiceditor/inputs/epic_editor_input.rb index b06313d..c26e03a 100644 --- a/lib/formtastic-epiceditor/inputs/epic_editor_input.rb +++ b/lib/formtastic-epiceditor/inputs/epic_editor_input.rb @@ -1,6 +1,8 @@ # app/inputs/my_special_string_input.rb # use with :as => :my_special_string + class EpicEditorInput < Formtastic::Inputs::TextInput + def input_html_options { :class => "epiceditor" @@ -26,6 +28,9 @@ def assets_base_path def buildInitScript(id) randNum = rand(1..100000) + editor_css = ActionController::Base.helpers.asset_path "epiceditor/themes/base/epiceditor.css" + dark_css = ActionController::Base.helpers.asset_path "epiceditor/themes/preview/preview-dark.css" + light_css = ActionController::Base.helpers.asset_path "epiceditor/themes/editor/epic-light.css" return """