editor/js/ckeditor-3.0.js does not allow for the inclusion of CKEditor's default custom config file (config.js).

CommentFileSizeAuthor
#1 ckeditor-3.0.js_.patch97 bytesEtherZa
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

EtherZa’s picture

FileSize
97 bytes

Attached patch

cpo’s picture

same problem

but I don't find "CKEDITOR.config.customConfig" in ckeditor.js (ckeditor 3.3).

Can you give us the filename please ?
thanks

cpo’s picture

I find it in ceditor-3, but no effect for me.

cpo’s picture

bug report in ckeditor website => don't use config.js file name. Rename it (for exemple myconfig.js or config-personal.js,...)

TwoD’s picture

Status: Active » Closed (won't fix)

Umm, Wysiwyg module doesn't need to set this option. It sends all the settings it needs as an argument to the function creating the editor instances. And as we aim to let our users avoid modifying Wysiwyg itself or the editor library files (to ease upgrading etc), there's no point in setting this option ourselves.

Anything set in a custom config file would be overridden by the settings passed directly to the instance anyway.

If you need to modify the settings created by Wysiwyg - before we have a proper GUI to do so from within Drupal - you can implement hook_wysiwyg_editor_settings_alter() in a small custom module. (You could even set customConfig via that hook, but settings that Wysiwyg uses would still have to be modified in the hook implementation because of them overriding the file.)

The settings overload order can be seen on http://docs.cksource.com/CKEditor_3.x/Developers_Guide/Setting_Configura...
The last entry in that list (nr 4) would be the settings Wysiwyg passes directly during instance creation, "in page" as they call it.

You could of course use a customConfig file to set things which Wysiwyg doesn't define. But if we implement GUI widgets for these settings in the future, the values set via them would get the highest "priority".

TwoD’s picture

Status: Closed (won't fix) » Closed (works as designed)

"By design" is probably closer, since we didn't set customConfig on purpose.

Btw, please use the -up switches (if you're using the diff tool) so we get the code context in patches, and +/- instead of >/<.

BlackCatWeb’s picture

Component: Editor - CKeditor » Code

In case someone Googling wants a solution based on the above comment, just implement a module that includes a definition for hook_wysiwyg_editor_settings_alter() with the following code:

function my_module_name_wysiwyg_editor_settings_alter(&$settings, &$context) {
  if ($context['profile']->editor == 'ckeditor') {
    // select 'spell-check-as-you-type' option by default on startup
    $settings['scayt_autoStartup'] = true;
  }
}

This worked for me under CKEditor version 3.4.2.

freestone’s picture

This does not work for me. I have read everywhere about how to turn SCAYT on at start with no success at all. Clear to me that WYSIWYG is overriding but I turn on this module and it does nothing. I am running CKEditor 3.5.1.6398 and WYSIWYG 6.x-2.x-dev .... as said here setting this in confi.js under the CKeditor library also does nothing.

Unless someone has other options I guess I try the CKeditor module instead....

Is there anyother way to get a SCYAT in Drupal....why the heck do all these editors interfere with the native spell checkers in the browser....don't they all have them now?... Safari in Windows is the only thing that just checks regardless of what the editor seems to interfere with.

TwoD’s picture

No, several browsers don't, and some people still use older versions. :/

SCAYT's really another issue, but adding a small module with the above hook implementation (replacing 'my_module_name' with the actual name of your module) will do the trick if the SCAYT button has been enabled too.
($context is not intended to be passed by reference, but it won't break things)

MYMODULE.module

function MYMODULE_wysiwyg_editor_settings_alter(&$settings, $context) {
  if ($context['profile']->editor == 'ckeditor') {
    // select 'spell-check-as-you-type' option by default on startup
    $settings['scayt_autoStartup'] = true;
    // Example of setting customConfig option. Just note it gets overridden by values in $settings.
    $settings['customConfig'] = 'path/to/my/config.js';
  }
}

MYMODULE.info

name = MYMODULE
description = My dev tweaks.
core = 6.x
freestone’s picture

Thanks twod I might re-visit this great module later.... I need to move on and so I installed CKEditor and CKFinder and it all works exactly like documented and is very flexible and also works with WYSIWYG Filter module.

Once you get your module where you can control all from the UI is will be great.

rjacobs’s picture

Thanks to #7 and #9 I was able to crank out a little custom module that allows me to dynamically specify custom (global) ckeditor settings via a form at admin/config/content/ckeditor_settings. I'm simply storing these as as key|value pairs defined in a text box. It seems to work quite well, and I'd be happy to share more (just some hook_menu stuff) if that's of value to anyone.

This approach still seems a little limited as it doesn't allow custom settings to be applied per-profile, or better yet, per-theme. Would it make sense to have wysiwyg (with ckeditor) search the active theme directory for a ckeditor.config.js file where custom settings could be added?

Anyway, I see this is 'closed', so perhaps the goal is to incorporate more custom options via the GUI (per-profile) directly?

Ryan

TwoD’s picture

Yes, the idea is that #313497: Allow configuration of advanced editor settings will move most of the GUI out to the editor implementations. No need to read that huge issue btw, no official code released yet, but since #277954: Allow to sort editor buttons got rolling recently I've been sketching on solutions to the first issue.

HeathN’s picture

Issue summary: View changes

#7 only works if I update to the dev release of WYSIWYG