There is a report here of difficulty getting the compressor to work - and the difficulty being solved simply by copying the gzip files for both PHP and JS into the right directory. However I have tried this and it does not work. I think that the reason is that there are two new versions of the compressor since that report, including a complete rewrite (I have installed version 1.10 dated 21/12/2006). The instructions for installing gzip compressor are now more complicated, since the readme file says this:
Here is a step by step list on how to install the GZip compressor.
- Copy the tiny_mce_gzip.js and tiny_mce_gzip.php to the tiny_mce directory. The same directory that contains the tiny_mce.js file.
- Remove the current script tag.
<script type="text/javascript" src="tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
- Add the new new GZip script
<script type="text/javascript" src="tinymce/jscripts/tiny_mce/tiny_mce_gzip.js"></script>.
- Add the new GZip initialization call that will tell the compressor what to include in the output. This should be the sum of all and themes, plugins contained on page.
This is a good deal more complicated. Where is this initialisation call we are supposed to change? How do you go about getting this to work? Any suggestions would be welcome.
I have already tried simply replacing the tiny_mce.js with tiny_mce_gzip.js, but this did not seem to produce any results. As soon as I remove all the compression and put it back to normal, it works fine.
Comment | File | Size | Author |
---|---|---|---|
#11 | compressor_2.patch | 1.59 KB | JohnAlbin |
#10 | compressor_1.patch | 1.18 KB | JohnAlbin |
#9 | compressor_0.patch | 2.02 KB | JohnAlbin |
#7 | compressor.patch | 2.01 KB | JohnAlbin |
#4 | tinymce-compressor-support-2.patch | 5.46 KB | umonkey |
Comments
Comment #1
joel_guesclin CreditAttribution: joel_guesclin commentedThere seem to be two errors in the module:
1) There is a typo which leads to trying to load the GZIP php file instead of the js file.
2) The JS Gzip init function does not get properly included in the page.
I think the attached patch should do the trick - anyway, it works for me using the Compressor 1.10 and TinyMCE module under 4.7.5
Comment #2
csc4 CreditAttribution: csc4 commentedI get
with PHP5 - it seems to be to do with the piece
Does anyone know how I can fix this?
Comment #3
umonkey CreditAttribution: umonkey commentedHere's an alternative version of the patch against v1.90.4.12, which loads the compressor if available. It also contains theme files for proper initialization, according to the TinyMCE. I've also added a few buttons to the simple theme, such as image, link and unlink, for I think they're vital for an WYSIWYG editor.
Comment #4
umonkey CreditAttribution: umonkey commentedSorry, the last patch contained a syntax error. Here's a correct one.
Comment #5
mstef CreditAttribution: mstef commentedpatching file ./themes/tinymce_compact_gzip.js
patching file ./themes/tinymce_full_gzip.js
patching file ./themes/tinymce_simple_gzip.js
patching file ./tinymce.module
Hunk #1 FAILED at 92.
1 out of 1 hunk FAILED -- saving rejects to file ./tinymce.module.rej
no changes made to the editor..still isn't showing
Comment #6
Ryanbach CreditAttribution: Ryanbach commentedIt would be a good idea if the 5.X supported this as well.
Comment #7
JohnAlbinumonkey, thanks for contributing a patch. However, you shouldn’t bundle enhancements (in addition to the bug you are trying to fix) into your patch file. It makes it very difficult to review/approve the patch.
Here’s a new patch that is compatible with pre-1.1.0 versions of the compressor as well as (almost) working with 1.1.0. The patch is a 90% solution, as tinyMCE only seems to initialize after you click the “disable wysiwyg” link (very counter-intuitive).
I may not get a chance to look at this until next week, but I wanted other people to look at it and try to fix the last 10%.
Comment #8
JohnAlbinThe patch is for 5.x-1.x-dev.
Comment #9
JohnAlbinJust noticed that the incompatiblity started with 1.0.9, not 1.1.0. This updated patch is the same as the last except for some changes in comments.
Comment #10
JohnAlbinThis new patch is the 100% solution we’re looking for. The TinyMCE compressor docs are a bit vague, but you only need to call
tinyMCE_GZ.init()
once per page, while still callingtinyMCE.init()
once per textarea.Comment #11
JohnAlbinForgot to update INSTALL.txt in previous patch.
Comment #12
Robrecht Jacques CreditAttribution: Robrecht Jacques commentedI can confirm that the patch in #11 works for the compressor version 1.1.0.
Thanks!
Comment #13
adrinux CreditAttribution: adrinux commented+1
This patch #11 is also working for me on a 5.1 site, latest TinyMCE and compressor versions.
Comment #14
JohnAlbinThat makes 2 people who have successfully used this patch (besides me.) Marking this as RTBC.
Comment #15
m3avrck CreditAttribution: m3avrck commentedThanks John and everyone else, fixed!
Comment #16
(not verified) CreditAttribution: commented