@ckeditor/ckeditor5-upload
Advanced tools
Comparing version 10.0.0 to 10.0.1
Changelog | ||
========= | ||
## [10.0.1](https://github.com/ckeditor/ckeditor5-upload/compare/v10.0.0...v10.0.1) (2018-06-21) | ||
### Other changes | ||
* Updated translations. | ||
## [10.0.0](https://github.com/ckeditor/ckeditor5-upload/compare/v1.0.0-beta.4...v10.0.0) (2018-04-25) | ||
@@ -5,0 +12,0 @@ |
{ | ||
"name": "@ckeditor/ckeditor5-upload", | ||
"version": "10.0.0", | ||
"version": "10.0.1", | ||
"description": "Upload Feature for CKEditor 5.", | ||
@@ -12,18 +12,18 @@ "keywords": [ | ||
"dependencies": { | ||
"@ckeditor/ckeditor5-core": "^10.0.0", | ||
"@ckeditor/ckeditor5-engine": "^10.0.0", | ||
"@ckeditor/ckeditor5-ui": "^10.0.0", | ||
"@ckeditor/ckeditor5-utils": "^10.0.0" | ||
"@ckeditor/ckeditor5-core": "^10.1.0", | ||
"@ckeditor/ckeditor5-engine": "^10.1.0", | ||
"@ckeditor/ckeditor5-ui": "^10.1.0", | ||
"@ckeditor/ckeditor5-utils": "^10.1.0" | ||
}, | ||
"devDependencies": { | ||
"@ckeditor/ckeditor5-basic-styles": "^10.0.0", | ||
"@ckeditor/ckeditor5-clipboard": "^10.0.0", | ||
"@ckeditor/ckeditor5-editor-classic": "^10.0.0", | ||
"@ckeditor/ckeditor5-enter": "^10.0.0", | ||
"@ckeditor/ckeditor5-heading": "^10.0.0", | ||
"@ckeditor/ckeditor5-image": "^10.0.0", | ||
"@ckeditor/ckeditor5-list": "^10.0.0", | ||
"@ckeditor/ckeditor5-paragraph": "^10.0.0", | ||
"@ckeditor/ckeditor5-typing": "^10.0.0", | ||
"@ckeditor/ckeditor5-undo": "^10.0.0", | ||
"@ckeditor/ckeditor5-basic-styles": "^10.0.1", | ||
"@ckeditor/ckeditor5-clipboard": "^10.0.1", | ||
"@ckeditor/ckeditor5-editor-classic": "^10.0.1", | ||
"@ckeditor/ckeditor5-enter": "^10.1.0", | ||
"@ckeditor/ckeditor5-heading": "^10.0.1", | ||
"@ckeditor/ckeditor5-image": "^10.1.0", | ||
"@ckeditor/ckeditor5-list": "^11.0.0", | ||
"@ckeditor/ckeditor5-paragraph": "^10.0.1", | ||
"@ckeditor/ckeditor5-typing": "^10.0.1", | ||
"@ckeditor/ckeditor5-undo": "^10.0.1", | ||
"eslint": "^4.15.0", | ||
@@ -30,0 +30,0 @@ "eslint-config-ckeditor5": "^1.0.7", |
@@ -6,4 +6,4 @@ CKEditor 5 file upload utilities | ||
[![npm version](https://badge.fury.io/js/%40ckeditor%2Fckeditor5-upload.svg)](https://www.npmjs.com/package/@ckeditor/ckeditor5-upload) | ||
[![Build Status](https://travis-ci.org/ckeditor/ckeditor5-upload.svg)](https://travis-ci.org/ckeditor/ckeditor5-upload) | ||
[![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=d3hvenZqQVZERFQ5d09FWXdyT0ozVXhLaVltRFRjTTUyZGpvQWNmWVhUUT0tLUZqNlJ1YWRUd0RvdEVOaEptM1B2Q0E9PQ==--c9d3dee40b9b4471ff3fb516d9ecf8d09292c7e0)](https://www.browserstack.com/automate/public-build/d3hvenZqQVZERFQ5d09FWXdyT0ozVXhLaVltRFRjTTUyZGpvQWNmWVhUUT0tLUZqNlJ1YWRUd0RvdEVOaEptM1B2Q0E9PQ==--c9d3dee40b9b4471ff3fb516d9ecf8d09292c7e0) | ||
[![Build Status](https://travis-ci.org/ckeditor/ckeditor5-upload.svg?branch=master)](https://travis-ci.org/ckeditor/ckeditor5-upload) | ||
[![BrowserStack Status](https://automate.browserstack.com/automate/badge.svg?badge_key=d3hvenZqQVZERFQ5d09FWXdyT0ozVXhLaVltRFRjTTUyZGpvQWNmWVhUUT0tLUZqNlJ1YWRUd0RvdEVOaEptM1B2Q0E9PQ==--c9d3dee40b9b4471ff3fb516d9ecf8d09292c7e0)](https://automate.browserstack.com/public-build/d3hvenZqQVZERFQ5d09FWXdyT0ozVXhLaVltRFRjTTUyZGpvQWNmWVhUUT0tLUZqNlJ1YWRUd0RvdEVOaEptM1B2Q0E9PQ==--c9d3dee40b9b4471ff3fb516d9ecf8d09292c7e0) | ||
[![Coverage Status](https://coveralls.io/repos/github/ckeditor/ckeditor5-upload/badge.svg?branch=master)](https://coveralls.io/github/ckeditor/ckeditor5-upload?branch=master) | ||
@@ -10,0 +10,0 @@ <br> |
@@ -12,2 +12,3 @@ /** | ||
import PendingActions from '@ckeditor/ckeditor5-core/src/pendingactions'; | ||
import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror'; | ||
@@ -49,2 +50,9 @@ import ObservableMixin from '@ckeditor/ckeditor5-utils/src/observablemixin'; | ||
*/ | ||
static get requires() { | ||
return [ PendingActions ]; | ||
} | ||
/** | ||
* @inheritDoc | ||
*/ | ||
init() { | ||
@@ -58,3 +66,16 @@ /** | ||
// Keeps upload in a sync with pending actions. | ||
this.loaders.on( 'add', () => this._updatePendingAction() ); | ||
this.loaders.on( 'remove', () => this._updatePendingAction() ); | ||
/** | ||
* Reference to a pending action registered in a {@link module:core/pendingactions~PendingActions} plugin | ||
* while upload is in progress. When there is no upload then value is `null`. | ||
* | ||
* @private | ||
* @member {Object} #_pendingAction | ||
*/ | ||
this._pendingAction = null; | ||
/** | ||
* A factory function which should be defined before using `FileRepository`. | ||
@@ -211,2 +232,24 @@ * | ||
} | ||
/** | ||
* Registers or deregisters pending action bound with upload progress. | ||
* | ||
* @private | ||
*/ | ||
_updatePendingAction() { | ||
const pendingActions = this.editor.plugins.get( PendingActions ); | ||
if ( this.loaders.length ) { | ||
if ( !this._pendingAction ) { | ||
const t = this.editor.t; | ||
const getMessage = value => `${ t( 'Upload in progress' ) } ${ parseInt( value ) }%.`; | ||
this._pendingAction = pendingActions.add( getMessage( this.uploadedPercent ) ); | ||
this._pendingAction.bind( 'message' ).to( this, 'uploadedPercent', getMessage ); | ||
} | ||
} else { | ||
pendingActions.remove( this._pendingAction ); | ||
this._pendingAction = null; | ||
} | ||
} | ||
} | ||
@@ -213,0 +256,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
38066
16
752