angular-ckeditor.min.js 1.4 KB

12
  1. !function(a,b){"function"==typeof define&&define.amd?define(["angular"],b):b(angular)}(this,function(a){function b(a){return{restrict:"A",require:["ckeditor","ngModel"],controller:["$scope","$element","$attrs","$parse","$q",c],link:function(b,c,e,f){var g=f[0],h=f[1];g.ready().then(function(){["dataReady","change","saveSnapshot"].forEach(function(a){g.$on(a,function(){h.$setViewValue(g.instance.getData()||"")})}),g.instance.setReadOnly(!1),d(function(){a(e.ready)(b)})}),h.$render=function(){g.ready().then(function(){g.instance.setData(h.$viewValue||"")})}}}}function c(a,b,c,e,f){var g,h=e(c.ckeditor)(a)||{},i=b[0];g=this.instance=i.hasAttribute("contenteditable")&&"true"==i.getAttribute("contenteditable").toLowerCase()?CKEDITOR.inline(i,h):CKEDITOR.replace(i,h),this.$on=function(b,c){function e(){var a=arguments;d(function(){f.apply(null,a)})}function f(){var b=arguments;a.$apply(function(){c.apply(null,b)})}return g.on(b,e),function(){g.removeListener(b,f)}},this.ready=function(){if(this.readyDefer)return this.readyDefer.promise;var a=this.readyDefer=f.defer();return"ready"===this.instance.status?a.resolve():this.$on("instanceReady",a.resolve),a.promise},a.$on("$destroy",function(){g.destroy(!1)})}a.module("ckeditor",[]).directive("ckeditor",["$parse",b]);var d=window&&window.setImmediate?window.setImmediate:function(a){setTimeout(a,0)}});
  2. //# sourceMappingURL=angular-ckeditor.min.map