Skip to content

Commit

Permalink
Merge pull request #15362 from ckeditor/cc/epic/5603-ckbox-image-editing
Browse files Browse the repository at this point in the history
Feature (ckbox): Integrates CKBox Image Editing feature with the editor.
  • Loading branch information
arkflpc authored Nov 22, 2023
2 parents 7dcbbea + 7cfae97 commit 11f18ac
Show file tree
Hide file tree
Showing 193 changed files with 3,128 additions and 455 deletions.
5 changes: 3 additions & 2 deletions docs/_snippets/features/build-image-upload-source.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

/* globals window */

import { CKBox } from '@ckeditor/ckeditor5-ckbox';
import { CKBox, CKBoxImageEdit } from '@ckeditor/ckeditor5-ckbox';
import { PictureEditing, ImageResize, AutoImage } from '@ckeditor/ckeditor5-image';
import { LinkImage } from '@ckeditor/ckeditor5-link';
import { Alignment } from '@ckeditor/ckeditor5-alignment';
Expand All @@ -19,7 +19,8 @@ ClassicEditor.builtinPlugins.push(
AutoImage,
LinkImage,
Alignment,
CKBox
CKBox,
CKBoxImageEdit
);

window.ClassicEditor = ClassicEditor;
3 changes: 3 additions & 0 deletions docs/_snippets/features/build-toolbar-source.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
/* globals window */

import { Code, Strikethrough, Subscript, Superscript, Underline } from '@ckeditor/ckeditor5-basic-styles';
import { CKBox, CKBoxImageEdit } from '@ckeditor/ckeditor5-ckbox';
import { TodoList } from '@ckeditor/ckeditor5-list';
import { Alignment } from '@ckeditor/ckeditor5-alignment';
import { TableProperties, TableCellProperties } from '@ckeditor/ckeditor5-table';
Expand All @@ -30,5 +31,7 @@ ClassicEditor.builtinPlugins.push( IndentBlock );
ClassicEditor.builtinPlugins.push( Indent );
ClassicEditor.builtinPlugins.push( Code );
ClassicEditor.builtinPlugins.push( TodoList );
ClassicEditor.builtinPlugins.push( CKBox );
ClassicEditor.builtinPlugins.push( CKBoxImageEdit );

window.ClassicEditor = ClassicEditor;
1 change: 1 addition & 0 deletions docs/_snippets/features/build-ui-language-source.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<script src="https://cdn.ckbox.io/ckbox/latest/ckbox.js"></script>
7 changes: 7 additions & 0 deletions docs/_snippets/features/build-ui-language-source.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,15 @@
/* config { "additionalLanguages": [ "ar", "es" ] } */

import { Superscript } from '@ckeditor/ckeditor5-basic-styles';
import { CKBox, CKBoxImageEdit } from '@ckeditor/ckeditor5-ckbox';
import { PictureEditing, ImageResize, AutoImage } from '@ckeditor/ckeditor5-image';
import ClassicEditor from '../build-classic';

ClassicEditor.builtinPlugins.push( Superscript );
ClassicEditor.builtinPlugins.push( CKBox );
ClassicEditor.builtinPlugins.push( CKBoxImageEdit );
ClassicEditor.builtinPlugins.push( PictureEditing );
ClassicEditor.builtinPlugins.push( ImageResize );
ClassicEditor.builtinPlugins.push( AutoImage );

