Please add support for YUI version 2.7.x, this could be done through replacing the following line in yui_editor_load_libs()

if (preg_match('/2.6.[0-9]$/iU', $yui_source)) {

with

if (preg_match('/2.[6-7].[0-9]$/iU', $yui_source)) {

Comments

skwashd’s picture

StatusFileSize
new1.88 KB

The attached patch adds support for YUI 2.7.0. I have tested it with 2.5.0, 2.5.2, 2.6.0 and 2.7.0 and it works.

I have escaped the dots in the version number so they match . not any character. Also the version check is only performed once and boolean is used in the if statements.

Based on current CVS as of 10min ago.

mikejoconnor’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new2.88 KB

Tested, works well. I made a white space change, other than that it looks great.

mikejoconnor’s picture

StatusFileSize
new1.81 KB

That will teach me to upload a patch, without reading it first...

New version with only the whitespace changes.

PGNetDev’s picture

with 2.7.0 compatibility 'in place', would you consider roll/publish-ing a new -dev tarball? thanks!

berenddeboer’s picture

I can also confirm this works perfectly.

jeremiah.snapp’s picture

StatusFileSize
new2.55 KB

The above patches do not update the yui_editor/plugins/img_upload.inc file so I've attached a patch that does.

berenddeboer’s picture

See #560086: YUI editor 2.7 support patch for even more 2.7 support. It includes this work.

berenddeboer’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new14.22 KB

Moved from #560086: YUI editor 2.7 support patch, here a patch that includes the above, plus various bug fixes and improvements that also work on earlier version of YUI:

The patch below adds support for YUI 2.7 and fixes quite a number of bugs. Can also be used fine for earlier version of YUI:

1. Support for 2.7.
2. Code button now saves even when pressed.
3. Some code cleanup.
4. Image upload creates the "images" directory if it does not exist. Previously upload would fail without warning if this subdirectory did not exist.
5. YUI editor now works even when used multiple times on a single page.
6. You can't include <?php tags. So I've added a filter which you can enable. Specify PHP with tags and the filter turns that into <?php.
7. The p versus br tag is no longer experimental, works on FF as well, if you patch editor.js.

On the latter, this only works if you do two additional things:

1. The toolbar should have p for the Normal state, so go to group parastyle and add:

{ text: 'Normal', value: 'p', checked: true },

This setting should become dependent on the config.

2. You need to use a patched version of editor.js. In function _createCurrentElement add below:

var _tmp = [], __tmp, __els = ['font', 'span', 'i', 'b', 'u'];

these two lines:

if (this.get('ptags'))
__els.push ('p');

3. In yui_editor.module you should change this:

yui_add_js('editor', $yui_source, '/build/editor/editor-min.js');

To something like:

drupal_add_js(drupal_get_path('module', 'yui_editor') .'/editor.js');

I haven't included this in this patch as it is a more far reaching change and I haven't tested it fully.

berenddeboer’s picture

StatusFileSize
new14.91 KB

The table plugin also didn't work anymore, so here a new patch that includes the above + a fix for the table plugin.

berenddeboer’s picture

StatusFileSize
new17.94 KB

And another patch. It appears that the plugin .css files use a weird formatting for the url() CSS directive, so when you enable CSS compression, the images don't show up.

steven mansour’s picture

Patch in #10 didn't work for me.

Applied patch with no errors, set yui to look in /files/2.7.0 where in installed 2.7.0b, but yui_editor never showed up in any text box.

Reverting back to either dev or stable module and /files/2.6.0 brought back yui_editor.

cbrody’s picture

Patch #10 didn't work for me either. Applied with no errors but yui editor no longer appears.

berenddeboer’s picture

I've only tested with remotely loaded YUI I think. Does patch work when you do that?

cbrody’s picture

I was using remotely loaded YUI, but have now given up on it for the time being and gone over to fckeditor.

geapi’s picture

same problem here, after applying the patch the editor disappeared

geapi’s picture

ok, played around more with it, if I set the remote yui source to 2.5.0 the editor works after the patch, setting it to 2.6 or 2.7 breaks it

thanks to the logs, I was able to figure out the why, it was looking for "editor.js" and not "yiu_editor.js" copied the version from yui_2.7.0b/build/editor/ in there and it started working, the editor shows up again but the content can NOT be saved, so reverted back to 2.5.0 and it worked again, will investigate more and post findings

sukr_s’s picture