From 470b56df207765824c191b98d9e5c8c6a7d74c91 Mon Sep 17 00:00:00 2001 From: Michi Gysel Date: Fri, 7 Mar 2014 23:31:11 +0100 Subject: [PATCH 1/2] fixed rails 4 asset pipeline with digests --- lib/formtastic-epiceditor.rb | 1 + .../inputs/epic_editor_input.rb | 13 +++++++++---- .../epiceditor/{epiceditor.js => epiceditor.js.erb} | 6 +++--- .../assets/javascripts/epiceditor/epiceditor.min.js | 4 ---- 4 files changed, 13 insertions(+), 11 deletions(-) rename vendor/assets/javascripts/epiceditor/{epiceditor.js => epiceditor.js.erb} (99%) delete mode 100644 vendor/assets/javascripts/epiceditor/epiceditor.min.js 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 """