If you use the CKeditor module instead of Wysiwyg, feat not, you can still use the plugin!

All you need to do is add the following in modules/ckeditor/ckeditor.config.js :

config.extraPlugins += (config.extraPlugins ? ',footnotes' : 'footnotes' );

CKEDITOR.plugins.addExternal('footnotes', Drupal.settings.ckeditor.module_path + '/../footnotes/footnotes_wysiwyg/ckeditor_plugin/');
CommentFileSizeAuthor
#4 footnotes-ckeditor-1152264-4.patch2.36 KBrooby

Comments

hingo’s picture

Same comment here, don't hesitate to commit enhancements (this one in README, perhaps?) yourself, either with or without having them discussed and reviewed, as you feel appropriate.

rooby’s picture

I'm doing a patch for integration with the CKEditor, is this something you would commit to this module or are you only going support WYSIWYG and let the CKEditor module implement the integration?

rooby’s picture

Oh, and this is the existing CKEditor issue - #1121470: Integration with Footnotes module

rooby’s picture

Status: Active » Needs review
StatusFileSize
new2.36 KB

Here is a patch that adds support for CKEditor module.
It adds the support to the footnotes_wysiwyg module (removing that modules dependency for the WYSIWYG module).

TinyMCE module support could also be added to the footnotes_wysiwyg module in this way. There isn't really a need to make it dependent on the WYSIWYG module.

rooby’s picture

As a side note, I am using a newer version of CKEditor and needed lavamind's patch from #1124454-2: Unable to edit footnotes via wysiwyg (ckeditor 3.5.2) (manual find and replace, not the actual patch).

hingo’s picture

is this something you would commit to this module

I would, especially since what we have now seems to constantly break. (Due to no fault of Footnotes, but CKEditor seems to change it's behavior with each release and then loose our Wysiwyg exported functionality.)

But note that I'm looking to pass forward the maintainership of this module (see project page). Hence I am not committing anything anymore, rather being deliberately quite passive.

So all I'm saying is this seems like a good idea. If you want to push this yourself, I will give you rights to commit, let me know.

hingo’s picture

Ok, you have commit rights now.

Looking at the patch: Why do you remove dependency on wysiwyg? I would've expected you to add dependency on ckeditor?

I have no other comments.

rooby’s picture

If you just add a dependency on ckeditor it would mean users have to have both the ckeditor and wysiwyg modules installed. Unfortunately drupal has no concept of OR in it's dependencies yet, although that would be great.

So the simplest way was to remove the wysiwyg dependency and make a note in the readme that you have to have one of the two modules installed. It might be a good idea to also add a message when you enable the module so that if the user doesn't have one of the modules installed it promts them to install one.

Seeing as there are no calls to wysiwyg functions and all there is are hooks, no errors will result, it is just that the module will do nothing without one of the parent modules.

The alternative is to have separate modules like footnotes_ckeditor, footnotes_tinymce and footnotes_wysiwyg each with their own dependencies, in which case you have to either duplicate the plugins (bad idea) or move the plugins from the sub modules into the main module in a plugins directory and have the sub modules all reference them there (not as bad an idea but I'm not convinced it is the best idea).

This way with no dependencies has also been adopted by the CKEditor Link module.

I thought about the options for a while but I'm open to other opinions on the matter.

hingo’s picture

You're right :-)

julien.reulos’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for the patch, it is working fine.
I am using ckeditor-7.x-1.x-dev.tar.gz (15 dec 2011), the ckeditor_3.6.2.tar.gz plugin and footnotes-7.x-2.5.tar.gz.

rooby’s picture

Thanks for the review, I will have time to commit this in the next day or two.

rooby’s picture

Category: task » feature
Priority: Minor » Normal
Status: Reviewed & tested by the community » Patch (to be ported)

Committed to D7 - http://drupalcode.org/project/footnotes.git/commit/4cd9340

Stupidly I didn't have the commit author properly set but I have fixed that for future commits.

Needs backport to drupal 6.

rooby’s picture

Version: 7.x-2.x-dev » 6.x-2.x-dev
rooby’s picture

Status: Patch (to be ported) » Fixed
RedRat’s picture

I have applied this patch to the 6.x-2.5 version, and now I can add Footnotes button to the CKEditor toolbar. When I press it, dialog with preentered text [object Object] appears, but when I press OK I got this error in IE 8 (reverse translation from Russian):

Message: Object doesn't support this property or method
Line: 45
Symbol: 11
Code: 0
URI-code: http://test.istmat.info/sites/all/modules/footnotes/footnotes_wysiwyg/ck...

Message: 'getFirst()' - is null or not a object
Line: 16
Symbol: 181
Code: 0
URI-code: http://test.istmat.info/sites/all/libraries/ckeditor/ckeditor.js?7

and dialog stay on screen.

P.S. Drupal 6.25, CKEditor 3.6.2, CKEditor module 6.x-1.8, Footnotes 6.x-2.5 with patch from #14.

rooby’s picture

Sorry, I rarely use IE, I will investigate it.

I would guess though it is not specific to the CKEditor module but the plugin and I would say the issue is more relevant to #1124454: Unable to edit footnotes via wysiwyg (ckeditor 3.5.2).

That maybe what #1124454-7: Unable to edit footnotes via wysiwyg (ckeditor 3.5.2) was referring to.

I'll check it out.

rooby’s picture

If you can try the patch in #1124454-7: Unable to edit footnotes via wysiwyg (ckeditor 3.5.2) I'd be interested in whether or not it fixes your problem.
If it does can you please report back there.

Thanks.

RedRat’s picture

I have tried aforementioned patch but it doesn't fix error. In FF all works fine, but in IE I got JS errors and footnotes dialog not working at all. :-(

BTW, should I fill separate issue for this bug or just change status of this? And could you, please, release a dev-version for 6.x so we can have the same starting point to make patches? I defenitely want to solve this problem 'cos I plan to use this module in my project.

RedRat’s picture

Category: feature » support
Status: Fixed » Needs work

I think this bug definitely have to be fixed because almost half of netizens still use a different versions of Internet Explorer.

pyrojonc’s picture

Version: 6.x-2.x-dev » 7.x-2.5
Component: Footnotes » footnotes_wysiwyg
Category: support » bug

I'm using CKEditor 4.1.1 and this patch worked for me except I still had to implement the change from here: http://drupal.org/node/1589130#comment-6983100 changing 'editor' to 'CKEDITOR' in plugin.js line 26. Then all works perfect. Thanks all.

  • 4cd9340 committed on 8.x-2.x
    Issue #1152264 by rooby, lavamind: Add support for CKEditor module.
    
    
  • rooby committed 7e87051 on 8.x-2.x
    Issue #1152264 by rooby: Add a litle extra instruction on setting up...

  • 4cd9340 committed on 7.x-3.x
    Issue #1152264 by rooby, lavamind: Add support for CKEditor module.
    
    
  • rooby committed 7e87051 on 7.x-3.x
    Issue #1152264 by rooby: Add a litle extra instruction on setting up...
scott_euser’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)