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

Merge branch 'master' into t/ckeditor5-engine/1304

Szymon Kupś 7 лет назад
Родитель
Сommit
e230815e15
59 измененных файлов с 950 добавлено и 182 удалено
  1. 4 4
      packages/ckeditor5-image/docs/_snippets/features/image-style-custom.js
  2. 24 17
      packages/ckeditor5-image/docs/features/image.md
  3. 3 1
      packages/ckeditor5-image/lang/contexts.json
  4. 8 0
      packages/ckeditor5-image/lang/translations/ast.po
  5. 11 3
      packages/ckeditor5-image/lang/translations/da.po
  6. 11 3
      packages/ckeditor5-image/lang/translations/de.po
  7. 8 0
      packages/ckeditor5-image/lang/translations/el.po
  8. 11 3
      packages/ckeditor5-image/lang/translations/en-au.po
  9. 8 0
      packages/ckeditor5-image/lang/translations/en.po
  10. 8 0
      packages/ckeditor5-image/lang/translations/eo.po
  11. 8 0
      packages/ckeditor5-image/lang/translations/es.po
  12. 50 0
      packages/ckeditor5-image/lang/translations/et.po
  13. 50 0
      packages/ckeditor5-image/lang/translations/eu.po
  14. 8 0
      packages/ckeditor5-image/lang/translations/fi.po
  15. 8 0
      packages/ckeditor5-image/lang/translations/fr.po
  16. 8 0
      packages/ckeditor5-image/lang/translations/gl.po
  17. 11 3
      packages/ckeditor5-image/lang/translations/hr.po
  18. 8 0
      packages/ckeditor5-image/lang/translations/hu.po
  19. 8 0
      packages/ckeditor5-image/lang/translations/it.po
  20. 8 0
      packages/ckeditor5-image/lang/translations/ja.po
  21. 8 0
      packages/ckeditor5-image/lang/translations/km.po
  22. 8 0
      packages/ckeditor5-image/lang/translations/kn.po
  23. 8 0
      packages/ckeditor5-image/lang/translations/ko.po
  24. 8 0
      packages/ckeditor5-image/lang/translations/ku.po
  25. 11 3
      packages/ckeditor5-image/lang/translations/nb.po
  26. 50 0
      packages/ckeditor5-image/lang/translations/ne.po
  27. 50 0
      packages/ckeditor5-image/lang/translations/nl.po
  28. 50 0
      packages/ckeditor5-image/lang/translations/pl.po
  29. 8 0
      packages/ckeditor5-image/lang/translations/pt-br.po
  30. 8 0
      packages/ckeditor5-image/lang/translations/pt.po
  31. 8 0
      packages/ckeditor5-image/lang/translations/ro.po
  32. 50 0
      packages/ckeditor5-image/lang/translations/ru.po
  33. 50 0
      packages/ckeditor5-image/lang/translations/si.po
  34. 8 0
      packages/ckeditor5-image/lang/translations/sk.po
  35. 50 0
      packages/ckeditor5-image/lang/translations/sq.po
  36. 50 0
      packages/ckeditor5-image/lang/translations/sv.po
  37. 11 3
      packages/ckeditor5-image/lang/translations/tr.po
  38. 50 0
      packages/ckeditor5-image/lang/translations/ug.po
  39. 8 0
      packages/ckeditor5-image/lang/translations/uk.po
  40. 8 0
      packages/ckeditor5-image/lang/translations/zh-cn.po
  41. 8 0
      packages/ckeditor5-image/lang/translations/zh.po
  42. 8 9
      packages/ckeditor5-image/src/imagestyle.js
  43. 31 16
      packages/ckeditor5-image/src/imagestyle/imagestylecommand.js
  44. 20 13
      packages/ckeditor5-image/src/imagestyle/imagestyleediting.js
  45. 6 4
      packages/ckeditor5-image/src/imagestyle/imagestyleui.js
  46. 22 21
      packages/ckeditor5-image/src/imagestyle/utils.js
  47. 2 2
      packages/ckeditor5-image/src/imagetoolbar.js
  48. 3 3
      packages/ckeditor5-image/src/imageupload/imageuploadui.js
  49. 32 26
      packages/ckeditor5-image/tests/imagestyle/imagestylecommand.js
  50. 8 10
      packages/ckeditor5-image/tests/imagestyle/imagestyleediting.js
  51. 5 4
      packages/ckeditor5-image/tests/imagestyle/imagestyleui.js
  52. 19 13
      packages/ckeditor5-image/tests/imagestyle/utils.js
  53. 9 9
      packages/ckeditor5-image/tests/imageupload/imageuploadui.js
  54. 2 2
      packages/ckeditor5-image/tests/manual/caption.js
  55. 1 1
      packages/ckeditor5-image/tests/manual/image.js
  56. 5 5
      packages/ckeditor5-image/tests/manual/imagestyle.js
  57. 2 2
      packages/ckeditor5-image/tests/manual/imageupload.js
  58. 1 1
      packages/ckeditor5-image/tests/manual/textalternative.js
  59. 1 1
      packages/ckeditor5-image/tests/manual/tickets/110/1.js

+ 4 - 4
packages/ckeditor5-image/docs/_snippets/features/image-style-custom.js

