summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Danielsson2009-10-23 02:11:23 (GMT)
committer Henrik Danielsson2009-10-23 02:11:23 (GMT)
commitdb89031b7d4ab3303310df4470fc9b68a5c6743a (patch)
treea879d61946a31b0c92b3be0283958a5295fd7080
parenta813042044d789a3329c6eca8a190c5ef326f052 (diff)
#610132 by TwoD: Updated CKEditor 3.0.1, stylesheets and version check.
-rw-r--r--CHANGELOG.txt1
-rw-r--r--editors/ckeditor.inc25
-rw-r--r--editors/js/ckeditor-3.0.js3
3 files changed, 22 insertions, 7 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 93b15e2..ac02848 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -6,6 +6,7 @@ Wysiwyg x.x-x.x, xxxx-xx-xx
Wysiwyg 6.x-3.x, xxxx-xx-xx
---------------------------
+#610132 by TwoD: Updated CKEditor 3.0.1, stylesheets and version check.
#620858 by quicksketch: Fixed focus event not firing for CKeditor.
#462146 by TwoD, et al: Added support for CKeditor.
#585932 by sun: Synced various clean-ups from 7.x.
diff --git a/editors/ckeditor.inc b/editors/ckeditor.inc
index 7d17524..a510262 100644
--- a/editors/ckeditor.inc
+++ b/editors/ckeditor.inc
@@ -41,7 +41,7 @@ function wysiwyg_ckeditor_editor() {
),
'proxy plugin settings callback' => 'wysiwyg_ckeditor_proxy_plugin_settings',
'versions' => array(
- '3.0.3665' => array(
+ '3.0.0.3665' => array(
'js files' => array('ckeditor-3.0.js'),
),
),
@@ -65,8 +65,11 @@ function wysiwyg_ckeditor_version($editor) {
while ($max_lines && $line = fgets($library, 140)) {
// version:'CKEditor 3.0 SVN',revision:'3665'
// version:'3.0 RC',revision:'3753'
+ // version:'3.0.1',revision:'4391'
if (preg_match('@version:\'(?:CKEditor )?([\d\.]+)(?:.+revision:\'([\d]+))?@', $line, $version)) {
fclose($library);
+ // Version numbers need to have three parts since 3.0.1.
+ $version[1] = preg_replace('/^(\d+)\.(\d+)$/', '${1}.${2}.0', $version[1]);
return $version[1] . '.' . $version[2];
}
$max_lines--;
@@ -140,12 +143,22 @@ function wysiwyg_ckeditor_settings($editor, $config, $theme) {
}
if (isset($config['css_setting'])) {
- if ($config['css_setting'] == 'theme') {
- // CKeditor only supports one CSS file currently.
- $settings['contentsCss'] = reset(wysiwyg_get_css());
+ // Versions below 3.0.1 could only handle one stylesheet.
+ if (version_compare($editor['installed version'], '3.0.1.4391', '<')) {
+ if ($config['css_setting'] == 'theme') {
+ $settings['contentsCss'] = reset(wysiwyg_get_css());
+ }
+ elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) {
+ $settings['contentsCss'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme()));
+ }
}
- elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) {
- $settings['contentsCss'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme()));
+ else {
+ if ($config['css_setting'] == 'theme') {
+ $settings['contentsCss'] = wysiwyg_get_css();
+ }
+ elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) {
+ $settings['contentsCss'] = explode(',', strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())));
+ }
}
}
diff --git a/editors/js/ckeditor-3.0.js b/editors/js/ckeditor-3.0.js
index adbae69..992fa85 100644
--- a/editors/js/ckeditor-3.0.js
+++ b/editors/js/ckeditor-3.0.js
@@ -92,12 +92,13 @@ Drupal.wysiwyg.editor.attach.ckeditor = function(context, params, settings) {
editor.dataProcessor.toDataFormat = CKEDITOR.tools.override(editor.dataProcessor.toDataFormat, function(originalToDataFormat) {
// Convert WYSIWYG mode content to raw data.
return function(data, fixForBody) {
+ data = originalToDataFormat.call(this, data, fixForBody);
for (var plugin in Drupal.settings.wysiwyg.plugins[params.format].drupal) {
if (typeof Drupal.wysiwyg.plugins[plugin].detach == 'function') {
data = Drupal.wysiwyg.plugins[plugin].detach(data, Drupal.settings.wysiwyg.plugins.drupal[plugin], editor.name);
}
}
- return originalToDataFormat.call(this, data, fixForBody);
+ return data;
};
});
}