Dec 202007

I was looking for a neat way to crop images last night and had originally planned to use the excellent jsCropper library from Dave Spurr, which I have used on projects before. When, during a bit of googling about I came across Kropper from Jonathon Wolke. It takes a slightly different approach to Cropper with the crop area staying put and the image moving under the crop area, but also includes a neat zooming feature and some pretty slick design. Another plus, from a Rails perspective, is that the code comes in an example Rails app!!! Makes it very easy to integrate.

Dec 282006

I have been asked a few times for the code for the FCKeditor demo. So I thought I would put it up here for anyone to download, and by here I mean here.

The tar includes the fckeditor plugin, the ajax scaffold plugin and the bits to get them working together. You will need to create a db and update the config files though.

A few people have said they have been having problems with the text area not appearing in Firefox. This isn’t a problem I have had but for those of you who have, thanks to James Penny there is a solution…..

Simply add something like :width => ‘400’, :height => ‘200’ to the fckeditor_textarea call and you should get the editor appearing as expected. Obviously you can change the dimensions to suite your needs.

The solution also explains why I never saw the issue – I have always had the dimensions specified……

I released a new version of the FCKeditor plugin today. It contains a couple of changes to the controller to fix a potential security issue and also a remote_form_for helper so that now you can do this:

<% fckeditor_remote_form_for :note,
                             :url => @options.merge(:controller => 'notes'),
                             :editors => { :note => ['text'] } do |f| %>
  <%= fckeditor_textarea( "note", "text", :ajax => true )
<% end %>

You still need to use the original fckeditor_textarea call as as of yet there is no f.fckeditor_textarea method.

I am currently trying to add a check for IsDirty to prevent accidental unloading of the editor and also looking at using the FCKeditor_IsCompatibleBrowser() function to degrade gracefully.

N.B If you are upgrading you will need to delete the public/javascripts/fckeditor directory before reinstalling…

This release tidies up some of the things I thought I’d got right with the last one, doh. However, it turns out I had overlooked the paths for the spell check and the resource manager. Both of these now dynamically configure so that you can place your install anywhere you fancy. Unfortunately there is a single piece of configuration now required, if, and only if your app is hosted away from the root of the server.

Continue reading »

This release fixes an issue with the base path to the editor being hardcoded into the helper. The problem arose when hosting an app using named virtual hosts and aliases. e.g. hosting your app at www.mydomain.com/scotts/railsapp instead of www.mydomain.com/railsapp.

This should now all work……..

There is a new version of the FCKeditor plugin up. This fixes a problem I found when running tests. The alias method in the init.rb file was being called for every test and causing an infinite recursion. The README has also been fixed to remove the various typos people have found (thanks for the feedback).

As before you can get the plugin using:

ruby script/plugin install svn://rubyforge.org/var/svn/fckeditorp/trunk/fckeditor

There is also a demo

This release is basically a bug fix. The only really change is to apply the patch kindly provided by Nicola Piccinini which sorts out an issue with file upload from inside the resource manager.

There are a couple of other changes to do with the install and version numbers, but that is all internal to the plugin.

demo

There is a new version of the FCKeditor Rails plugin available details of how to get it and a demo are here.

This version fixes a problem with having multiple editors open at once on the same page and also adds a helper to allow multiple editors on the same Ajax form. This also now works with static html forms but you can just use the standard form helpers for that.

Continue reading »

I’ve just released the next version of the FCKeditor plugin. The main change in this version is the addition of the spell check functionality using ASpell. A big thank you to Ken Pratt for providing the patch for that and at the same time providing a solution (I hope) to the routing issues that some people have had.

If you already have this plugin installed you can upgrade by just deleting the existing install and getting it again. If you have altered the fckcustom.js file then you will need to add:

FCKConfig.SpellChecker = 'SpellerPages';

to it . If not just delete that too before reinstalling. You also need to be sure that ASpell is installed along with any dictionaries you want to use (If you are on windows check the README for the expected install directory).

Continue reading »