Posted by nhck on July 28, 2009 at 10:50am
| Project: | IMCE Wysiwyg bridge |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
| Issue tags: | ckeditor, ckfinder, file browser, image browser |
Issue Summary
The successor of FCKeditor is coming, over at the wysiwyg-module they already have support for it: #462146: Add editor: CKeditor
I did some research, but couldn't get it to work so far - maybe someone that actually knows what to do could help out.
These are my pointers:
- the filebrowser and the popup-plugin must be enabled - you need to edit ckeditor.inc of the wysiwyg-module to do this
- there is some discussion about it here: http://dev.fckeditor.net/ticket/3673
- The Name of the URL-variable changed from ImageBrowserURL to filebrowserImageBrowseUrl
However CKeditor uses some kind of different model to add images to their URL field - I couldn't figure out how they do this: Its not working with the id of the url field anymore I guess. Its more closely related to their ckfinder-product.
Comments
#1
Subscribing
#2
sub..
#3
Subscribing
#4
Subscribing
#5
this would be awesome
#6
Yes, reaaaally needed. CKeditor seems the proper way to go in terms of ease of use for clients.
#7
I've noticed they have some more documentation up at:
http://docs.fckeditor.net/CKEditor_3.x/Developers_Guide/File_Browser_%28...
#8
Ok... so I messed around a little bit... did a couple very very simple changes to the imce_wysiwyg.module code. It almost works....
Add image and IMCE to the toolbar from wysiwyg profile settings.
You should then have in image button... push it... now click browse server. TADA it opens IMCE....
BUT, after you upload an image... it wont let you send the image back to ckeditor... it just opens it up on a new window/tab (in firefox).
If someone can figure out how to send it to ckeditor.. that would be awesome.
#9
Actually it should be sufficient to just specify:
options' => array(
'filebrowserBrowseUrl' => url('imce', array('query' => array('app' => $editor . '|url@txtUrl|width@txtWidth|height@txtHeight'))),
),
However, this: 'app' => $editor . '|url@txtUrl|width@txtWidth|height@txtHeight' isn't correct anymore for ckeditor. You need to send it to ckeditor somehow different:
Check modules/imce/js/imce_set_app.js.
#10
The solution should be somewhere along these lines:
http://modxcms.com/forums/index.php?topic=39191.20
#11
sub
#12
hi! I try to fix this problem and it works for me.
see readme.txt in attach for instructions.
If you know hot to do this work better - please notice me.
#13
Nice going Yas375 I made this into a patch for you and for the maintainer to put out a new version.
Reassigning this to dev for test robot.
Btw: ckeditor now has officially replaced fckeditor (http://ckeditor.com/blog/CKEditor_3.0_is_here)
Reviewed and tested by me :-)
#14
It works for me, too. Thank you to both of that0n3guy and Yas375.
#15
#16
2Niels Hackius: thanks for patch! =)
#17
Hi,
I have installed this patch but the "Send to ckeditor" button doesn't work in Safari on OSX. I get the error message:
TypeError: Result of expression 'win.document.activeElement.search' [undefined] is not an object. imce_wysiwyg.js?f:16
Any ideas??
Regards,
- Paul
#18
I'm also not getting the "Send to ckeditor" button to work on Safari on OSX. It's fine with FF though.
#19
got next message while patching with http://drupal.org/files/issues/ckeditor_imce_yas-fix.zip:
"D:\wamp\www\drupal>patch -p0 < ckeditor.inc_fixedlists.patch
can't find file to patch at input line 9
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|? ckeditor.inc_fixedlists.patch
|Index: ckeditor.inc
|===================================================================
|RCS file: /cvs/drupal-contrib/contributions/modules/wysiwyg/editors/ckeditor.in
c,v
|retrieving revision 1.2
|diff -u -p -r1.2 ckeditor.inc
|--- ckeditor.inc 10 Aug 2009 22:54:40 -0000 1.2
|+++ ckeditor.inc 19 Aug 2009 20:54:13 -0000
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored"
and, next message while patching with http://drupal.org/files/issues/imce_wysiwyg-533168.patch
"D:\wamp\www\drupal>patch -p0 < imce_wysiwyg-533168.patch
can't find file to patch at input line 8
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: imce_wysiwyg.module
|===================================================================
|RCS file: /cvs/drupal-contrib/contributions/modules/imce_wysiwyg/imce_wysiwyg.m
odule,v
|retrieving revision 1.4
|diff -u -p -r1.4 imce_wysiwyg.module
|--- imce_wysiwyg.module 4 Mar 2009 15:52:16 -0000 1.4
|+++ imce_wysiwyg.module 17 Sep 2009 12:23:48 -0000
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored
can't find file to patch at input line 38
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: js/imce_wysiwyg.js
|===================================================================
|RCS file: /cvs/drupal-contrib/contributions/modules/imce_wysiwyg/js/imce_wysiwy
g.js,v
|retrieving revision 1.3
|diff -u -p -r1.3 imce_wysiwyg.js
|--- js/imce_wysiwyg.js 25 Feb 2009 16:31:46 -0000 1.3
|+++ js/imce_wysiwyg.js 17 Sep 2009 12:23:49 -0000
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored"
what's wrong with me?
#20
i don't know how to work with patches yet. That's why I can advice you to see differencies manualy. There only a few changes.
#21
Subscribing, with +1 to the getting it working in Safari issue
#22
subscribe
#23
subscribe
#24
Very nice. Works for me, excepting issue where trying to return image to CK in Safari will result in the browser visiting the image instead.
Happy to test further fixes for Safari support. I recall Safari worked OK with IMCE Wysiwyg using TinyMCE or FCK so feel this should go back to needs work, even though I'm sure we'd love to see it included ASAP.
#25
subscribe
#26
Moving back to RTBC. Unless someone here has a patch for Safari a browser with 3% marketshare, I don't believe we should hold up the other browsers.
Please file a separate bug for Safari.
#27
So, is this now included in the latest dev release [dated October 31, 2009]?
#28
Has anyone noticed that when one places the cursor in the editor's textarea in IE, the cursor does not appear straight away? After fiddling a bit with it, eventually it does... Not really usable by a non-skilled client. It does not seem to happen in the official demo. Any idea??
#29
@chowdah, no the patch in #13 has not been added to the 6.x-1.x-dev release yet. You'll need to patch your copy - the patch applies cleanly to either the current stable or dev releases.
For us, CKEditor using IMCE Wysiwyg 6.x-1.0 with this patch applied works fine.
#30
subscribe
#31
The patch still applies but I'm not able to send the image to the editor. Clicking the selected image just opens a new tab which shows the image. This is FF 3.5.
#32
I've added compatibility for Safari to the patch. Safari couldn't find the non-standard document.activeElement property, so I just used the location.href property instead. I also replaced the routine for finding the value of CKEditorFuncNum with a simple, strict regular expression for the sake of efficiency and added the "Browse Server" button to the Link dialog.
I've tested against Safari 4, FF3.5, IE6, and IE8, all on Windows.
#33
There is support missing for the html link for browsing to files on the server/uploading files to link to. I added the below to line #61 of the imce_wysiwyg.module file:
'LinkBrowser' => TRUE,
'filebrowserLinkBrowseUrl' => url('imce', array('query' => array('app' => $editor . '|sendto@imceCkeditSendTo|params@'))),
#34
Actually,the LinkBrowser and other old FCKEditor options are no longer necessary. In fact, since the image, flash, and link browser calls are all identical, the whole options array can be reduced to one item:
'options' => array('filebrowserBrowseUrl' => url('imce', array('query' => array('app' => $editor . '|sendto@imceCkeditSendTo|params@'))),
),
I'm including a revised patch with the corrected options list and a slightly more efficient regular expression for parsing the url. Since the initial patch was set to RTBC despite the Safari bug, I'm setting the status back to "needs review".
#35
tracking
#36
Patch in #34 is true, and combined with patch #32 I've got a working solution in Safari.
#37
+++ js/imce_wysiwyg.js 3 Dec 2009 05:56:08 -0000@@ -9,3 +9,14 @@ function imceImageBrowser(field_name, ur
+//sendTo function for ckeditor
+var imceCkeditSendTo = function(file, win) {
+ var parts = /\?(?:.*&)?CKEditorFuncNum=(\d+)(?:&|$)/.exec(win.location.href);
+ if (parts && parts.length > 1) {
+ CKEDITOR.tools.callFunction(parts[1], file.url);
+ win.close();
+ } else {
+ throw 'CKEditorFuncNum parameter not found or invalid: ' + win.location.href;
+ }
+};
ugh. Is there really no cleaner solution for CKeditor? I don't really want to believe this.
This review is powered by Dreditor.
#38
The custom sendTo function is necessary for CKEditor. The proper way to return the path to the correct instance of CKEditor is to pass the value of the CKEditorFuncNum to the callFunction function. CKEditor passes this value through the URL of the IMCE browser, so it needs to be extracted from there. If there is a cleaner way, it's not documented.
#39
Subscribing.
#40
subscribing
#41
subscribing
#42
subscribing
#43
The patch in #34 worked well for me after some basic testing (FF in Mac OSX)
#44
@ sun #37
No kidding, I just bailed and decided to use the ckeditor standalone module. Guess what! It works out of the box!
#45
Thanks. Such comments really help us to move forward.
#46
re: #44 and #45
I am not sure if the reply is tongue in cheek?
But, I am confused and trying to understand where this is heading.
I would like to use Wysiwyg module with ckeditor because it also supports options for other editors.
As such the IMCE Wysiwyg bridge module seems essential.
I see there is a patch and I am sorry I have not had time to test it with other tasks at hand.
Thanks
#47
I'm pretty sure sun was ironic.
#48
Hi I also have the same issue of cursor not displaying in IE 8 and IE7. How did u fix that issue.
Thanks
#49
subscribing.
#50
Patch in #34 works for me (FF 3.6 @ Linux)
@sun - I understand you are seeking a cleaner solution, however, this is a *working* solution. I suggest you consider applying this patch now, and refactor it later. This way people will find the module working for them on first shot, and will not have to find this patch and apply it (a high barrier for many it appears).
#51
subscribe
#52
How can I apply this patch manually?
#53
subscribing
#54
Subscribing and +1, awesome work guys!
#55
Thanks for reporting, reviewing, and testing! Committed to all branches.
A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.
#56
Automatically closed -- issue fixed for 2 weeks with no activity.
#57
Maintainer: Please update nodule's page as this is now available; it is still understood that there is no ckeditor support. Thanks!