| 1. | Danger - 04 05, 2007 @ 03:58PM |
Excellent!
Do you have it in SVN anywhere? If not, would you like me to set up a repository for you?
This is really great. Way to solve problems for the antarcticanians.
One of the coolest Doodlekit blogs I've seen is Tall Matt's Travels, where Matt Olson chronicles is non-stop trip around the world. Matt was tired of corporate america (can't blame him since he worked at Cerner), and left it all to pursue his dream. It's quite amazing actually.
Anyway, Matt has been blogging through various Internet cafe's, and recently had a problem with the WYSIWYG. The problem was that the particular browser he was using did not support gzip compression. I assumed we where safe from this problem, but then Matt had to go to Antartica!
This is good though, cause it force me to finish the last piece of the TinyMCE Gzip Compressor. Before I couldn't support conditional Gzip compression, since Rails' caching stuff doesn't allow after_filter's. I ended up having to copy the caching code and massage in some gzip stuff to get it to work right.
Here it is.
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") %>
This plugin assumes that TinyMCE is installed in /public/javascripts/tiny_mce.
I've tested this in Rails 1.1.6 and 1.2.3.
I've also created a separate page specifically for the plugin. If you're going to link to it, please use this url.
http://garbageburrito.com/home/tinymce_gzip_compressor_ruby_on_rails_plugin
| 1. | Danger - 04 05, 2007 @ 03:58PM |
Excellent!
Do you have it in SVN anywhere? If not, would you like me to set up a repository for you?
This is really great. Way to solve problems for the antarcticanians.
| 2. | daddz - 04 10, 2007 @ 02:06AM |
Will this work together with the TinyMCE-Rails-Plugin: http://wiki.rubyonrails.org/rails/pages/HowToUseTinyMCE ?
| 3. | iGEL - 04 10, 2007 @ 08:08PM |
Hi!
Somehow this plugin doesn't work here. The route /javascripts/tiny_mce/tiny_mce_gzip.js is not found. Without the gzip-plugin, TinyMCE works fine. I tried to add the routes at the beginning of routes.rb, in the Routes.draw block and at the end of the file, but it doesn't helped. TinyMCE 2.1.0 is located in #{RAILS_ROOT}/public/javascripts/tiny_mce/tiny_mce.js and your plugin in #{RAILS_ROOT}/vendor/plugins/tiny_mce_gzip/init.rb. Guess I'm just being stupid, maybe you can give me a hint?
| 5. | hiram - 05 14, 2007 @ 10:26PM |
I was getting this error: "ArgumentError (A copy of ApplicationController has been removed from the module tree but is still active!)"
For some reason, this error was appearing because i had before_filter(s) defined in application.rb. I edited tiny_mce_gzip_controller.rb to use skip_before_filter(s) and this error went away.
| 6. | Steve - 08 02, 2007 @ 05:05PM |
I couldn't seem to add "TinyMceGzip::Routes.add_routes" to my routes. it seems to me that it was loading it before the plugins were loaded and was failing because of it.
I moved it to my environment.rb, errors went away for now.. not sure how to confirm it's all working other than throwing it up on my remote test server....
| 7. | Geoff - 09 26, 2007 @ 08:04PM |
Hi. I'm using the tinymcegzip plugin. I think it's great. Super easy to use - great work!
I have noticed a problem sometime. Although it still works, I seem to get this Application error often:
A NoMethodError occurred in tiny_mce_gzip#check: undefined method `size' for nil:NilClass [RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/cgi_process.rb:228:in `set_content_length!'
------------------------------- Request: ------------------------------- * URL: http://127.0.0.1:40380/javascripts/tiny_mce/tiny_mce_gzip_check.js?
I've been trying to figure it out, but haven't really got a clue.
Any ideas, or hints on where I might be best to look?
| 8. | Geoff - 09 30, 2007 @ 06:04PM |
RE my last post - I figured it out. It was an oversight (which I should have seen a lot sooner). In tiny_mce_gzip.js 'settings' I had 'check: true'. however, there was no tiny_mce_gzip_check.js file in my javascripts folder.
To fix it - I just removed 'check: true'.
| 9. | Alan Degener - 10 13, 2007 @ 02:53PM |
I am trying out the compression thing. When I don't compress it downloads 141KB javascript. When I do compress is downloads 304KB - which is obviously bigger and slower. When I look at that 304KB script it says diskcache=false which is odd because I changes all parameters and restarted server.
Why would compression be twice the size?
| 10. | vito - 11 15, 2007 @ 09:37AM |
I've also mentioned the same odd thing - without the plugin I 've got 218 Kbytes, after having installed it - 335 Kbytes...
It seems that without the plugin only needed parts of tiny_mce are being sent, and with the plugin the whole tiny_mce is being sent.
Maybe the solution is to remove unused files from tiny_mce plugin dir, but I have no time to experiment on it.
| 11. | vito - 11 21, 2007 @ 07:01AM |
Using Filemon tool I've got the list of only used files in a tiny_mce plugin dir when current theme is 'simple':
..\public\javascripts\tiny_mce\blank.htm
..\public\javascripts\tiny_mce\tiny_mce.js
..\public\javascripts\tiny_mce\langs\en.js
..\public\javascripts\tiny_mce\themes\simple\editor_template.js
..\public\javascripts\tiny_mce\themes\simple\css\editor_ui.css
..\public\javascripts\tiny_mce\themes\simple\css\editor_content.css
..\public\javascripts\tiny_mce\themes\simple\images\bold.gif
..\public\javascripts\tiny_mce\themes\simple\images\italic.gif
..\public\javascripts\tiny_mce\themes\simple\images\underline.gif
..\public\javascripts\tiny_mce\themes\simple\images\strikethrough.gif
..\public\javascripts\tiny_mce\themes\simple\images\redo.gif
..\public\javascripts\tiny_mce\themes\simple\images\undo.gif
..\public\javascripts\tiny_mce\themes\simple\images\cleanup.gif
..\public\javascripts\tiny_mce\themes\simple\images\numlist.gif
..\public\javascripts\tiny_mce\themes\simple\images\separator.gif
..\public\javascripts\tiny_mce\themes\simple\images\bullist.gif
I've deleted the unused rest and tried to enable tiny_mce_gzip... but the experiment failed.
The reason is that tiny_mce_gzip tries to compress every part of tiny_mce plugin according to its (tiny_mce_gzip's) some internal idea of what parts tiny_mce consists of regardless of what is actually inside of tiny_mce plugin dir.
| 13. | dabla - 11 22, 2007 @ 03:00AM |
I've got the same issue as hiram had, namely the following error stating: "ArgumentError (A copy of ApplicationController has been removed from the module tree but is still active!)"
I also replaced the before_filter definition within the tiny_mce_gzip_controller.rb with a skip_before_filter definition, but the error still remained even after this modification.
Then I suddenly noticed that the TinyMceGzipController (e.g. tiny_mce_gzip_controller.rb) extended the ApplicationController class. I've modified this and let the TinyMceGzipController extend the ActionController::Base class and the error disappeared. Hopefully this can be helpfull to other people too.
| 14. | dude - 02 05, 2008 @ 08:13PM |
I get the same error:
A NoMethodError occurred in tiny_mce_gzip#check: undefined method `size' for nil:NilClass [RAILS_ROOT]/vendor/rails/actionpack/lib/action_controller/cgi_process.rb:228:in `set_content_length!'
------------------------------- Request: ------------------------------- * URL: http://127.0.0.1:40380/javascripts/tiny_mce/tiny_mce_gzip_check.js?
Where can I get a copy of tiny_mce_gzip_check.js it doesn't seem to be included with the distro?
| 16. | Stephan Wehner - 02 07, 2008 @ 01:40AM |
Thanks for this; looks pretty good.
I couldn't spot a license. Is it ok to copy / extend?
Stephan
Post a Comment