Add editor: CKeditor

eigentor - May 14, 2009 - 01:58
Project:Wysiwyg
Version:7.x-3.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:fixed
Description

As CKeditor is the new kid on the block and the legal follower of FCKeditor, it might be worth integrating it. Main reason: It is so blazing fast. http://ckeditor.com/ Am no real coder, so could not check out other improvements (looks pretty much the same, same featureset) apart from inline editing mode being included.

Discusson on g.d.o. here http://groups.drupal.org/node/21169

Or is CKeditor maybe already supported and I don't know?

#1

sun - May 14, 2009 - 13:01
Title:Integrate CKeditor» Add editor: CKeditor

Happily accepting patches.

#2

sun - June 14, 2009 - 02:38
Status:active» needs work

First pass. Note that this only works with the current nightly build. The current beta is pretty old. Would have saved me from a few hours of debugging if I had known that.

This will go into new 3.x branch. Until then, we can get the basics working (most stuff should work already) and perhaps also work on Drupal plugins support, if we want to.

Probably it's best to strip the Drupal plugin stuff first and commit a basic support first.

AttachmentSize
wysiwyg-HEAD.ckeditor.patch 16.85 KB

#3

sun - June 20, 2009 - 20:28
Status:needs work» fixed

Committed attached patch to 3.x (only).

Only works with nightly build. However, the entire editor, its skin/theme, and behavior looks still very alpha. So this is primarily for testing purposes.

AttachmentSize
wysiwyg-HEAD.ckeditor.patch 9.04 KB

#4

eigentor - June 21, 2009 - 01:28

Well this is pre-Alpha and the implementation is by no means meant for production use.

But I wanted to try CKedtor for one reason: Its speed. Outcome: A content type with 5 textareas that load CKeditor.
Loading time: 1.5 seconds. How I learn from Sun and that issue half of that is Drupal loading time, so we might get below 1 second - for five Editor fields.

I find this quite impressive. There might be newer and niftier Editors. But my main concern with Wysiwygs so far was their snail-like slowness. Not so here - check it out. And hey - it's got a resizing widget, long missed in FCKeditor.

Below some screenshots of the new skin - not yet perfect, but they are reworking it, instead of keeping the old. The buttons may be a bit - er - overcolored, but hopefully this will be smoothed out a bit with coming versions.

#5

eigentor - June 21, 2009 - 01:22

Images

#6

System Message - July 5, 2009 - 01:30
Status:fixed» closed

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

#7

realityloop - July 13, 2009 - 23:19
Status:closed» needs work

This patch seems to be broken with the latest nightly of CKEditor, and dev version of wysiwyg, I can save editor settings in wysiwyg prefs, but just get blank area for body region when creating a node.

#8

Aren Cambre - July 18, 2009 - 02:17

FYI: CKEditor is now RC. Per the CKEditor web site: "This is supposed to be the last version before the final release."

#9

spydmobile - July 19, 2009 - 20:12

Wow, This will be great in WYSIWYG!!

#10

eigentor - July 20, 2009 - 04:46

I have to go to the CKeditor queue and post some patches to improve colors. This is awful, the green and red buttons being much too saturated. One has a hard time looking at anything else :P Also the tabs on top are hardly visible as such.

#11

Niels Hackius - July 20, 2009 - 15:29

There is a problem with the verison detection of CKEditor 3.0 RC: The current version is not properly detected anymore, because the changed the version string.

I attached a patch for this.

AttachmentSize
ckedtior-3.0rc-version.patch 1.04 KB

#12

sun - July 20, 2009 - 19:13

Please use diff -up for creating patches.

#13

sun - August 10, 2009 - 22:55
Status:needs work» fixed

Thanks for reporting, reviewing, and testing! Committed attached patch to all 3.x branches.

A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.

AttachmentSize
wysiwyg-HEAD.ckeditor-version.patch 850 bytes

#14

FilmKnurd - August 19, 2009 - 20:59

The names for the list buttons (ordered and unordered) are incorrect in ckeditor.inc. This prevents the buttons from being displayed. It's a simple fix, the names need to be changed: UnorderedList to --> BulletedList and OrderedList to --> NumberedList.

AttachmentSize
ckeditor.inc_fixedlists.patch 1.03 KB

#15

Razunter - August 21, 2009 - 07:54

Name for "Paste from word" is also incorrect

#16

sirkitree - August 21, 2009 - 21:42

Just thought I'd comment that this patch also works with the 2.0 version of the module. It's also the only editor I've been able to get to work seamlessly with a CDN. CKEditor FTW!

#17

sun - August 21, 2009 - 22:02
Status:fixed» needs review

#18

sirkitree - August 22, 2009 - 00:24

Also, CKEditor 3.0 was just released today - still working, however it doesn't seem to be working once javascript is aggregated. Making so that wysiwyg api does not preprocess the editor's javascript makes the editor work.

#19

sirkitree - August 22, 2009 - 01:20

EDIT

#20

AdrianB - August 23, 2009 - 20:57

Subscribing

#21

scottrigby - August 24, 2009 - 02:23

Looking good! I'd be fine to use this even before supporting addtl skins (like the "Kama" skin which is nice!), but I just realized that img_assist integration is only available for TinyMCE (right?)...

#22

igorik - August 26, 2009 - 19:12

subscribing, wysiwyg + ckeditor, the best combo ever :)

#23

Starnox - August 31, 2009 - 22:21

subscribe

#24

2440media2 - September 2, 2009 - 17:49

subscribing

#25

jhardy1974 - September 2, 2009 - 23:54
Category:feature request» support request

I have tried applying all of the patches but I get the following error:
Parse error: syntax error, unexpected '(', expecting T_STRING in /nfs/c01/h10/mnt/35735/domains/mysite.com/html/modules/wysiwyg/editors/ckeditor.inc on line 229

