TinyMCE GZip Compressor Ruby on Rails Plugin - Take 2
UPDATE: I've finally added conditional Gzip compression. See TinyMCE GZip Compressor Ruby on Rails Plugin - Take 3 .
After posting in the TinyMCE forums about my GZip Compressor, Spocke let me know that they revamped the other Gzip Compressors, and that I should work off those. I checked it out and the code is a lot cleaner, so I went ahead and refactored.
This time though I went all out and created it as a plugin. It supports caching and gzip compression with one caveat. If you enable caching, then it will always gzip the output. This means that browsers that don't support gzip will break. This shouldn't be an issue since any browser that can run TinyMCE should support gzip.
TinyMCE GZip Compressor Ruby on Rails Plugin
To install it, extract the plugin to vendor/plugins. The path should look like RAILS_ROOT/vendor/plugins/tiny_mce_gzip.
Add the following line to routes.rb
TinyMceGzip::Routes.add_routes
Change your tiny_mce javascript include to the following.
<%= javascript_include_tag("tiny_mce/tiny_mce_gzip") %>
That's it!
This plugin assumes that TinyMCE is installed in /public/javascripts/tiny_mce.
Let me know if you have any issues, comments or questions.
Comments
| 3. | Walter McGinnis - 10 24, 2006 @ 12:22AM |
One last comment. I promise. Any chance that you be moving this plugin to a subversion repository? If you don't have or don't want to set up the means, rubyforge seems like a good candidate.
I mention this because I prefer to use subversion with externals for plugins.
Cheers,
Walter
| 6. | Walter McGinnis - 10 26, 2006 @ 05:28PM |
I finally smoothed out some bumps with using the TinyMCE plugin with ajaxscaffold generated code (see http://blog.katipo.co.nz/ for details). After I get some other work out of the way, I'll give your code a try.
When I do, I'll let you know how it goes.
Cheers,
Walter
| 8. | Igor - 11 22, 2006 @ 11:32PM |
There is no such file in public\javascripts\tiny_mce\tiny_mce_gzip.js !
So <%= javascript_include_tag("tiny_mce\tiny_mce_gzip") %> isn't gonna cut it.
I've copied your file lib\tiny_mce_gzip.js over, but still nothing.
Do I add the routing line anywhere I want in routes.rb?
Do I need to include this plugin somehow maybe?
Thanks!
| 9. | Doug Johnston - 12 05, 2006 @ 07:00PM |
Cool idea! I got it to work and it does shrink the filesize down to a more manageable 65k. It seems to take a little while to gunzip it on the client side though (5-10 seconds) and on fast connections it seems like it might be faster to just download the original. Anyone else experiencing this? The real problem is that during the 5-10 seconds of gunzipping the file, the browser (Firefox 2.0) appears to lockup. It always recovers, but still, that's a rather undesirable effect. Perhaps too, it's that I'm running in development mode. I'll have to test it in production mode with full caching to see if that makes a difference. Regardless, thanks for the great work!
| 17. | Ivan Storck - 03 01, 2007 @ 05:24PM |
I followed all the steps above but I can't figure out how to get the TinyMCE editor to show up for my textarea. Do I need another plugin or another piece of code?
| 21. | Patricia - 04 03, 2007 @ 10:24PM |
Show !
Very Good !
| 23. | steve - 08 21, 2007 @ 09:34PM |
This didn't work for me ... I'm pretty sure I know what I'm doing. Did the latest rails release break this?
| 24. | Jason - 08 28, 2007 @ 09:00PM |
I short-term solution to the ApplicationController error is found here http://aspn.activestate.com/ASPN/Mail/Message/rubyonrails-talk/3507571.
| 27. | Kindy - 10 11, 2007 @ 06:02AM |
See You have only 2 provissions. either you can change all textarea to MCE or not. ok.
dont think much bigger :D . cool this foolish plugin made my system go 500 error.
:-(
| 28. | Vovka - 10 17, 2007 @ 10:03AM |
I disabled TinyMCE for one of my textareas!!! Use code like this:
#when intitializing in <header> in rhtml
tinyMCE.init({mode : "textareas", editor_deselector : "mceNoEditor"});
...
#in <body>
<%= text_area 'event_photo_loader', :caption, :size => "20x3", :class => "mceNoEditor" %>
Remi, it's simple! Just set editor_deselector during initialization and use this name in the capacity of class for your form-item. Enjoy Ruby-with-TinyMCE!
| 29. | Maximka - 11 08, 2007 @ 10:48PM |
Very Pizdatiy Post
| 30. | antenado - 03 31, 2008 @ 08:09AM |
very good
| 31. | Ilya Shubin - 05 14, 2008 @ 05:26AM |
O_O Thanks for plugin, Ben.
But what you say about this http://www.example-code.com/ruby/gzip_compressString.asp ?
| 32. | impressora hp - 05 31, 2008 @ 12:51PM |
impressora
impressora hp
impressora laser
impressora multifuncional
cartucho impressora
tinta impressora
tinta de impressora
driver impressora
impressora deskjet
impresora
impressora fiscal
impressora a laser
impressora canon
impressora zebra
impressora laser hp
impressora matricial
impressora xerox
cartuchos impressora
cartucho de impressora
impressora jato de tinta
cartucho impressora hp
cartucho para impressora
tinta para impressora
impressora termica
impressora cd




Post a Comment