I installed TinyMCE on Monday and it seems to work fine on my Drupal 5.1 site.
Last night I added Linktocontent and the whole process went according to plan, except I do not see a checkbox for either Linktonode or Linktomenu in the TinyMCE Buttons&Plugins section. There are a whole bunch of buttons listed and I can identify most of them, but nothing seems to be Linktonode.

Comments

vm’s picture

Did you move the linktonode folder from the tinymce_plugins folder to the tinymce installation ? If its anything like the other plugins that comes with / or seperate from tinymce, the folder has to be add to the tinymce library plugins folder. the plugin_reg.php file (if i remember the correct name of the file) may have to be altered as well adding the proper button to the tinymce bar.

vm’s picture

   // linktocontent.module: linktonode
   if (is_dir(drupal_get_path('module', 'tinymce') . '/tinymce/jscripts/tiny_mce/plugins/linktonode/')) {
     $plugins['linktonode'] = array();
     $plugins['linktonode']['theme_advanced_buttons3'] = array('linktonode');
   }

insure the above code was indeed added to the plugin_reg.php file

you can figure out what button linktonode should look like by inspecting linktonode/images/linktonode.gif which is the image the button should be using.

stborchert’s picture

Hi.
Thank you, VeryMisunderstood for youre quick help.
The plugin info should be inserted into plugin_reg.php while installing linktocontent_node or linktocontent_menu (see #119677).
Unfortunately the plugings themself are not copied to the tinymce plugins folder yet.

jsgammato’s picture

Well, I got it to appear, but now when I click it, it never finishes loading and I get an error that says an object was expected in Char 3 Line 115 of linktonode\popup.php

stborchert’s picture

Assigned: Unassigned » stborchert
Category: support » bug

Hm, sure it says "popup.php"? The file only has 95 lines.
Could you please make a screenshot of this javascript (?) error.

stborchert’s picture

Title: Linktonode does not appear in Buttons & Plugins » Error: object expected

Forget to change title...

jsgammato’s picture

StatusFileSize
new90.34 KB

Here is a screenshot. You can't see the line 115 char 3 because the address to the popup.php is too long, but that is what it says.

jsgammato’s picture

StatusFileSize
new28.89 KB

Here is the left-hand part of the error message.

stborchert’s picture

StatusFileSize
new19.72 KB

Hm, weird.
Which version do you use (Internet Explorer)?

stborchert’s picture

And which version of popup.php...

jsgammato’s picture

I use IE 6.0.2900
and popup.php // $Id: popup.php,v 1.6.4.4 2007/02/21 16:26:51 stborchert Exp $
(I only just downloaded it last night for the first time)

stborchert’s picture

Hm. Well, lets debug a little :-)
Could you please insert an alert into jscripts/functions.js:
Line 53: alert(_getBaseHref());
Perhaps some additional alerts in nodelist.js to isolate the error...

jsgammato’s picture

done, I think - no space between alert and the rest?
I typed: alert(_getBaseHref());
into a previously blank line 53

stborchert’s picture

Jup. It should give you a message box the next time you open the plugin.

jsgammato’s picture

Same error, but I see no message.
According to my FTP client:
< 257 "/www/HarnWriters/modules/tinymce/tinymce/jscripts/tiny_mce/plugins/linktonode/jscripts" is current directory.
and functions.js is now size = 3,628, so I am sure I copied it to the place I got it from.

stborchert’s picture

No message? Uh, thats really weird. But you can see the loading image?

#52  $("#statusImg").top(top + "px").show();
#53  alert(_getBaseHref()); // debug
#54  $.ajax({
#55    type: "POST",

Is this your code?

The message must appear if you see the loading image. :-[

jsgammato’s picture

StatusFileSize
new25.22 KB

$("#statusImg").top(top + "px").show();
alert(_getBaseHref());
$.ajax({
type: "POST",

is my code, but... I can only see the tiptop of the loading image - see attached
Maybe the message is underneath the image?

stborchert’s picture

is my code, but... I can only see the tiptop of the loading image - see attached
Maybe the message is underneath the image?

No not really. They are centered in the calling window.
Try to move the alert call from #53 to #29 (for example).

stborchert’s picture

Could you please test what happens if you delete your cache (settings > advanced)?

jsgammato’s picture

I'm not quite sure how to do that.
I'm on Drupal 5.1, so I went to Administer>Site Configuration>Performance and set Page Cache to Disabled, saved, then I re-enabled it and set it to 1 minute (from None) and saved again. I hope that did it.
I sent you a message via your profile, too.

jsgammato’s picture

I added the var objTop to line 32, with no value:

function loadCategories(obj) {
alert(_getBaseHref());
var params = '';
var vid = '-1';
var objTop;
var top = 75;
if (obj != null) {
var fSel = $("#browse_sel_0_sel");
if (fSel !== null) {
vid = fSel.get(0).value;
}

jsgammato’s picture

That also had no apparent effect. I wondered if I am editing the wrong file, but I check and triple check and it sure looks right :(

stborchert’s picture

Could you please upload the new files (popup.php and functions.js; see mail).

jsgammato’s picture

will do
see PM on site

jsgammato’s picture

It worked!
You're a genius!
Thank you so much - this will be very helpful on my link-heavy, text-heavy site!

stborchert’s picture

Status: Active » Fixed

Puh, nice to hear.
But there's is also the problem with inline popups. But this is an other story... :-)

stborchert’s picture

Status: Fixed » Closed (fixed)
dcoun’s picture

Status: Closed (fixed) » Postponed (maintainer needs more info)

Hello,
I have the same problem. What was the solution?

stborchert’s picture

Hi.
John didn't use the latest version (// $Id: functions.js,v 1.10.4.3 2007/03/01 20:27:02 stborchert Exp $).
Did you download version 5.x.1-2 of linktocontent?

dcoun’s picture

Version: 5.x-1.x-dev » 5.x-1.2

I have: // $Id: functions.js,v 1.1.2.2 2007/03/07 08:35:24 stborchert Exp $
and in firefox and opera it hangs waiting the blue "loading" circle, in IE it gives the error mentioned before. I have downloaded the last 1.2 version

dcoun’s picture

The above was in linktomenu, the following is in linktonode:
// $Id: functions.js,v 1.10.4.4 2007/03/07 08:35:24 stborchert Exp $

dcoun’s picture

Again sorry but the message I get from IE is a bit different:
For linktonode is about the popup.php:
Line: 47, Char:3, Error: The object does not support this property or method
For linktomenu is about the popup.php:
Line: 42, Char:3, Error: The object does not support this property or method

dcoun’s picture

I am not an expert user and I now found the Error Console in firefox that it is much more clear:

Error: $("#statusImg").top is not a function
Code: http://www.example.com/modules/tinymce/tinymce/jscripts/tiny_mce/plugins... Line: 41

Error: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMNSHTMLDocument.queryCommandState]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://www.example.com/modules/tinymce/tinymce/jscripts/tiny_mce/tiny_mc... :: anonymous :: line 1" data: no]
Code: http://www.example.com/modules/tinymce/tinymce/jscripts/tiny_mce/tiny_mc... Line: 1

stborchert’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Hi.
I opened a new issue to not spam the accounts of VeryMisunderstood and jsgammato.
Please answer to http://drupal.org/node/147025.