Browse Source

Fixed the demo and shortened the description.

Piotrek Koszuliński 5 years ago
parent
commit
58f723c6b7

+ 1 - 1
packages/ckeditor5-image/docs/_snippets/features/image-insert-via-url.html

@@ -1,5 +1,5 @@
 <div id="snippet-image-insert-via-url">
-	<p>This is <a href="https://ckeditor.com">CKEditor&nbsp;5</a>.</p>
+	<p>Insert a new image or edit the source URL of the image below:</p>
 
 	<figure class="image">
 		<img src="%BASE_PATH%/assets/img/fields.jpg" alt="Autumn fields">

+ 6 - 1
packages/ckeditor5-image/docs/_snippets/features/image-insert-via-url.js

@@ -14,7 +14,12 @@ ClassicEditor
 			viewportTopOffset: window.getViewportTopOffsetConfig()
 		},
 		image: {
-			toolbar: [ 'imageStyle:full', 'imageStyle:side', '|', 'imageTextAlternative' ]
+			toolbar: [ 'imageStyle:full', 'imageStyle:side', '|', 'imageTextAlternative' ],
+			upload: {
+				panel: {
+					items: [ 'insertImageViaUrl' ]
+				}
+			}
 		},
 		cloudServices: CS_CONFIG
 	} )

+ 5 - 17
packages/ckeditor5-image/docs/features/image.md

@@ -82,18 +82,16 @@ By default, if the image caption is empty, the `<figcaption>` element is not vis
 
 See the {@link features/image-upload Image upload} guide.
 
-## Insert image via URL
+## Inserting images via source URL
 
-Another great feature is the ability to insert an image via a URL address. This feature is available under the **Image Upload** feature dropdown. Once it's enabled, when you click on the arrow button, you will see a small panel view containing the form for an image source URL. Once you fill it, you will be able to insert the image into the editor's content.
+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.
 
-### Enable inserting an image via URL
-
-Currently, if you want to use the feature, you have to enable it through the editor's configuration. You can do it by setting the special token `insertImageViaUrl` in the `image.upload.panel.items`:
+In order to enable this option configure `image.upload.panel.items` like below:
 
 ```js
 ClassicEditor
 	.create( document.querySelector( '#editor' ), {
-		plugins: [Image, ImageUpload],
+		// ...
 		image: {
 			// ...
 			upload: {
@@ -105,17 +103,7 @@ ClassicEditor
 	} )
 ```
 
-This will extend the standalone **Insert image** button in the toolbar by adding the dropdown panel with the new feature. To see how it works, please take a look at the demo in the [next section](/replace-image-via-url).
-
-### Replace image via URL
-
-Yet another cool function that the feature introduces is the ability to replace a previously inserted image without loosing its styling and custom attributes (if it has ones). If you click on the image and open the `{@link module:image/imageupload/ui/imageuploadpanelview~ImageUploadPanelView#dropdownView ImageUpload dropdown}` you will see that the **Insert image via URL** form is already filled. This is the URL of the current image. You can easily edit it and update it through the form.
-
-<info-box>
-<strong>Bonus tip</strong>: You can even edit the URL of an image inserted from the native file system or from — for example — `{@link module:ckfinder/ckfinder~CKFinder}`.
-</info-box>
-
-Check it out in this short demo:
+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:
 
 {@snippet features/image-insert-via-url}