@ckeditor/ckeditor5-adapter-ckfinder
Advanced tools
Comparing version 34.0.0 to 34.1.0
@@ -1,5 +0,4 @@ | ||
!function(e){const t=e.en=e.en||{};t.dictionary=Object.assign(t.dictionary||{},{"Cannot upload file:":"Cannot upload file:"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})), | ||
/*! | ||
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved. | ||
* For licensing, see LICENSE.md. | ||
*/(()=>{var e={704:(e,t,o)=>{e.exports=o(79)("./src/core.js")},448:(e,t,o)=>{e.exports=o(79)("./src/upload.js")},79:e=>{"use strict";e.exports=CKEditor5.dll}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,o),s.exports}o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";o.r(r),o.d(r,{UploadAdapter:()=>a});var e=o(704),t=o(448);const n="ckCsrfToken",s="abcdefghijklmnopqrstuvwxyz0123456789";function i(){let e=function(e){e=e.toLowerCase();const t=document.cookie.split(";");for(const o of t){const t=o.split("=");if(decodeURIComponent(t[0].trim().toLowerCase())===e)return decodeURIComponent(t[1])}return null}(n);var t,o;return e&&40==e.length||(e=function(e){let t="";const o=new Uint8Array(e);window.crypto.getRandomValues(o);for(let e=0;e<o.length;e++){const r=s.charAt(o[e]%s.length);t+=Math.random()>.5?r.toUpperCase():r}return t}(40),t=n,o=e,document.cookie=encodeURIComponent(t)+"="+encodeURIComponent(o)+";path=/"),e}class a extends e.Plugin{static get requires(){return[t.FileRepository]}static get pluginName(){return"CKFinderUploadAdapter"}init(){const e=this.editor.config.get("ckfinder.uploadUrl");e&&(this.editor.plugins.get(t.FileRepository).createUploadAdapter=t=>new d(t,e,this.editor.t))}}class d{constructor(e,t,o){this.loader=e,this.url=t,this.t=o}upload(){return this.loader.file.then((e=>new Promise(((t,o)=>{this._initRequest(),this._initListeners(t,o,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,o){const r=this.xhr,n=this.loader,s=(0,this.t)("Cannot upload file:")+` ${o.name}.`;r.addEventListener("error",(()=>t(s))),r.addEventListener("abort",(()=>t())),r.addEventListener("load",(()=>{const o=r.response;if(!o||!o.uploaded)return t(o&&o.error&&o.error.message?o.error.message:s);e({default:o.url})})),r.upload&&r.upload.addEventListener("progress",(e=>{e.lengthComputable&&(n.uploadTotal=e.total,n.uploaded=e.loaded)}))}_sendRequest(e){const t=new FormData;t.append("upload",e),t.append("ckCsrfToken",i()),this.xhr.send(t)}}})(),(window.CKEditor5=window.CKEditor5||{}).adapterCkfinder=r})(); | ||
*/(()=>{var e={704:(e,t,r)=>{e.exports=r(79)("./src/core.js")},448:(e,t,r)=>{e.exports=r(79)("./src/upload.js")},79:e=>{"use strict";e.exports=CKEditor5.dll}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var s=t[o]={exports:{}};return e[o](s,s.exports,r),s.exports}r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{"use strict";r.r(o),r.d(o,{UploadAdapter:()=>d});var e=r(704),t=r(448);const n="ckCsrfToken",s="abcdefghijklmnopqrstuvwxyz0123456789";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}(n);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 o=s.charAt(r[e]%s.length);t+=Math.random()>.5?o.toUpperCase():o}return t}(40),t=n,r=e,document.cookie=encodeURIComponent(t)+"="+encodeURIComponent(r)+";path=/"),e}class d extends e.Plugin{static get requires(){return[t.FileRepository]}static get pluginName(){return"CKFinderUploadAdapter"}init(){const e=this.editor.config.get("ckfinder.uploadUrl");e&&(this.editor.plugins.get(t.FileRepository).createUploadAdapter=t=>new a(t,e,this.editor.t))}}class a{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 o=this.xhr,n=this.loader,s=(0,this.t)("Cannot upload file:")+` ${r.name}.`;o.addEventListener("error",(()=>t(s))),o.addEventListener("abort",(()=>t())),o.addEventListener("load",(()=>{const r=o.response;if(!r||!r.uploaded)return t(r&&r.error&&r.error.message?r.error.message:s);e({default:r.url})})),o.upload&&o.upload.addEventListener("progress",(e=>{e.lengthComputable&&(n.uploadTotal=e.total,n.uploaded=e.loaded)}))}_sendRequest(e){const t=new FormData;t.append("upload",e),t.append("ckCsrfToken",i()),this.xhr.send(t)}}})(),(window.CKEditor5=window.CKEditor5||{}).adapterCkfinder=o})(); |
{ | ||
"Cannot upload file:": "A generic error message displayed on upload failure. The file name is concatenated to this text." | ||
} |
@@ -5,3 +5,3 @@ Software License Agreement | ||
**CKEditor 5 CKFinder adapter** – https://github.com/ckeditor/ckeditor5-adapter-ckfinder <br> | ||
Copyright (c) 2003-2022, [CKSource](http://cksource.com) Holding sp. z o.o. All rights reserved. | ||
Copyright (c) 2003-2022, [CKSource Holding sp. z o.o.](https://cksource.com) All rights reserved. | ||
@@ -18,2 +18,2 @@ Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html). | ||
**CKEditor** is a trademark of [CKSource](http://cksource.com) Holding sp. z o.o. All other brand and product names are trademarks, registered trademarks or service marks of their respective holders. | ||
**CKEditor** is a trademark of [CKSource Holding sp. z o.o.](https://cksource.com) All other brand and product names are trademarks, registered trademarks or service marks of their respective holders. |
{ | ||
"name": "@ckeditor/ckeditor5-adapter-ckfinder", | ||
"version": "34.0.0", | ||
"version": "34.1.0", | ||
"description": "CKFinder adapter for CKEditor 5.", | ||
@@ -15,19 +15,19 @@ "keywords": [ | ||
"dependencies": { | ||
"ckeditor5": "^34.0.0" | ||
"ckeditor5": "^34.1.0" | ||
}, | ||
"devDependencies": { | ||
"@ckeditor/ckeditor5-basic-styles": "^34.0.0", | ||
"@ckeditor/ckeditor5-core": "^34.0.0", | ||
"@ckeditor/ckeditor5-clipboard": "^34.0.0", | ||
"@ckeditor/ckeditor5-basic-styles": "^34.1.0", | ||
"@ckeditor/ckeditor5-core": "^34.1.0", | ||
"@ckeditor/ckeditor5-clipboard": "^34.1.0", | ||
"@ckeditor/ckeditor5-dev-utils": "^30.0.0", | ||
"@ckeditor/ckeditor5-editor-classic": "^34.0.0", | ||
"@ckeditor/ckeditor5-enter": "^34.0.0", | ||
"@ckeditor/ckeditor5-heading": "^34.0.0", | ||
"@ckeditor/ckeditor5-image": "^34.0.0", | ||
"@ckeditor/ckeditor5-list": "^34.0.0", | ||
"@ckeditor/ckeditor5-paragraph": "^34.0.0", | ||
"@ckeditor/ckeditor5-theme-lark": "^34.0.0", | ||
"@ckeditor/ckeditor5-typing": "^34.0.0", | ||
"@ckeditor/ckeditor5-undo": "^34.0.0", | ||
"@ckeditor/ckeditor5-upload": "^34.0.0", | ||
"@ckeditor/ckeditor5-editor-classic": "^34.1.0", | ||
"@ckeditor/ckeditor5-enter": "^34.1.0", | ||
"@ckeditor/ckeditor5-heading": "^34.1.0", | ||
"@ckeditor/ckeditor5-image": "^34.1.0", | ||
"@ckeditor/ckeditor5-list": "^34.1.0", | ||
"@ckeditor/ckeditor5-paragraph": "^34.1.0", | ||
"@ckeditor/ckeditor5-theme-lark": "^34.1.0", | ||
"@ckeditor/ckeditor5-typing": "^34.1.0", | ||
"@ckeditor/ckeditor5-undo": "^34.1.0", | ||
"@ckeditor/ckeditor5-upload": "^34.1.0", | ||
"webpack": "^5.58.1", | ||
@@ -34,0 +34,0 @@ "webpack-cli": "^4.9.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
13989
9
259
Updatedckeditor5@^34.1.0