Comments

stborchert’s picture

Title: New TinyMCE » Update modules to work with new TinyMCE-API
Version: 5.x-1.7 » 5.x-2.x-dev
Assigned: Unassigned » stborchert
Category: support » task

Hi.
Thanks for the hint. The changes will be made in the next version.

greetings,

Stefan

caw67’s picture

Status: Active » Closed (fixed)
stborchert’s picture

Status: Closed (fixed) » Active

Task is still active because I haven't done any changes regarding this.

nath’s picture

Any progress on this? This module is useful but so is the new version of TinyMCE.

stborchert’s picture

Assigned: stborchert » Unassigned

Hi.
Linktocontent is currently on its way to a new maintainer. I hope you can wait a little more.

greetings,

Stefan

sun’s picture

Title: Update modules to work with new TinyMCE-API » TinyMCE 3.x support

Better title. Patches are welcome.

sun’s picture

Status: Active » Closed (duplicate)
Docc’s picture

Version: 5.x-2.x-dev » 6.x-2.x-dev
Status: Closed (duplicate) » Needs review
StatusFileSize
new34 KB

Here`s a port to tinymce 3.x
Patch it from within the linktocontent/tinymce_plugins dir and copy the patched files to the proper tinymce folder.

No backwards comp. so the patched plugin files only works with tinymce 3.x. Can be used on stable release.

Regards

sun’s picture

StatusFileSize
new26.63 KB

Looks good, although there was plenty of whitespace at the end of some lines.

I've primarily cleaned-up the editor_plugin_src.js scripts and removed changes for the compressed scripts. We'll handle those later on. Of course, this means that you either have to overwrite editor_plugin.js with editor_plugin_src.js manually, or you know how to change TinyMCE's execMode ;)

chema’s picture

I had tried this second patch, and I have to say that it works great!.
The only weird thing is that the texts are not translated from the labels to the text. I've been looking at the langs files, but I can't see why it's not being translated (I'm using "en" as my language profile).

If you need me to test something, just tell me.

Great work both of you!

sun’s picture

Please note that, although this patch may work, and 6.x would be a good chance to drop support for TinyMCE 2.x, I most probably won't commit it. The reason is simple: Linktocontent would be the only module that supports TinyMCE 3.x directly. Even the TinyMCE Drupal module does not support TinyMCE 3.x flawlessly. That's why I originally marked this issue as duplicate of Wysiwyg API support in #7. With Wysiwyg API, Linktocontent will be able to support TinyMCE 2.x and 3.x concurrently, as well as any other editor. However, Linktocontent's editor plugins will need to be completely rewritten.

Docc’s picture

Yep, i like the idea behind Wysiwyg API. Really hope developers will get behind it.
For people in need of a working tinymce 3x plugin at this moment. This patch will do.

jrb’s picture

I think I did everything I needed to do:

1. Ran the patch from http://drupal.org/node/252938
2. Ran the patch from #9 above.
3. Put the plugins in the correct location.
4. Replaced editor_plugin.js with editor_plugin_src.js in two places (linktonode, linktomenu).

I can see the correct buttons in the TinyMCE editor, but I'm getting Javascript errors now when the linktonode/linktomenu window pops up:

Error: tinyMCE.baseURL is undefined
Source File: http://example.com/sites/all/modules/tinymce/tinymce/jscripts/tiny_mce/p...
Line: 14

Error: init is not defined
Source File: http://example.com/sites/all/modules/tinymce/tinymce/jscripts/tiny_mce/p...
Line: 1

What did I miss?

Thanks,
JRB

Docc’s picture

Seems like the patching went wrong. Try the patch from #8 and see if it works.
Didnt try the cleaned up one from #9 myself

Replying to the message #10. Seems the language files arent patched.
For example the en language file: old: "tinyMCE.addToLang('linktomenu'," new: "tinyMCE.addI18n('en.linktomenu',"

Ill see if i can push out another correct patch.

jrb’s picture

Yes, that was it. The patch from #8 did work, but the one from #9 did not.

Thanks!
JRB

Squidgy’s picture

Ah, shoot, Docc, I was checking the other thread (port to 6) and didn't realize you'd already done this. Money is mailed to your info [at] optixdesigns.nl account. Thanks again!

As JrBeaton said, patch #8 worked, patch #9 alas didn't.

sun’s picture

Since Image Assist 2.x now supports TinyMCE 3.x only, I'll create a new 2.x branch for TinyMCE 3.x support in Linktocontent soon.

sun’s picture

Status: Needs review » Needs work
StatusFileSize
new35.99 KB

I decided to incorporate #307075: Implement hook_wysiwyg_plugin() in this issue, since we would have to test with the obsolete TinyMCE module otherwise.

First iteration.

sun’s picture

Title: TinyMCE 3.x support » TinyMCE 3.x/Wysiwyg API support
Version: 6.x-2.x-dev » 5.x-2.x-dev
Status: Needs work » Needs review
StatusFileSize
new81.36 KB

So, here we go. Admittedly, I was required to rewrite half of the module(s) to make it work.

Any takers for testing this patch? (Note that is only applies to latest code for DRUPAL-5--2 in CVS)

Docc’s picture

Great work Sun!. I would test it but i only have Drupal 6 installations. So hopefully some other users can help you out on this one.

sun’s picture

StatusFileSize
new81.51 KB

Proper test for installed modules in _registered_plugins()

stborchert’s picture

Module worked after patching without any problems.
Maybe some more testers would be good (instead of the former maintainer ;-) ).

Stefan

btw: +1 from me for this

sun’s picture

Status: Needs review » Fixed

Thanks for reviewing, Stefan!

I decided against waiting any longer, because we will get much more tests when this code is available in the 5.x-2.x development snapshot. Also, I do not think that there are any issues left.

Committed to HEAD and 5.x-2.x.

@Docc: Your port to 6.x patch needs a re-roll (for HEAD) now.

Squidgy’s picture

Testing the newly committed 5.x-2.x, whenever I click the linktonode or linktomenu icons, I get an error saying
{ "message": " is not a valid type name for Link to content" }[ ]. ( This is after installing the Wysiwyg version of tinymce. )

In the admin side of the module, I configured both linktonode and linktomenu correctly, as best I know, and also re-installed tinymce, but I'm still getting the same message - is there something I'm doing wrong?

sun’s picture

Status: Fixed » Needs work
kingandy’s picture

FWIW, the current 5.x-2.x-dev version seems to work fine for me. This is with the fresh installs of Wysiwyg API, Jquery Update and TinyMCE editor, downloaded and installed today. (I also have JQuery UI installed, I don't know if that's relevant.) It's a much easier and smoother process than the last time I installed it, with the file copying and editing and oy.

(I still have some thoughts about the installation process in general, but I think I will create them as separate issues as they're not specific to the Wysiwyg API integration. Actually I'll go and see if anyone else has brought them up.)

Incidentally - the project page for this module should probably be updated to mention the planned move to Wysiwyg API. Until I found this issue I thought we were going to remain reliant on the obsolete tinymce.module...

xpo60rj’s picture

Can some explain how to get linktocontent working with wysiwyg api 5.x-2.x-dev? I have installed wysiwyg api. installed the latest version of tinymce inside wysiwyg. then i put linktocontent inside the plugin folder of tinymce. doesnt show up.

sun’s picture

http://drupal.org/project/wysiwyg:

Unlike other integration modules for Drupal, it is not recommended to edit or alter any files of this module.

You should NOT copy, move, or alter any files.

xpo60rj’s picture

Wow can you be a bigger douche? Um I have NOT copied, moved or altered any files. I followed the install instructions. You know it says to download TinyMCE and Extract the archive and copy its contents into a new folder in the following location:modules/wysiwyg/tinymce. Post #22 and #26 says it should run just fine with linktocontent. I'll just figure it out myself.

sun’s picture

Well, you wrote:

then i put linktocontent inside the plugin folder of tinymce.

xpo60rj’s picture

yes into the folder, downloaded from moxie, that the instructions said to drop into modules/wysiwyg/tinymce. Dont see how that is copying, moving, or altering any of the files for your module.

sun’s picture

In short: Linktocontent's editor plugin files need to stay and be located in Linktocontent's module folder, and must not be moved anywhere.

xpo60rj’s picture

I tried it that way, when I first started, but always get this.....

There seems to be an error with the installation of linktocontent_menu. Please check you copied all files from linktocontent/tinymce_plugins/linktomenu to the TinyMCE plugin directory

There seems to be an error with the installation of linktocontent_node. Please check you copied all files from linktocontent/tinymce_plugins/linktonode to the TinyMCE plugin directory.

which is why i put the plugins inside tinymce's plugin folder....though that doesn't work either.

xpo60rj’s picture

Ok. I have sort of figured out what is wrong.

1.Fresh Install Drupal 5.16
2.Fresh Install Jquery Update - jquery 1.2.6
3.Fresh Install Wysiwyg 5.x-2.x-dev
4.Fresh Install TinyMCE 3.2
5.Fresh Install Link to Content 5.x-2.x-dev

Install 1-4 works fine without a hitch and can go about doing edits and so forth.

5a. Installed link to content by putting it in the drupal modules folder.
5b. configured link to content - seems fine no errors
5c. enabled linktonode and linktomenu - plugins found no errors.
5d. edit my profile for wysiwyg tinymce - click on buttons and plugins - Linktonode and linktomenu now appear.
5e. First confirmed everything is still working. selected the following buttons and saved:

Align Center
Align Right
Justify
Bullet List
Numbered List
Outdent
Indent
Link
Unlink
Anchor
Image
Horizontal Rule
Advanced image
Advanced link
HTML Block Format

5f. Everything to this point is still working.

5g. Selected linktomenu, saved. Editor dissappears. Gone. Only Text appears.
5h. Unselected linktomenu, saved. Editor Reappears. Everything works.
5i. Selected linktonode, saved. Editor Dissappears. Gone. Only Text appears.
5j. Unselected linktonode, saved. Editor Reappears. Everything works.

I guess I will go back to my original TinyMCE module with custom settings and 3.2 with working linktocontent until I can find a better way, but for now i've exhausted my resources.

freddyseubert’s picture

sorry to reactivate this issue :/

@sun or someone else who has got insight into this module and it's co-operation with wysiwyg api:

With the latest dev version (2.x-dev) I have the following issue:
After setting up linktocontent, I can select the buttons in the wysiwyg profile for tinyMCE, but they do not show up in the editor when creating/editing nodes.

The patch regarding the wysiwyg implementation is, as sun wrote in #23, "Committed to HEAD and 5.x-2.x." but the Status still says "needs work". Could you please give me an instruction which version of the linktocontent module to use (optional with which patch) for working with the wysiwyg module (5.x-2.x-dev)?

Regards, Freddy

kingandy’s picture

I'm experiencing this as well. Could it be significant that WYSIWYG changed where it keeps its libraries since this patch was written? It used to be sites/all/modules/wysiwyg/... but now it's sites/all/libraries/...

scip’s picture

I have got this working by changing a line of code in wysiwyg/editors/tinymce.inc
For some (probably valid) reason, the linktomenu and linktocontent plugins are being marked to not load.
I have changed line 311 in function wysiwyg_tinymce_plugin_settings, and removed the check for $plugin['load']
What I don't know is why this isn't being set.

Regarding comment #32 from sun, this is because wysiwyg is picking up the plugins directly from the linktocontent folders and therefore they don't need to be moved anywhere else. sun - a very clever man, who needs a chill-pill to cope with us (relative) dimwits.