Coder Social home page Coder Social logo

80beans / wysihat-engine Goto Github PK

View Code? Open in Web Editor NEW
167.0 167.0 16.0 1.24 MB

A Rails engine to help integrate the 37signals WysiHat rich text editor to your application.

Home Page: http://www.80beans.com/2009/10/01/wysihat-engine/

License: MIT License

Ruby 13.93% JavaScript 86.07%

wysihat-engine's People

Contributors

champierre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

wysihat-engine's Issues

WysiHat Engine script/generate generator command not working

I tried to install WysiHat Engine on Mac OS 10.5.8. Here's a breakdown of my attempts. All of the following commands were performed inside the "/Users/dpie/Sites/my_app" directory. All password prompts have been removed.

  • Installed Paperclip 2.3.1.1 as a plugin
  • Set "config.gem 'wysihat-engine', :source => 'http://gemcutter.org'" in environment.rb
  $ sudo rake gems:install
  (in /Users/dpie/Sites/my_app)
  gem install wysihat-engine --source http://gemcutter.org
  ERROR:  Error installing wysihat-engine:
    wysihat-engine requires thoughtbot-paperclip (>= 2.3.1, runtime)
  • Set "config.gem 'paperclip', :source => 'http://gemcutter.org'" in environment.rb
  • Removed "config.gem 'wysihat-engine', :source => 'http://gemcutter.org'" from environment.rb
  • Removed Paperclip plugin and installed it as a gem instead
  $ sudo rake gems:install
  (in /Users/dpie/Sites/my_app)
  gem install paperclip --source http://gemcutter.org
  Successfully installed paperclip-2.3.1.1
  1 gem installed
  Installing ri documentation for paperclip-2.3.1.1...
  Installing RDoc documentation for paperclip-2.3.1.1...

  $ gem list --local
  *** LOCAL GEMS ***
  ...
  paperclip (2.3.1.1)

  $ sudo rake gems:unpack
  (in /Users/dpie/Sites/my_app)
  Unpacked gem: '/Users/dpie/Sites/my_app/vendor/gems/paperclip-2.3.1.1'

  $ sudo rake gems:install
  (in /Users/dpie/Sites/my_app)
  $ sudo rake gems:install
  (in /Users/dpie/Sites/my_app)
  gem install wysihat-engine --source http://gemcutter.org
  ERROR:  Error installing wysihat-engine:
    wysihat-engine requires thoughtbot-paperclip (>= 2.3.1, runtime)
  • Tried installing the normal gem way
  $ sudo gem install wysihat-engine
  ERROR:  could not find gem wysihat-engine locally or in a repository

  $ sudo gem install wysihat-engine --source http://gemcutter.org
  ERROR:  Error installing wysihat-engine:
    wysihat-engine requires thoughtbot-paperclip (>= 2.3.1, runtime)
  • Forced WysiHat Engine gem to ignore errors and install
  $ sudo gem install wysihat-engine --source http://gemcutter.org -f
  Successfully installed wysihat-engine-0.1.7
  1 gem installed
  Installing ri documentation for wysihat-engine-0.1.7...
  Installing RDoc documentation for wysihat-engine-0.1.7...

  $ gem list --local
  *** LOCAL GEMS ***
  ...
  paperclip (2.3.1.1)
  wysihat-engine (0.1.7)
  • Tried running the generate code without, then with 'sudo'
  $ script/generate wysihat
  -bash: script/generate: Permission denied

  $ sudo script/generate wysihat
  sudo: script/generate: command not found
  • Unpacked the gem and tried again
  $ sudo rake gems:unpack
  (in /Users/dpie/Sites/my_app)
  Unpacked gem: '/Users/dpie/Sites/my_app/vendor/gems/wysihat-engine-0.1.7'

  $ script/generate wysihat
  -bash: script/generate: Permission denied

  $ sudo script/generate wysihat
  sudo: script/generate: command not found

Verified that the generate file did in fact exist, then tried changing file permissions. Nothing worked. Any ideas?

Thanks!

  • Dave

Wysihat not initializing properly when in ajax link_to_remote

Maybe not a direct issue to report, but I could need some help using your great wysihat-engine in a project that populates a div element with the wysihat form through the link_to_remote ajax call. For some reason it does not work, just gives me a regular text-area form. I suspect it has to do with a lack for a window load event for the wysihatify? Maybe I could call this function directly from the ":complete" callback in the "link_to_remote"? A bit too hard for me to work through all the javascript code to find a workaround.

Any help greatly appreciated!
Best, Espen

Edit hyperlinks

When a link is created via wysihat editor there is no way to edit it. Is that a configuration option?
How to set link value in the popup to return selected href value?

NoMethodError in Wysihat_files#index

This Error happens when I click on the Image Upload button.
Here's a trace :
Showing /home/shreyas/.rvm/gems/ruby-1.8.7-p330@global/gems/wysihat-engine-0.1.13/app/views/wysihat_files/_wysihat_file.html.erb where line #2 raised:

