| author | ymh <ymh.work@gmail.com> |
| Wed, 09 Sep 2015 13:10:01 +0200 | |
| changeset 497 | 3ba7920facf4 |
| permissions | -rw-r--r-- |
|
497
3ba7920facf4
Correct dependency and loading problem for ckeditor with dojo
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1 |
(function (root, factory) { |
|
3ba7920facf4
Correct dependency and loading problem for ckeditor with dojo
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2 |
if (typeof define === 'function' && define.amd) { |
|
3ba7920facf4
Correct dependency and loading problem for ckeditor with dojo
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3 |
// AMD. Register as an anonymous module unless amdModuleId is set |
|
3ba7920facf4
Correct dependency and loading problem for ckeditor with dojo
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4 |
define('ckeditor-jquery', ["jquery","ckeditor"], function (a0,b1) { |
|
3ba7920facf4
Correct dependency and loading problem for ckeditor with dojo
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5 |
return (factory(a0,b1)); |
|
3ba7920facf4
Correct dependency and loading problem for ckeditor with dojo
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6 |
}); |
|
3ba7920facf4
Correct dependency and loading problem for ckeditor with dojo
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7 |
} else if (typeof exports === 'object') { |
|
3ba7920facf4
Correct dependency and loading problem for ckeditor with dojo
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8 |
// Node. Does not work with strict CommonJS, but |
|
3ba7920facf4
Correct dependency and loading problem for ckeditor with dojo
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
9 |
// only CommonJS-like environments that support module.exports, |
|
3ba7920facf4
Correct dependency and loading problem for ckeditor with dojo
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
10 |
// like Node. |
|
3ba7920facf4
Correct dependency and loading problem for ckeditor with dojo
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
11 |
module.exports = factory(require("jquery"),require("ckeditor")); |
|
3ba7920facf4
Correct dependency and loading problem for ckeditor with dojo
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
12 |
} else { |
|
3ba7920facf4
Correct dependency and loading problem for ckeditor with dojo
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
13 |
factory(jquery,ckeditor); |
|
3ba7920facf4
Correct dependency and loading problem for ckeditor with dojo
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
14 |
} |
|
3ba7920facf4
Correct dependency and loading problem for ckeditor with dojo
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
15 |
}(this, function (jquery, ckeditor) { |
|
3ba7920facf4
Correct dependency and loading problem for ckeditor with dojo
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
16 |
|
|
3ba7920facf4
Correct dependency and loading problem for ckeditor with dojo
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
17 |
/* |
|
3ba7920facf4
Correct dependency and loading problem for ckeditor with dojo
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
18 |
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. |
|
3ba7920facf4
Correct dependency and loading problem for ckeditor with dojo
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
19 |
For licensing, see LICENSE.md or http://ckeditor.com/license |
|
3ba7920facf4
Correct dependency and loading problem for ckeditor with dojo
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
20 |
*/ |
|
3ba7920facf4
Correct dependency and loading problem for ckeditor with dojo
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
21 |
(function(a){CKEDITOR.config.jqueryOverrideVal="undefined"==typeof CKEDITOR.config.jqueryOverrideVal?!0:CKEDITOR.config.jqueryOverrideVal;"undefined"!=typeof a&&(a.extend(a.fn,{ckeditorGet:function(){var a=this.eq(0).data("ckeditorInstance");if(!a)throw"CKEditor is not initialized yet, use ckeditor() with a callback.";return a},ckeditor:function(g,d){if(!CKEDITOR.env.isCompatible)throw Error("The environment is incompatible.");if(!a.isFunction(g))var k=d,d=g,g=k;var i=[],d=d||{};this.each(function(){var b= |
|
3ba7920facf4
Correct dependency and loading problem for ckeditor with dojo
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
22 |
a(this),c=b.data("ckeditorInstance"),f=b.data("_ckeditorInstanceLock"),h=this,j=new a.Deferred;i.push(j.promise());if(c&&!f)g&&g.apply(c,[this]),j.resolve();else if(f)c.once("instanceReady",function(){setTimeout(function(){c.element?(c.element.$==h&&g&&g.apply(c,[h]),j.resolve()):setTimeout(arguments.callee,100)},0)},null,null,9999);else{if(d.autoUpdateElement||"undefined"==typeof d.autoUpdateElement&&CKEDITOR.config.autoUpdateElement)d.autoUpdateElementJquery=!0;d.autoUpdateElement=!1;b.data("_ckeditorInstanceLock", |
|
3ba7920facf4
Correct dependency and loading problem for ckeditor with dojo
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
23 |
!0);c=a(this).is("textarea")?CKEDITOR.replace(h,d):CKEDITOR.inline(h,d);b.data("ckeditorInstance",c);c.on("instanceReady",function(d){var e=d.editor;setTimeout(function(){if(e.element){d.removeListener();e.on("dataReady",function(){b.trigger("dataReady.ckeditor",[e])});e.on("setData",function(a){b.trigger("setData.ckeditor",[e,a.data])});e.on("getData",function(a){b.trigger("getData.ckeditor",[e,a.data])},999);e.on("destroy",function(){b.trigger("destroy.ckeditor",[e])});e.on("save",function(){a(h.form).submit(); |
|
3ba7920facf4
Correct dependency and loading problem for ckeditor with dojo
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
24 |
return!1},null,null,20);if(e.config.autoUpdateElementJquery&&b.is("textarea")&&a(h.form).length){var c=function(){b.ckeditor(function(){e.updateElement()})};a(h.form).submit(c);a(h.form).bind("form-pre-serialize",c);b.bind("destroy.ckeditor",function(){a(h.form).unbind("submit",c);a(h.form).unbind("form-pre-serialize",c)})}e.on("destroy",function(){b.removeData("ckeditorInstance")});b.removeData("_ckeditorInstanceLock");b.trigger("instanceReady.ckeditor",[e]);g&&g.apply(e,[h]);j.resolve()}else setTimeout(arguments.callee, |
|
3ba7920facf4
Correct dependency and loading problem for ckeditor with dojo
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
25 |
100)},0)},null,null,9999)}});var f=new a.Deferred;this.promise=f.promise();a.when.apply(this,i).then(function(){f.resolve()});this.editor=this.eq(0).data("ckeditorInstance");return this}}),CKEDITOR.config.jqueryOverrideVal&&(a.fn.val=CKEDITOR.tools.override(a.fn.val,function(g){return function(d){if(arguments.length){var k=this,i=[],f=this.each(function(){var b=a(this),c=b.data("ckeditorInstance");if(b.is("textarea")&&c){var f=new a.Deferred;c.setData(d,function(){f.resolve()});i.push(f.promise()); |
|
3ba7920facf4
Correct dependency and loading problem for ckeditor with dojo
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
26 |
return!0}return g.call(b,d)});if(i.length){var b=new a.Deferred;a.when.apply(this,i).done(function(){b.resolveWith(k)});return b.promise()}return f}var f=a(this).eq(0),c=f.data("ckeditorInstance");return f.is("textarea")&&c?c.getData():g.call(f)}})))})(window.jQuery); |
|
3ba7920facf4
Correct dependency and loading problem for ckeditor with dojo
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
27 |
|
|
3ba7920facf4
Correct dependency and loading problem for ckeditor with dojo
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
28 |
})); |