Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions formtastic-epiceditor.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions lib/formtastic-epiceditor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 9 additions & 4 deletions lib/formtastic-epiceditor/inputs/epic_editor_input.rb
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -26,18 +28,21 @@ 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 """
<script>
var el#{randNum} = $('##{id}'),
html = el#{randNum}.val(),
opts = {
container: '#{id}-epiceditor',
clientSideStorage: false,
basePath: '#{assets_base_path}',
basePath: '',
theme: {
base:'/themes/base/epiceditor.css',
preview:'/themes/preview/preview-dark.css',
editor:'/themes/editor/epic-light.css'
base:'#{editor_css}',
preview:'#{dark_css}',
editor:'#{light_css}'
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,9 +468,9 @@
'<iframe frameborder="0" id="epiceditor-editor-frame"></iframe>' +
'<iframe frameborder="0" id="epiceditor-previewer-frame"></iframe>' +
'<div id="epiceditor-utilbar">' +
'<img width="30" src="' + this.settings.basePath + '/preview.png" title="Toggle Preview Mode" class="epiceditor-toggle-btn epiceditor-toggle-preview-btn"> ' +
'<img width="30" src="' + this.settings.basePath + '/edit.png" title="Toggle Edit Mode" class="epiceditor-toggle-btn epiceditor-toggle-edit-btn"> ' +
'<img width="30" src="' + this.settings.basePath + '/fullscreen.png" title="Enter Fullscreen" class="epiceditor-fullscreen-btn">' +
'<img width="30" src="<%= asset_path 'epiceditor/preview.png' %>" title="Toggle Preview Mode" class="epiceditor-toggle-btn epiceditor-toggle-preview-btn"> ' +
'<img width="30" src="<%= asset_path 'epiceditor/edit.png' %>" title="Toggle Edit Mode" class="epiceditor-toggle-btn epiceditor-toggle-edit-btn"> ' +
'<img width="30" src="<%= asset_path 'epiceditor/fullscreen.png' %>" title="Enter Fullscreen" class="epiceditor-fullscreen-btn">' +
'</div>' +
'</div>'

Expand Down
4 changes: 0 additions & 4 deletions vendor/assets/javascripts/epiceditor/epiceditor.min.js

This file was deleted.