You have a nil object when you didn't expect it!
The error occurred while evaluating nil.starts_with?
Extracted source (around line #2):

1:


  • 2: <%= include_link(wysihat_file) %>
    3: <%= link_to_remote t('wysihat_files.destroy.name'), :url => wysihat_file, :method => :delete, :confirm => t('wysihat_files.destroy.sure') %>
    4:
  • Wysihat fails to load in IE7

    Have tried to get the demo app running in IE7. It fails with a Javascript 'object expected' error.

    Have run it through the Visual Web Developer debugger (only way I could get something useful!) and it breaks at the point where 'addButtons' is called:

    Content

    <script type="text/javascript">addButtons('page_content', ['bold', 'italic', 'underline', 'strikethrough', 'justify_left', 'justify_center', 'justify_right', 'insert_ordered_list', 'insert_unordered_list', 'undo', 'redo', 'link', 'html', 'image']);

    Still digging around to work out why - initial guess is that this has something to do with the latest change to make the JS unobtrusive.

    How can I style the textarea generated by wysihat?

    Hi guys,

    I've implemented wysihat-engine and it works great! The one problem I can't seem to solve is styling the textarea. In google chromes inspector I see that wysihat-engine generates an iframe and I can add the font-family manually there and it works but I haven't found a way to get it to work via simple css.

    Any clues on how to get this to work? Just need to change the font-family to helvetica and play with the color/size.

    Many thanks!
    -Tony

    contentEditable on DIV instead of IFRAME

    Hi there, first of all, great work! It's cool to see the progress in this area. I think Wysihat is going to turn into a really solid platform for a new generation of rich text editors.

    One vision I have for my customers is allowing them to edit their pages within their templates. This requires just setting the editable area (usually a DIV) to be contentEditable = true. Since Firefox 2 is old now, this shouldn't be too much of a problem as that was the only browser that didn't conform to only allowing that DIV being editable. This is far more ideal than having a detached IFRAME in an 'admin area' where the user can't see their page as it will appear in its final context.

    It turns out that Wysihat was designed for this option. It's very undocumented but you can change the options to set the elements to editable rather than turn it into an IFRAME.

    I was just wondering if the modifications you're making to this fork are keeping this in mind? I did a quick browse of the paste code that was recently committed and I see you're addressing the iframe there directly. Maybe you could shed some light on this.

    Last time I checked, the contentEditable functionality didn't actually work, but hopefully in the future it'll be fixed up :) I've got a bit more time these days so I will delve in and see if I can't get it working at least a little bit :)

    I hope I was clear enough in my explanation, but please let me know if I need to elaborate more :D

    Looking forward to hearing your thoughts.

    Brendon

    Paperclip conflict

    I already had Paperclip installed before I installed wysihat... After I installed wysihat and raked, when I rebooted my server the app crashes with a superclass mismatch for class PaperclipCommandLineError which I understand probably means I am trying to reuse the PaperclipCommandLineError class... However, I have gone all thru the app and can't find where it's happening. I then uninstalled wysihat (I also was trying to do remote_form_for which apparently breaks wysihat, thus rendering it useless for me), but the app is still puking.

    next_migration_number

    Running "rails g wysihat" in rails 3 after installation gives me a NotImplementedError exception in the next_migration_number method. This method is defined under Rails::Generators::Migration::ClassMethods in the rails source, so changing it to be a class method in wysihat fixed it for me:

    -def next_migration_number(dirname) #:nodoc:
    +def self.next_migration_number(dirname) #:nodoc:

    Image button not working

    Attempting to add an image through the toolbar results in "unitialized constant WysihatFilesController"

    on Rails 3.0.0
    wysihat-engine-0.1.13

    Rails 3 NoMethodError in _wysihat_file.html.erb

    A NoMethodError comes up when clicking the "Insert Image" button.

    link_to_remote has been removed from Rails 3, so line 3 of _wysihat_file.html.erb should change from:

    <%= link_to_remote t('wysihat_files.destroy.name'), :url => wysihat_file, :method => :delete, :confirm => t('wysihat_files.destroy.sure') %>

    to

    <%= link_to t('wysihat_files.destroy.name'), :url => wysihat_file, :method => :delete, :confirm => t('wysihat_files.destroy.sure'), :remote =>true %>

    This fixed the NoMethodError, it still doesn't work well. Ideas?

    Wysihat Gem - Rails 3

    running 'rails generate wysihat' results in:

    /gems/railties-3.0.0/lib/rails/generators/migration.rb:30:in next_migration_number': NotImplementedError (NotImplementedError) /gems/railties-3.0.0/lib/rails/generators/migration.rb:49:inmigration_template'
    /gems/wysihat-engine-0.1.13/lib/generators/wysihat_generator.rb:60:in install_wysihat' /gems/thor-0.14.1/lib/thor/task.rb:22:insend'
    /gems/thor-0.14.1/lib/thor/task.rb:22:in run' /gems/thor-0.14.1/lib/thor/invocation.rb:118:ininvoke_task'
    /gems/thor-0.14.1/lib/thor/invocation.rb:124:in invoke_all' /gems/thor-0.14.1/lib/thor/shell.rb:14:inmap'
    /gems/thor-0.14.1/lib/thor/core_ext/ordered_hash.rb:73:in each' /gems/thor-0.14.1/lib/thor/invocation.rb:124:inmap'
    /gems/thor-0.14.1/lib/thor/invocation.rb:124:in invoke_all' /gems/thor-0.14.1/lib/thor/group.rb:226:indispatch'
    /gems/thor-0.14.1/lib/thor/base.rb:389:in start' /gems/railties-3.0.0/lib/rails/generators.rb:163:ininvoke'
    /gems/railties-3.0.0/lib/rails/commands/generate.rb:10
    /gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in require' /gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:inrequire'
    /gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in load_dependency' /gems/activesupport-3.0.0/lib/active_support/dependencies.rb:591:innew_constants_in'
    /gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in load_dependency' /gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:inrequire'
    /gems/railties-3.0.0/lib/rails/commands.rb:17
    from script/rails:6:in `require'
    from script/rails:6

    would love to help, but pretty sure I don't know enough about rails 3 or wysihat-engine to do so...

    Error on installing on Heroku

    I keep getting this error no matter what I do on heroku and my code. PLEASE HELP!

    -----> Heroku receiving push

    -----> Installing gem paperclip >= 2.3.1 from http://gemcutter.org, http://gems.rubyforge.org
    Successfully installed paperclip-2.3.1.1
    1 gem installed

    -----> Installing gem wysihat-engine from http://gemcutter.org, http://gems.rubyforge.org
    ERROR: Error installing wysihat-engine:
    wysihat-engine requires thoughtbot-paperclip (>= 2.3.1, runtime)

    I can not go on with my push because it do not want to install it.

    Remote_form_for doesn't work

    I noticed that when you change the FORM from form_for(@page) to remote_form_for(@page) if you have 'wysihat_engine_pack' included in the javascript it won't work. It will fall back to regular posting.

    You can see this in the demo app, just edit app/views/pages/new.html.erb and chnage from_for to remote_form_for and see that it just posts as normal.

    If you remove the 'wysihat_engine_pack' from the app/views/layouts/pages.html.erb and click create, the page will not change and using firebug you can see the ajax call.

    Unfortunately I don't know enough about why the wysihat-engine is taking over from the remote_form_for, though I suspect that it would relate to how it monitors the forms.

    Hope this is an easy fix as I am sure others want to use remote_form_for and the wysihat engine at the same time. :-)

    HTML tags displaying as text

    I solved my previous Issue but I am unable to delete it.

    Now something even more frustrating is happening to me, the html tags for text formating end up showing as text instead of properly rendering bold or italic text.

    Successful Installation but failed implementation

    <script type="text/javascript">Event.observe(window, 'load', function() {wysiHatify('noticia_body', ['bold', 'italic', 'underline', 'strikethrough', 'h1', 'h2', 'h3', 'p', 'justify_left', 'justify_center', 'justify_right', 'insert_ordered_list', 'insert_unordered_list', 'undo', 'redo', 'link', 'html', 'image', 'paste']);});</script><textarea class="wysihat_editor" cols="40" id="noticia_body" name="noticia[body]" rows="20"></textarea> 
    

    Thats the source code that shows up when I make my post text_area a wysihat_editor.

    <%= f.label "Texto" %>

    <%= f.wysihat_editor :body %>

    is my new.html.erb code.

    <%= javascript_include_tag 'wysihat_engine_pack' %>
    <%= stylesheet_link_tag 'facebox', 'wysihat' %>

    are my links in the application.html.erb .

    Is this happening because I have deleted all the prototype associated files or there it has nothing to do with that?

    Im sorry for my ignorance I am barely 17 years old and learning Ruby/ Ruby on Rails.

    Which html tags are removed when text is saved?

    Hi. I ran into some problems today, trying to use the wysihat for rendering html pages (stored in a database) with advanced tags like "object" for quicktime, and "form" tags for some paypal-forms. Both of these are somehow removed when saving to the database (actually some of them are removed and some are kept, difficult to see a pattern).

    I haven´t managed to find out where exactly this sanitizing is happening in the wysihat.js (so that I could possibly disable it).

    Any ideas?
    Thanks again for a great gem.

    Recommend Projects

    • React photo React

      A declarative, efficient, and flexible JavaScript library for building user interfaces.

    • Vue.js photo Vue.js

      🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

    • Typescript photo Typescript

      TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

    • TensorFlow photo TensorFlow

      An Open Source Machine Learning Framework for Everyone

    • Django photo Django

      The Web framework for perfectionists with deadlines.

    • D3 photo D3

      Bring data to life with SVG, Canvas and HTML. 📊📈🎉

    Recommend Topics

    • javascript

      JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

    • web

      Some thing interesting about web. New door for the world.

    • server

      A server is a program made to process requests and deliver data to clients.

    • Machine learning

      Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

    • Game

      Some thing interesting about game, make everyone happy.

    Recommend Org

    • Facebook photo Facebook

      We are working to build community through open source technology. NB: members must have two-factor auth.

    • Microsoft photo Microsoft

      Open source projects and samples from Microsoft.

    • Google photo Google

      Google ❤️ Open Source for everyone.

    • D3 photo D3

      Data-Driven Documents codes.