Here is a plugin I made to use Footnotes with CKeditor. Please review and integrate into to this module.

Comments

hingo’s picture

Hi

Sorry for my slow response. I've been traveling and then ill.

Thanks for this contribution! I'll have a look at this as soon as possible.

owen barton’s picture

Status: Patch (to be ported) » Needs work
StatusFileSize
new13.97 KB

Here is the above packaged with the TinyMCE plugin as a single module - I think this would be preferable, since WYSIWYG can happily select the right plugin for the right editor.

Note that the CKeditor plugin was not actually working for me - I get:

u is null
for(var w=0;w<u.length;w++){var x=p[u[...mand),p=n&&n.create.apply(q,m.args); 
hingo’s picture

Thanks for uploading your code (also got a 3rd variant per email).

The package from #2 is what I'll be working with in the coming days. (I need to figure out how to turn off or deprecate the original tinymce_footnotes since your module replaces it.)

hingo’s picture

Version: 6.x-2.3 » 6.x-2.x-dev

Phew. As Footnotes is a very simple module, getting this to actually work must have been the most difficult patch so far. Figuring out which JavaScript variable must match which variable in the hook_wysiwyg_plugin()... I actually had to install FireBug to see what was going on. (And once I had gotten CKEditor to work, I had broken TinyMCE, so had to fix that again.)

Btw, for those who will Google or otherwise find this issue, the "u is null" error message seems to happen when plugin names don't match so that CKEditor is looking for a plugin that isn't found in the array. For the Wysiwyg module this is precisely what happens when a matchin javascript module isn't found for something defined on the php side. The uncompiled source file in CKEditor is _source/core/plugins.js (row 59).

lavamind: In your original code, the dialog sets the value="" attribute correctly, but if you reopen an old footnote, it is not picked up again, so if you save an edited footnote, the value is lost. I see you had some code that was supposed to do that, but it didn't work, so I'm doing it instead in loadElements function. (Download Footnotes 6.x-2.x-dev to check it out.)

As part of this commit, the original Footnotes TinyMCE module was deprecated, but it is kept around for backward compatibility.

hingo’s picture

Assigned: Unassigned » hingo
Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.