Made a demo of all currently supported editors, can be found here http://demo.foxinbox.org/node/add/test-content and found two issues. (Very clean and fresh install of drupal.)

Openwyswyg kills (other editors stop working, I believe it's jquery being killed).

Firebug doesn't give any openwysyg errors, but jquery errors out with saying $ is not a function (other jquery based items break. like admin menu, with similar errors). The http://drupal.org/project/openwysiwyg mentions that openWysiwyg conflicted with jquery, so not sure if that is related (as I believe it's worked before).

Unrelated but jqyswyg is throwing up an error "$(element).closest is not a function", but it doesn't seem to be breaking anything, at I believe closest is in a later version of jquery.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sun’s picture

Title: openwyswyg appears to be broken » OpenWYSIWYG broken, jWysiwyg needs jQuery 1.3+

Wow, thank you! :)

scottsawyer’s picture

I'm getting this error from FF Error Console:

Error: The stylesheet node/add/styles/wysiwyg.css was not loaded because its MIME type, "text/html", is not "text/css".
Source File: node/add/forum
Line: 0

Using
IE Unlimited CSS Loader
Might that be the problem??

scottsawyer’s picture

never mind, uninstalled openwysiwyg and installed FCK. problem solved, 20 minutes.

nquocbao’s picture

It's openWYSIWYG problem, they define their own '$' function ...

I replace $( with $openWysiwyg( in scripts/wysiwyg.js and everything works

sun’s picture

Status: Active » Needs review
FileSize
608 bytes

Can we try this for openWYSIWYG?

nquocbao’s picture

The latest version can not detect openWysiwyg:

Library patch is defined as:

  'library path' => wysiwyg_get_path('openwysiwyg') . '/scripts',

while we use

  $changelog = $editor['library path'] . '/changelog';

The change log file stays in editor folder, not the scripts folder :(

nquocbao’s picture

And the patch does not work too.

sun’s picture

nquocbao’s picture

Status: Needs review » Needs work
sun’s picture

Status: Needs work » Needs review

So let's try again? Not sure what $openWysiwyg that has been mentioned in #4 is...

EugenMayer’s picture

Well its about $ being bind to something else then jquery. But well, you cann use the normal enclosure trick here, which is used to also let jquery plugins work

(function($) {
.
.
.
})(jQuery);

Well in the other case, instead of replacing $ with $openWysiwyg, simply to the same arround the whole editor js implementation.

(function($) {
.
.
.
})($openWysiwyg);
sun’s picture

Priority: Normal » Major
Issue tags: +Release blocker
sun’s picture

Since D6 does not globally use jQuery.noConflict(); I fear there's little chance to solve this properly prior to D7.

Thus, attached patch reverts the addition of the $ closure in openwysiwyg.js, which worked previously and still works now.

sun’s picture

Status: Needs review » Fixed

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.

That said, I'd welcome feedback on #970892: Drop openWYSIWYG support

TwoD’s picture

Awww, and I was just going to throw another patch in here.

We don't need jQuery.noConflic(). It just reverts $ to what it was before jQuery was loaded, which in our case is undefined since we load openWYSIWYG after jQuery.

Instead of manually overriding methods on the global WYSIWYG object to swap between the versions of $, why not automate it?

// Wrap openWYSIWYG's methods to temporarily use its version of $.  
jQuery.each(WYSIWYG, function (key, value) {
  if (jQuery.isFunction(value)) {
    WYSIWYG[key] = function () {
      var old$ = $;
      $ = Drupal.wysiwyg._openwysiwyg;
      var result = value.apply(this, arguments);
      $ = old$;
      return result;
    };
  }
});

$ = old$; instead of $ = jQuery; makes this temporary replacement survive nested calls to methods without needing a "depth counter" to know when it's safe to revert to jQuery's $.

sun’s picture

Status: Fixed » Needs review
FileSize
3.09 KB

Crazy TwoD, just crazy :)

TwoD’s picture

Status: Needs review » Reviewed & tested by the community

XD

sun’s picture

Status: Reviewed & tested by the community » Fixed

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.

Status: Fixed » Closed (fixed)
Issue tags: -Release blocker

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