@@ -12,16 +12,16 @@ ClassicEditor
 		image: {
 			styles: [
 				// This option is equal to a situation where no style is applied.
-				'imageStyleFull',
+				'full',
 
 				// This represents an image aligned to left.
-				'imageStyleAlignLeft',
+				'alignLeft',
 
 				// This represents an image aligned to right.
-				'imageStyleAlignRight'
+				'alignRight'
 			],
 
-			toolbar: [ 'imageTextAlternative', '|', 'imageStyleAlignLeft', 'imageStyleFull', 'imageStyleAlignRight' ]
+			toolbar: [ 'imageTextAlternative', '|', 'imageStyle:alignLeft', 'imageStyle:full', 'imageStyle:alignRight' ]
 		},
 		toolbar: {
 			viewportTopOffset: 60

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

@@ -11,10 +11,10 @@ The [`@ckeditor/ckeditor5-image`](https://www.npmjs.com/package/@ckeditor/ckedit
 * {@link module:image/imagetoolbar~ImageToolbar} adds the image feature's contextual toolbar,
 * {@link module:image/imagecaption~ImageCaption} adds support for captions,
 * {@link module:image/imagestyle~ImageStyle} adds support for image styles,
-* {@link module:image/imageupload~ImageUpload} adds support for uploading dropped or pasted images (note: it is currently located in the [`@ckeditor/ckeditor5-upload`](https://www.npmjs.com/package/@ckeditor/ckeditor5-upload) package but will be moved to the `@ckeditor/ckeditor5-image` package).
+* {@link module:image/imageupload~ImageUpload} adds support for uploading dropped or pasted images (see: {@link features/image-upload Image upload}).
 
 <info-box info>
-	The first four features listed above (so all except the upload support) are enabled by default in all builds.
+	All features listed above are enabled by default in all builds.
 </info-box>
 
 ## Base image support
@@ -100,7 +100,7 @@ A side image:
 <info-box>
 	The actual styling of the images is the developer's job. The editor comes with some default styles, but they will only be applied to images inside the editor. The developer needs to style them on the target pages.
 
-	Here you can find the source of the default styles applied by the editor: [`ckeditor5-image/theme/theme.scss`](https://github.com/ckeditor/ckeditor5-image/blob/master/theme/theme.scss).
+	Here you can find the source of the default styles applied by the editor: [`ckeditor5-image/theme/imagestyle.css`](https://github.com/ckeditor/ckeditor5-image/blob/master/theme/imagestyle.css).
 </info-box>
 
 Below you can see a demo of the editor with the image styles feature enabled. The default configuration is used. You can change the styles of images through the image's contextual toolbar.
@@ -118,17 +118,17 @@ ClassicEditor
 	.create( document.querySelector( '#editor' ), {
 		image: {
 			// You need to configure the image toolbar too, so it uses the new style buttons.
-			toolbar: [ 'imageTextAlternative', '|', 'imageStyleAlignLeft', 'imageStyleFull', 'imageStyleAlignRight' ],
+			toolbar: [ 'imageTextAlternative', '|', 'imageStyle:alignLeft', 'imageStyle:full', 'imageStyle:alignRight' ],
 
 			styles: [
 				// This option is equal to a situation where no style is applied.
-				'imageStyleFull',
+				'full',
 
 				// This represents an image aligned to left.
-				'imageStyleAlignLeft',
+				'alignLeft',
 
 				// This represents an image aligned to right.
-				'imageStyleAlignRight'
+				'alignRight'
 			]
 		}
 	} )
@@ -136,7 +136,7 @@ ClassicEditor
 	.catch( ... );
 ```
 
-In the code sample above we used predefined image styles – `'imageStyleFull'`, `'imageStyleAlignLeft'` and `'imageStyleAlignRight'`. The latter two apply, respectively, `.image-style-align-left` and  `.image-style-align-right` classes to the `<figure>` element.
+In the code sample above we used predefined image styles – `'full'`, `'alignLeft'` and `'alignRight'`. The latter two apply, respectively, `.image-style-align-left` and  `.image-style-align-right` classes to the `<figure>` element.
 
 See the result below:
 
@@ -150,11 +150,11 @@ See the result below:
 
 Besides using the {@link module:image/imagestyle/utils~defaultStyles 5 predefined styles}:
 
-* `'imageStyleFull'`,
-* `'imageStyleSide'`,
-* `'imageStyleAlignLeft'`,
-* `'imageStyleAlignCenter'`,
-* `'imageStyleAlignRight'`
+* `'full'`,
+* `'side'`,
+* `'alignLeft'`,
+* `'alignCenter'`,
+* `'alignRight'`
 
 you can also define your own styles or modify the existing ones.
 
@@ -162,7 +162,9 @@ you can also define your own styles or modify the existing ones.
 	Reusing (or modifying) predefined styles has this advantage that CKEditor 5 will use its official translations for the defined button titles.
 </info-box>
 
-TODO (example)...
+You can find advanced examples in the {@link module:image/image~ImageConfig#styles `image.styles`} configuration option's documentation.
+
+TODO (live example)...
 
 ## Image upload
 
@@ -194,7 +196,7 @@ ClassicEditor
 	.create( document.querySelector( '#editor' ), {
 		plugins: [ Image, ImageToolbar, ImageCaption, ImageStyle ],
 		image: {
-			toolbar: [ 'imageTextAlternative', '|', 'imageStyleFull', 'imageStyleSide' ]
+			toolbar: [ 'imageTextAlternative', '|', 'imageStyle:full', 'imageStyle:side' ]
 		}
 	} )
 	.then( ... )
@@ -211,8 +213,13 @@ The {@link module:image/image~Image} plugin registers:
 
 The {@link module:image/imagestyle~ImageStyle} plugin registers:
 
-* A command for each defined style (based on the {@link module:image/image~ImageConfig#styles `image.styles`} configuration option) &mdash; e.g. `'imageStyleFull'` and `'imageStyleSide'`,
-* A button for each defined style &mdash; e.g. `'imageStyleFull'` and `'imageStyleSide'`.
+* The `'imageStyle'` command that accepts value based on the {@link module:image/image~ImageConfig#styles `image.styles`} configuration option (e.g. `'full'` and `'side'`):
+
+	```js
+	editor.execute( 'imageStyle', { value: 'side' } );
+	```
+
+* A button for each defined style &mdash; e.g. `'imageStyle:full'` and `'imageStyle:side'`.
 
 ## Contribute
 

+ 3 - 1
packages/ckeditor5-image/lang/contexts.json

@@ -7,5 +7,7 @@
 	"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."
+	"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."
 }

+ 8 - 0
packages/ckeditor5-image/lang/translations/ast.po

@@ -40,3 +40,11 @@ msgstr ""
 msgctxt "Placeholder text for image caption displayed when caption is empty."
 msgid "Enter image caption"
 msgstr ""
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr ""
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr ""

+ 11 - 3
packages/ckeditor5-image/lang/translations/da.po

@@ -19,15 +19,15 @@ msgstr "Fuld billedstørrelse"
 
 msgctxt "Label for the Left aligned image option"
 msgid "Left aligned image"
-msgstr ""
+msgstr "Venstrestillet billede"
 
 msgctxt "Label for the Centered image option"
 msgid "Centered image"
-msgstr ""
+msgstr "Centreret billede"
 
 msgctxt "Label for the Right aligned image option"
 msgid "Right aligned image"
-msgstr ""
+msgstr "Højrestillet billede"
 
 msgctxt "Label for the Change image text alternative button."
 msgid "Change image text alternative"
@@ -40,3 +40,11 @@ msgstr "Alternativ tekst"
 msgctxt "Placeholder text for image caption displayed when caption is empty."
 msgid "Enter image caption"
 msgstr "Indtast billedoverskrift"
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr "Indsæt billede"
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr "Upload fejlede"

+ 11 - 3
packages/ckeditor5-image/lang/translations/de.po

@@ -19,15 +19,15 @@ msgstr "Bild in voller Größe"
 
 msgctxt "Label for the Left aligned image option"
 msgid "Left aligned image"
-msgstr ""
+msgstr "linksbündiges Bild"
 
 msgctxt "Label for the Centered image option"
 msgid "Centered image"
-msgstr ""
+msgstr "zentriertes Bild"
 
 msgctxt "Label for the Right aligned image option"
 msgid "Right aligned image"
-msgstr ""
+msgstr "rechtsbündiges Bild"
 
 msgctxt "Label for the Change image text alternative button."
 msgid "Change image text alternative"
@@ -40,3 +40,11 @@ msgstr "Textalternative"
 msgctxt "Placeholder text for image caption displayed when caption is empty."
 msgid "Enter image caption"
 msgstr "Bildunterschrift eingeben"
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr "Bild einfügen"
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr ""

+ 8 - 0
packages/ckeditor5-image/lang/translations/el.po

@@ -40,3 +40,11 @@ msgstr "Εναλλακτικό κείμενο"
 msgctxt "Placeholder text for image caption displayed when caption is empty."
 msgid "Enter image caption"
 msgstr "Λεζάντα"
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr "Εισαγωγή εικόνας"
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr ""

+ 11 - 3
packages/ckeditor5-image/lang/translations/en-au.po

@@ -19,15 +19,15 @@ msgstr "Full size image"
 
 msgctxt "Label for the Left aligned image option"
 msgid "Left aligned image"
-msgstr ""
+msgstr "Left aligned image"
 
 msgctxt "Label for the Centered image option"
 msgid "Centered image"
-msgstr ""
+msgstr "Centred image"
 
 msgctxt "Label for the Right aligned image option"
 msgid "Right aligned image"
-msgstr ""
+msgstr "Right aligned image"
 
 msgctxt "Label for the Change image text alternative button."
 msgid "Change image text alternative"
@@ -40,3 +40,11 @@ msgstr "Text alternative"
 msgctxt "Placeholder text for image caption displayed when caption is empty."
 msgid "Enter image caption"
 msgstr "Enter image caption"
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr "Insert image"
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr "Upload failed"

+ 8 - 0
packages/ckeditor5-image/lang/translations/en.po

@@ -40,3 +40,11 @@ msgstr "Text alternative"
 msgctxt "Placeholder text for image caption displayed when caption is empty."
 msgid "Enter image caption"
 msgstr "Enter image caption"
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr "Insert image"
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr "Upload failed"

+ 8 - 0
packages/ckeditor5-image/lang/translations/eo.po

@@ -40,3 +40,11 @@ msgstr "Alternativa teksto"
 msgctxt "Placeholder text for image caption displayed when caption is empty."
 msgid "Enter image caption"
 msgstr "Skribu klarigon pri la bildo"
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr "Enmetu bildon"
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr ""

+ 8 - 0
packages/ckeditor5-image/lang/translations/es.po

@@ -40,3 +40,11 @@ msgstr "Texto alternativo"
 msgctxt "Placeholder text for image caption displayed when caption is empty."
 msgid "Enter image caption"
 msgstr ""
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr ""
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr ""

+ 50 - 0
packages/ckeditor5-image/lang/translations/et.po

@@ -0,0 +1,50 @@
+# Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
+msgid ""
+msgstr ""
+"Language: et\n"
+"Language-Team: Estonian (https://www.transifex.com/ckeditor/teams/11143/et/)\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgctxt "Label for the image widget."
+msgid "image widget"
+msgstr "pildi vidin"
+
+msgctxt "Label for the Side image option."
+msgid "Side image"
+msgstr "Pilt küljel"
+
+msgctxt "Label for the Full size image option."
+msgid "Full size image"
+msgstr "Täissuuruses pilt"
+
+msgctxt "Label for the Left aligned image option"
+msgid "Left aligned image"
+msgstr "Vasakule joondatud pilt"
+
+msgctxt "Label for the Centered image option"
+msgid "Centered image"
+msgstr "Keskele joondatud pilt"
+
+msgctxt "Label for the Right aligned image option"
+msgid "Right aligned image"
+msgstr "Paremale joondatud pilt"
+
+msgctxt "Label for the Change image text alternative button."
+msgid "Change image text alternative"
+msgstr "Muuda pildi tekstilist alternatiivi"
+
+msgctxt "Label for the image text alternative input."
+msgid "Text alternative"
+msgstr "Alternatiivne tekst"
+
+msgctxt "Placeholder text for image caption displayed when caption is empty."
+msgid "Enter image caption"
+msgstr "Sisesta pildi pealkiri"
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr "Siseta pilt"
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr "Üleslaadimine ebaõnnestus"

+ 50 - 0
packages/ckeditor5-image/lang/translations/eu.po

@@ -0,0 +1,50 @@
+# Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
+msgid ""
+msgstr ""
+"Language: eu\n"
+"Language-Team: Basque (https://www.transifex.com/ckeditor/teams/11143/eu/)\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgctxt "Label for the image widget."
+msgid "image widget"
+msgstr "irudi widgeta"
+
+msgctxt "Label for the Side image option."
+msgid "Side image"
+msgstr "Alboko irudia"
+
+msgctxt "Label for the Full size image option."
+msgid "Full size image"
+msgstr "Tamaina osoko irudia"
+
+msgctxt "Label for the Left aligned image option"
+msgid "Left aligned image"
+msgstr "Ezkerrean lerrokatutako irudia"
+
+msgctxt "Label for the Centered image option"
+msgid "Centered image"
+msgstr "Zentratutako irudia"
+
+msgctxt "Label for the Right aligned image option"
+msgid "Right aligned image"
+msgstr "Eskuinean lerrokatutako irudia"
+
+msgctxt "Label for the Change image text alternative button."
+msgid "Change image text alternative"
+msgstr "Aldatu irudiaren ordezko testua"
+
+msgctxt "Label for the image text alternative input."
+msgid "Text alternative"
+msgstr "Ordezko testua"
+
+msgctxt "Placeholder text for image caption displayed when caption is empty."
+msgid "Enter image caption"
+msgstr "Sartu irudiaren epigrafea"
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr "Txertatu irudia"
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr "Kargatzeak huts egin du"

+ 8 - 0
packages/ckeditor5-image/lang/translations/fi.po

@@ -40,3 +40,11 @@ msgstr "Vaihtoehtoinen teksti"
 msgctxt "Placeholder text for image caption displayed when caption is empty."
 msgid "Enter image caption"
 msgstr "Syötä kuvateksti"
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr "Lisää kuva"
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr "Lataus epäonnistui"

+ 8 - 0
packages/ckeditor5-image/lang/translations/fr.po

@@ -40,3 +40,11 @@ msgstr "Texte alternatif"
 msgctxt "Placeholder text for image caption displayed when caption is empty."
 msgid "Enter image caption"
 msgstr "Saisissez la légende de l’image"
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr "Insérer une image"
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr "Échec de l'envoi"

+ 8 - 0
packages/ckeditor5-image/lang/translations/gl.po

@@ -40,3 +40,11 @@ msgstr "Texto alternativo"
 msgctxt "Placeholder text for image caption displayed when caption is empty."
 msgid "Enter image caption"
 msgstr "Introduza o título da imaxe"
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr "Inserir imaxe"
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr "Fallou o envío"

+ 11 - 3
packages/ckeditor5-image/lang/translations/hr.po

@@ -19,15 +19,15 @@ msgstr "Slika pune veličine"
 
 msgctxt "Label for the Left aligned image option"
 msgid "Left aligned image"
-msgstr ""
+msgstr "Lijevo poravnata slika"
 
 msgctxt "Label for the Centered image option"
 msgid "Centered image"
-msgstr ""
+msgstr "Centrirana slika"
 
 msgctxt "Label for the Right aligned image option"
 msgid "Right aligned image"
-msgstr ""
+msgstr "Slika poravnata desno"
 
 msgctxt "Label for the Change image text alternative button."
 msgid "Change image text alternative"
@@ -40,3 +40,11 @@ msgstr "Alternativni tekst"
 msgctxt "Placeholder text for image caption displayed when caption is empty."
 msgid "Enter image caption"
 msgstr "Unesite naslov slike"
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr "Umetni sliku"
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr "Slanje nije uspjelo"

+ 8 - 0
packages/ckeditor5-image/lang/translations/hu.po

@@ -40,3 +40,11 @@ msgstr "Helyettesítő szöveg"
 msgctxt "Placeholder text for image caption displayed when caption is empty."
 msgid "Enter image caption"
 msgstr "Képaláírás megadása"
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr "Kép beszúrása"
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr "A feltöltés nem sikerült"

+ 8 - 0
packages/ckeditor5-image/lang/translations/it.po

@@ -40,3 +40,11 @@ msgstr "Testo alternativo"
 msgctxt "Placeholder text for image caption displayed when caption is empty."
 msgid "Enter image caption"
 msgstr "inserire didascalia dell'immagine"
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr "Inserisci immagine"
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr "Caricamento fallito"

+ 8 - 0
packages/ckeditor5-image/lang/translations/ja.po

@@ -40,3 +40,11 @@ msgstr "代替テキスト"
 msgctxt "Placeholder text for image caption displayed when caption is empty."
 msgid "Enter image caption"
 msgstr "画像の注釈を入力"
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr "画像挿入"
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr "アップロード失敗"

+ 8 - 0
packages/ckeditor5-image/lang/translations/km.po

@@ -40,3 +40,11 @@ msgstr ""
 msgctxt "Placeholder text for image caption displayed when caption is empty."
 msgid "Enter image caption"
 msgstr "បញ្ចូល​ពាក្យ​ពណ៌នា​រូបភាព"
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr "បញ្ចូល​រូបភាព"
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr "អាប់ឡូត​មិនបាន"

+ 8 - 0
packages/ckeditor5-image/lang/translations/kn.po

@@ -40,3 +40,11 @@ msgstr "‍ಪಠ್ಯದ ಬದಲಿ"
 msgctxt "Placeholder text for image caption displayed when caption is empty."
 msgid "Enter image caption"
 msgstr "‍ಚಿತ್ರದ ಶೀರ್ಷಿಕೆ ಸೇರಿಸು"
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr ""
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr ""

+ 8 - 0
packages/ckeditor5-image/lang/translations/ko.po

@@ -40,3 +40,11 @@ msgstr "대체 텍스트"
 msgctxt "Placeholder text for image caption displayed when caption is empty."
 msgid "Enter image caption"
 msgstr "이미지 설명을 입력하세요"
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr ""
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr ""

+ 8 - 0
packages/ckeditor5-image/lang/translations/ku.po

@@ -40,3 +40,11 @@ msgstr "جێگرەوەی تێکست"
 msgctxt "Placeholder text for image caption displayed when caption is empty."
 msgid "Enter image caption"
 msgstr "سەردێڕی وێنە دابنێ"
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr "وێنە دابنێ"
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr "بارکردنەکە سەرنەکەووت"

+ 11 - 3
packages/ckeditor5-image/lang/translations/nb.po

@@ -19,15 +19,15 @@ msgstr "Bilde i full størrelse"
 
 msgctxt "Label for the Left aligned image option"
 msgid "Left aligned image"
-msgstr ""
+msgstr "Venstrejustert bilde"
 
 msgctxt "Label for the Centered image option"
 msgid "Centered image"
-msgstr ""
+msgstr "Midtstilt bilde"
 
 msgctxt "Label for the Right aligned image option"
 msgid "Right aligned image"
-msgstr ""
+msgstr "Høyrejustert bilde"
 
 msgctxt "Label for the Change image text alternative button."
 msgid "Change image text alternative"
@@ -40,3 +40,11 @@ msgstr "Tekstalternativ for bilde"
 msgctxt "Placeholder text for image caption displayed when caption is empty."
 msgid "Enter image caption"
 msgstr "Skriv inn bildetekst"
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr "Sett inn bilde"
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr "Opplasting feilet"

+ 50 - 0
packages/ckeditor5-image/lang/translations/ne.po

@@ -0,0 +1,50 @@
+# Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
+msgid ""
+msgstr ""
+"Language: ne_NP\n"
+"Language-Team: Nepali (Nepal) (https://www.transifex.com/ckeditor/teams/11143/ne_NP/)\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgctxt "Label for the image widget."
+msgid "image widget"
+msgstr ""
+
+msgctxt "Label for the Side image option."
+msgid "Side image"
+msgstr ""
+
+msgctxt "Label for the Full size image option."
+msgid "Full size image"
+msgstr ""
+
+msgctxt "Label for the Left aligned image option"
+msgid "Left aligned image"
+msgstr ""
+
+msgctxt "Label for the Centered image option"
+msgid "Centered image"
+msgstr ""
+
+msgctxt "Label for the Right aligned image option"
+msgid "Right aligned image"
+msgstr ""
+
+msgctxt "Label for the Change image text alternative button."
+msgid "Change image text alternative"
+msgstr ""
+
+msgctxt "Label for the image text alternative input."
+msgid "Text alternative"
+msgstr ""
+
+msgctxt "Placeholder text for image caption displayed when caption is empty."
+msgid "Enter image caption"
+msgstr ""
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr "तस्वीर सम्मिलित गर्नुहोस्"
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr ""

+ 50 - 0
packages/ckeditor5-image/lang/translations/nl.po

@@ -0,0 +1,50 @@
+# Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
+msgid ""
+msgstr ""
+"Language: nl\n"
+"Language-Team: Dutch (https://www.transifex.com/ckeditor/teams/11143/nl/)\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgctxt "Label for the image widget."
+msgid "image widget"
+msgstr "Afbeeldingswidget"
+
+msgctxt "Label for the Side image option."
+msgid "Side image"
+msgstr "Afbeelding naast tekst"
+
+msgctxt "Label for the Full size image option."
+msgid "Full size image"
+msgstr "Afbeelding op volledige grootte"
+
+msgctxt "Label for the Left aligned image option"
+msgid "Left aligned image"
+msgstr "Links uitgelijnde afbeelding"
+
+msgctxt "Label for the Centered image option"
+msgid "Centered image"
+msgstr "Gecentreerde afbeelding"
+
+msgctxt "Label for the Right aligned image option"
+msgid "Right aligned image"
+msgstr "Rechts uitgelijnde afbeelding"
+
+msgctxt "Label for the Change image text alternative button."
+msgid "Change image text alternative"
+msgstr "Verander alt-tekst van de afbeelding"
+
+msgctxt "Label for the image text alternative input."
+msgid "Text alternative"
+msgstr "Alt-tekst"
+
+msgctxt "Placeholder text for image caption displayed when caption is empty."
+msgid "Enter image caption"
+msgstr "Typ een afbeeldingsbijschrift"
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr "Afbeelding toevoegen"
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr "Opladen afbeelding mislukt"

+ 50 - 0
packages/ckeditor5-image/lang/translations/pl.po

@@ -0,0 +1,50 @@
+# Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
+msgid ""
+msgstr ""
+"Language: pl\n"
+"Language-Team: Polish (https://www.transifex.com/ckeditor/teams/11143/pl/)\n"
+"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n"
+
+msgctxt "Label for the image widget."
+msgid "image widget"
+msgstr ""
+
+msgctxt "Label for the Side image option."
+msgid "Side image"
+msgstr ""
+
+msgctxt "Label for the Full size image option."
+msgid "Full size image"
+msgstr ""
+
+msgctxt "Label for the Left aligned image option"
+msgid "Left aligned image"
+msgstr ""
+
+msgctxt "Label for the Centered image option"
+msgid "Centered image"
+msgstr ""
+
+msgctxt "Label for the Right aligned image option"
+msgid "Right aligned image"
+msgstr ""
+
+msgctxt "Label for the Change image text alternative button."
+msgid "Change image text alternative"
+msgstr ""
+
+msgctxt "Label for the image text alternative input."
+msgid "Text alternative"
+msgstr ""
+
+msgctxt "Placeholder text for image caption displayed when caption is empty."
+msgid "Enter image caption"
+msgstr ""
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr "Wstaw obraz"
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr ""

+ 8 - 0
packages/ckeditor5-image/lang/translations/pt-br.po

@@ -40,3 +40,11 @@ msgstr "Texto alternativo"
 msgctxt "Placeholder text for image caption displayed when caption is empty."
 msgid "Enter image caption"
 msgstr "Inserir legenda da imagem"
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr "Inserir imagem"
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr "Falha ao subir arquivo"

+ 8 - 0
packages/ckeditor5-image/lang/translations/pt.po

@@ -40,3 +40,11 @@ msgstr "Texto alternativo"
 msgctxt "Placeholder text for image caption displayed when caption is empty."
 msgid "Enter image caption"
 msgstr "Indicar legenda da imagem"
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr "Inserir imagem"
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr "Falha ao carregar"

+ 8 - 0
packages/ckeditor5-image/lang/translations/ro.po

@@ -40,3 +40,11 @@ msgstr "Text alternativ"
 msgctxt "Placeholder text for image caption displayed when caption is empty."
 msgid "Enter image caption"
 msgstr "Introdu titlul descriptiv al imaginii"
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr "Inserează imagine"
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr "Încărcare eșuată"

+ 50 - 0
packages/ckeditor5-image/lang/translations/ru.po

@@ -0,0 +1,50 @@
+# Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
+msgid ""
+msgstr ""
+"Language: ru\n"
+"Language-Team: Russian (https://www.transifex.com/ckeditor/teams/11143/ru/)\n"
+"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n"
+
+msgctxt "Label for the image widget."
+msgid "image widget"
+msgstr "Виджет изображений"
+
+msgctxt "Label for the Side image option."
+msgid "Side image"
+msgstr "Боковое изображение"
+
+msgctxt "Label for the Full size image option."
+msgid "Full size image"
+msgstr "Оригинальный размер изображения"
+
+msgctxt "Label for the Left aligned image option"
+msgid "Left aligned image"
+msgstr "Выравнивание по левому краю"
+
+msgctxt "Label for the Centered image option"
+msgid "Centered image"
+msgstr "Выравнивание по центру"
+
+msgctxt "Label for the Right aligned image option"
+msgid "Right aligned image"
+msgstr "Выравнивание по правому краю"
+
+msgctxt "Label for the Change image text alternative button."
+msgid "Change image text alternative"
+msgstr "Редактировать альтернативный текст"
+
+msgctxt "Label for the image text alternative input."
+msgid "Text alternative"
+msgstr "Альтернативный текст"
+
+msgctxt "Placeholder text for image caption displayed when caption is empty."
+msgid "Enter image caption"
+msgstr "Подпись к изображению"
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr "Вставить изображение"
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr "Загрузка не выполнена"

+ 50 - 0
packages/ckeditor5-image/lang/translations/si.po

@@ -0,0 +1,50 @@
+# Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
+msgid ""
+msgstr ""
+"Language: si_LK\n"
+"Language-Team: Sinhala (Sri Lanka) (https://www.transifex.com/ckeditor/teams/11143/si_LK/)\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgctxt "Label for the image widget."
+msgid "image widget"
+msgstr ""
+
+msgctxt "Label for the Side image option."
+msgid "Side image"
+msgstr ""
+
+msgctxt "Label for the Full size image option."
+msgid "Full size image"
+msgstr ""
+
+msgctxt "Label for the Left aligned image option"
+msgid "Left aligned image"
+msgstr ""
+
+msgctxt "Label for the Centered image option"
+msgid "Centered image"
+msgstr ""
+
+msgctxt "Label for the Right aligned image option"
+msgid "Right aligned image"
+msgstr ""
+
+msgctxt "Label for the Change image text alternative button."
+msgid "Change image text alternative"
+msgstr ""
+
+msgctxt "Label for the image text alternative input."
+msgid "Text alternative"
+msgstr ""
+
+msgctxt "Placeholder text for image caption displayed when caption is empty."
+msgid "Enter image caption"
+msgstr ""
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr "පින්තූරය ඇතුල් කරන්න"
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr "උඩුගත කිරීම අසාර්ථක විය"

+ 8 - 0
packages/ckeditor5-image/lang/translations/sk.po

@@ -40,3 +40,11 @@ msgstr "Alternatívny text"
 msgctxt "Placeholder text for image caption displayed when caption is empty."
 msgid "Enter image caption"
 msgstr "Vložte popis obrázka"
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr "Vložiť obrázok"
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr "Nahrávanie zlyhalo"

+ 50 - 0
packages/ckeditor5-image/lang/translations/sq.po

@@ -0,0 +1,50 @@
+# Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
+msgid ""
+msgstr ""
+"Language: sq\n"
+"Language-Team: Albanian (https://www.transifex.com/ckeditor/teams/11143/sq/)\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgctxt "Label for the image widget."
+msgid "image widget"
+msgstr "Vegla e fotos"
+
+msgctxt "Label for the Side image option."
+msgid "Side image"
+msgstr "Foto anësore"
+
+msgctxt "Label for the Full size image option."
+msgid "Full size image"
+msgstr "Foto me madhësi të plotë"
+
+msgctxt "Label for the Left aligned image option"
+msgid "Left aligned image"
+msgstr "Foto e vendosur majtas"
+
+msgctxt "Label for the Centered image option"
+msgid "Centered image"
+msgstr "Foto e vendosur në mes"
+
+msgctxt "Label for the Right aligned image option"
+msgid "Right aligned image"
+msgstr "Foto e vendosur djathtas"
+
+msgctxt "Label for the Change image text alternative button."
+msgid "Change image text alternative"
+msgstr "Ndrysho tekstin alternativ të fotos"
+
+msgctxt "Label for the image text alternative input."
+msgid "Text alternative"
+msgstr "Teksti alternativ"
+
+msgctxt "Placeholder text for image caption displayed when caption is empty."
+msgid "Enter image caption"
+msgstr "Shto përshkrimin e fotos"
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr "Shto Foto"
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr "Ngarkimi dishtoi"

+ 50 - 0
packages/ckeditor5-image/lang/translations/sv.po

@@ -0,0 +1,50 @@
+# Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
+msgid ""
+msgstr ""
+"Language: sv\n"
+"Language-Team: Swedish (https://www.transifex.com/ckeditor/teams/11143/sv/)\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgctxt "Label for the image widget."
+msgid "image widget"
+msgstr ""
+
+msgctxt "Label for the Side image option."
+msgid "Side image"
+msgstr ""
+
+msgctxt "Label for the Full size image option."
+msgid "Full size image"
+msgstr ""
+
+msgctxt "Label for the Left aligned image option"
+msgid "Left aligned image"
+msgstr ""
+
+msgctxt "Label for the Centered image option"
+msgid "Centered image"
+msgstr ""
+
+msgctxt "Label for the Right aligned image option"
+msgid "Right aligned image"
+msgstr ""
+
+msgctxt "Label for the Change image text alternative button."
+msgid "Change image text alternative"
+msgstr ""
+
+msgctxt "Label for the image text alternative input."
+msgid "Text alternative"
+msgstr ""
+
+msgctxt "Placeholder text for image caption displayed when caption is empty."
+msgid "Enter image caption"
+msgstr ""
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr "Infoga bild"
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr "Uppladdning misslyckades"

+ 11 - 3
packages/ckeditor5-image/lang/translations/tr.po

@@ -19,15 +19,15 @@ msgstr "Tam Boyut Görsel"
 
 msgctxt "Label for the Left aligned image option"
 msgid "Left aligned image"
-msgstr ""
+msgstr "Sola hizalı görsel"
 
 msgctxt "Label for the Centered image option"
 msgid "Centered image"
-msgstr ""
+msgstr "Ortalı görsel"
 
 msgctxt "Label for the Right aligned image option"
 msgid "Right aligned image"
-msgstr ""
+msgstr "Sağa hizalı görsel"
 
 msgctxt "Label for the Change image text alternative button."
 msgid "Change image text alternative"
@@ -40,3 +40,11 @@ msgstr "Yazı alternatifi"
 msgctxt "Placeholder text for image caption displayed when caption is empty."
 msgid "Enter image caption"
 msgstr "Resim Açıklaması Gir"
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr "Görsel Ekle"
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr "Yükleme başarsız"

+ 50 - 0
packages/ckeditor5-image/lang/translations/ug.po

@@ -0,0 +1,50 @@
+# Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
+msgid ""
+msgstr ""
+"Language: ug\n"
+"Language-Team: Uighur (https://www.transifex.com/ckeditor/teams/11143/ug/)\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+msgctxt "Label for the image widget."
+msgid "image widget"
+msgstr "رەسىمچىك"
+
+msgctxt "Label for the Side image option."
+msgid "Side image"
+msgstr "يان رەسىم"
+
+msgctxt "Label for the Full size image option."
+msgid "Full size image"
+msgstr "ئەسلى چوڭلۇقتىكى رەسىم"
+
+msgctxt "Label for the Left aligned image option"
+msgid "Left aligned image"
+msgstr "سولغا توغۇرلانغان رەسىم"
+
+msgctxt "Label for the Centered image option"
+msgid "Centered image"
+msgstr "ئوتتۇردىكى رەسىم"
+
+msgctxt "Label for the Right aligned image option"
+msgid "Right aligned image"
+msgstr "ئوڭغا توغۇرلانغان رەسىم"
+
+msgctxt "Label for the Change image text alternative button."
+msgid "Change image text alternative"
+msgstr "رەسىملىك تېكىست تاللىغۇچنى ئۆزگەرتىش"
+
+msgctxt "Label for the image text alternative input."
+msgid "Text alternative"
+msgstr "تېكىست ئاملاشتۇرۇش"
+
+msgctxt "Placeholder text for image caption displayed when caption is empty."
+msgid "Enter image caption"
+msgstr "رەسىمنىڭ تېمىسىنى كىرگۈزۈڭ"
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr "رەسىم قىستۇرۇش"
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr "چىقىرىش مەغلۇپ بولدى"

+ 8 - 0
packages/ckeditor5-image/lang/translations/uk.po

@@ -40,3 +40,11 @@ msgstr ""
 msgctxt "Placeholder text for image caption displayed when caption is empty."
 msgid "Enter image caption"
 msgstr ""
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr ""
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr ""

+ 8 - 0
packages/ckeditor5-image/lang/translations/zh-cn.po

@@ -40,3 +40,11 @@ msgstr "替换文本"
 msgctxt "Placeholder text for image caption displayed when caption is empty."
 msgid "Enter image caption"
 msgstr "输入图片标题"
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr "插入图像"
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr "上传失败"

+ 8 - 0
packages/ckeditor5-image/lang/translations/zh.po

@@ -40,3 +40,11 @@ msgstr "文字替代"
 msgctxt "Placeholder text for image caption displayed when caption is empty."
 msgid "Enter image caption"
 msgstr "輸入圖片說明"
+
+msgctxt "Label for the insert image toolbar button."
+msgid "Insert image"
+msgstr "插入圖片"
+
+msgctxt "Title of the notification displayed when upload fails."
+msgid "Upload failed"
+msgstr "上傳失敗"

+ 8 - 9
packages/ckeditor5-image/src/imagestyle.js

@@ -37,12 +37,11 @@ export default class ImageStyle extends Plugin {
 
 /**
  * Available image styles.
- * The option is used by the {@link module:image/imagestyle/imagestyleediting~ImageStyleEditing} feature.
  *
  * The default value is:
  *
  *		const imageConfig = {
- *			styles: [ 'imageStyleFull', 'imageStyleSide' ]
+ *			styles: [ 'full', 'side' ]
  *		};
  *
  * which configures two default styles:
@@ -65,10 +64,10 @@ export default class ImageStyle extends Plugin {
  *			styles: [
  *				// This will only customize the icon of the "full" style.
  *				// Note: 'right' is one of default icons provided by the feature.
- *				{ name: 'imageStyleFull', icon: 'right' },
+ *				{ name: 'full', icon: 'right' },
  *
  *				// This will customize the icon, title and CSS class of the default "side" style.
- *				{ name: 'imageStyleSide', icon: customIcon, title: 'My side style', class: 'custom-side-image' }
+ *				{ name: 'side', icon: customIcon, title: 'My side style', class: 'custom-side-image' }
  *			]
  *		};
  *
@@ -96,14 +95,14 @@ export default class ImageStyle extends Plugin {
  * The feature creates commands based on defined styles, so you can change the style of a selected image by executing
  * the following command:
  *
- *		editor.execute( 'imageStyleSide' );
+ *		editor.execute( 'imageStyle' { value: 'side' } );
  *
- * The features creates also buttons which execute the commands, so assuming that you use the
- * default image styles setting you can {@link module:image/image~ImageConfig#toolbar configure the image toolbar}
- * to contain these options:
+ * The feature creates also buttons which execute the command. So, assuming that you use the
+ * default image styles setting, you can {@link module:image/image~ImageConfig#toolbar configure the image toolbar}
+ * (or any other toolbar) to contain these options:
  *
  *		const imageConfig = {
- *			toolbar: [ 'imageStyleFull', 'imageStyleSide' ]
+ *			toolbar: [ 'imageStyle:full', 'imageStyle:side' ]
  *		};
  *
  * @member {Array.<module:image/imagestyle/imagestyleediting~ImageStyleFormat>} module:image/image~ImageConfig#styles

+ 31 - 16
packages/ckeditor5-image/src/imagestyle/imagestylecommand.js

@@ -20,27 +20,34 @@ export default class ImageStyleCommand extends Command {
 	 * Creates an instance of the image style command. Each command instance is handling one style.
 	 *
 	 * @param {module:core/editor/editor~Editor} editor The editor instance.
-	 * @param {module:image/imagestyle/imagestyleediting~ImageStyleFormat} style A style to be applied by this command.
+	 * @param {Array.<module:image/imagestyle/imagestyleediting~ImageStyleFormat>} styles A styles that this command supports.
 	 */
-	constructor( editor, style ) {
+	constructor( editor, styles ) {
 		super( editor );
 
 		/**
-		 * The value of the command &mdash; `true` if a style handled by the command is applied on a currently selected image,
-		 * `false` otherwise.
+		 * Cached name of the default style if present. If there is no default style it defaults to `false`.
 		 *
-		 * @readonly
-		 * @observable
-		 * @member {Boolean} #value
+		 * @type {Boolean|String}
+		 * @private
 		 */
+		this._defaultStyle = false;
 
 		/**
 		 * A style handled by this command.
 		 *
 		 * @readonly
-		 * @member {module:image/imagestyle/imagestyleediting~ImageStyleFormat} #style
+		 * @member {Array.<module:image/imagestyle/imagestyleediting~ImageStyleFormat>} #styles
 		 */
-		this.style = style;
+		this.styles = styles.reduce( ( styles, style ) => {
+			styles[ style.name ] = style;
+
+			if ( style.isDefault ) {
+				this._defaultStyle = style.name;
+			}
+
+			return styles;
+		}, {} );
 	}
 
 	/**
@@ -53,20 +60,28 @@ export default class ImageStyleCommand extends Command {
 
 		if ( !element ) {
 			this.value = false;
-		} else if ( this.style.isDefault ) {
-			this.value = !element.hasAttribute( 'imageStyle' );
+		} else if ( element.hasAttribute( 'imageStyle' ) ) {
+			const attributeValue = element.getAttribute( 'imageStyle' );
+			this.value = this.styles[ attributeValue ] ? attributeValue : false;
 		} else {
-			this.value = ( element.getAttribute( 'imageStyle' ) == this.style.name );
+			this.value = this._defaultStyle;
 		}
 	}
 
 	/**
 	 * Executes the command.
 	 *
+	 *		editor.execute( 'imageStyle', { value: 'side' } );
+	 *
+	 * @param {Object} options
+	 * @param {String} options.value The name of the style (based on the
+	 * {@link module:image/image~ImageConfig#styles `image.styles`} configuration option).
 	 * @fires execute
 	 */
-	execute() {
-		if ( this.value ) {
+	execute( options = {} ) {
+		const styleName = options.value;
+
+		if ( !this.styles[ styleName ] ) {
 			return;
 		}
 
@@ -76,10 +91,10 @@ export default class ImageStyleCommand extends Command {
 		model.change( writer => {
 			// Default style means that there is no `imageStyle` attribute in the model.
 			// https://github.com/ckeditor/ckeditor5-image/issues/147
-			if ( this.style.isDefault ) {
+			if ( this.styles[ styleName ].isDefault ) {
 				writer.removeAttribute( 'imageStyle', imageElement );
 			} else {
-				writer.setAttribute( 'imageStyle', this.style.name, imageElement );
+				writer.setAttribute( 'imageStyle', styleName, imageElement );
 			}
 		} );
 	}

+ 20 - 13
packages/ckeditor5-image/src/imagestyle/imagestyleediting.js

@@ -44,7 +44,7 @@ export default class ImageStyleEditing extends Plugin {
 		const editing = editor.editing;
 
 		// Define default configuration.
-		editor.config.define( 'image.styles', [ 'imageStyleFull', 'imageStyleSide' ] );
+		editor.config.define( 'image.styles', [ 'full', 'side' ] );
 
 		// Get configuration.
 		const styles = normalizeImageStyles( editor.config.get( 'image.styles' ) );
@@ -61,35 +61,42 @@ export default class ImageStyleEditing extends Plugin {
 		// Converter for figure element from view to model.
 		data.upcastDispatcher.on( 'element:figure', viewToModelStyleAttribute( styles ), { priority: 'low' } );
 
-		// Register separate command for each style.
-		for ( const style of styles ) {
-			editor.commands.add( style.name, new ImageStyleCommand( editor, style ) );
-		}
+		// Register imageStyle command.
+		editor.commands.add( 'imageStyle', new ImageStyleCommand( editor, styles ) );
 	}
 }
 
 /**
  * Image style format descriptor.
  *
- *		import fullWidthIcon from 'path/to/icon.svg`;
+ *		import fullSizeIcon from 'path/to/icon.svg';
  *
  *		const imageStyleFormat = {
- *			name: 'fullSizeImage',
- *			icon: fullWidthIcon,
+ *			name: 'fullSize',
+ *			icon: fullSizeIcon,
  *			title: 'Full size image',
  *			className: 'image-full-size'
  *		}
  *
  * @typedef {Object} module:image/imagestyle/imagestyleediting~ImageStyleFormat
+ *
  * @property {String} name The unique name of the style. It will be used to:
- * * register the {@link module:core/command~Command command} which will apply this style,
- * * store the style's button in the editor {@link module:ui/componentfactory~ComponentFactory},
- * * store the style in the `imageStyle` model attribute.
+ *
+ * * store the chosen style in the model by setting the `imageStyle` attribute of the `<image>` element,
+ * * as a value of the {@link module:image/imagestyle/imagestylecommand~ImageStyleCommand#execute `imageStyle` command},
+ * * when registering button for each of the styles (`'imageStyle:{name}'`) in the
+ * {@link module:ui/componentfactory~ComponentFactory UI components factory} (this functionality is provided by the
+ * {@link module:image/imagestyle/imagestyleui~ImageStyleUI} plugin),
+ *
  * @property {Boolean} [isDefault] When set, the style will be used as the default one.
  * A default style does not apply any CSS class to the view element.
+ *
  * @property {String} icon One of the following to be used when creating the style's button:
- *  * An SVG icon source (as an XML string),
- *  * One of {@link module:image/imagestyle/utils~defaultIcons} to use a default icon provided by the plugin.
+ *
+ * * An SVG icon source (as an XML string),
+ * * One of {@link module:image/imagestyle/utils~defaultIcons} to use a default icon provided by the plugin.
+ *
  * @property {String} title The style's title.
+ *
  * @property {String} className The CSS class used to represent the style in view.
  */

+ 6 - 4
packages/ckeditor5-image/src/imagestyle/imagestyleui.js

@@ -69,8 +69,10 @@ export default class ImageStyleUI extends Plugin {
 	_createButton( style ) {
 		const editor = this.editor;
 
-		editor.ui.componentFactory.add( style.name, locale => {
-			const command = editor.commands.get( style.name );
+		const componentName = `imageStyle:${ style.name }`;
+
+		editor.ui.componentFactory.add( componentName, locale => {
+			const command = editor.commands.get( 'imageStyle' );
 			const view = new ButtonView( locale );
 
 			view.set( {
@@ -80,9 +82,9 @@ export default class ImageStyleUI extends Plugin {
 			} );
 
 			view.bind( 'isEnabled' ).to( command, 'isEnabled' );
-			view.bind( 'isOn' ).to( command, 'value' );
+			view.bind( 'isOn' ).to( command, 'value', value => value === style.name );
 
-			this.listenTo( view, 'execute', () => editor.execute( style.name ) );
+			this.listenTo( view, 'execute', () => editor.execute( 'imageStyle', { value: style.name } ) );
 
 			return view;
 		} );

+ 22 - 21
packages/ckeditor5-image/src/imagestyle/utils.js

@@ -20,53 +20,53 @@ import rightIcon from '@ckeditor/ckeditor5-core/theme/icons/object-right.svg';
  *
  * Among them, 2 default semantic content styles are available:
  *
- * * `imageStyleFull` is a full–width image without any CSS class,
- * * `imageStyleSide` is a side image styled with the `image-style-side` CSS class
+ * * `full` is a full–width image without any CSS class,
+ * * `side` is a side image styled with the `image-style-side` CSS class
  *
  * There are also 3 styles focused on formatting:
  *
- * * `imageStyleAlignLeft` aligns the image to the left using the `image-style-align-left` class,
- * * `imageStyleAlignCenter` centers the image to the left using the `image-style-align-center` class,
- * * `imageStyleAlignRight` aligns the image to the right using the `image-style-align-right` class,
+ * * `alignLeft` aligns the image to the left using the `image-style-align-left` class,
+ * * `alignCenter` centers the image to the left using the `image-style-align-center` class,
+ * * `alignRight` aligns the image to the right using the `image-style-align-right` class,
  *
  * @member {Object.<String,Object>}
  */
 const defaultStyles = {
 	// This option is equal to situation when no style is applied.
-	imageStyleFull: {
-		name: 'imageStyleFull',
+	full: {
+		name: 'full',
 		title: 'Full size image',
 		icon: fullWidthIcon,
 		isDefault: true
 	},
 
 	// This represents side image.
-	imageStyleSide: {
-		name: 'imageStyleSide',
+	side: {
+		name: 'side',
 		title: 'Side image',
 		icon: rightIcon,
 		className: 'image-style-side'
 	},
 
 	// This style represents an imaged aligned to the left.
-	imageStyleAlignLeft: {
-		name: 'imageStyleAlignLeft',
+	alignLeft: {
+		name: 'alignLeft',
 		title: 'Left aligned image',
 		icon: leftIcon,
 		className: 'image-style-align-left'
 	},
 
 	// This style represents a centered imaged.
-	imageStyleAlignCenter: {
-		name: 'imageStyleAlignCenter',
+	alignCenter: {
+		name: 'alignCenter',
 		title: 'Centered image',
 		icon: centerIcon,
 		className: 'image-style-align-center'
 	},
 
 	// This style represents an imaged aligned to the right.
-	imageStyleAlignRight: {
-		name: 'imageStyleAlignRight',
+	alignRight: {
+		name: 'alignRight',
 		title: 'Right aligned image',
 		icon: rightIcon,
 		className: 'image-style-align-right'
@@ -108,25 +108,26 @@ export function normalizeImageStyles( configuredStyles = [] ) {
 function _normalizeStyle( style ) {
 	// Just the name of the style has been passed.
 	if ( typeof style == 'string' ) {
+		const styleName = style;
+
 		// If it's one of the defaults, just use it.
-		// Clone the style to avoid overriding defaults.
-		if ( defaultStyles[ style ] ) {
-			style = Object.assign( {}, defaultStyles[ style ] );
+		if ( defaultStyles[ styleName ] ) {
+			// Clone the style to avoid overriding defaults.
+			style = Object.assign( {}, defaultStyles[ styleName ] );
 		}
 		// If it's just a name but none of the defaults, warn because probably it's a mistake.
 		else {
 			log.warn(
 				'image-style-not-found: There is no such image style of given name.',
-				{ name: style }
+				{ name: styleName }
 			);
 
 			// Normalize the style anyway to prevent errors.
 			style = {
-				name: style
+				name: styleName
 			};
 		}
 	}
-
 	// If an object style has been passed and if the name matches one of the defaults,
 	// extend it with defaults – the user wants to customize a default style.
 	// Note: Don't override the user–defined style object, clone it instead.

+ 2 - 2
packages/ckeditor5-image/src/imagetoolbar.js

@@ -178,10 +178,10 @@ export default class ImageToolbar extends Plugin {
  * * {@link module:image/imagetextalternative~ImageTextAlternative}.
  *
  * Three toolbar items will be available in {@link module:ui/componentfactory~ComponentFactory}:
- * `'imageStyleFull'`, `'imageStyleSide'`, and `'imageTextAlternative'` so you can configure the toolbar like this:
+ * `'imageStyle:full'`, `'imageStyle:side'`, and `'imageTextAlternative'` so you can configure the toolbar like this:
  *
  *		const imageConfig = {
- *			toolbar: [ 'imageStyleFull', 'imageStyleSide', '|', 'imageTextAlternative' ]
+ *			toolbar: [ 'imageStyle:full', 'imageStyle:side', '|', 'imageTextAlternative' ]
  *		};
  *
  * Of course, the same buttons can also be used in the

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

@@ -14,7 +14,7 @@ import { isImageType, findOptimalInsertionPosition } from './utils';
 
 /**
  * Image upload button plugin.
- * Adds `uploadImage` button to UI component factory.
+ * Adds `imageUpload` button to UI component factory.
  *
  * @extends module:core/plugin~Plugin
  */
@@ -26,8 +26,8 @@ export default class ImageUploadUI extends Plugin {
 		const editor = this.editor;
 		const t = editor.t;
 
-		// Setup `uploadImage` button.
-		editor.ui.componentFactory.add( 'uploadImage', locale => {
+		// Setup `imageUpload` button.
+		editor.ui.componentFactory.add( 'imageUpload', locale => {
 			const view = new FileDialogButtonView( locale );
 			const command = editor.commands.get( 'imageUpload' );
 

+ 32 - 26
packages/ckeditor5-image/tests/imagestyle/imagestylecommand.js

@@ -11,14 +11,13 @@ describe( 'ImageStyleCommand', () => {
 	const defaultStyle = { name: 'defaultStyle', title: 'foo bar', icon: 'icon-1', isDefault: true };
 	const otherStyle = { name: 'otherStyle', title: 'baz', icon: 'icon-2', className: 'other-class-name' };
 
-	let model, defaultStyleCommand, otherStyleCommand;
+	let model, command;
 
 	beforeEach( () => {
 		return ModelTestEditor.create()
 			.then( newEditor => {
 				model = newEditor.model;
-				defaultStyleCommand = new ImageStyleCommand( newEditor, defaultStyle );
-				otherStyleCommand = new ImageStyleCommand( newEditor, otherStyle );
+				command = new ImageStyleCommand( newEditor, [ defaultStyle, otherStyle ] );
 
 				model.schema.register( 'p', { inheritAllFrom: '$block' } );
 
@@ -34,35 +33,31 @@ describe( 'ImageStyleCommand', () => {
 	it( 'command value should be false if no image is selected', () => {
 		setData( model, '[]<image></image>' );
 
-		expect( defaultStyleCommand.value ).to.be.false;
-		expect( otherStyleCommand.value ).to.be.false;
+		expect( command.value ).to.be.false;
 	} );
 
 	it( 'should match default style if no imageStyle attribute is present', () => {
 		setData( model, '[<image></image>]' );
 
-		expect( defaultStyleCommand.value ).to.be.true;
-		expect( otherStyleCommand.value ).to.be.false;
+		expect( command.value ).to.equal( 'defaultStyle' );
 	} );
 
 	it( 'proper command should have true value when imageStyle attribute is present', () => {
 		setData( model, '[<image imageStyle="otherStyle"></image>]' );
 
-		expect( defaultStyleCommand.value ).to.be.false;
-		expect( otherStyleCommand.value ).to.be.true;
+		expect( command.value ).to.equal( 'otherStyle' );
 	} );
 
 	it( 'should have false value if style does not match', () => {
 		setData( model, '[<image imageStyle="foo"></image>]' );
 
-		expect( defaultStyleCommand.value ).to.be.false;
-		expect( otherStyleCommand.value ).to.be.false;
+		expect( command.value ).to.be.false;
 	} );
 
 	it( 'should set proper value when executed', () => {
 		setData( model, '[<image></image>]' );
 
-		otherStyleCommand.execute();
+		command.execute( { value: 'otherStyle' } );
 
 		expect( getData( model ) ).to.equal( '[<image imageStyle="otherStyle"></image>]' );
 	} );
@@ -70,7 +65,23 @@ describe( 'ImageStyleCommand', () => {
 	it( 'should do nothing when attribute already present', () => {
 		setData( model, '[<image imageStyle="otherStyle"></image>]' );
 
-		otherStyleCommand.execute();
+		command.execute( { value: 'otherStyle' } );
+
+		expect( getData( model ) ).to.equal( '[<image imageStyle="otherStyle"></image>]' );
+	} );
+
+	it( 'should do nothing attribute is not known', () => {
+		setData( model, '[<image imageStyle="otherStyle"></image>]' );
+
+		command.execute( { value: 'someNotExistingStyle' } );
+
+		expect( getData( model ) ).to.equal( '[<image imageStyle="otherStyle"></image>]' );
+	} );
+
+	it( 'should do nothing when value is not passed', () => {
+		setData( model, '[<image imageStyle="otherStyle"></image>]' );
+
+		command.execute();
 
 		expect( getData( model ) ).to.equal( '[<image imageStyle="otherStyle"></image>]' );
 	} );
@@ -81,7 +92,7 @@ describe( 'ImageStyleCommand', () => {
 		model.change( writer => {
 			expect( writer.batch.deltas ).to.length( 0 );
 
-			otherStyleCommand.execute();
+			command.execute( { value: 'otherStyle' } );
 
 			expect( writer.batch.deltas ).to.length.above( 0 );
 		} );
@@ -90,38 +101,33 @@ describe( 'ImageStyleCommand', () => {
 	it( 'should be enabled on image element', () => {
 		setData( model, '[<image></image>]' );
 
-		expect( defaultStyleCommand.isEnabled ).to.be.true;
-		expect( otherStyleCommand.isEnabled ).to.be.true;
+		expect( command.isEnabled ).to.be.true;
 	} );
 
 	it( 'should be disabled when not placed on image', () => {
 		setData( model, '[<p></p>]' );
 
-		expect( defaultStyleCommand.isEnabled ).to.be.false;
-		expect( otherStyleCommand.isEnabled ).to.be.false;
+		expect( command.isEnabled ).to.be.false;
 	} );
 
 	it( 'should be disabled when not placed directly on image', () => {
 		setData( model, '[<p></p><image></image>]' );
 
-		expect( defaultStyleCommand.isEnabled ).to.be.false;
-		expect( otherStyleCommand.isEnabled ).to.be.false;
+		expect( command.isEnabled ).to.be.false;
 	} );
 
 	it( 'default style should be active after executing it after another style', () => {
 		setData( model, '[<image></image>]' );
 
-		expect( defaultStyleCommand.value ).to.be.true;
-		expect( otherStyleCommand.value ).to.be.false;
+		expect( command.value ).to.equal( 'defaultStyle' );
 
-		otherStyleCommand.execute();
+		command.execute( { value: 'otherStyle' } );
 
 		expect( getData( model ) ).to.equal( '[<image imageStyle="otherStyle"></image>]' );
 
-		defaultStyleCommand.execute();
+		command.execute( { value: 'defaultStyle' } );
 
 		expect( getData( model ) ).to.equal( '[<image></image>]' );
-		expect( defaultStyleCommand.value ).to.be.true;
-		expect( otherStyleCommand.value ).to.be.false;
+		expect( command.value ).to.equal( 'defaultStyle' );
 	} );
 } );

+ 8 - 10
packages/ckeditor5-image/tests/imagestyle/imagestyleediting.js

@@ -71,7 +71,7 @@ describe( 'ImageStyleEditing', () => {
 				.then( newEditor => {
 					editor = newEditor;
 
-					expect( newEditor.config.get( 'image.styles' ) ).to.deep.equal( [ 'imageStyleFull', 'imageStyleSide' ] );
+					expect( newEditor.config.get( 'image.styles' ) ).to.deep.equal( [ 'full', 'side' ] );
 				} );
 		} );
 
@@ -81,10 +81,8 @@ describe( 'ImageStyleEditing', () => {
 			expect( schema.checkAttribute( [ '$root', 'image' ], 'imageStyle' ) ).to.be.true;
 		} );
 
-		it( 'should register separate command for each style', () => {
-			expect( editor.commands.get( 'fullStyle' ) ).to.be.instanceOf( ImageStyleCommand );
-			expect( editor.commands.get( 'sideStyle' ) ).to.be.instanceOf( ImageStyleCommand );
-			expect( editor.commands.get( 'dummyStyle' ) ).to.be.instanceOf( ImageStyleCommand );
+		it( 'should register a command', () => {
+			expect( editor.commands.get( 'imageStyle' ) ).to.be.instanceOf( ImageStyleCommand );
 		} );
 
 		it( 'should convert from view to model', () => {
@@ -266,7 +264,7 @@ describe( 'ImageStyleEditing', () => {
 				.then( newEditor => {
 					editor = newEditor;
 
-					expect( newEditor.config.get( 'image.styles' ) ).to.deep.equal( [ 'imageStyleFull', 'imageStyleSide' ] );
+					expect( newEditor.config.get( 'image.styles' ) ).to.deep.equal( [ 'full', 'side' ] );
 				} );
 		} );
 
@@ -276,14 +274,14 @@ describe( 'ImageStyleEditing', () => {
 					plugins: [ ImageStyleEditing ],
 					image: {
 						styles: [
-							'imageStyleSide'
+							'side'
 						]
 					}
 				} )
 				.then( newEditor => {
 					editor = newEditor;
 
-					expect( newEditor.config.get( 'image.styles' ) ).to.deep.equal( [ 'imageStyleSide' ] );
+					expect( newEditor.config.get( 'image.styles' ) ).to.deep.equal( [ 'side' ] );
 				} );
 		} );
 
@@ -293,14 +291,14 @@ describe( 'ImageStyleEditing', () => {
 					plugins: [ ImageStyleEditing ],
 					image: {
 						styles: [
-							{ name: 'imageStyleSide' }
+							{ name: 'side' }
 						]
 					}
 				} )
 				.then( newEditor => {
 					editor = newEditor;
 
-					expect( newEditor.config.get( 'image.styles' ) ).to.deep.equal( [ { name: 'imageStyleSide' } ] );
+					expect( newEditor.config.get( 'image.styles' ) ).to.deep.equal( [ { name: 'side' } ] );
 				} );
 		} );
 	} );

+ 5 - 4
packages/ckeditor5-image/tests/imagestyle/imagestyleui.js

@@ -43,9 +43,10 @@ describe( 'ImageStyleUI', () => {
 	it( 'should register buttons for each style', () => {
 		const spy = sinon.spy( editor, 'execute' );
 
+		const command = editor.commands.get( 'imageStyle' );
+
 		for ( const style of styles ) {
-			const command = editor.commands.get( style.name );
-			const buttonView = editor.ui.componentFactory.create( style.name );
+			const buttonView = editor.ui.componentFactory.create( `imageStyle:${ style.name }` );
 
 			expect( buttonView ).to.be.instanceOf( ButtonView );
 			expect( buttonView.label ).to.equal( style.title );
@@ -57,7 +58,7 @@ describe( 'ImageStyleUI', () => {
 			expect( buttonView.isEnabled ).to.be.false;
 
 			buttonView.fire( 'execute' );
-			sinon.assert.calledWithExactly( editor.execute, style.name );
+			sinon.assert.calledWithExactly( editor.execute, 'imageStyle', { value: style.name } );
 
 			spy.reset();
 		}
@@ -86,7 +87,7 @@ describe( 'ImageStyleUI', () => {
 			.then( newEditor => {
 				editor = newEditor;
 
-				const buttonView = editor.ui.componentFactory.create( 'style 1' );
+				const buttonView = editor.ui.componentFactory.create( 'imageStyle:style 1' );
 
 				expect( buttonView.label ).to.equal( 'Default title' );
 			} );

+ 19 - 13
packages/ckeditor5-image/tests/imagestyle/utils.js

@@ -18,7 +18,13 @@ testUtils.createSinonSandbox();
 describe( 'ImageStyle utils', () => {
 	let imageStyles;
 
-	describe( 'imageStyles()', () => {
+	describe( 'normalizeImageStyles()', () => {
+		// Since this function is all about normalizing the config object, make sure it doesn't throw
+		// if the config is empty (which may happen e.g. if only ImageStyleUI was loaded).
+		it( 'does not throw when given undefined', () => {
+			expect( normalizeImageStyles() ).to.deep.equal( [] );
+		} );
+
 		describe( 'object format', () => {
 			beforeEach( () => {
 				imageStyles = normalizeImageStyles( [
@@ -27,7 +33,7 @@ describe( 'ImageStyle utils', () => {
 					{ name: 'baz', title: 'Side image', icon: 'custom', className: 'baz-class' },
 
 					// Customized default styles.
-					{ name: 'imageStyleFull', icon: 'left', title: 'Custom title' }
+					{ name: 'full', icon: 'left', title: 'Custom title' }
 				] );
 			} );
 
@@ -47,7 +53,7 @@ describe( 'ImageStyle utils', () => {
 
 			it( 'should extend one of default styles if #name matches', () => {
 				expect( imageStyles[ 3 ] ).to.deep.equal( {
-					name: 'imageStyleFull',
+					name: 'full',
 					title: 'Custom title',
 					icon: leftIcon,
 					isDefault: true
@@ -57,36 +63,36 @@ describe( 'ImageStyle utils', () => {
 
 		describe( 'string format', () => {
 			it( 'should use one of default styles if #name matches', () => {
-				expect( normalizeImageStyles( [ 'imageStyleFull' ] ) ).to.deep.equal( [ {
-					name: 'imageStyleFull',
+				expect( normalizeImageStyles( [ 'full' ] ) ).to.deep.equal( [ {
+					name: 'full',
 					title: 'Full size image',
 					icon: fullWidthIcon,
 					isDefault: true
 				} ] );
 
-				expect( normalizeImageStyles( [ 'imageStyleSide' ] ) ).to.deep.equal( [ {
-					name: 'imageStyleSide',
+				expect( normalizeImageStyles( [ 'side' ] ) ).to.deep.equal( [ {
+					name: 'side',
 					title: 'Side image',
 					icon: rightIcon,
 					className: 'image-style-side'
 				} ] );
 
-				expect( normalizeImageStyles( [ 'imageStyleAlignLeft' ] ) ).to.deep.equal( [ {
-					name: 'imageStyleAlignLeft',
+				expect( normalizeImageStyles( [ 'alignLeft' ] ) ).to.deep.equal( [ {
+					name: 'alignLeft',
 					title: 'Left aligned image',
 					icon: leftIcon,
 					className: 'image-style-align-left'
 				} ] );
 
-				expect( normalizeImageStyles( [ 'imageStyleAlignCenter' ] ) ).to.deep.equal( [ {
-					name: 'imageStyleAlignCenter',
+				expect( normalizeImageStyles( [ 'alignCenter' ] ) ).to.deep.equal( [ {
+					name: 'alignCenter',
 					title: 'Centered image',
 					icon: centerIcon,
 					className: 'image-style-align-center'
 				} ] );
 
-				expect( normalizeImageStyles( [ 'imageStyleAlignRight' ] ) ).to.deep.equal( [ {
-					name: 'imageStyleAlignRight',
+				expect( normalizeImageStyles( [ 'alignRight' ] ) ).to.deep.equal( [ {
+					name: 'alignRight',
 					title: 'Right aligned image',
 					icon: rightIcon,
 					className: 'image-style-align-right'

+ 9 - 9
packages/ckeditor5-image/tests/imageupload/imageuploadui.js

@@ -55,14 +55,14 @@ describe( 'ImageUploadUI', () => {
 		return editor.destroy();
 	} );
 
-	it( 'should register uploadImage button', () => {
-		const button = editor.ui.componentFactory.create( 'uploadImage' );
+	it( 'should register imageUpload button', () => {
+		const button = editor.ui.componentFactory.create( 'imageUpload' );
 
 		expect( button ).to.be.instanceOf( FileDialogButtonView );
 	} );
 
 	it( 'should be disabled while ImageUploadCommand is disabled', () => {
-		const button = editor.ui.componentFactory.create( 'uploadImage' );
+		const button = editor.ui.componentFactory.create( 'imageUpload' );
 		const command = editor.commands.get( 'imageUpload' );
 
 		command.isEnabled = true;
@@ -76,7 +76,7 @@ describe( 'ImageUploadUI', () => {
 
 	// ckeditor5-upload/#77
 	it( 'should be properly bound with ImageUploadCommand', () => {
-		const button = editor.ui.componentFactory.create( 'uploadImage' );
+		const button = editor.ui.componentFactory.create( 'imageUpload' );
 		const command = editor.commands.get( 'imageUpload' );
 		const spy = sinon.spy();
 
@@ -93,7 +93,7 @@ describe( 'ImageUploadUI', () => {
 
 	it( 'should execute imageUpload command', () => {
 		const executeStub = sinon.stub( editor, 'execute' );
-		const button = editor.ui.componentFactory.create( 'uploadImage' );
+		const button = editor.ui.componentFactory.create( 'imageUpload' );
 		const files = [ createNativeFileMock() ];
 
 		button.fire( 'done', files );
@@ -103,7 +103,7 @@ describe( 'ImageUploadUI', () => {
 	} );
 
 	it( 'should optimize the insertion position', () => {
-		const button = editor.ui.componentFactory.create( 'uploadImage' );
+		const button = editor.ui.componentFactory.create( 'imageUpload' );
 		const files = [ createNativeFileMock() ];
 
 		setModelData( model, '<paragraph>f[]oo</paragraph>' );
@@ -119,7 +119,7 @@ describe( 'ImageUploadUI', () => {
 	} );
 
 	it( 'should correctly insert multiple files', () => {
-		const button = editor.ui.componentFactory.create( 'uploadImage' );
+		const button = editor.ui.componentFactory.create( 'imageUpload' );
 		const files = [ createNativeFileMock(), createNativeFileMock() ];
 
 		setModelData( model, '<paragraph>foo[]</paragraph><paragraph>bar</paragraph>' );
@@ -139,7 +139,7 @@ describe( 'ImageUploadUI', () => {
 
 	it( 'should not execute imageUpload if the file is not an image', () => {
 		const executeStub = sinon.stub( editor, 'execute' );
-		const button = editor.ui.componentFactory.create( 'uploadImage' );
+		const button = editor.ui.componentFactory.create( 'imageUpload' );
 		const file = {
 			type: 'media/mp3',
 			size: 1024
@@ -151,7 +151,7 @@ describe( 'ImageUploadUI', () => {
 
 	it( 'should work even if the FileList does not support iterators', () => {
 		const executeStub = sinon.stub( editor, 'execute' );
-		const button = editor.ui.componentFactory.create( 'uploadImage' );
+		const button = editor.ui.componentFactory.create( 'imageUpload' );
 		const files = {
 			0: createNativeFileMock(),
 			length: 1

+ 2 - 2
packages/ckeditor5-image/tests/manual/caption.js

@@ -26,9 +26,9 @@ ClassicEditor
 			Enter, Typing, Paragraph, Heading, Image, ImageToolbar,
 			Undo, Clipboard, ImageCaption, ImageStyle, Bold, Italic, Heading, List
 		],
-		toolbar: [ 'headings', '|', 'undo', 'redo', 'bold', 'italic', 'bulletedList', 'numberedList' ],
+		toolbar: [ 'heading', '|', 'undo', 'redo', 'bold', 'italic', 'bulletedList', 'numberedList' ],
 		image: {
-			toolbar: [ 'imageStyleFull', 'imageStyleSide', '|', 'imageTextAlternative' ]
+			toolbar: [ 'imageStyle:full', 'imageStyle:side', '|', 'imageTextAlternative' ]
 		}
 	} )
 	.then( editor => {

+ 1 - 1
packages/ckeditor5-image/tests/manual/image.js

@@ -17,7 +17,7 @@ import ClipboardPlugin from '@ckeditor/ckeditor5-clipboard/src/clipboard';
 ClassicEditor
 	.create( document.querySelector( '#editor' ), {
 		plugins: [ EnterPlugin, TypingPlugin, ParagraphPlugin, HeadingPlugin, ImagePlugin, UndoPlugin, ClipboardPlugin ],
-		toolbar: [ 'headings', '|', 'undo', 'redo' ]
+		toolbar: [ 'heading', '|', 'undo', 'redo' ]
 	} )
 	.then( editor => {
 		window.editor = editor;

+ 5 - 5
packages/ckeditor5-image/tests/manual/imagestyle.js

@@ -29,9 +29,9 @@ ClassicEditor
 			ClipboardPlugin,
 			ImageStyle
 		],
-		toolbar: [ 'headings', '|', 'undo', 'redo' ],
+		toolbar: [ 'heading', '|', 'undo', 'redo' ],
 		image: {
-			toolbar: [ 'imageStyleFull', 'imageStyleSide' ]
+			toolbar: [ 'imageStyle:full', 'imageStyle:side' ]
 		}
 	} )
 	.then( editor => {
@@ -54,10 +54,10 @@ ClassicEditor
 			ClipboardPlugin,
 			ImageStyle
 		],
-		toolbar: [ 'headings', '|', 'undo', 'redo' ],
+		toolbar: [ 'heading', '|', 'undo', 'redo' ],
 		image: {
-			styles: [ 'imageStyleAlignLeft', 'imageStyleAlignCenter', 'imageStyleAlignRight' ],
-			toolbar: [ 'imageStyleAlignLeft', 'imageStyleAlignCenter', 'imageStyleAlignRight' ]
+			styles: [ 'imageStyle:alignLeft', 'imageStyle:alignCenter', 'imageStyle:alignRight' ],
+			toolbar: [ 'imageStyle:alignLeft', 'imageStyle:alignCenter', 'imageStyle:alignRight' ]
 		}
 	} )
 	.then( editor => {

+ 2 - 2
packages/ckeditor5-image/tests/manual/imageupload.js

@@ -30,9 +30,9 @@ ClassicEditor
 			Enter, Typing, Paragraph, Heading, Undo, Bold, Italic, Heading, List, Image, ImageToolbar, Clipboard,
 			ImageCaption, ImageStyle, ImageUpload
 		],
-		toolbar: [ 'headings', '|', 'undo', 'redo', 'bold', 'italic', 'bulletedList', 'numberedList', 'uploadImage' ],
+		toolbar: [ 'heading', '|', 'undo', 'redo', 'bold', 'italic', 'bulletedList', 'numberedList', 'imageUpload' ],
 		image: {
-			toolbar: [ 'imageStyleFull', 'imageStyleSide', '|', 'imageTextAlternative' ]
+			toolbar: [ 'imageStyle:full', 'imageStyle:side', '|', 'imageTextAlternative' ]
 		}
 	} )
 	.then( editor => {

+ 1 - 1
packages/ckeditor5-image/tests/manual/textalternative.js

@@ -18,7 +18,7 @@ import ImageToolbar from '../../src/imagetoolbar';
 ClassicEditor
 	.create( document.querySelector( '#editor' ), {
 		plugins: [ EnterPlugin, TypingPlugin, ParagraphPlugin, HeadingPlugin, ImagePlugin, UndoPlugin, ClipboardPlugin, ImageToolbar ],
-		toolbar: [ 'headings', '|', 'undo', 'redo' ],
+		toolbar: [ 'heading', '|', 'undo', 'redo' ],
 		image: {
 			toolbar: [ 'imageTextAlternative' ]
 		}

+ 1 - 1
packages/ckeditor5-image/tests/manual/tickets/110/1.js

@@ -18,7 +18,7 @@ import ImageToolbar from '../../../../src/imagetoolbar';
 ClassicEditor
 	.create( document.querySelector( '#editor' ), {
 		plugins: [ EnterPlugin, TypingPlugin, ParagraphPlugin, HeadingPlugin, ImagePlugin, UndoPlugin, ImageToolbar, BalloonToolbar ],
-		balloonToolbar: [ 'headings', '|', 'undo', 'redo' ],
+		balloonToolbar: [ 'heading', '|', 'undo', 'redo' ],
 		image: {
 			toolbar: [ 'imageTextAlternative' ]
 		}