And line 229 is:
/**
* Attach this editor to a target element.
*/
Drupal.wysiwyg.editor.attach.ckeditor = function(context, params, settings) {
// Apply editor instance settings.
CKEDITOR.config.customConfig = '';

#26

Aren Cambre - September 3, 2009 - 00:43
Category:support request» feature request

This is still a feature request.

#27

scotjam - September 3, 2009 - 17:28

subscribing

#28

jmather - September 3, 2009 - 17:57

subscribe

#29

dfrt - September 3, 2009 - 20:38

subscribing

#30

bennash - September 4, 2009 - 00:46

yes please asap

#31

Starnox - September 4, 2009 - 15:37

Attached some files you can just drop into the 2.x-dev version. Worked nicely for me after a cache flush. Also updated the download url in ckeditor.inc

I haven't tested all the buttons but the basics are there.

AttachmentSize
editors.zip 7.09 KB

#32

apurvarc - September 5, 2009 - 16:34

Anyone tried this patch with the stable (not dev) of WYSIWYG?

#33

gjk - September 7, 2009 - 08:59

Subscribing.

#34

glueckskind - September 7, 2009 - 15:04

Patch #33 works until I turn javascript aggregation on.

#35

serialbob - September 8, 2009 - 09:30

It works with the dev version. Thanks.

#36

Wound - September 8, 2009 - 17:30

subscribe

#37

jkatinger - September 8, 2009 - 23:44

subscribe

#38

Elryn - September 9, 2009 - 16:22

subscribe

#39

XerraX - September 11, 2009 - 10:24

having the same problem with javascript aggregation on

#40

kmonty - September 12, 2009 - 01:14
Status:needs review» needs work

Subscribe

#41

haggins - September 13, 2009 - 23:23

#31 works great. thanks!

#42

livingegg - September 14, 2009 - 20:06

+1 Subscribing

#43

livingegg - September 14, 2009 - 22:50

#31 worked well for me - THANK YOU!

#44

livingegg - September 14, 2009 - 22:54

The HTML block format button is not working. Here is a .zip - same as the #31 drop-in but with the Format combo-box fixed.

AttachmentSize
ckeditor-2.x-dev.zip 5.27 KB

#45

TwoD - September 15, 2009 - 06:47

Could you please provide patches for HEAD? Zips are a bit hard to review.
Could someone please investigate why JavaScript aggregation breaks the editor? Are there any errors, etc?
I'd love to get this fully operational but I've got my hands full atm.

#46

jaxtheking - September 15, 2009 - 10:35

Plugins correct name

Guys, I noticed some of the plugins called in the wysiwyg_ckeditor_plugins function (ckeditor.inc) were not being called. The reason for that was the wrong name, so find below the correct names if you want to use those plugins:

'Font' => t('Font'), /* not FontName */
'Styles' => t('Font style'), /* not Style */
'Scayt' => t('Check spelling'), /* not SpellCheck*/
'HorizontalRule' => t('Horizontal rule'), /* not Rule */

I thought this might help someone...

#47

livingegg - September 15, 2009 - 17:53

TwoD - Are you asking for a 3.x or 2.x patch? The reason why were using a zip file was because it makes it easy to just drop in the files to 2.x, until the 3.x is released and back-ported to 2.x

Also - I have been unable to find any clear instructions for how to create a patch in windows (without having to check out the cvs repository into an ide like eclipse)

#48

livingegg - September 15, 2009 - 22:14

Okay - here's my first crack at a patch. I created it with TortoiseSVN and the first few header lines are a bit different than the cvs-generated ones I've seen so I'm not sure if its directly usable or not. This is #31 with the fixes to the button names brought up by jax and myself.

As for the javascript aggregation issue I have no idea how to debug that so I'm leaving it for another.

AttachmentSize
ckeditor-2.x-dev_fixedbuttons.patch 1.43 KB

#49

livingegg - September 15, 2009 - 22:20

And here is an updated copy of the drop-in files for those that want it as a zip.

AttachmentSize
ckeditor-2.x-dev.zip 5.27 KB

#50

livingegg - September 15, 2009 - 23:11

Another issue that I'm not sure how to debug: The CSS > Block formats setting from the front-end UI has no effect.

#51

TwoD - September 15, 2009 - 23:12

3.x patches for now, backporting should be easy once everything's ok.
The patch in #48 seems ok at first glance. Will test later.

#52

mattyoung - September 16, 2009 - 00:17

subscribe

#53

lazy-r - September 16, 2009 - 09:33

+1 subscribe

#54

perke - September 16, 2009 - 10:35

+1 subscribe

#55

slosa - September 16, 2009 - 11:54

sub

#56

theabacus - September 16, 2009 - 16:06

sub

#57

GrimSage - September 17, 2009 - 03:51

sub

#58

that0n3guy - September 17, 2009 - 14:08

Just to give ya some heads up... IMCE works with the bridge here: http://drupal.org/node/533168#new

#59

georgedamonkey - September 17, 2009 - 14:47

subscribe

#60

sapelzin - September 17, 2009 - 17:43

I have a multi-site installation. I've applied the patches and installed CKEditor. It works as expected on my www site (www.example.com), but doesn't work on any other sites (abc.example.com, xyz.example.com). Wysiwig is installed in the sites/all folder and is shared by all the sites.

Has anyone else run into this problem? Any ideas what needs to be modified?

Thank you.

#61

mcrittenden - September 17, 2009 - 18:21

Subscribe.

#62

picciuto - September 17, 2009 - 18:54

Subscribe.

#63

likewhoa - September 18, 2009 - 03:16

Subscribe

#64

vegardjo - September 18, 2009 - 12:27

subscribe

(BTW: added the files in #49 which installed the editor just fine, but I am still not able to select it for any input formats..)

#65

that0n3guy - September 19, 2009 - 04:22

Do we need to add filefield insert support here or at filefile insert issues?

http://drupal.org/node/580308 - FF insert issue

#66

TwoD - September 20, 2009 - 20:20

The CKeditor implementation needs support for "native plugins" as well as our own "Drupal plugins", FileField can then create a plugin either for specific use with CKeditor or one which can be used by all editors supporting Drupal plugins.

#67

livingegg - September 21, 2009 - 18:53

@vegardjo - do you mean that it does not show up in the combobox in the editors table column here http://peaks.eclg.org/admin/settings/wysiwyg?

#68

iterator - September 21, 2009 - 21:38
Category:feature request» task
Status:needs work» active

The javascript aggregation doesn´t work. Here is a piece of the ckeditor code:
var x='editor'+ ++l;
If you aggregate this piece of code it will look like this:
var x='editor'+++l;
This will cause an error (invalid increment operand).
There are a few more pieces of code like this.
A possible solution would be to disable the javascript aggregation only for the ckeditor js files.

My workaround for now is to disable the aggregation for the complete wysiwyg module. Perhaps someone wants to use this patch.
I wrote this patch for the 2.x-dev version but it should work with the latest stable version too.

AttachmentSize
wysiwyg-2.x-dev_dont_aggregate.patch 6.01 KB

#69

iterator - September 21, 2009 - 21:42
Category:task» feature request
Status:active» needs work

Sry, i didn´t want to change the category and status of THIS thread. Don´t work on more than one thread at the same time :)

#70

vegardjo - September 22, 2009 - 16:00

@livingegg well, yes. Or that I cannot select anything from the drop down menu, as nothing drops down. See: http://skitch.com/vegardjo/nygnw/wysiwyg-localhost

Also, I don't get the install instructions for any other editors when CKEditor is installed, so I don't know what would happen if more editors were installed..

#71

TwoD - September 22, 2009 - 17:02

@vegardjo. Please see Q: How do I select a different installed editor? The box is disabled. You must click "Remove" to delete the old editor profile before assigning a new one to the input formats. You've also deleted the editor which was configured for that format, which is why Wysiwyg module reverts back to "No editor".

You can click the fieldset at the bottom of admin/settings/wysiwyg to see the installation instructions for all editors at all times.

#72

vegardjo - September 23, 2009 - 12:59

Ah, stupid me.. In addition I made the error of *replacing* the original editors folder with the one I downloaded from here, not just adding the new files for CKEditor, resulting in the deletion of the files for the other editors, leaving me with CKeditor as my only choice!

anyways, thanks! :)

#73

Yas375 - October 18, 2009 - 07:25

anybody already write a patch to configure settings for CKEditor?

Description of problem: admin/settings/wysiwyg and click "edit" near format with ckeditor. Now if we change some settings then editor will not use default settings. For example try to select all buttons and see what you get.

For fckeditor there is file fckeditor.config.js in wysiwyg/editors/js/ directory. And I think we need to write config file for ckeditor too for correct work...

anybody already write a patch to configure settings for CKEditor? )

--
One of my projects on drupal is site about Android news.

#74

Junni - September 24, 2009 - 13:42

Subscribe. Would be a nice thing to have this CKEditor!

#75

DanielJohnston - September 24, 2009 - 14:31