window.ClassicEditor = ClassicEditor;
1 change: 1 addition & 0 deletions docs/_snippets/features/image-upload.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<script src="https://cdn.ckbox.io/ckbox/latest/ckbox.js"></script>
<div class="ck ck-content" id="snippet-image-upload">
<h2>Uploading images</h2>
<p>To upload an image, do the following:</p>
Expand Down
7 changes: 5 additions & 2 deletions docs/_snippets/features/image-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ ClassicEditor
'|',
'resizeImage:25',
'resizeImage:50',
'resizeImage:original'
'resizeImage:original',
'|',
'ckboxImageEdit'
],
resizeOptions: [
{
Expand All @@ -56,7 +58,8 @@ ClassicEditor
}
},
ckbox: {
tokenUrl: TOKEN_URL
tokenUrl: TOKEN_URL,
forceDemoLabel: true
}
} )
.then( editor => {
Expand Down
1 change: 1 addition & 0 deletions docs/_snippets/features/mathtype.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<script src="https://cdn.ckbox.io/ckbox/latest/ckbox.js"></script>
<style>
.editor-icon__image[alt="MathType"],
.editor-icon__image[alt="ChemType"] {
Expand Down
10 changes: 8 additions & 2 deletions docs/_snippets/features/mathtype.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@ import { CloudServices } from '@ckeditor/ckeditor5-cloud-services';
import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config';
import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset';
import { EasyImage } from '@ckeditor/ckeditor5-easy-image';
import { ImageUpload } from '@ckeditor/ckeditor5-image';
import { ImageUpload, PictureEditing } from '@ckeditor/ckeditor5-image';
import MathType from '@wiris/mathtype-ckeditor5';
import { CKBox, CKBoxImageEdit } from '@ckeditor/ckeditor5-ckbox';

ClassicEditor
.create( document.querySelector( '#mathtype-editor' ), {
plugins: [
ArticlePluginSet,
CKBox,
CKBoxImageEdit,
PictureEditing,
EasyImage,
ImageUpload,
CloudServices,
Expand All @@ -42,7 +46,9 @@ ClassicEditor
'imageStyle:breakText',
'|',
'toggleImageCaption',
'imageTextAlternative'
'imageTextAlternative',
'|',
'ckboxImageEdit'
]
},
table: {
Expand Down
7 changes: 7 additions & 0 deletions docs/_snippets/features/read-only-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,17 @@
import { FindAndReplace } from '@ckeditor/ckeditor5-find-and-replace';
import { ExportPdf } from '@ckeditor/ckeditor5-export-pdf';
import { ExportWord } from '@ckeditor/ckeditor5-export-word';
import { CKBox, CKBoxImageEdit } from '@ckeditor/ckeditor5-ckbox';
import { PictureEditing, ImageResize, AutoImage } from '@ckeditor/ckeditor5-image';
import ClassicEditor from '../build-classic';

ClassicEditor.builtinPlugins.push( FindAndReplace );
ClassicEditor.builtinPlugins.push( ExportPdf );
ClassicEditor.builtinPlugins.push( ExportWord );
ClassicEditor.builtinPlugins.push( CKBox );
ClassicEditor.builtinPlugins.push( CKBoxImageEdit );
ClassicEditor.builtinPlugins.push( PictureEditing );
ClassicEditor.builtinPlugins.push( ImageResize );
ClassicEditor.builtinPlugins.push( AutoImage );

window.ClassicEditor = ClassicEditor;
6 changes: 6 additions & 0 deletions docs/_snippets/features/read-only-hide-toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ ClassicEditor
'|', 'bulletedList', 'numberedList', 'outdent', 'indent'
]
},
image: {
toolbar: [
'imageStyle:inline', 'imageStyle:block', 'imageStyle:side', '|',
'toggleImageCaption', 'imageTextAlternative', 'ckboxImageEdit'
]
},
ui: {
viewportOffset: {
top: window.getViewportTopOffsetConfig()
Expand Down
6 changes: 6 additions & 0 deletions docs/_snippets/features/read-only.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ ClassicEditor
'|', 'bulletedList', 'numberedList', 'outdent', 'indent'
]
},
image: {
toolbar: [
'imageStyle:inline', 'imageStyle:block', 'imageStyle:side', '|',
'toggleImageCaption', 'imageTextAlternative', 'ckboxImageEdit'
]
},
ui: {
viewportOffset: {
top: window.getViewportTopOffsetConfig()
Expand Down
4 changes: 4 additions & 0 deletions docs/_snippets/features/toolbar-basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ ClassicEditor
'|', 'bulletedList', 'numberedList', 'outdent', 'indent'
]
},
image: {
toolbar: [ 'imageStyle:inline', 'imageStyle:block', 'imageStyle:side',
'|', 'toggleImageCaption', 'imageTextAlternative', '|', 'ckboxImageEdit' ]
},
cloudServices: CS_CONFIG,
ui: {
viewportOffset: {
Expand Down
1 change: 1 addition & 0 deletions docs/_snippets/features/toolbar-breakpoint.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<script src="https://cdn.ckbox.io/ckbox/latest/ckbox.js"></script>
<div id="toolbar-breakpoint">
<h3>Seedless plants</h3>
<p>Plants in this group, called <em>cryptogams</em>, do not produce seeds.</p>
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/features/toolbar-breakpoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ ClassicEditor
}
},
image: {
toolbar: [ 'imageStyle:inline', 'imageStyle:block', 'imageStyle:side', '|', 'toggleImageCaption', 'imageTextAlternative' ]
toolbar: [ 'imageStyle:inline', 'imageStyle:block', 'imageStyle:side',
'|', 'toggleImageCaption', 'imageTextAlternative', '|', 'ckboxImageEdit' ]
},
codeBlock: {
languages: [
Expand Down
1 change: 1 addition & 0 deletions docs/_snippets/features/toolbar-grouping.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<script src="https://cdn.ckbox.io/ckbox/latest/ckbox.js"></script>
<div id="toolbar-grouping">
<h3>What doesn’t kill me…</h3>
<p>
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/features/toolbar-grouping.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ ClassicEditor
}
},
image: {
toolbar: [ 'imageStyle:inline', 'imageStyle:block', 'imageStyle:side', '|', 'toggleImageCaption', 'imageTextAlternative' ]
toolbar: [ 'imageStyle:inline', 'imageStyle:block', 'imageStyle:side',
'|', 'toggleImageCaption', 'imageTextAlternative', '|', 'ckboxImageEdit' ]
},
codeBlock: {
languages: [
Expand Down
1 change: 1 addition & 0 deletions docs/_snippets/features/toolbar-nested-icon.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<script src="https://cdn.ckbox.io/ckbox/latest/ckbox.js"></script>
<div id="toolbar-nested-icon">
<h5>Conifers</h5>
<p>
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/features/toolbar-nested-icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ ClassicEditor
}
],
image: {
toolbar: [ 'imageStyle:inline', 'imageStyle:block', 'imageStyle:side', '|', 'toggleImageCaption', 'imageTextAlternative' ]
toolbar: [ 'imageStyle:inline', 'imageStyle:block', 'imageStyle:side',
'|', 'toggleImageCaption', 'imageTextAlternative', '|', 'ckboxImageEdit' ]
},
cloudServices: CS_CONFIG,
ui: {
Expand Down
1 change: 1 addition & 0 deletions docs/_snippets/features/toolbar-nested-label.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<script src="https://cdn.ckbox.io/ckbox/latest/ckbox.js"></script>
<div id="toolbar-nested-label">
<h3>Seed-producing plants</h3>
<p>
Expand Down
4 changes: 4 additions & 0 deletions docs/_snippets/features/toolbar-nested-label.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ ClassicEditor
items: [ 'bold', 'italic', 'strikethrough', 'superscript', 'subscript' ]
}
],
image: {
toolbar: [ 'imageStyle:inline', 'imageStyle:block', 'imageStyle:side',
'|', 'toggleImageCaption', 'imageTextAlternative', '|', 'ckboxImageEdit' ]
},
cloudServices: CS_CONFIG,
ui: {
viewportOffset: {
Expand Down
1 change: 1 addition & 0 deletions docs/_snippets/features/toolbar-nested-simple.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<script src="https://cdn.ckbox.io/ckbox/latest/ckbox.js"></script>
<div id="toolbar-nested-simple">
<h4>Mosses and liverworts</h4>
<p>
Expand Down
4 changes: 4 additions & 0 deletions docs/_snippets/features/toolbar-nested-simple.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ ClassicEditor
items: [ 'bulletedList', 'numberedList', 'todoList' ]
}
],
image: {
toolbar: [ 'imageStyle:inline', 'imageStyle:block', 'imageStyle:side',
'|', 'toggleImageCaption', 'imageTextAlternative', '|', 'ckboxImageEdit' ]
},
cloudServices: CS_CONFIG,
ui: {
viewportOffset: {
Expand Down
1 change: 1 addition & 0 deletions docs/_snippets/features/toolbar-nested-tooltip.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<script src="https://cdn.ckbox.io/ckbox/latest/ckbox.js"></script>
<div id="toolbar-nested-tooltip">
<h4>Flowering plants</h4>
<p>
Expand Down
4 changes: 4 additions & 0 deletions docs/_snippets/features/toolbar-nested-tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ ClassicEditor
items: [ 'uploadImage', 'insertTable' ]
}
],
image: {
toolbar: [ 'imageStyle:inline', 'imageStyle:block', 'imageStyle:side',
'|', 'toggleImageCaption', 'imageTextAlternative', '|', 'ckboxImageEdit' ]
},
cloudServices: CS_CONFIG,
ui: {
viewportOffset: {
Expand Down
1 change: 1 addition & 0 deletions docs/_snippets/features/toolbar-separator.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<script src="https://cdn.ckbox.io/ckbox/latest/ckbox.js"></script>
<div id="toolbar-separator">
<h3>A brief history of a tiny beast</h3>
<p>
Expand Down
4 changes: 4 additions & 0 deletions docs/_snippets/features/toolbar-separator.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ ClassicEditor
'|', 'bulletedList', 'numberedList', 'outdent', 'indent'
]
},
image: {
toolbar: [ 'imageStyle:inline', 'imageStyle:block', 'imageStyle:side',
'|', 'toggleImageCaption', 'imageTextAlternative', '|', 'ckboxImageEdit' ]
},
cloudServices: CS_CONFIG,
ui: {
viewportOffset: {
Expand Down
1 change: 1 addition & 0 deletions docs/_snippets/features/toolbar-wrapping.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<script src="https://cdn.ckbox.io/ckbox/latest/ckbox.js"></script>
<div id="toolbar-wrapping">
<h2>The plant kingdom</h2>
<p>The plant kingdom is a diverse group of organisms that includes both tiny algae and giant sequoias. Despite this diversity, all plants have a few things in common.</p>
Expand Down
3 changes: 2 additions & 1 deletion docs/_snippets/features/toolbar-wrapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ ClassicEditor
}
},
image: {
toolbar: [ 'imageStyle:inline', 'imageStyle:block', 'imageStyle:side', '|', 'toggleImageCaption', 'imageTextAlternative' ]
toolbar: [ 'imageStyle:inline', 'imageStyle:block', 'imageStyle:side',
'|', 'toggleImageCaption', 'imageTextAlternative', '|', 'ckboxImageEdit' ]
},
codeBlock: {
languages: [
Expand Down
6 changes: 6 additions & 0 deletions docs/_snippets/features/ui-language-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ ClassicEditor
'|', 'bulletedList', 'numberedList', 'outdent', 'indent'
]
},
image: {
toolbar: [
'imageStyle:inline', 'imageStyle:block', 'imageStyle:side', '|',
'toggleImageCaption', 'imageTextAlternative', 'ckboxImageEdit'
]
},
ui: {
viewportOffset: {
top: window.getViewportTopOffsetConfig()
Expand Down
6 changes: 6 additions & 0 deletions docs/_snippets/features/ui-language-rtl.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ ClassicEditor
'|', 'bulletedList', 'numberedList', 'outdent', 'indent'
]
},
image: {
toolbar: [
'imageStyle:inline', 'imageStyle:block', 'imageStyle:side', '|',
'toggleImageCaption', 'imageTextAlternative', 'ckboxImageEdit'
]
},
ui: {
viewportOffset: {
top: window.getViewportTopOffsetConfig()
Expand Down
6 changes: 6 additions & 0 deletions docs/_snippets/features/ui-language.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ ClassicEditor
'|', 'bulletedList', 'numberedList', 'outdent', 'indent'
]
},
image: {
toolbar: [
'imageStyle:inline', 'imageStyle:block', 'imageStyle:side', '|',
'toggleImageCaption', 'imageTextAlternative', 'ckboxImageEdit'
]
},
ui: {
viewportOffset: {
top: window.getViewportTopOffsetConfig()
Expand Down
1 change: 1 addition & 0 deletions docs/_snippets/features/wproofreader.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<script src="https://cdn.ckbox.io/ckbox/latest/ckbox.js"></script>
<div class="ck ck-content" id="snippet-wproofreader">
<p>Warsaw is the capital adn largest city of Poland. The metropolis stands on the Vistula River in east-central Poland and its population is officially estimatd at 1.8 million residents within a greater metropolitan area of 3.1 million residents, which makes Warsaw the 7th most-populous capital city in the European Union. Warsaw is an alpha-global city, a major international tourist destination, and a significaant cultural, political, and economic hub. Its historical Old Town was designated a UNESCO World Heritage Site.</p>

Expand Down
14 changes: 5 additions & 9 deletions docs/_snippets/features/wproofreader.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
import { ClassicEditor } from '@ckeditor/ckeditor5-editor-classic';
import { CloudServices } from '@ckeditor/ckeditor5-cloud-services';
import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset';
import { EasyImage } from '@ckeditor/ckeditor5-easy-image';
import { ImageUpload } from '@ckeditor/ckeditor5-image';
import { CKBox, CKBoxImageEdit } from '@ckeditor/ckeditor5-ckbox';
import { PictureEditing, ImageUpload } from '@ckeditor/ckeditor5-image';
import WProofreader from '@webspellchecker/wproofreader-ckeditor5/src/wproofreader';

import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config';

ClassicEditor
.create( document.querySelector( '#snippet-wproofreader' ), {
plugins: [ ArticlePluginSet, EasyImage, ImageUpload, CloudServices, WProofreader ],
plugins: [ ArticlePluginSet, PictureEditing, CKBox, CKBoxImageEdit, ImageUpload, CloudServices, WProofreader ],
wproofreader: {
serviceId: '1:Eebp63-lWHbt2-ASpHy4-AYUpy2-fo3mk4-sKrza1-NsuXy4-I1XZC2-0u2F54-aqYWd1-l3Qf14-umd',
lang: 'auto',
Expand All @@ -40,12 +40,8 @@ ClassicEditor
},
image: {
toolbar: [
'imageStyle:inline',
'imageStyle:wrapText',
'imageStyle:breakText',
'|',
'toggleImageCaption',
'imageTextAlternative'
'imageStyle:inline', 'imageStyle:block', 'imageStyle:side', '|',
'toggleImageCaption', 'imageTextAlternative', 'ckboxImageEdit'
]
},
table: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@
/* globals window */

import { Autosave } from '@ckeditor/ckeditor5-autosave';
import { CKBox, CKBoxImageEdit } from '@ckeditor/ckeditor5-ckbox';
import { PictureEditing, ImageResize, AutoImage } from '@ckeditor/ckeditor5-image';
import ClassicEditor from '../../build-classic';

ClassicEditor.builtinPlugins.push( Autosave );
ClassicEditor.builtinPlugins.push( CKBox );
ClassicEditor.builtinPlugins.push( CKBoxImageEdit );
ClassicEditor.builtinPlugins.push( PictureEditing );
ClassicEditor.builtinPlugins.push( ImageResize );
ClassicEditor.builtinPlugins.push( AutoImage );

window.ClassicEditor = ClassicEditor;
Loading

0 comments on commit 11f18ac

Please sign in to comment.