/
easyimage.html
313 lines (275 loc) · 15.1 KB
/
easyimage.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
<!DOCTYPE html>
<!--
Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license.
-->
<html>
<head>
<meta charset="utf-8">
<meta name="description" content="Easy Image Plugin">
<meta name="keywords" content="ckeditor, editor, wysiwyg, image, caption, widget, drag, drop, easyimage, cdn, responsive, configure, configuration, setup, settings, options, customization, customize, customise, customisation, config, modification, modify, change">
<meta name="sdk-samples" content="Easy Image Plugin">
<meta name="sdk-category" content="sdk-inserting-images">
<meta name="sdk-order" content="30">
<title>Easy Image Plugin</title>
<link href="https://fonts.googleapis.com/css?family=Maven+Pro:700,500,400" rel="stylesheet">
<link href="../template/theme/css/sdk.css" rel="stylesheet">
<script src="../../ckeditor4/ckeditor.js"></script>
<script src="assets/picoModal-2.0.1.min.js"></script>
<script src="assets/contentloaded.js"></script>
<script src="assets/simplesample.js"></script>
<script src="assets/beautify-html.js"></script>
<script src="assets/sample.js"></script>
<script src="assets/easyimage/optimizations.js"></script>
<!--[if lt IE 9]>
<script src="assets/html5shiv.min.js"></script>
<![endif]-->
<link rel="icon" href="../template/theme/img/favicon.ico">
</head>
<body>
<header class="sdk-header">
</header>
<section class="sdk-container">
<nav class="sdk-sidebar">
</nav>
<section class="sdk-contents">
<script src="assets/easyimage/optimizations.js"></script>
<style>
.sdk-row {
display: table;
}
.sdk-col {
display: table-cell;
padding: 0 10px;
vertical-align: top;
width: 50%;
}
.sdk-col-main {
width: 70%;
}
.sdk-col-aside {
width: 30%;
}
.ei-image, .ei-placeholder {
max-width: 100%;
}
.ei-placeholder {
opacity: .4;
}
.sdk-col .ei-optimization {
display: table;
border-collapse: collapse;
table-layout: fixed;
border: 1px #000 solid;
min-width: 500px;
font-family: Arial;
margin-top: 1.2em;
}
.ei-optimization caption {
display: table-caption;
text-align: -webkit-center;
}
.ei-optimization-head {
display: table-header-group;
vertical-align: middle;
border-color: inherit;
background: #ddd;
font-weight: bold;
}
.ei-optimization th {
font-weight: normal;
}
.ei-optimization tr {
display: table-row;
vertical-align: inherit;
border-color: inherit;
}
.ei-optimization td, .ei-optimization th {
padding: 6px;
border: 1px solid #AAAAAA;
font-size: 12px;
height: 26px;
}
.ei-optimization th[scope=col] {
font-weight: bold;
}
.ei-optimization-head th:first-child {
width: 40%;
}
.ei-optimization td {
padding-left: 20px;
}
.ei-optimization-body {
display: table-row-group;
vertical-align: middle;
border-color: inherit;
}
.ei-optimization-body tr:nth-child( odd ) {
background: #f5f5f5;
color: #000;
}
</style>
<h1>Easy Image Plugin <a class="documentation" href="https://ckeditor.com/docs/ckeditor4/latest/guide/dev_easyimage.html">Documentation</a></h1>
<p>
The optional <a href="https://ckeditor.com/cke4/addon/easyimage">Easy Image</a> plugin, introduced in CKEditor 4.9, supports uploading and inserting images into the editor content. It provides the following features when compared to two alternative image plugins, the default <a href="./image.html">Image</a> plugin and the optional <a href="./image2.html">Enhanced Image</a> plugin:
</p>
<ul>
<li>
It allows for adding <strong>image captions</strong> (that will not be separated from the image when its location changes).
</li>
<li>
It allows for uploading images to <a href="https://ckeditor.com/ckeditor-cloud-services/">CKEditor Cloud Services</a> that <strong>optimizes images</strong> by rescaling them and compressing, resulting in smaller sizes and faster download times.
</li>
<li>
It produces <strong>responsive markup</strong>, so inserted images are suitable for a wide range of devices (including mobile ones).
</li>
<li>
It allows for adding <strong>custom styles</strong> for inserted images.
</li>
<li>
It uses a <strong>customizable balloon toolbar</strong> for every image.
</li>
<li>
It does not produce any content reflow, resulting in smoother and better user experience.
</li>
<li>
Images uploaded to CKEditor Cloud Services are <strong>stored in the cloud</strong> and delivered through a <strong>blazing-fast CDN</strong>.
</li>
</ul>
<p>
A few configuration options are available to fine-tune this feature, including <a href="https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-easyimage_styles">adding custom styles</a>, <a href="https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-easyimage_toolbar">customizing the image widget's toolbar</a> or setting a <a href="https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-easyimage_class">custom CSS class</a> for the widget. Refer to the <a href="https://ckeditor.com/docs/ckeditor4/latest/guide/dev_easyimage.html">Easy Image Plugin</a> article to learn more about this feature.
</p>
<p>Note: The example below uses some configuration options mentioned above to add additional image styles (pink and blue gradient) with respective balloon toolbar buttons and context menu entries.</p>
<textarea cols="80" id="editor1" name="editor1" rows="10" data-sample="1" data-sample-short>
<h1>Walking the capitals of Europe: Warsaw</h1>
<figure class="easyimage">
<img alt="Picture of the Warsaw Old Town." width="4288" srcset="https://33333.cdn.cke-cs.com/0fNqCUeBSal4ENvGfd7K/images/c12cb88e596270d8d963b7c87bef1767880f42d94fb2ec43_warsaw01.jpg/w_430 430w, https://33333.cdn.cke-cs.com/0fNqCUeBSal4ENvGfd7K/images/c12cb88e596270d8d963b7c87bef1767880f42d94fb2ec43_warsaw01.jpg/w_860 860w, https://33333.cdn.cke-cs.com/0fNqCUeBSal4ENvGfd7K/images/c12cb88e596270d8d963b7c87bef1767880f42d94fb2ec43_warsaw01.jpg/w_1290 1290w, https://33333.cdn.cke-cs.com/0fNqCUeBSal4ENvGfd7K/images/c12cb88e596270d8d963b7c87bef1767880f42d94fb2ec43_warsaw01.jpg/w_1720 1720w, https://33333.cdn.cke-cs.com/0fNqCUeBSal4ENvGfd7K/images/c12cb88e596270d8d963b7c87bef1767880f42d94fb2ec43_warsaw01.jpg/w_2150 2150w, https://33333.cdn.cke-cs.com/0fNqCUeBSal4ENvGfd7K/images/c12cb88e596270d8d963b7c87bef1767880f42d94fb2ec43_warsaw01.jpg/w_2580 2580w, https://33333.cdn.cke-cs.com/0fNqCUeBSal4ENvGfd7K/images/c12cb88e596270d8d963b7c87bef1767880f42d94fb2ec43_warsaw01.jpg/w_3010 3010w, https://33333.cdn.cke-cs.com/0fNqCUeBSal4ENvGfd7K/images/c12cb88e596270d8d963b7c87bef1767880f42d94fb2ec43_warsaw01.jpg/w_3440 3440w, https://33333.cdn.cke-cs.com/0fNqCUeBSal4ENvGfd7K/images/c12cb88e596270d8d963b7c87bef1767880f42d94fb2ec43_warsaw01.jpg/w_3870 3870w, https://33333.cdn.cke-cs.com/0fNqCUeBSal4ENvGfd7K/images/c12cb88e596270d8d963b7c87bef1767880f42d94fb2ec43_warsaw01.jpg/w_4288 4288w" sizes="100vw" src="https://33333.cdn.cke-cs.com/0fNqCUeBSal4ENvGfd7K/images/c12cb88e596270d8d963b7c87bef1767880f42d94fb2ec43_warsaw01.jpg">
<figcaption>Medieval Old Town square, destroyed in 1944 &amp; rebuilt after WWII.</figcaption>
</figure>
<p>If you enjoyed my previous articles in which we discussed wandering around <a href="https://en.wikipedia.org/wiki/Copenhagen">Copenhagen</a> and <a href="https://en.wikipedia.org/wiki/Vilnius">Vilnius</a>, you’ll definitely love exploring <a href="https://en.wikipedia.org/wiki/Warsaw">Warsaw</a>.</p>
<h2>Time to put comfy sandals on!</h2>
<p>Best time to visit the city is July and August, when it’s cool enough to not break a sweat and hot enough to enjoy summer. The city which has quite a combination of both old and modern textures is located by the river of Vistula.</p>
<p>The historic <strong>Old Town</strong>, which was reconstructed after the World War II, with its late 18th century characteristics, is a must-see. You can start your walk from the <strong>Nowy Świat Street</strong> which will take you straight to the Old Town.</p>
<p>Then you can go to the <strong>Powiśle</strong> area and take a walk on the newly renovated promenade on the riverfront. There are also lots of cafes, bars and restaurants where you can shake off the exhaustion of the day. On Sundays, there are many parks where you can enjoy nature or listen to pianists from around the world playing Chopin.</p>
<p>For museum lovers, you can add these to your list:</p>
<ul>
<li><a href="http://www.polin.pl/en">POLIN</a></li>
<li><a href="http://www.1944.pl/en">Warsaw Uprising Museum</a></li>
<li><a href="http://chopin.museum/en">Fryderyk Chopin Museum</a></li>
</ul>
<h2>Next destination</h2>
<p>We will go to Berlin and have a night's walk in the city that never sleeps! Make sure you subscribe to our newsletter!</p>
</textarea>
<h2>Image Optimization</h2>
<p>
Easy Image guarantees that all images inserted into your content are responsive. With a single image upload, several optimized versions of the image are created after upload by <a href="https://ckeditor.com/ckeditor-cloud-services/">CKEditor Cloud Services</a>, for different sizes of displays. All this is transparent to the end user who uploaded the image. Rescaled and optimized images are delivered through a CDN.
</p>
<div id="optimizations">
<p>
<strong>Please upload some image to the editor above to see the level of optimization for a number of popular device types.</strong>
</p>
</div>
<p class="tip">
If you are looking for pixel-perfect image alignment with vertical and horizotal whitespace, configurable image border and file manager integration, try the default <a href="./image.html">Image</a> plugin. If you need more modern image support with features such as image captions, drag and drop positioning, click and drag resizing, image alignment (including centering) with inline styles or CSS classes and custom image styles, but without cloud storage support with optimized images and responsive markup, try <a href="./image2.html">Enhanced Image</a>.
</p>
<h2>Related Features</h2>
<ul>
<li><a href="./image.html">Inserting Images – Default Image Plugin</a></li>
<li><a href="./image.html">Inserting Images – Enhanced Image Plugin</a></li>
<li><a href="./styles.html#widget-styles">Styling and Formatting – Applying Styles to Editor Content</a></li>
</ul>
<script src="assets/activate.js"></script>
<script src="assets/pastefromoffice/pastefromoffice.js"></script>
<script>
CKEDITOR.once( 'instanceCreated', function( evt ) {
evt.editor.once( 'configLoaded', function( evt ) {
delete evt.editor.config.uploadUrl;
delete evt.editor.config.filebrowserBrowseUrl;
delete evt.editor.config.filebrowserImageBrowseUrl;
delete evt.editor.config.filebrowserUploadUrl;
delete evt.editor.config.filebrowserImageUploadUrl;
} );
} );
</script>
<script data-sample="1" >
// Don't forget to add CSS for your custom styles.
CKEDITOR.addCss( 'figure[class*=easyimage-gradient]::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; right: 0; }' +
'figure[class*=easyimage-gradient] figcaption { position: relative; z-index: 2; }' +
'.easyimage-gradient-1::before { background-image: linear-gradient( 135deg, rgba( 115, 110, 254, 0 ) 0%, rgba( 66, 174, 234, .72 ) 100% ); }' +
'.easyimage-gradient-2::before { background-image: linear-gradient( 135deg, rgba( 115, 110, 254, 0 ) 0%, rgba( 228, 66, 234, .72 ) 100% ); }' );
CKEDITOR.replace( 'editor1', {
extraPlugins: 'easyimage',
removePlugins: 'image',
removeDialogTabs: 'link:advanced',
toolbar: [
{ name: 'document', items: [ 'Undo', 'Redo' ] },
{ name: 'styles', items: [ 'Format' ] },
{ name: 'basicstyles', items: [ 'Bold', 'Italic', 'Strike', '-', 'RemoveFormat' ] },
{ name: 'paragraph', items: [ 'NumberedList', 'BulletedList' ] },
{ name: 'links', items: [ 'Link', 'Unlink' ] },
{ name: 'insert', items: [ 'EasyImageUpload' ] }
],
height: 630,
cloudServices_uploadUrl: 'https://33333.cke-cs.com/easyimage/upload/',
// Note: this is a token endpoint to be used for CKEditor 4 samples only. Images uploaded using this token may be deleted automatically at any moment.
// To create your own token URL please visit https://ckeditor.com/ckeditor-cloud-services/.
cloudServices_tokenUrl: 'https://33333.cke-cs.com/token/dev/ijrDsqFix838Gh3wGO3F77FSW94BwcLXprJ4APSp3XQ26xsUHTi0jcb1hoBt',
easyimage_styles: {
gradient1: {
group: 'easyimage-gradients',
attributes: {
'class': 'easyimage-gradient-1'
},
label: 'Blue Gradient',
icon: '../../../ckeditor4/{%CKEDITOR_VERSION%}/{%CKEDITOR_EXAMPLES_SLUG%}/assets/easyimage/icons/gradient1.png',
iconHiDpi: '../../../ckeditor4/{%CKEDITOR_VERSION%}/{%CKEDITOR_EXAMPLES_SLUG%}/assets/easyimage/icons/hidpi/gradient1.png'
},
gradient2: {
group: 'easyimage-gradients',
attributes: {
'class': 'easyimage-gradient-2'
},
label: 'Pink Gradient',
icon: '../../../ckeditor4/{%CKEDITOR_VERSION%}/{%CKEDITOR_EXAMPLES_SLUG%}/assets/easyimage/icons/gradient2.png',
iconHiDpi: '../../../ckeditor4/{%CKEDITOR_VERSION%}/{%CKEDITOR_EXAMPLES_SLUG%}/assets/easyimage/icons/hidpi/gradient2.png'
},
noGradient: {
group: 'easyimage-gradients',
attributes: {
'class': 'easyimage-no-gradient'
},
label: 'No Gradient',
icon: '../../../ckeditor4/{%CKEDITOR_VERSION%}/{%CKEDITOR_EXAMPLES_SLUG%}/assets/easyimage/icons/nogradient.png',
iconHiDpi: '../../../ckeditor4/{%CKEDITOR_VERSION%}/{%CKEDITOR_EXAMPLES_SLUG%}/assets/easyimage/icons/hidpi/nogradient.png'
}
},
easyimage_toolbar: [
'EasyImageFull',
'EasyImageSide',
'EasyImageGradient1',
'EasyImageGradient2',
'EasyImageNoGradient',
'EasyImageAlt'
],
removeButtons: 'PasteFromWord'
} );
</script>
<script>
// Umberto SDK does not copy the `<head>` content, so the crawler option will not be visible in the output file.
// That's why it is added manually in the `<script>` tag.
const metaElement = document.createElement( 'meta' );
metaElement.name = 'x-cke-crawler-ignore-patterns';
metaElement.content = JSON.stringify( {
'request-failure': '33333.cdn.cke-cs.com'
} );
document.head.appendChild( metaElement );
CKEDITOR.once( 'instanceReady', function( evt ) {
setupOptimizationsCalculator( evt.editor, '#optimizations' );
} );
</script>
</section>
</section>
<footer class="sdk-footer">
</footer>
</body>
</html>