summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsun2010-11-13 18:53:15 (GMT)
committer sun2010-11-13 18:53:15 (GMT)
commit73c8b5a8f56b38bdac641594c5e63f0bf5694ebc (patch)
tree4bc806884801f72577b9a192145bb8ceb67da220
parent76bbca67252d35f7e8d8b1f2fae3ff46a06f4ecc (diff)
#497654 by TwoD: Fixed Drupal plugins disabled in FCKeditor/WebKit browsers.
-rw-r--r--CHANGELOG.txt1
-rw-r--r--editors/js/fckeditor-2.6.js4
-rw-r--r--wysiwyg.init.js12
3 files changed, 17 insertions, 0 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 7d3618f..5b2f45a 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -12,6 +12,7 @@ Wysiwyg 7.x-2.x, xxxx-xx-xx
Wysiwyg 6.x-2.x, xxxx-xx-xx
---------------------------
+#497654 by TwoD: Fixed Drupal plugins disabled in FCKeditor/WebKit browsers.
#735624 by sun: Fixed enabling one button removes default editor toolbar.
#755610 by sun, TwoD, BrightBold: Fixed white-space in block formats setting
breaks editors.
diff --git a/editors/js/fckeditor-2.6.js b/editors/js/fckeditor-2.6.js
index 4fa7439..8167770 100644
--- a/editors/js/fckeditor-2.6.js
+++ b/editors/js/fckeditor-2.6.js
@@ -135,6 +135,10 @@ Drupal.wysiwyg.editor.instance.fckeditor = {
return FCK_TRISTATE_DISABLED;
}
var state = instance.FCK.GetNamedCommandState(this.Name);
+ // FCKeditor sets the wrong state in WebKit browsers.
+ if (!$.support.queryCommandEnabled && state == FCK_TRISTATE_DISABLED) {
+ state = FCK_TRISTATE_OFF;
+ }
if (state == FCK_TRISTATE_OFF && instance.FCK.EditMode == FCK_EDITMODE_WYSIWYG) {
if (typeof Drupal.wysiwyg.plugins[plugin].isNode == 'function') {
var node = instance.FCKSelection.GetSelectedElement();
diff --git a/wysiwyg.init.js b/wysiwyg.init.js
index b6a7b77..469cace 100644
--- a/wysiwyg.init.js
+++ b/wysiwyg.init.js
@@ -6,3 +6,15 @@ Drupal.wysiwyg.editor = Drupal.wysiwyg.editor || { 'init': {}, 'attach': {}, 'de
Drupal.wysiwyg.plugins = Drupal.wysiwyg.plugins || {};
+(function ($) {
+ // Determine support for queryCommandEnabled().
+ // An exception should be thrown for non-existing commands.
+ // Safari and Chrome (WebKit based) return -1 instead.
+ try {
+ document.queryCommandEnabled('__wysiwygTestCommand');
+ $.support.queryCommandEnabled = false;
+ }
+ catch (error) {
+ $.support.queryCommandEnabled = true;
+ }
+})(jQuery);