Skip to content

Commit

Permalink
Switched to use tinymce-jquery gem
Browse files Browse the repository at this point in the history
  • Loading branch information
romul committed Jan 11, 2012
1 parent a6547a4 commit df95c2d
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 42 deletions.
9 changes: 9 additions & 0 deletions app/assets/javascripts/admin/spree_editor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
//= require_tree .
//= require admin/spree_core
//= require tinymce-jquery
10 changes: 10 additions & 0 deletions app/assets/stylesheets/admin/spree_editor.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* This is a manifest file that'll automatically include all the stylesheets available in this directory
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
* the top of the compiled file, but it's generally better to create a new file per style scope.
*
*= require_self
*/

form.edit_product div.left { width: 67%; }
form.edit_product div.right { width: 30%; }
14 changes: 1 addition & 13 deletions app/views/shared/editor_engines/_tiny_mce.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
<%= javascript_include_tag 'admin/tinymce/tiny_mce.js' %>
<%= javascript_include_tag 'admin/tinymce/jquery.tinymce.js' %>

<script type="text/javascript">
$(function() {
var myConfig = { dompath: true };
Expand All @@ -24,16 +21,7 @@
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : false,

// Example content CSS (should be your site CSS)
content_css : "/stylesheets/page-content.css",

// Drop lists for link/image/media/template dialogs
template_external_list_url : "/javascripts/tinymce-template_list.js",
external_link_list_url : "/javascripts/tinymce-link_list.js",
external_image_list_url : "/javascripts/tinymce-/image_list.js",
media_external_list_url : "/javascripts/tinymce-media_list.js",
theme_advanced_resizing : false
});
}
});
Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/editor_engines/_wym_editor.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
jQueryPath: 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'
});
});
</script>
</script>
15 changes: 15 additions & 0 deletions lib/generators/spree_editor/install_generator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module SpreeEditor
module Generators
class InstallGenerator < Rails::Generators::Base

def add_javascripts
append_file "app/assets/javascripts/admin/all.js", "//= require admin/spree_editor\n"
end

def add_stylesheets
inject_into_file "app/assets/stylesheets/admin/all.css", " *= require admin/spree_editor\n", :before => /\*\//, :verbose => true
end

end
end
end
26 changes: 0 additions & 26 deletions lib/tasks/install.rake

This file was deleted.

1 change: 0 additions & 1 deletion lib/tasks/spree_editor.rake

This file was deleted.

3 changes: 2 additions & 1 deletion spree_editor.gemspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = 'spree_editor'
s.version = '0.50.1'
s.version = '0.70.0'
s.summary = 'Adds support of several WYSIWYG editors to Spree'
s.description = 'Atm supported: YUIRichEditor, WYMEditor, TinyMCE'
s.required_ruby_version = '>= 1.8.7'
Expand All @@ -17,4 +17,5 @@ Gem::Specification.new do |s|
s.requirements << 'none'

s.add_dependency('spree_core', '>= 0.70.0')
s.add_dependency('tinymce-rails', '>= 3.4.7')
end

0 comments on commit df95c2d

Please sign in to comment.