Skip to content

Commit

Permalink
Merge branch 't/11856' into major
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Jasiun committed Dec 16, 2014
2 parents b709b28 + 99438b9 commit 0a6108f
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -27,6 +27,7 @@ Fixed Issues:
Other Changes:

* [#10903](http://dev.ckeditor.com/ticket/10903): Performance improvements for [`addClass`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.element-method-addClass), [`removeClass`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.element-method-removeClass) and [`hasClass`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.element-method-hasClass) methods.
* [#11856](http://dev.ckeditor.com/ticket/11856): jQuery adapter throw an meaningful error if CKEditor or jQuery is not loaded.

## CKEditor 4.4.7

Expand Down
11 changes: 8 additions & 3 deletions adapters/jquery.js
Expand Up @@ -19,6 +19,14 @@
*/

( function( $ ) {
if ( typeof $ == 'undefined' ) {
throw new Error( 'jQuery should be loaded before CKEditor adapter. Have you mistaken loaded scripts order?' );
}

if ( typeof CKEDITOR == 'undefined' ) {
throw new Error( 'CKEditor core should be loaded before jQuery adapter. Have you mistaken loaded scripts order?' );
}

/**
* Allows CKEditor to override `jQuery.fn.val()`. When set to `true`, the `val()` function
* used on textarea elements replaced with CKEditor uses the CKEditor API.
Expand Down Expand Up @@ -47,9 +55,6 @@
:
CKEDITOR.config.jqueryOverrideVal;

if ( typeof $ == 'undefined' )
return;

// jQuery object methods.
$.extend( $.fn, {
/**
Expand Down
3 changes: 3 additions & 0 deletions tests/adapters/jquery/manual/nockeditor.html
@@ -0,0 +1,3 @@
<script>
delete window.CKEDITOR;
</script>
4 changes: 4 additions & 0 deletions tests/adapters/jquery/manual/nockeditor.md
@@ -0,0 +1,4 @@
@bender-ckeditor-adapters: jquery
@bender-tags: 4.5.0, tc, jquery

There should be an error telling that `CKEditor core should be loaded before jQuery adapter`.
1 change: 1 addition & 0 deletions tests/adapters/jquery/manual/nojquery.html
@@ -0,0 +1 @@
<script src="%BASE_PATH%../apps/ckeditor/adapters/jquery.js" ></script>
3 changes: 3 additions & 0 deletions tests/adapters/jquery/manual/nojquery.md
@@ -0,0 +1,3 @@
@bender-tags: 4.5.0, tc

There should be an error telling that `jQuery should be loaded before CKEditor adapter`.

0 comments on commit 0a6108f

Please sign in to comment.