I've got latest Drupal 6.x on a Pressflow install, Wysiwyg 2.x-dev, files from #49 dropped in, the patch from #68 applied, and ckeditor 3.0 in the appropriate place.

I get this error over 30 times when I edit a node, with different values for the argument number and the first line number:

warning: Missing argument 2 for myDrupal_add_js(), called in /data/distro01/pressflow/sites/communitydance.eu/modules/wysiwyg/wysiwyg.module on line 139 and defined in /data/distro01/pressflow/sites/communitydance.eu/modules/wysiwyg/wysiwyg.module on line 953.

Oddly enough, the actual text editing box appears to work ok otherwise. Thoughts anyone?

#76

glueckskind - September 25, 2009 - 06:19

I did not try it, but try to replace

function myDrupal_add_js($path, $type, $scope, $defer, $cache, $preprocess) {
if(!$type) $type = 'module';
if(!$scope) $scope = 'header';
if(!$defer) $defer = FALSE;
if(!$cache) $cache = TRUE;
drupal_add_js($path, $type, $scope, $defer, $cache, FALSE);
}

with:

function myDrupal_add_js($path, $type = 'module', $scope = 'header', $defer = FALSE, $cache = TRUE) {
drupal_add_js($path, $type, $scope, $defer, $cache, FALSE);
}

#77

DanielJohnston - September 25, 2009 - 07:14

@glueckskind #76 - Works like a charm! Yay!

#78

droplet - September 25, 2009 - 08:21

Subscribe+
waiting some fix for javascript aggregation

#79

DanielJohnston - September 25, 2009 - 08:29

Another minor report - Teaser break button doesn't appear in the editor when 'Teaser break' is selected to appear in the CKEditor profile.

#80

Yas375 - September 25, 2009 - 10:16

I do some work on intergration CKEditor into drupal.

If you will apply this patch to dev version, then it have to work. And buttons preferences on editor settings page have to works to.
My patch based on and include next patches:
http://drupal.org/files/issues/wysiwyg-HEAD.ckeditor_0.patch
http://drupal.org/files/issues/wysiwyg-HEAD.ckeditor-version.patch
http://drupal.org/files/issues/ckeditor.inc_fixedlists.patch

AttachmentSize
wysiwyg-6x.dev-ckedtor-support-with-working-buttons-prefs.patch 11.07 KB

#81

Wim Leers - September 25, 2009 - 17:33

Using HEAD + dropping CKEditor 3.0 in sites/all/libraries fails. I can configure CKEditor, but it doesn't show up. Something is wrong with the skin also (WYSIWYG API refers to 'default' while no 'default' skin exists).

I'm going to stick with the stable release + FCKEditor for now :)

#82

Yas375 - October 18, 2009 - 07:24
Status:needs work» needs review

My patch in post #80 fix problem with button settings and with skin. Try to apply it.

Or if you want you can simply add two files from archive below to your wysiwyg module folder. I tested it with 6.x-2.0 and 6.x-2.x-dev (2009-Sep-18) versions of wysiwyg.

--
Yas's blog

AttachmentSize
wysiwyg_ckeditor_support_yas25.09.09.zip 4.13 KB

#83

droplet - September 25, 2009 - 20:50

YES. it works. (don't know how to test Skin)

from now, some bug still waiting for fix:
- Language
- Editor appearance settings
- JavaScript aggregation

#84

CinemaSaville - September 25, 2009 - 23:17

This still doesn't work with Safari on a Mac. Works great on FF though. Anybody able to help out the Safari Macians?

#85

matthew petty - September 25, 2009 - 23:28

Subscribing... can't wait!

#86

CinemaSaville - September 25, 2009 - 23:57

To be more specific, it just all stays on the same row. (See attached Screenshot) So it must be the CSS that's off (I'm guessing.) Any thoughts?

AttachmentSize
screenshot.png 222.04 KB

#87

Yas375 - September 26, 2009 - 05:27

Is demo of ckeditor (http://ckeditor.com/demo) working correctly on safari?

#88

mattyoung - September 26, 2009 - 06:44

I browse it with Safari/Mac OS 10.6 and it comes up fine and seem to work.

What do you want to try with it?

#89

droplet - September 26, 2009 - 09:04

CinemaSaville, is it working correctly on Garland theme ?

#90

sun - September 27, 2009 - 02:05

Given the amount of people opening issues for CKeditor, we should backport this sucker to 2.x.

#91

CinemaSaville - September 27, 2009 - 04:02

droplet, same on Garland. With the default settings, everything looks fine, but once I start to pick and choose buttons, that's when it starts to go haywire. I wouldn't mind, but I'm trying to use IMCE with this as well.

#92

RedKing - September 27, 2009 - 05:47

Hi every one,

It's been working fine for me with http://drupal.org/node/462146#comment-2083296 and imce_wysiwyg is working to with the last patch findable at http://drupal.org/node/533168#comment-2052198

Thank you for this greats works...

#93

Yas375 - September 27, 2009 - 06:33

RedKing, you are welcome ;)

#94

RedKing - September 28, 2009 - 04:41

Thank's Yas375

Line Break isn't working. The "div page-break-after" is created in source code but the page break isn't effective on my front page. It's the only think I've presently find who's not working.

I've deactivate line break remover in ckeditor profiles and in input formats so I presume that's coming from ckeditor module.

EDIT :

I apologize because it's not coming from wysiwyg module. I just discover i've a div tag who's going to alter node output when I'm trying to preview or save it.

#95

that0n3guy - September 27, 2009 - 14:43

Feature request...

Support insert events so we can use http://drupal.org/project/filefield_insert w/ ckeditor.

#96

droplet - September 27, 2009 - 16:45

case sensitive problem.

'Width' => '100%',
'Height' => 420,

I tried to change the width/height value but don't work. after read some docs. I found that some case sensitive problem here.

changed to :

'width' => '100%',
'height' => 420,

also here may need to update.
'IncludeLatinEntities' => FALSE,
'IncludeGreekEntities' => FALSE,

==>

config.entities_greek = false;
config.entities_latin = false;

#97

Sborsody - September 28, 2009 - 21:44

Just tried the CKEditor demo on their website and....

OOOW MY EYES! Totally wrong to have a wysiwyg editor's colors compete with a website's colors. But it looks like the editor has "skins" including the old FCKeditor look.

#98

macrocosm - October 5, 2009 - 08:11

I have ckeditor working nicely & it's surely a huge improvement but I seem to be missing the split body teaser bits? Anyone else have that working? ...theres not even a checkbox for it in the profiles. I also couldn't get the IMCE bits to work as suggested above.

Really looking forward to an official release of all these compiled patches and other goodies, I must have missed something in my install to be without those bits above. Still this is already my favorite wysiwyg by far .. it has clean body resize and a nice full screen option, and yes it is super fucking fast! Once imce and other drupal integrations bits are fully sorted this will be so sweeet!

Cheers for the patches!!

#99

allan1015 - October 6, 2009 - 05:27

Have it working on IE with IMCE. (with above patches to wysiwyg and imce_wsywig)
However on Chrome the buttons are all in one row, as discussed above.
If I don't select any buttons, all unchecked, then all the buttons line up nicely, of course I don't get any IMCE that way

Works
FireFox 3.0.14
IE8

Doesn't Work (buttons stretched)
Chrome3
Safari 4

#100

allan1015 - October 6, 2009 - 06:51

