spree-contrib / spree_editor

Rich text editor for Spree with Image and File uploading in-place.
http://guides.spreecommerce.org
BSD 3-Clause "New" or "Revised" License
112 stars 183 forks source link

WYMEditor doesn't work (with suggestion for fix) #8

Closed per-gron closed 12 years ago

per-gron commented 12 years ago

As mentioned in README.md since 4cabdf8826ac498a3937f9d6e4f1ef392f31663b, WYMEditor doesn't work. Here's a version of _wym_editor.html.erb that works for me:

<script type="text/javascript" src="/assets/wymeditor/jquery.wymeditor.min.js"></script>

<script type="text/javascript">
  $(function() {
      var ids = [<%= ids.map{|id| "'textarea##{id}'"}.join(', ') %>]
      $(ids.join(', ')).wymeditor({
        lang: '<%= I18n.locale.to_s.downcase %>',
        skin: 'compact',
        updateSelector: 'form',
        updateEvent: 'submit'
      });
  });
</script>

Sorry about not posting a patch, I'm on a tight deadline and my spree_editor repo is a bit messy.

peterberkenbosch commented 12 years ago

Thanks Per.. I will be working on fixing this asap!

per-gron commented 12 years ago

Thanks.

I also noticed that WYMEditor gets confused about the path to jQuery. Documentation for it is here http://trac.wymeditor.org/trac/wiki/0.5/Customization search for "jQueryPath".

The way I did it (which I am almost sure is not the right Rails way to do it) was to add jQueryPath: '/assets/admin/all.js' to the wymeditor arguments hash.

per-gron commented 12 years ago

I forgot to mention that the jQuery problems only show up on WYMEditor's popup windows; most of the editor's functions work anyway. For instance, the window for creating a link shows up, but the submit button does not work unless the jQueryPath argument is set.

ghost commented 12 years ago

I have fixed those bugs on my github : https://github.com/bricms/spree_editor

I use jquery google link for jQueryPath

Finally I added the French language to TinyMCE.

Please merge those fix to your master !

romul commented 12 years ago

Done: https://github.com/spree/spree_editor/commit/692883789040cdcebae847dbe47a3d4472d33fc7