8
0
Просмотр исходного кода

Merge branch 'master' into t/64

Piotrek Koszuliński 7 лет назад
Родитель
Сommit
4a4de01563

+ 11 - 0
packages/ckeditor5-core/CHANGELOG.md

@@ -1,6 +1,17 @@
 Changelog
 =========
 
+## [10.1.0](https://github.com/ckeditor/ckeditor5-core/compare/v10.0.0...v10.1.0) (2018-06-21)
+
+### Features
+
+* Introduced `PendingActions` plugin. Closes [#126](https://github.com/ckeditor/ckeditor5-core/issues/126). ([e1af648](https://github.com/ckeditor/ckeditor5-core/commit/e1af648))
+
+### Other changes
+
+* Updated translations.
+
+
 ## [10.0.0](https://github.com/ckeditor/ckeditor5-core/compare/v1.0.0-beta.4...v10.0.0) (2018-04-25)
 
 ### Other changes

+ 14 - 0
packages/ckeditor5-core/lang/translations/ca.po

@@ -0,0 +1,14 @@
+# Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
+msgid ""
+msgstr ""
+"Language: ca\n"
+"Language-Team: Catalan (https://www.transifex.com/ckeditor/teams/11143/ca/)\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgctxt "Label for the Save button."
+msgid "Save"
+msgstr "Desar"
+
+msgctxt "Label for the Cancel button."
+msgid "Cancel"
+msgstr "Cancel·lar"

+ 1 - 1
packages/ckeditor5-core/lang/translations/cs.po

@@ -3,7 +3,7 @@ msgid ""
 msgstr ""
 "Language: cs\n"
 "Language-Team: Czech (https://www.transifex.com/ckeditor/teams/11143/cs/)\n"
-"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
+"Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;\n"
 
 msgctxt "Label for the Save button."
 msgid "Save"

+ 14 - 0
packages/ckeditor5-core/lang/translations/fa.po

@@ -0,0 +1,14 @@
+# Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
+msgid ""
+msgstr ""
+"Language: fa\n"
+"Language-Team: Persian (https://www.transifex.com/ckeditor/teams/11143/fa/)\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+msgctxt "Label for the Save button."
+msgid "Save"
+msgstr "ذخیره"
+
+msgctxt "Label for the Cancel button."
+msgid "Cancel"
+msgstr "لغو"

+ 1 - 1
packages/ckeditor5-core/lang/translations/kn.po

@@ -3,7 +3,7 @@ msgid ""
 msgstr ""
 "Language: kn\n"
 "Language-Team: Kannada (https://www.transifex.com/ckeditor/teams/11143/kn/)\n"
-"Plural-Forms: nplurals=1; plural=0;\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
 
 msgctxt "Label for the Save button."
 msgid "Save"

+ 14 - 0
packages/ckeditor5-core/lang/translations/no.po

@@ -0,0 +1,14 @@
+# Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
+msgid ""
+msgstr ""
+"Language: no\n"
+"Language-Team: Norwegian (https://www.transifex.com/ckeditor/teams/11143/no/)\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgctxt "Label for the Save button."
+msgid "Save"
+msgstr "Lagre"
+
+msgctxt "Label for the Cancel button."
+msgid "Cancel"
+msgstr "Avbryt"

+ 1 - 1
packages/ckeditor5-core/lang/translations/sk.po

@@ -3,7 +3,7 @@ msgid ""
 msgstr ""
 "Language: sk\n"
 "Language-Team: Slovak (https://www.transifex.com/ckeditor/teams/11143/sk/)\n"
-"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
+"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n == 1 ? 0 : n % 1 == 0 && n >= 2 && n <= 4 ? 1 : n % 1 != 0 ? 2: 3);\n"
 
 msgctxt "Label for the Save button."
 msgid "Save"

+ 1 - 1
packages/ckeditor5-core/lang/translations/uk.po

@@ -3,7 +3,7 @@ msgid ""
 msgstr ""
 "Language: uk\n"
 "Language-Team: Ukrainian (https://www.transifex.com/ckeditor/teams/11143/uk/)\n"
-"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != 11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || (n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n"
 
 msgctxt "Label for the Save button."
 msgid "Save"

+ 14 - 14
packages/ckeditor5-core/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@ckeditor/ckeditor5-core",
-  "version": "10.0.0",
+  "version": "10.1.0",
   "description": "CKEditor 5 core editor architecture.",
   "keywords": [
     "ckeditor5-lib",
@@ -25,21 +25,21 @@
     "framework"
   ],
   "dependencies": {
-    "@ckeditor/ckeditor5-engine": "^10.0.0",
-    "@ckeditor/ckeditor5-utils": "^10.0.0"
+    "@ckeditor/ckeditor5-engine": "^10.1.0",
+    "@ckeditor/ckeditor5-utils": "^10.1.0"
   },
   "devDependencies": {
-    "@ckeditor/ckeditor5-autoformat": "^10.0.0",
-    "@ckeditor/ckeditor5-basic-styles": "^10.0.0",
-    "@ckeditor/ckeditor5-block-quote": "^10.0.0",
-    "@ckeditor/ckeditor5-editor-classic": "^10.0.0",
-    "@ckeditor/ckeditor5-essentials": "^10.0.0",
-    "@ckeditor/ckeditor5-heading": "^10.0.0",
-    "@ckeditor/ckeditor5-image": "^10.0.0",
-    "@ckeditor/ckeditor5-link": "^10.0.0",
-    "@ckeditor/ckeditor5-list": "^10.0.0",
-    "@ckeditor/ckeditor5-paragraph": "^10.0.0",
-    "@ckeditor/ckeditor5-ui": "^10.0.0",
+    "@ckeditor/ckeditor5-autoformat": "^10.0.1",
+    "@ckeditor/ckeditor5-basic-styles": "^10.0.1",
+    "@ckeditor/ckeditor5-block-quote": "^10.0.1",
+    "@ckeditor/ckeditor5-editor-classic": "^10.0.1",
+    "@ckeditor/ckeditor5-essentials": "^10.1.0",
+    "@ckeditor/ckeditor5-heading": "^10.0.1",
+    "@ckeditor/ckeditor5-image": "^10.1.0",
+    "@ckeditor/ckeditor5-link": "^10.0.2",
+    "@ckeditor/ckeditor5-list": "^11.0.0",
+    "@ckeditor/ckeditor5-paragraph": "^10.0.1",
+    "@ckeditor/ckeditor5-ui": "^10.1.0",
     "eslint": "^4.15.0",
     "eslint-config-ckeditor5": "^1.0.7",
     "husky": "^0.14.3",

+ 2 - 2
packages/ckeditor5-core/src/command.js

@@ -79,10 +79,10 @@ export default class Command {
 		// By default commands are disabled when the editor is in read-only mode.
 		this.listenTo( editor, 'change:isReadOnly', ( evt, name, value ) => {
 			if ( value ) {
-				this.on( 'beforeChange:isEnabled', forceDisable, { priority: 'highest' } );
+				this.on( 'set:isEnabled', forceDisable, { priority: 'highest' } );
 				this.isEnabled = false;
 			} else {
-				this.off( 'beforeChange:isEnabled', forceDisable );
+				this.off( 'set:isEnabled', forceDisable );
 				this.refresh();
 			}
 		} );

+ 18 - 18
packages/ckeditor5-core/src/pendingactions.js

@@ -13,22 +13,22 @@ import Collection from '@ckeditor/ckeditor5-utils/src/collection';
 import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
 
 /**
- * List of editor pending actions.
+ * The list of pending editor actions.
  *
  * This plugin should be used to synchronise plugins that execute long-lasting actions
- * (i.e. file upload) with the editor integration. It gives a developer, who integrates the editor,
- * an easy way to check if there are any pending action whenever such information is needed.
- * All plugins, which register pending action provides also a message what action is ongoing
- * which can be displayed to a user and let him decide if he wants to interrupt the action or wait.
+ * (i.e. file upload) with the editor integration. It gives the developer who integrates the editor
+ * an easy way to check if there are any pending actions whenever such information is needed.
+ * All plugins that register a pending action also provide a message about the action that is ongoing
+ * which can be displayed to the user. This lets them decide if they want to interrupt the action or wait.
  *
- * Adding and updating pending action:
+ * Adding and updating a pending action:
  *
  * 		const pendingActions = editor.plugins.get( 'PendingActions' );
  * 		const action = pendingActions.add( 'Upload in progress 0%' );
  *
  * 		action.message = 'Upload in progress 10%';
  *
- * Removing pending action:
+ * Removing a pending action:
  *
  * 		const pendingActions = editor.plugins.get( 'PendingActions' );
  * 		const action = pendingActions.add( 'Unsaved changes.' );
@@ -60,7 +60,7 @@ export default class PendingActions extends Plugin {
 	 */
 	init() {
 		/**
-		 * Defines whether there is any registered pending action or not.
+		 * Defines whether there is any registered pending action.
 		 *
 		 * @readonly
 		 * @observable
@@ -69,7 +69,7 @@ export default class PendingActions extends Plugin {
 		this.set( 'isPending', false );
 
 		/**
-		 * List of pending actions.
+		 * A list of pending actions.
 		 *
 		 * @private
 		 * @type {module:utils/collection~Collection}
@@ -79,10 +79,10 @@ export default class PendingActions extends Plugin {
 	}
 
 	/**
-	 * Adds action to the list of pending actions.
+	 * Adds an action to the list of pending actions.
 	 *
-	 * This method returns an action object with observable message property.
-	 * The action object can be later used in the remove method. It also allows you to change the message.
+	 * This method returns an action object with an observable message property.
+	 * The action object can be later used in the {@link #remove} method. It also allows you to change the message.
 	 *
 	 * @param {String} message Action message.
 	 * @returns {Object} Observable object that represents a pending action.
@@ -90,11 +90,11 @@ export default class PendingActions extends Plugin {
 	add( message ) {
 		if ( typeof message !== 'string' ) {
 			/**
-			 * Message has to be a string.
+			 * The message must be a string.
 			 *
 			 * @error pendingactions-add-invalid-message
 			 */
-			throw new CKEditorError( 'pendingactions-add-invalid-message: Message has to be a string.' );
+			throw new CKEditorError( 'pendingactions-add-invalid-message: The message must be a string.' );
 		}
 
 		const action = Object.create( ObservableMixin );
@@ -107,9 +107,9 @@ export default class PendingActions extends Plugin {
 	}
 
 	/**
-	 * Removes action from the list of pending actions.
+	 * Removes an action from the list of pending actions.
 	 *
-	 * @param {Object} action Action object.
+	 * @param {Object} action An action object.
 	 */
 	remove( action ) {
 		this._actions.remove( action );
@@ -117,9 +117,9 @@ export default class PendingActions extends Plugin {
 	}
 
 	/**
-	 * Returns first action from the list.
+	 * Returns the first action from the list.
 	 *
-	 * returns {Object} Pending action object.
+	 * returns {Object} The pending action object.
 	 */
 	get first() {
 		return this._actions.get( 0 );

+ 4 - 4
packages/ckeditor5-core/tests/command.js

@@ -99,19 +99,19 @@ describe( 'Command', () => {
 			expect( editor.something ).to.false;
 		} );
 
-		it( 'stops beforeChange event to force disabled and not affect change event', () => {
-			const beforeChangeSpy = sinon.spy();
+		it( 'stops `set` event to force disabled and not affect `change` event', () => {
+			const setSpy = sinon.spy();
 			const changeSpy = sinon.spy();
 
 			command.isEnabled = true;
 			editor.isReadOnly = false;
 
-			command.on( 'beforeChange', beforeChangeSpy );
+			command.on( 'set', setSpy );
 			command.on( 'change', changeSpy );
 
 			editor.isReadOnly = true;
 
-			sinon.assert.notCalled( beforeChangeSpy );
+			sinon.assert.notCalled( setSpy );
 			sinon.assert.calledOnce( changeSpy );
 		} );
 	} );