Not sure if this goes in this thread, let me know if wrong, just passing this finding along

I have a CSS issue with FCKeditor and CKeditor using Wysiwyg,
I am using Vitzo-flex theme

When I selected 'Use Theme CSS' it didn't adopt my themes style, well not all of it, and the text was all centered and the Center-Justify button was defaulted

When I selected the editors style, the centering issue wasnt there but neither was my theme style

When I changed to Define CSS and used the following path %b%t/css/style.css
it worked and adopted my themes style and centering issue went away

True for both FCKeditor and CKeditor under wysiwyg

#101

perandre - October 6, 2009 - 09:55

+1, will test soon

#102

dsms - October 6, 2009 - 11:03

subscribe

#103

allan1015 - October 6, 2009 - 17:50

The button wrapping issue in different browsers appears like it might be a ckeditor issue

I created a new toolbar configuration, actually I took the one sample from the developers documentation and took out the line break '/'

Then I modified the sample ckeditor provides, skin.html, to add the new toolbar on page.

In IE the toolbar wraps automatically, if I resize window etc. In chrome/safari it does,t, just extends out to the right and some buttons go missing depending on browser width

(someone above posted a picture of this)

I posted at the ckeditor forum
http://cksource.com/forums/viewtopic.php?f=11&t=16051

Of course it could mean that Drupal integration isn't adding any row breaks '/' in the configuration and it should be.

#104

stripped your speech - October 6, 2009 - 17:53

subscribe

#105

macrocosm - October 7, 2009 - 04:52

Its even worse in Chrome for me nothing shows up at all .. I have it disabled by default. The link to switch to wysiwyg does not even appear.

Good thing this is on my dev server! I would have a buncha pissed chrome users right about now...
:::sigh::: guess I need to still stick with fckeditor for the time being.

Cheers for the progress though, its nearly working!

#106

Yas375 - October 7, 2009 - 08:09

2allan1015: I will try to fix this problem on sunday. thanks for hint with '/' =)

#107

sun - October 7, 2009 - 09:43

@macrocosm: How about working with others here on a patch instead of complaining?

#108

allan1015 - October 7, 2009 - 11:52

macrocosm
What does 'the link to switch to wysiwyg does not even appear' mean?
Just trying to help understand where the problem might be.

So it works in non Chrome browsers?

Of course dev servers, ckeditor integration is unreleased, not on the official support list, etc.

#109

allan1015 - October 7, 2009 - 12:16

Sunday?!! We have to wait till Sunday :) :)

While your in there, perhasp a look at the ckeditor.inc file at this point

