@ckeditor/ckeditor5-adapter-ckfinder
Advanced tools
Comparing version 28.0.0 to 29.0.0
@@ -5,2 +5,2 @@ /*! | ||
*/ | ||
window.CKEditor5=window.CKEditor5||{},window.CKEditor5.adapterCkfinder=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(e,t,r){e.exports=r(1)("./src/upload.js")},function(e,t){e.exports=CKEditor5.dll},function(e,t,r){e.exports=r(1)("./src/core.js")},function(e,t,r){"use strict";r.r(t);var n=r(2),o=r(0);function i(){let e=function(e){e=e.toLowerCase();const t=document.cookie.split(";");for(const r of t){const t=r.split("=");if(decodeURIComponent(t[0].trim().toLowerCase())===e)return decodeURIComponent(t[1])}return null}("ckCsrfToken");var t,r;return e&&40==e.length||(e=function(e){let t="";const r=new Uint8Array(e);window.crypto.getRandomValues(r);for(let e=0;e<r.length;e++){const n="abcdefghijklmnopqrstuvwxyz0123456789".charAt(r[e]%"abcdefghijklmnopqrstuvwxyz0123456789".length);t+=Math.random()>.5?n.toUpperCase():n}return t}(40),t="ckCsrfToken",r=e,document.cookie=encodeURIComponent(t)+"="+encodeURIComponent(r)+";path=/"),e}class s extends n.Plugin{static get requires(){return[o.FileRepository]}static get pluginName(){return"CKFinderUploadAdapter"}init(){const e=this.editor.config.get("ckfinder.uploadUrl");e&&(this.editor.plugins.get(o.FileRepository).createUploadAdapter=t=>new d(t,e,this.editor.t))}}class d{constructor(e,t,r){this.loader=e,this.url=t,this.t=r}upload(){return this.loader.file.then(e=>new Promise((t,r)=>{this._initRequest(),this._initListeners(t,r,e),this._sendRequest(e)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const e=this.xhr=new XMLHttpRequest;e.open("POST",this.url,!0),e.responseType="json"}_initListeners(e,t,r){const n=this.xhr,o=this.loader,i=(0,this.t)("Cannot upload file:")+` ${r.name}.`;n.addEventListener("error",()=>t(i)),n.addEventListener("abort",()=>t()),n.addEventListener("load",()=>{const r=n.response;if(!r||!r.uploaded)return t(r&&r.error&&r.error.message?r.error.message:i);e({default:r.url})}),n.upload&&n.upload.addEventListener("progress",e=>{e.lengthComputable&&(o.uploadTotal=e.total,o.uploaded=e.loaded)})}_sendRequest(e){const t=new FormData;t.append("upload",e),t.append("ckCsrfToken",i()),this.xhr.send(t)}}t.default={UploadAdapter:s}}]).default; | ||
window.CKEditor5=window.CKEditor5||{},window.CKEditor5.adapterCkfinder=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(e,t,r){e.exports=r(1)("./src/upload.js")},function(e,t){e.exports=CKEditor5.dll},function(e,t,r){e.exports=r(1)("./src/core.js")},function(e,t,r){"use strict";r.r(t),r.d(t,"UploadAdapter",(function(){return s}));var n=r(2),o=r(0);function i(){let e=function(e){e=e.toLowerCase();const t=document.cookie.split(";");for(const r of t){const t=r.split("=");if(decodeURIComponent(t[0].trim().toLowerCase())===e)return decodeURIComponent(t[1])}return null}("ckCsrfToken");var t,r;return e&&40==e.length||(e=function(e){let t="";const r=new Uint8Array(e);window.crypto.getRandomValues(r);for(let e=0;e<r.length;e++){const n="abcdefghijklmnopqrstuvwxyz0123456789".charAt(r[e]%"abcdefghijklmnopqrstuvwxyz0123456789".length);t+=Math.random()>.5?n.toUpperCase():n}return t}(40),t="ckCsrfToken",r=e,document.cookie=encodeURIComponent(t)+"="+encodeURIComponent(r)+";path=/"),e}class s extends n.Plugin{static get requires(){return[o.FileRepository]}static get pluginName(){return"CKFinderUploadAdapter"}init(){const e=this.editor.config.get("ckfinder.uploadUrl");e&&(this.editor.plugins.get(o.FileRepository).createUploadAdapter=t=>new d(t,e,this.editor.t))}}class d{constructor(e,t,r){this.loader=e,this.url=t,this.t=r}upload(){return this.loader.file.then(e=>new Promise((t,r)=>{this._initRequest(),this._initListeners(t,r,e),this._sendRequest(e)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const e=this.xhr=new XMLHttpRequest;e.open("POST",this.url,!0),e.responseType="json"}_initListeners(e,t,r){const n=this.xhr,o=this.loader,i=(0,this.t)("Cannot upload file:")+` ${r.name}.`;n.addEventListener("error",()=>t(i)),n.addEventListener("abort",()=>t()),n.addEventListener("load",()=>{const r=n.response;if(!r||!r.uploaded)return t(r&&r.error&&r.error.message?r.error.message:i);e({default:r.url})}),n.upload&&n.upload.addEventListener("progress",e=>{e.lengthComputable&&(o.uploadTotal=e.total,o.uploaded=e.loaded)})}_sendRequest(e){const t=new FormData;t.append("upload",e),t.append("ckCsrfToken",i()),this.xhr.send(t)}}}]); |
{ | ||
"name": "@ckeditor/ckeditor5-adapter-ckfinder", | ||
"version": "28.0.0", | ||
"version": "29.0.0", | ||
"description": "CKFinder adapter for CKEditor 5.", | ||
@@ -14,19 +14,19 @@ "keywords": [ | ||
"dependencies": { | ||
"ckeditor5": "^28.0.0" | ||
"ckeditor5": "^29.0.0" | ||
}, | ||
"devDependencies": { | ||
"@ckeditor/ckeditor5-basic-styles": "^28.0.0", | ||
"@ckeditor/ckeditor5-core": "^28.0.0", | ||
"@ckeditor/ckeditor5-clipboard": "^28.0.0", | ||
"@ckeditor/ckeditor5-basic-styles": "^29.0.0", | ||
"@ckeditor/ckeditor5-core": "^29.0.0", | ||
"@ckeditor/ckeditor5-clipboard": "^29.0.0", | ||
"@ckeditor/ckeditor5-dev-utils": "^25.0.0", | ||
"@ckeditor/ckeditor5-editor-classic": "^28.0.0", | ||
"@ckeditor/ckeditor5-enter": "^28.0.0", | ||
"@ckeditor/ckeditor5-heading": "^28.0.0", | ||
"@ckeditor/ckeditor5-image": "^28.0.0", | ||
"@ckeditor/ckeditor5-list": "^28.0.0", | ||
"@ckeditor/ckeditor5-paragraph": "^28.0.0", | ||
"@ckeditor/ckeditor5-theme-lark": "^28.0.0", | ||
"@ckeditor/ckeditor5-typing": "^28.0.0", | ||
"@ckeditor/ckeditor5-undo": "^28.0.0", | ||
"@ckeditor/ckeditor5-upload": "^28.0.0", | ||
"@ckeditor/ckeditor5-editor-classic": "^29.0.0", | ||
"@ckeditor/ckeditor5-enter": "^29.0.0", | ||
"@ckeditor/ckeditor5-heading": "^29.0.0", | ||
"@ckeditor/ckeditor5-image": "^29.0.0", | ||
"@ckeditor/ckeditor5-list": "^29.0.0", | ||
"@ckeditor/ckeditor5-paragraph": "^29.0.0", | ||
"@ckeditor/ckeditor5-theme-lark": "^29.0.0", | ||
"@ckeditor/ckeditor5-typing": "^29.0.0", | ||
"@ckeditor/ckeditor5-undo": "^29.0.0", | ||
"@ckeditor/ckeditor5-upload": "^29.0.0", | ||
"webpack": "^4.43.0", | ||
@@ -33,0 +33,0 @@ "webpack-cli": "^3.3.11" |
@@ -5,4 +5,4 @@ CKFinder adapter for CKEditor 5 | ||
[![npm version](https://badge.fury.io/js/%40ckeditor%2Fckeditor5-adapter-ckfinder.svg)](https://www.npmjs.com/package/@ckeditor/ckeditor5-adapter-ckfinder) | ||
[![Dependency Status](https://david-dm.org/ckeditor/ckeditor5-adapter-ckfinder/status.svg)](https://david-dm.org/ckeditor/ckeditor5-adapter-ckfinder) | ||
[![devDependency Status](https://david-dm.org/ckeditor/ckeditor5-adapter-ckfinder/dev-status.svg)](https://david-dm.org/ckeditor/ckeditor5-adapter-ckfinder?type=dev) | ||
[![Coverage Status](https://coveralls.io/repos/github/ckeditor/ckeditor5/badge.svg?branch=master)](https://coveralls.io/github/ckeditor/ckeditor5?branch=master) | ||
[![Build Status](https://travis-ci.com/ckeditor/ckeditor5.svg?branch=master)](https://travis-ci.com/ckeditor/ckeditor5) | ||
@@ -9,0 +9,0 @@ This package implements a CKEditor 5 upload adapter compatible with the [CKFinder file manager and uploader](https://ckeditor.com/ckfinder/)'s server–side connector. |
@@ -20,7 +20,7 @@ /** | ||
* | ||
* See the {@glink features/image-upload/ckfinder "CKFinder file manager integration" guide} to learn how to configure | ||
* See the {@glink features/images/image-upload/ckfinder "CKFinder file manager integration" guide} to learn how to configure | ||
* and use this feature as well as find out more about the full integration with the file manager | ||
* provided by the {@link module:ckfinder/ckfinder~CKFinder} plugin. | ||
* | ||
* Check out the {@glink features/image-upload/image-upload comprehensive "Image upload overview"} to learn about | ||
* Check out the {@glink features/images/image-upload/image-upload comprehensive "Image upload overview"} to learn about | ||
* other ways to upload images into CKEditor 5. | ||
@@ -27,0 +27,0 @@ * |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
87352
+ Added@ckeditor/ckeditor5-clipboard@29.2.0(transitive)
+ Added@ckeditor/ckeditor5-core@29.2.0(transitive)
+ Added@ckeditor/ckeditor5-engine@29.2.0(transitive)
+ Added@ckeditor/ckeditor5-enter@29.2.0(transitive)
+ Added@ckeditor/ckeditor5-paragraph@29.2.0(transitive)
+ Added@ckeditor/ckeditor5-select-all@29.2.0(transitive)
+ Added@ckeditor/ckeditor5-typing@29.2.0(transitive)
+ Added@ckeditor/ckeditor5-ui@29.2.0(transitive)
+ Added@ckeditor/ckeditor5-undo@29.2.0(transitive)
+ Added@ckeditor/ckeditor5-upload@29.2.0(transitive)
+ Added@ckeditor/ckeditor5-utils@29.2.0(transitive)
+ Added@ckeditor/ckeditor5-widget@29.2.0(transitive)
+ Addedckeditor5@29.2.0(transitive)
- Removed@ckeditor/ckeditor5-clipboard@28.0.0(transitive)
- Removed@ckeditor/ckeditor5-core@28.0.0(transitive)
- Removed@ckeditor/ckeditor5-engine@28.0.0(transitive)
- Removed@ckeditor/ckeditor5-enter@28.0.0(transitive)
- Removed@ckeditor/ckeditor5-paragraph@28.0.0(transitive)
- Removed@ckeditor/ckeditor5-select-all@28.0.0(transitive)
- Removed@ckeditor/ckeditor5-typing@28.0.0(transitive)
- Removed@ckeditor/ckeditor5-ui@28.0.0(transitive)
- Removed@ckeditor/ckeditor5-undo@28.0.0(transitive)
- Removed@ckeditor/ckeditor5-upload@28.0.0(transitive)
- Removed@ckeditor/ckeditor5-utils@28.0.0(transitive)
- Removed@ckeditor/ckeditor5-widget@28.0.0(transitive)
- Removedckeditor5@28.0.0(transitive)
Updatedckeditor5@^29.0.0