X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;ds=inline;f=_source%2Fadapters%2Fjquery.js;h=d95842641038c20523788cefb94f76431fbdc152;hb=2f22c0c38f17e75be5541089076885442aaa2377;hp=314c8edf85ad625a319f604fb689dc5db6a69ffa;hpb=941b0a9ba4e673e292510d80a5a86806994b8ea6;p=ckeditor.git
diff --git a/_source/adapters/jquery.js b/_source/adapters/jquery.js
index 314c8ed..d958426 100644
--- a/_source/adapters/jquery.js
+++ b/_source/adapters/jquery.js
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
+Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
@@ -32,15 +32,21 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
(function()
{
/**
- * Allow CKEditor to override jQuery.fn.val(). This results in ability to use val()
- * function on textareas as usual and having those calls synchronized with CKEditor
- * Rich Text Editor component.
- *
- * This config option is global and executed during plugin load.
- * Can't be customized across editor instances.
- *
+ * Allows CKEditor to override jQuery.fn.val(), making it possible to use the val()
+ * function on textareas, as usual, having it synchronized with CKEditor.
+ *
+ * This configuration option is global and executed during the jQuery Adapter loading.
+ * It can't be customized across editor instances.
* @type Boolean
* @example
+ * <script>
+ * CKEDITOR.config.jqueryOverrideVal = true;
+ * </script>
+ * <!-- Important: The JQuery adapter is loaded *after* setting jqueryOverrideVal -->
+ * <script src="/ckeditor/adapters/jquery.js"></script>
+ * @example
+ * // ... then later in the code ...
+ *
* $( 'textarea' ).ckeditor();
* // ...
* $( 'textarea' ).val( 'New content' );
@@ -97,6 +103,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
*/
ckeditor: function( callback, config )
{
+ if ( !CKEDITOR.env.isCompatible )
+ return this;
+
if ( !jQuery.isFunction( callback ))
{
var tmp = config;
@@ -183,10 +192,14 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
// Bind to submit event.
$element.parents( 'form' ).submit( onSubmit );
+ // Bind to form-pre-serialize from jQuery Forms plugin.
+ $element.parents( 'form' ).bind( 'form-pre-serialize', onSubmit );
+
// Unbind when editor destroyed.
$element.bind( 'destroy.ckeditor', function()
{
$element.parents( 'form' ).unbind( 'submit', onSubmit );
+ $element.parents( 'form' ).unbind( 'form-pre-serialize', onSubmit );
});
}