function wysiwyg_ckeditor_settings($editor, $config, $theme) {
+  $settings = array(
+    'basePath' => base_path() . $editor['library path'] . '/',
+    'SkinPath' => base_path() . $editor['library path'] . '/editor/skins/' . $theme . '/',

I am a complete hack at this, but thew skin path doesn't look right? perhaps take out the /editor part? Not sure. I tried doing that and forcing the skin name], like this:

    'SkinPath' => base_path() . $editor['library path'] . '/skins/office2003' . '/',

but nothing changed in display, so I may be off base as well

#110

droplet - October 8, 2009 - 02:12

basePath / SkinPath are some old things in Fckeditor.

try this:

'skin' => 'v2',

http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.skin

#111

droplet - October 8, 2009 - 03:44

fixed width / height / ProcessHTMLEntities options
add Language / Resizing button / Toolbar location support

AttachmentSize
d6-3-dev.patch 2.11 KB

#112

allan1015 - October 8, 2009 - 04:33

droplet, using 'skin' instead of SkinPath in the ckeditor.inc file did the trick
(before applying patch in 111)

$settings = array(
    'basePath' => base_path() . $editor['library path'] . '/',
    'skin' => 'office2003',
    'width' => '100%',
    'height' => '420',
    // By default, CKeditor converts most characters into HTML entities. Since
    // it does not support a custom definition, but Drupal supports Unicode, we
    // disable at least the additional character sets. CKeditor always converts
    // XML default characters '&', '<', '>'.
    // @todo Check whether completely disabling ProcessHTMLEntities is an option.
    'IncludeLatinEntities' => FALSE,
    'IncludeGreekEntities' => FALSE,
  );

#113

macrocosm - October 8, 2009 - 05:57

@Sun .. that wasnt a complaint it was a report back ... u notice the "needs review" status of this thread? I tested the patches and supplied my thoughts.

@allan1015 .. I have enabled the on/off switch for the editor. It sits below the body field on the left, when you click it it enables/disables the wysiwyg, pretty standard stuff ... and is an option in all of the editors I've tried in Drupal. I keep the editor disabled by default as I feel it gets in the way as I usually dont need it ... and on the occasion that I do need it I simple click the enable button... simple.

My report was that the editor did not load at all in Google Chrome (because thats my default setting) however the enable/disable button did not appear which it does in FireFox.

#114

allan1015 - October 8, 2009 - 07:27

I have attempted to combine most of the patches to ckeditor.inc and ckeditor-3.0.js , mostly this is a combo of yas375, livingegg, and the last one from droplet.

I picked and choose where there where conflicts between peoples patches, deferred to Yas375 on most of the button stuff as his code allows buttons to wrap in IE, not all on one line.

I pushed all the buttons and made sure something happen, didn't do a full test of all functions

also added the change to the skin attribute as discussed in last two posts. Its set for office2003, you may want to set it for kama which seems to be the default.

Ive no idea how to make patches so its as a zip

Also, livingegg had added the following after the 'Height' => 420, line. I didn't put them in as I was unclear what they did

'LinkBrowser' => FALSE,
'LinkUpload' => FALSE,
'ImageBrowser' => FALSE,
'ImageUpload' => FALSE,
'FlashBrowser' => FALSE,
'FlashUpload' => FALSE,

Allan

AttachmentSize
wysiwyg-ckeditor-combinedpatches.zip 5.78 KB

#115

rismondo - October 8, 2009 - 14:37

subscribing

#116

mattyoung - October 8, 2009 - 20:12

@allan1015:

>Ive no idea how to make patches

http://drupal.org/patch

#117

allan1015 - October 8, 2009 - 21:59

Ok, thanks
the core issue for me was no idea what would be the stable release I would patch against? There are conflicting changes from various authors,etc. I was trying I guess to offer perhaps a new baseline that seem to have a workable combination of everyones input so far.

But Ill keep your link in mind for future

Allan

#118

TwoD - October 9, 2009 - 02:16

Just to clear things up a bit. We should patch against 7.x-3.x-dev aka HEAD. We'll then backport to 6.x-2.x-dev aka DRUPAL-6--2. For the moment, the code in 3.x and 2.x are similar enough to let one grab the files editors/ckeditor.inc and editors/js/ckeditor.js from D7 and directly use them in the D6 branch (probably also in D5), but that might change after a while.
The major difference (CKeditor being in focus) is thus that the D7 version already has the implementation files in CVS, while the other branches don't. So if we patch against D7/HEAD, it'll be less code to review.

I'm currently working on compiling all the changes above into one patch (just some testing left), as well as trying to add support for native and Drupal plugins. The Drupal plugin support is the most tricky part since the documentation does not yet cover the features/classes we need to use for a good enough implementation.

#119

fred0 - October 9, 2009 - 05:21

TwoD, since you're about to start applying patches and doing additional work on this, I thought I'd quickly throw in 1 more for review. This is against the 7.x-3.x-dev version.

First, it changes the wysiwyg_ckeditor_themes function to scan the CKEditor library for skins and builds the array from that. This is a compliment to the patch I submitted earlier in issue 414496.
The other change is to the 'skin' setting so that it returns a default if the user hasn't configured the editor yet (ie - no settings exist in the database) and sets the default to be kama instead of office2003 since that seems to be the new default skin for CKEditor.

Edit: And I look forward to your updates and Drupal module integration (once the documentation is available, of course)!

AttachmentSize
ckeditor.inc_.patch 1.43 KB

#120

Maedi - October 10, 2009 - 08:23

subscribing..

#121

fred0 - October 10, 2009 - 18:37

Oops. That last patch should have used drupal_set_message() and not die(). Here's that tweak.
Also, the isset() line in wysiwyg_ckeditor_settings() might not be correct or necessary if we change the core module to use defined keys as discussed here.

AttachmentSize
ckeditor.inc_.patch 1.47 KB

#122

mokargas - October 13, 2009 - 06:32

Subscribing. Looking fantastic.

#123

upupax - October 13, 2009 - 09:31

subscribe

#124

detot - October 13, 2009 - 10:11

subscribe

#125

smussenden - October 14, 2009 - 03:46

subscribing

#126

maharvey67 - October 14, 2009 - 03:59

there should be a "subscribe" button...

#127

pribeh - October 14, 2009 - 06:26

subscribe.

#128

espirates - October 14, 2009 - 06:40

there should be a "subscribe" button...

What a simple yet brilliant idea, unfortunately, drupal.org would never go for something like that.

#129

lukus - October 14, 2009 - 13:33

Subscribe also

(and a +1 for the subscribe button idea)

#130

Jax - October 14, 2009 - 15:09

<?php
+  isset($config['theme']) ? $settings['skin'] = $theme : $settings['skin'] = 'kama';
?>

should be replaced with
<?php
$settings['skin'] = isset($config['theme']) ? $theme : 'kama';
?>

which is the correct way to use a ternary operator.

#131

droplet - October 14, 2009 - 15:38

I prefer this

<?php
   
if (isset($config['theme'])) {
    
$settings['skin'] = $theme;
    }
?>

default skin value defined in Ckeditor already

#132

borfast - October 14, 2009 - 23:08

Subscribing (I hate to pollute threads just for this... :( )

#133

scottrigby - October 15, 2009 - 01:24

Regarding the subscribe thing, here's Derek Wright's (+ Chad & David's) great summary: http://3281d.com/2009/03/27/death-to-subscribe-comments

You can currently subscribe to all issues of a project, by clicking the 'Subscribe' button at the top of any project's issue tracker, leading you someplace like here: http://drupal.org/project/issues/subscribe-mail/wysiwyg

But yeah, as Derek said, it does kind of suck that there's not another way (yet) to subscribe to a single issue :p

#134

johngriffin - October 15, 2009 - 12:02

subscribe

#135

nicof - October 15, 2009 - 13:31

Hi,

I read tons of info about ckeditor patches for drupal 6.
Can somebody tell me if there is a STABLE all-in-one patch that works for drupal 6 integration?
My time is limited to test everything, I was wondering of the ckeditor can be implemented in drupal 6.

Thanks

#136

pribeh - October 15, 2009 - 19:51

Hi nicof,

Follow the instructions in #82.

Thomas

#137

registrator - October 16, 2009 - 06:21

Hi,

I'm using ckeditor since a few weeks and its running well with the provided patches. Stable, no problems at all. Thanks to the developers!

Does anybody know how to integrate a file browser such as ckfinder? I can't get it work in my multisite environment.

#138

perandre - October 16, 2009 - 07:07

Anyone checked out http://drupal.org/project/ckeditor ?

#139

bohemicus - October 16, 2009 - 09:57

Subscribing

#140

Yas375 - October 16, 2009 - 12:34

All-in-one patch for ckEditor support v.1

I have fixed bug with chrome and safari. Now button seems good!
And I create global patch, which you can simply apply even for version 6.x-2.0 and ckeditor will working. This big patch contain patches and fixes from: #3, #13, #14, #80, #82, #96, #111, #112, #114, #121 and some of my fixes.

Attention! This patch contain fixes from #121, but if you would like set theme for ckEditor in admin area then you nave to see #414496: Allow to select editor theme/skin.

So, you can apply my patch by running it from your wysiwyg module directory:

patch -p1 < wysiwyg-6.x-2.0_ckeditor_support_yas_v1.patch

Or you can add files from attached archive to your wysiwyg module directory.

AttachmentSize
wysiwyg-6.x-2.0_ckeditor_support_yas_v1.patch 13.07 KB
wysiwyg-6.x-2.0_ckeditor_support_yas_v1.zip 4.43 KB

#141

Aren Cambre - October 16, 2009 - 13:32

#142

Chad_Dupuis - October 16, 2009 - 16:47

sub

#143

omerida - October 16, 2009 - 20:55

CKEditor wouldn't load for me if javascript aggregation is enabled. This patch excludes the editor's js file from Drupals javascript preprocessing.

AttachmentSize
ckeditor_js_preprocess.patch 461 bytes

#144

Yas375 - October 17, 2009 - 07:08

re: #142: sub for what?

#145

Starnox - October 17, 2009 - 08:50

sub for subscribe...

#146

droplet - October 17, 2009 - 12:10

does Wysiwyg support editor plugins ?
both Fckeditor / Ckeditor extra plugins not work well.

#147

TwoD - October 17, 2009 - 14:00

@droplet, It depends on the editor implementation. The FCKeditor implementation has support for 'native' FCKeditor plugins as well as dialog-less 'Drupal plugins' (Teaser Break, but not Image Assist). Both types of plugins require hook_wysiwyg_plugin() to be implemented, describing the plugin for the module/editor.

I'm currently working on CKeditor support and I have the same amount of support for Drupal plugins as FCKeditor does, but I haven't started with native plugins yet.

I'm also checking to make sure all of the above fixes are included (thanks Yas375 for combining them all, that makes for a good reference). I would have put a patch in here now but I'm on the wrong computer atm (just got home from a quick hunting trip :)) so that probably won't be until later tonight. :/

#148

allan1015 - October 17, 2009 - 18:04

Yas375 - THANKS!

Can anyone verify - the only way to change the skin/theme is in the code, there is no browser/admin interface place for that, right?

#149

Yas375 - October 17, 2009 - 18:43

allan1015, with my last patch only one way to change skin. You have to add one line in editors/ckeditor.inc at the end of function wysiwyg_ckeditor_settings add line:
$settings['skin'] = 'office2003';

You will have something like this:

  if (isset($config['theme'])) {
    $settings['skin'] = $config['theme'];
  }
  $settings['skin'] = 'office2003';
  return $settings;

If you would like to set skin from administration page, then you have to see #414496: Allow to select editor theme/skin and try apply patches from there. I haven't time to test this patches. That's why I don't include code from that patches. Maybe I will do this later...

#150

allan1015 - October 17, 2009 - 19:37

Yas375 thanks

I did basically as you had indicated, but like this

  if (isset($config['theme'])) {
    $settings['skin'] = $config['theme'];
  } else {
    $settings['skin'] = 'office2003';
  }

I'll check out that admin patch later tonight, I guess i missed that one when I searched, thanks

Allan

#151

nicof - October 18, 2009 - 11:42

#140 - Yas375 >> Thanks. The patch works perfect and spares me time.
Cheers

Update: 'Optimize JavaScript files' option must be disabled in site configuration - performance.

#152

Flying Drupalist - October 18, 2009 - 08:34

Umm, so should I be using Yas375's combined patch or wait for TwoD's?

#153

agentdcooper - October 18, 2009 - 14:31

guys/gals - please dont hate me for asking this here... I have wysiwyg-6.x.2.0 with ckeditor v3.0.1 working great (v3.0.1 was released 10/17/09 and works without problem just by untar'n it into sites/all/libraries location) with the patches from this post... my trouble comes in when I try to use the "CKEditor v3.x plugin for SyntaxHighlighter" located here and here. the deal is... I have the ckeditor SyntaxHighlighter plugin working just fine when going to www.xxxx.com/drupal/sites/all/libraries/_samples/index.html - all that was involved was 6 lines of code ;

1 line in sites/all/modules/wysiwyg/editors/ckeditor.inc in the function wysiwyg_ckeditor_settings ... $settings = array(
- I added     'customConfig' => base_path() . $editor['library path'] . '/config.js',

5 lines in sites/all/libraries/ckeditor/config.js
- I added

CKEDITOR.editorConfig = function( config )
{
        config.extraPlugins = 'syntaxhighlight';
        config.toolbar_Full.push(['Code']);
};

as I mentioned, everything works great when going to www.xxxx.com/drupal/sites/all/libraries/_samples/index.html - I can see my button and all, and the plugin fully works. but when going to use it within my drupal site, I have NO BUTTON! I've tried many different things with the sites/all/modules/wysiwyg/editors/ckeditor.inc file, to get it to work with drupal, but it just doesnt work... am I missing something here? anyone have suggestions? I can get the BUTTON to show in the wysiwyg profiles ala the IMCE button using IMCE_bridge using the latest patch to work with CKeditor v3, but again nothing shows when I use ckeditor thru drupal as normal.

little help?

#154

TwoD - October 19, 2009 - 11:10

And here it is! This patch adds support for native plugins and partial support for Drupal plugins. Drupal plugin support is about at the same level as for FKCeditor meaning Teaser Break will work, but Image Assist and other dialog based plugins will not. I included most of the features above but removed the form related buttons and some others, which either seemed to have little purpose on a Drupal page or because the corresponding buttons in other editors are already disabled.

I applied omerida's patch to disable aggregation for the CKeditor because it doesn't handle the compression well.

I've not figured out a good way to handle translation files for native plugins yet, so implementing those might throw an error.

@Yas375, I could not find any references to the bbcode, dragresizetable and tablecommands plugins so I did not include those. We'd also like to handle grouping of buttons in some way which works for all editors, see #277954: Allow to sort editor buttons. Until that's fixed, that part could be put in a separate patch as a temporary fix.

@agentdcooper, the first rule of Drupal is "Don't hack core!", and we try to apply a similar rule in Wysiwyg module. ;) There's a hook you can implement to 'describe' native plugins to Wysiwyg moule and let it be passed on to the editor. I've created an example module (for D6) implementing the hook to make syntax highlighting available, see the attached zip.

Attached is a patch for D7 (Wysiwyg module needs a few patches there too or plugins don't work) and the complete files for testing with D6. Hopefully I haven't missed anything. Questions and suggestions are as always welcome.

AttachmentSize
wysiwyg-HEAD_ckeditor.patch 15.98 KB
ckeditor-3.0.js_.txt 6.37 KB
ckeditor.inc_.txt 10.33 KB
syntax_module.zip 1.06 KB

#155

dsms - October 19, 2009 - 12:41

Thanks for your work, TwoD!

when can we expect this patch in 6.x-2.x-dev?

#156

droplet - October 19, 2009 - 13:23

"complete files for testing with D6" does not work for me , tested on D6-3-dev / D6-2-dev
wysiwyg-HEAD_ckeditor.patch , not yet test, failed to patch

#157

dogbertdp - October 19, 2009 - 13:31

subscribe

#158

sun - October 19, 2009 - 14:23
Version:6.x-2.x-dev» 7.x-3.x-dev

Awesome job, TwoD! This looks mostly ready to fly! :)

I'd suggest to incorporate the following issues and afterwards commit to HEAD (7.x-3.x), backport to DRUPAL-6--3 (where ckeditor.* already exists), and lastly, copy and add that to DRUPAL-6--2.

+++ editors/ckeditor.inc 19 Oct 2009 10:18:40 -0000
@@ -29,6 +33,13 @@ function wysiwyg_ckeditor_editor() {
     'plugin settings callback' => 'wysiwyg_ckeditor_plugin_settings',
+     'proxy plugin' => array(
+      'drupal' => array(
+        'load' => TRUE,
+        'proxy' => TRUE,
+      ),

Wrong indentation here.

+++ editors/ckeditor.inc 19 Oct 2009 10:18:40 -0000
@@ -76,7 +87,18 @@ function wysiwyg_ckeditor_version($edito
function wysiwyg_ckeditor_themes($editor, $profile) {
...
+  // @todo Don't return skin names here.
+  //return array('kama', 'office2003', 'v2');

Hm - I don't understand this @todo...?

+++ editors/ckeditor.inc 19 Oct 2009 10:18:40 -0000
@@ -139,6 +178,22 @@ function wysiwyg_ckeditor_settings($edit
+          else if ($type == 'buttons' && empty($plugins[$plugin]['internal'])) {

s/else if/elseif/

+++ editors/ckeditor.inc 19 Oct 2009 10:18:40 -0000
@@ -164,12 +222,15 @@ function wysiwyg_ckeditor_plugin_setting
-      // Add path for native external plugins; internal ones do not need a path.
+      // Add path for native external plugins; internal ones default to the standard path.

Doesn't wrap at 80 chars.

+++ editors/ckeditor.inc 19 Oct 2009 10:18:40 -0000
@@ -164,12 +222,15 @@ function wysiwyg_ckeditor_plugin_setting
+        $settings[$name]['path'] =  base_path() . $editor['library path'] . '/plugins/' . $name . '/';

Duplicate space here.

+++ editors/ckeditor.inc 19 Oct 2009 10:18:40 -0000
@@ -177,7 +238,26 @@ function wysiwyg_ckeditor_plugin_setting
+/**
  * Return internal plugins for this editor; semi-implementation of hook_wysiwyg_plugin().
+ * Excluded native plugins: About, Button, Checkbox, Form, HiddenField, ImageButton, NewPage, PageBreak, Print, Radio, Select, Save, TextField, Textarea, Templates,
  */
function wysiwyg_ckeditor_plugins($editor) {

There should be a blank line between the summary and the description and the description should wrap at 80 chars.

See http://drupal.org/node/1354 for more info.

+++ editors/js/ckeditor-3.0.js 19 Oct 2009 10:18:40 -0000
@@ -1,6 +1,37 @@
+  // Initialize editor configurations.
+  CKEDITOR.on('focus', function(ev) {
+    Drupal.wysiwyg.activeId = ev.editor.name;

This comment doesn't really map to the code. :)

+++ editors/js/ckeditor-3.0.js 19 Oct 2009 10:18:40 -0000
@@ -1,6 +1,37 @@
+  // Plugins must only be loaded once. Only the settings from the first format
+  // will be used but they're identical anyway.
+  var registeredPlugins = {};

Hm... that won't always be true. But I think we can go with that for the time being (i.e. until 3.x is in shape).

+++ editors/js/ckeditor-3.0.js 19 Oct 2009 10:18:40 -0000
@@ -8,6 +39,75 @@ Drupal.wysiwyg.editor.attach.ckeditor =
+    pluginsLoaded: function(ev) {
+    // Override the conversion methods to let Drupal plugins modify the data.
+      var editor = ev.editor;

Comment has a wrong indentation.

Don't forget CHANGELOG.txt, and, for convenience:

#462146 by TwoD: Added support for CKeditor.

I'm on crack. Are you, too?

#159

TwoD - October 20, 2009 - 03:08
Status:needs review» fixed

Fixed the issues sun mentioned and did some more testing.
Committed to 7.x-3.x-dev and backported to 5.x-2.x-dev, 6.x-2.x-dev, 6.x-3.x-dev. (All using identical files.)

Thanks to everyone for testing, patching and reporting!
This fix will be part of the next -dev snapshots and upcoming releases.
Please report any new issues separately.

AttachmentSize
wysiwyg-HEAD-ckeditor2.patch 17.04 KB

#160

agentdcooper - October 20, 2009 - 13:16

thanks much TwoD, that syntax_module was a huge help in allowing me to understand how wysiwyg works with CKeditor + plugins, I am very thankful for your assistance! things are looking great for drupal + ckeditor + wysiwyg module w/ the new patches.

oh, one thing I gonna mention... I did change in ckeditor.inc was the 'versions' array within function wysiwyg_ckeditor_editor() - I changed it to this to support ckeditor 3.0.1, otherwise the newest version of ckeditor would not work with this wysiwyg module.

    'proxy plugin settings callback' => 'wysiwyg_ckeditor_proxy_plugin_settings',
    'versions' => array(
      '3.0' => array(
        'js files' => array('ckeditor-3.0.js'),
      ),
    ),
  );
  return $editor;

((essentially I shortened it TO just '3.0')) works for me... thanks for everyones work here, many praises! =)

happy daze

#161

omerida - October 20, 2009 - 16:50

@nicof, re #151 - see my patch in #143 for js aggregation

#162

Starnox - October 20, 2009 - 19:26

#160 worked great. Cheers

#163

TwoD - October 21, 2009 - 00:59

Please continue 3.0.1 discussion in #610132: CKEditor 3.0.1, stylesheets and version check. or create a new issue if it's something else.

#164

sun - October 29, 2009 - 01:35
Status:fixed» needs work

+++ editors/ckeditor.inc 20 Oct 2009 02:26:00 -0000
@@ -17,11 +17,15 @@ function wysiwyg_ckeditor_editor() {
-        'files' => array('ckeditor_source.js'),
+         'files' => array(

Problem. :)

+++ editors/ckeditor.inc 20 Oct 2009 02:26:00 -0000
@@ -76,7 +87,17 @@ function wysiwyg_ckeditor_version($edito
+  $dir_handle = @opendir($path) or drupal_set_message('Unable to open ' . $path, $type = 'error');

dsm() does neither end the request nor prevent this function from proceeding. Hence, the or statement is completely wrong here.

Furthermore,

1) the message will never be displayed, because the editor library would not exist in the first place.

2) the message string does not use t(), and therefore, it's not translatable, and furthermore, $path is being displayed totally unsanitized here.

+++ editors/ckeditor.inc 20 Oct 2009 02:26:00 -0000
@@ -76,7 +87,17 @@ function wysiwyg_ckeditor_version($edito
+    if($file!="." && $file!=".." && $file!="CVS" && $file!=".svn") {

1) There should be a space after an if statement.

2) There should be a space between comparison values.

3) Only use double quotes whenever technically needed. Otherwise, always use single quotes.

+++ editors/ckeditor.inc 20 Oct 2009 02:26:00 -0000
@@ -95,23 +116,27 @@ function wysiwyg_ckeditor_themes($editor
+    // Skin is not really the same as theme.
+    'theme' => 'default',
+    'skin' => $theme,

Now that I know that it's not the same - what is it? :P

+++ editors/ckeditor.inc 20 Oct 2009 02:26:00 -0000
@@ -119,11 +144,24 @@ function wysiwyg_ckeditor_settings($edit
+  // Language
...
+  // Resizing button
...
+  //Toolbar location

1) Missing trailing period (full-stop).

2) Missing leading space in third comment.

3) These inline comments technically do not explain anything one could not obviously figure out by reading the actual code, so they can be removed altogether.

+++ editors/ckeditor.inc 20 Oct 2009 02:26:00 -0000
@@ -177,7 +238,29 @@ function wysiwyg_ckeditor_plugin_setting
+ * Excluded native plugins: About, Button, Checkbox, Form, HiddenField,
+ * ImageButton, NewPage, PageBreak, Print, Radio, Select, Save, TextField,
+ * Textarea, Templates.

Alrighty - if we start to document them, then we also need to document why we omitted them. ;)

+++ editors/js/ckeditor-3.0.js 20 Oct 2009 02:26:00 -0000
@@ -8,6 +38,75 @@ Drupal.wysiwyg.editor.attach.ckeditor =
+  settings.on = {
+    // Event handlers.
+    instanceReady: function(ev) {
+      var editor = ev.editor;
+      var dtd = CKEDITOR.dtd;
+      var tags = CKEDITOR.tools.extend( {}, dtd.$block, dtd.$listItem, dtd.$tableContent );
+      if (settings.apply_source_formatting) {
...
+        for (var tag in tags) {
+          if (tag == 'pre') {
...
+          this.dataProcessor.writer.setRules(tag, {
...
+        for (var key in tags) {
+          if (tag == 'pre') {
...
+          this.dataProcessor.writer.setRules(tag, {

(++etc) ugh - what happens here? :) I CAN HAZ SOME INLINE DOCS PLZ? :-D

+++ editors/js/ckeditor-3.0.js 20 Oct 2009 02:26:00 -0000
@@ -8,6 +38,75 @@ Drupal.wysiwyg.editor.attach.ckeditor =
+        });
+  }
+    }

Strange indentation.

This review is powered by Dreditor.

#165

TwoD - October 29, 2009 - 03:47

Ok, I'm staring myself blind at this code...
How about these changes to fix the errors in that committed patch?
Also pulled in the ckeditor patch from #612954: Broken editor settings. to do the cleanup in one place.

AttachmentSize
wysiwyg-HEAD-ckeditor-cleanup.patch 4.79 KB

#166

TwoD - October 29, 2009 - 03:52
Status:needs work» needs review

Status should change too of course...
Note that to actually use CKEditor with D7 HEAD, you'll need the patch from #612954 too as the API has changed.

#167

sun - October 29, 2009 - 04:03

+++ editors/ckeditor.inc 29 Oct 2009 03:29:42 -0000
@@ -24,7 +24,7 @@ function wysiwyg_ckeditor_editor() {
         'title' => 'Source',
          'files' => array(
-          'ckeditor_source.js' => array('preprocess' => FALSE),
+           'ckeditor_source.js' => array('preprocess' => FALSE),
         ),

hah - almost! :) Only the indentation on 'files' went wrong in the previous patch, the rest is fine. ;)

+++ editors/ckeditor.inc 29 Oct 2009 03:29:42 -0000
@@ -92,15 +92,20 @@ function wysiwyg_ckeditor_version($edito
+  $dir_handle = @opendir($path);
+  if ($dir_handle) {
+    $themes = array(); 
+    while ($file = readdir($dir_handle)) {
+      if ($file != '.' && $file != '..' && $file != 'CVS' && $file != '.svn') {
+        $themes[] = $file;
+      }
     }
+    closedir($dir_handle);

On a second thought, I wonder what this code actually wants to retrieve... I guess, directories. However, there's no condition that would ensure we're not reading a file.

PHP's error suppression we generally try to avoid in Drupal, so the first two lines should actually look like:

if (file_exists($path) && ($dir_handle = opendir($path))) {
  ...
}

+++ editors/js/ckeditor-3.0.js 29 Oct 2009 03:29:42 -0000
@@ -36,13 +36,16 @@ Drupal.wysiwyg.editor.attach.ckeditor =
+      // See http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Output_Formatting.

@see

+++ editors/js/ckeditor-3.0.js 29 Oct 2009 03:29:42 -0000
@@ -58,7 +61,7 @@ Drupal.wysiwyg.editor.attach.ckeditor =
-        for (var key in tags) {
+        for (var tag in tags) {

hah, nice! ;)

I'm on crack. Are you, too?

#168

TwoD - October 29, 2009 - 04:52

I could have sworn I changed the files line...
Thanks for the reviews btw.

AttachmentSize
wysiwyg-HEAD-ckeditor-cleanup2.patch 4.78 KB

#169

TwoD - October 29, 2009 - 16:49

+++ editors/ckeditor.inc 29 Oct 2009 04:47:25 -0000
@@ -92,15 +92,19 @@ function wysiwyg_ckeditor_version($edito
+      if (is_dir($file) && $file != '.' && $file != '..' && $file != 'CVS' && $file != '.svn') {

Should have been:

+      if (is_dir($path . $file) && $file != '.' && $file != '..' && $file != 'CVS' && $file != '.svn') {

This review is powered by Dreditor.

#170

realityloop - October 29, 2009 - 22:48
Status:needs review» needs work

Paste From Word button doesn't currently appear when checked

#171

agerson - October 29, 2009 - 22:49

subscribe

#172

samhassell - November 4, 2009 - 04:12

subscribe

#173

seniorheff - November 4, 2009 - 18:25

The horizontal rule button does not appear when checked as well, along with a couple of others.

#174

Yas375 - November 5, 2009 - 07:31

what patch or patches you have to use? my patch from #140 or patch from TwoD?

#175

realityloop - November 9, 2009 - 22:14

I'm using patch @ #168

#176

Niels Hackius - November 10, 2009 - 19:04

I am using #168 with #169.

The Word Problem is due to "PasteWord" instead of "PasteFromWord" in "editors/ckeditor.inc"

I don't know if this patch is any use, but I'll attach it anyway (against HEAD)

The definition of all the buttons can be found here: http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Toolbar

AttachmentSize
wysiwyg-462146_176.patch 893 bytes

#177

realityloop - November 10, 2009 - 21:21

That worked for me, thanks Nick! #176

#178

TwoD - November 14, 2009 - 03:23
Status:needs work» needs review

I've fixed the issues mentioned here since my last patch plus a few others from various threads.
I could not confirm the missing Horizontal rule button though, but I did notice inserted hr tags were invisible in D7, which is forced by the Seven theme's style.css.

Please note that you have to re-save the CKEditor profiles for the button name fixes to take effect.

AttachmentSize
wysiwyg-HEAD-ckeditor-cleanup3.patch 6.85 KB

#179

eloqerk - November 14, 2009 - 16:56

subscribe

#180

jim0203 - November 15, 2009 - 13:02

Sub.

#181

TwoD - November 16, 2009 - 13:02

Could someone please verify that the patch in #178 works? I'd like to get fixed asap. We have a ton of subscribers here, could someone please spare a few minutes?

#182

sun - November 16, 2009 - 13:56
Status:needs review» reviewed & tested by the community

Looks good :)

I didn't test, but the code looks fine, and we are low on testers in general anyway. I'm sure "they" will complain if anything no longer works in the new snapshot. ;)

#183

jide - November 16, 2009 - 15:03

I encountered a bug with the implementation of Drupal.wysiwyg.plugins[pluginName].invoke.

var data = { format: 'html', node: editor.getSelection().getSelectedElement() };

data.node is null for me.

After some digging, I found that :

- According to http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dom.selection.htm... :
Returns: {CKEDITOR.dom.element} The selected element. Null if no selection is available or the selection type is not CKEDITOR.SELECTION_ELEMENT.
- It turns out that editor.getSelection().getType() returns 2, which is CKEDITOR.SELECTION_TEXT.
- It seems that we may return editor.getSelection().getSelectedElement().$ instead, but I am not sure it is required.

This bug would only affect plugins that use the data object, that's why it is not obvious right now, since the only default plugin right now is Break and it does not use the data content.

#184

TwoD - November 16, 2009 - 19:51

Thanks for the code review sun! Good point about the snapshot. ;)

Nice find jide! There's an issue somewhere about the data object not being the same for all editors (given the same content and selection), maybe we should cross reference with that issue? (I'm just in for a quick peek now so I don't have time to search for it.) Did everything else seem ok?

#185

TwoD - November 17, 2009 - 16:27
Status:reviewed & tested by the community» fixed

The attached patch is now committed to all relevand branches and will soon be in the snapshots. Thanks again to everyone for reviewing, testing, finding bugs and providing patches or otherwise helping to get this done!

The difference between cleanup 3 and 4 are some tweaks to wysiwyg_ckeditor_themes(). Fixed the typo $file . $file and added an extra check so we don't return an empty array. The filename check was changed to ignore all files starting with a single '.', which includes the current dir (.), the parent dir (..), GIT repository/checkout files (.git), Subversion checkout files (.svn) and all other hidden files/folders in Unix/Linux environments. The 'CVS' folder remains a special case.

I'm leaving the issue jide mentions in #183 to be fixed in #613944: data.node object only present in TinyMCE so all the involved editors are synced at the same time.

AttachmentSize
wysiwyg-HEAD-ckeditor-cleanup4.patch 6.86 KB

#186

AdrianB - November 19, 2009 - 16:35

Great!

#187

Yas375 - November 22, 2009 - 15:34

good job, TwoD! thanks!

#188

jakewalk - November 23, 2009 - 10:06

I installed the latest 6.x-2.x-dev (2009-11-22) and it seems to work together with the latest ckeditor, but how do I change the skin? It appears as it uses the v2 skin, but I'd like to use the new kama skin. Where do I change that setting? I added config.skins = 'kama';
to the config.js, but without success. Is that supposed to work?

#189

igorik - November 23, 2009 - 10:42

@jakewalk - Start new issue about your problem, this issue was about implementation CKEditor and this is fixed.

#190

TwoD - November 23, 2009 - 12:33

Just FYI since I mentioned skins/themes with the committed patch.
Skin/Theme changing is not fully implemented in the GUI yet. Only CKEditor reports which skins are installed (though it uses the theme functions for that for now).
You can not change the skin using the config file because settings from the server are sent as parameters directly to the CKEDITOR.replace() method, which have the highest priority. You can overriding those settings using the technique in comment #30, #313497: Allow to configure advanced editor settings until #414496: Allow to select editor theme/skin is fixed.

 
 

Drupal is a registered trademark of Dries Buytaert.