Browse Source

Merge branch 'stable'

Anna Tomanek 5 years ago
parent
commit
1f5cc6f38f

+ 3 - 3
packages/ckeditor5-image/docs/features/image.md

@@ -84,9 +84,9 @@ See the {@link features/image-upload Image upload} guide.
 
 ## Inserting images via source URL
 
-Besides the ability to insert images by uploading them directly from your disk or via CKFinder, you can also configure the editor to allow inserting images via source URL.
+Besides the ability to insert images by uploading them directly from your disk or via CKFinder, you can also configure CKEditor 5 to allow inserting images via source URL.
 
-In order to enable this option configure `image.upload.panel.items` like below:
+In order to enable this option, configure {@link module:image/imageupload~ImageUploadPanelConfig#items `image.upload.panel.items`} like below:
 
 ```js
 ClassicEditor
@@ -103,7 +103,7 @@ ClassicEditor
 	} )
 ```
 
-This will extend the standalone **Insert image** button in the toolbar by adding the dropdown panel with the new feature (click the arrow next to the button). To see how it works, please take a look at the demo below:
+This will extend the standalone **Insert image** button in the toolbar by adding a dropdown panel with the new feature. To open the panel and add the image URL, click the arrow next to the image button. Check the demo below to insert a new image via URL or update an existing image by selecting it, opening the dropdown panel and pasting a new URL.
 
 {@snippet features/image-insert-via-url}
 

+ 21 - 21
packages/ckeditor5-image/lang/contexts.json

@@ -1,24 +1,24 @@
 {
-	"image widget": "Label for the image widget.",
-	"Side image": "Label for the Side image option.",
-	"Full size image": "Label for the Full size image option.",
-	"Left aligned image": "Label for the Left aligned image option",
-	"Centered image": "Label for the Centered image option",
-	"Right aligned image": "Label for the Right aligned image option",
-	"Change image text alternative": "Label for the Change image text alternative button.",
-	"Text alternative": "Label for the image text alternative input.",
-	"Enter image caption": "Placeholder text for image caption displayed when caption is empty.",
-	"Insert image": "Label for the insert image toolbar button.",
-	"Upload failed": "Title of the notification displayed when upload fails.",
+	"image widget": "The label for the image widget.",
+	"Side image": "The label for the Side image option.",
+	"Full size image": "The label for the Full size image option.",
+	"Left aligned image": "The label for the Left aligned image option.",
+	"Centered image": "The label for the Centered image option.",
+	"Right aligned image": "The label for the Right aligned image option.",
+	"Change image text alternative": "The label for the Change image text alternative button.",
+	"Text alternative": "The label for the image text alternative input.",
+	"Enter image caption": "The placeholder text for the image caption displayed when the caption is empty.",
+	"Insert image": "The label for the insert image toolbar button.",
+	"Upload failed": "The title of the notification displayed when upload fails.",
 	"Image toolbar": "The label used by assistive technologies describing an image toolbar attached to an image widget.",
-	"Resize image": "The label used for the dropdown in the image toolbar containing defined resize options",
-	"Resize image to %0": "The label used for the standalone resize options buttons in the image toolbar",
-	"Resize image to the original size": "The accessibility label of the standalone image resize reset option button in the image toolbar for the screen readers",
-	"Original": "Default label for the resize option that resets the size of the image.",
-	"Image resize list": "The accessibility label of the image resize dropdown list for the screen readers.",
-	"Insert": "The label of submit form button if image src URL input has no value",
-	"Update": "The label of submit form button if image src URL input has value",
-	"Insert image via URL": "The input label for the Insert image via URL form",
-	"Update image URL": "The alternative input label for the Insert image via URL form",
-	"Paste the image source URL.": "The tip label below the Insert image via URL form"
+	"Resize image": "The label used for the dropdown in the image toolbar containing defined resize options.",
+	"Resize image to %0": "The label used for the standalone resize options buttons in the image toolbar.",
+	"Resize image to the original size": "The accessibility label of the standalone image resize reset option button in the image toolbar for screen readers.",
+	"Original": "The default label for the resize option that resets the size of the image.",
+	"Image resize list": "The accessibility label of the image resize dropdown for screen readers.",
+	"Insert": "The label of the form submit button if the image source URL input has no value.",
+	"Update": "The label of the form submit button if the image source URL input has a value.",
+	"Insert image via URL": "The input label for the Insert image via URL form.",
+	"Update image URL": "The input label for the Insert image via URL form for a pre-existing image.",
+	"Paste the image source URL.": "The content of the tip below the Insert image via URL form."
 }

+ 11 - 10
packages/ckeditor5-image/src/imageupload.js

@@ -42,7 +42,7 @@ export default class ImageUpload extends Plugin {
 }
 
 /**
- * Image upload configuration.
+ * The image upload configuration.
  *
  * @member {module:image/imageupload~ImageUploadConfig} module:image/image~ImageConfig#upload
  */
@@ -75,7 +75,7 @@ export default class ImageUpload extends Plugin {
  *		};
  *
  * The type string should match [one of the sub-types](https://www.iana.org/assignments/media-types/media-types.xhtml#image)
- * of the image MIME type. E.g. for the `image/jpeg` MIME type, add `'jpeg'` to your image upload configuration.
+ * of the image MIME type. For example, for the `image/jpeg` MIME type, add `'jpeg'` to your image upload configuration.
  *
  * **Note:** This setting only restricts some image types to be selected and uploaded through the CKEditor UI and commands. Image type
  * recognition and filtering should also be implemented on the server which accepts image uploads.
@@ -85,7 +85,7 @@ export default class ImageUpload extends Plugin {
  */
 
 /**
- * Image upload panel view configuration.
+ * The image upload panel view configuration.
  *
  * @protected
  * @member {module:image/imageupload~ImageUploadPanelConfig} module:image/imageupload~ImageUploadConfig#panel
@@ -98,7 +98,7 @@ export default class ImageUpload extends Plugin {
  *			.create( editorElement, {
  * 				image: {
  * 					upload: {
- * 						panel: ... // panel settings goes here
+ * 						panel: ... // Panel settings go here.
  * 					}
  * 				}
  *			} )
@@ -114,12 +114,13 @@ export default class ImageUpload extends Plugin {
 /**
  * The list of {@link module:image/imageupload~ImageUpload} integrations.
  *
- * The option accepts string tokens.
- * * for predefined integrations, we have two special strings: `insertImageViaUrl` and `openCKFinder`.
- * The former adds **Insert image via URL** feature, while the latter adds built-in **CKFinder** integration.
- * * for custom integrations, each string should be a name of the already registered component.
- * If you have a plugin `PluginX` that registers `pluginXButton` component, then the integration token
- * in that case should be `pluginXButton`.
+ * This option accepts string tokens:
+ * * For predefined integrations, there are two special strings: `insertImageViaUrl` and `openCKFinder`.
+ * The former adds the {@glink features/image#inserting-images-via-source-url Insert image via URL} feature, while the latter adds the
+ * built-in {@glink features/image-upload/ckfinder CKFinder} integration.
+ * * For custom integrations, each string should be a name of the already registered component.
+ * If you have a plugin `PluginX` that registers the `pluginXButton` component, then in that case the integration token
+ * should be `pluginXButton`.
  *
  *		// Add `insertImageViaUrl`, `openCKFinder` and custom `pluginXButton` integrations.
  *		const imageUploadConfig = {

+ 1 - 1
packages/ckeditor5-image/src/imageupload/imageuploadui.js

@@ -145,7 +145,7 @@ export default class ImageUploadUI extends Plugin {
 	}
 
 	/**
-	 * Creates and sets up file dialog button view.
+	 * Creates and sets up the file dialog button view.
 	 *
 	 * @param {module:utils/locale~Locale} locale The localization services instance.
 	 *

+ 2 - 2
packages/ckeditor5-image/src/imageupload/ui/imageuploadformrowview.js

@@ -15,8 +15,8 @@ import '../../../theme/imageuploadformrowview.css';
  * The class representing a single row in a complex form,
  * used by {@link module:image/imageupload/ui/imageuploadpanelview~ImageUploadPanelView}.
  *
- * **Note**: For now this class is private. When more use cases arrive (beyond ckeditor5-table and ckeditor5-image),
- * it will become a component in ckeditor5-ui.
+ * **Note**: For now this class is private. When more use cases appear (beyond `ckeditor5-table` and `ckeditor5-image`),
+ * it will become a component in `ckeditor5-ui`.
  *
  * @private
  * @extends module:ui/view~View

+ 8 - 8
packages/ckeditor5-image/src/imageupload/ui/imageuploadpanelview.js

@@ -38,8 +38,8 @@ export default class ImageUploadPanelView extends View {
 	/**
 	 * Creates a view for the dropdown panel of {@link module:image/imageupload/imageuploadui~ImageUploadUI}.
 	 *
-	 * @param {module:utils/locale~Locale} [locale] The localization services instance..
-	 * @param {Object} [integrations] Integrations object that contain
+	 * @param {module:utils/locale~Locale} [locale] The localization services instance.
+	 * @param {Object} [integrations] An integrations object that contains
 	 * components (or tokens for components) to be shown in the panel view.
 	 */
 	constructor( locale, integrations ) {
@@ -69,7 +69,7 @@ export default class ImageUploadPanelView extends View {
 		this.dropdownView = this._createDropdownView( locale );
 
 		/**
-		 * Value of the URL input.
+		 * The value of the URL input.
 		 *
 		 * @member {String} #imageURLInputValue
 		 * @observable
@@ -122,7 +122,7 @@ export default class ImageUploadPanelView extends View {
 		} );
 
 		/**
-		 * Collection of the defined integrations for inserting the images.
+		 * A collection of the defined integrations for inserting the images.
 		 *
 		 * @private
 		 * @member {module:utils/collection~Collection}
@@ -226,7 +226,7 @@ export default class ImageUploadPanelView extends View {
 	}
 
 	/**
-	 * Creates dropdown view.
+	 * Creates the dropdown view.
 	 *
 	 * @param {module:utils/locale~Locale} locale The localization services instance.
 	 *
@@ -294,7 +294,7 @@ export default class ImageUploadPanelView extends View {
 	}
 
 	/**
-	 * Focuses the fist {@link #_focusables} in the form.
+	 * Focuses the first {@link #_focusables focusable} in the form.
 	 */
 	focus() {
 		this._focusCycler.focusFirst();
@@ -303,13 +303,13 @@ export default class ImageUploadPanelView extends View {
 
 /**
  * Fired when the form view is submitted (when one of the children triggered the submit event),
- * e.g. click on {@link #insertButtonView}.
+ * e.g. by a click on {@link #insertButtonView}.
  *
  * @event submit
  */
 
 /**
- * Fired when the form view is canceled, e.g. click on {@link #cancelButtonView}.
+ * Fired when the form view is canceled, e.g. by a click on {@link #cancelButtonView}.
  *
  * @event cancel
  */

+ 4 - 4
packages/ckeditor5-image/src/imageupload/utils.js

@@ -87,12 +87,12 @@ function getImageMimeType( blob, src ) {
 }
 
 /**
- * Creates integrations object that will be passed to the
+ * Creates an integrations object that will be passed to the
  * {@link module:image/imageupload/ui/imageuploadpanelview~ImageUploadPanelView}.
  *
- * @param {module:core/editor/editor~Editor} editor Editor instance.
+ * @param {module:core/editor/editor~Editor} editor The editor instance.
  *
- * @returns {Object.<String, module:ui/view~View>} Integrations object.
+ * @returns {Object.<String, module:ui/view~View>} The integrations object.
  */
 export function prepareIntegrations( editor ) {
 	const panelItems = editor.config.get( 'image.upload.panel.items' );
@@ -133,7 +133,7 @@ export function prepareIntegrations( editor ) {
 }
 
 /**
- * Creates labeled field view.
+ * Creates a labeled field view.
  *
  * @param {module:utils/locale~Locale} locale The localization services instance.
  *