Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

Commit 28f59df

Browse files
committed
Merge branch 't/ckeditor5/550'
Other: Rename `ContextualToolbar` to `BalloonToolbar`. Closes ckeditor/ckeditor5#550. BREAKING CHANGE: Renamed `contextual/contextualtoolbar~ContextualToolbar` to `balloon/balloontoolbar~BalloonToolbar`. BREAKING CHANGE: Renamed `contextualToolbar` configuration option to `balloonToolbar`.
2 parents 04b0312 + 3dc8e34 commit 28f59df

File tree

10 files changed

+87
-87
lines changed

10 files changed

+87
-87
lines changed

src/toolbar/contextual/contextualtoolbar.js renamed to src/toolbar/balloon/balloontoolbar.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
/**
7-
* @module ui/toolbar/contextual/contextualtoolbar
7+
* @module ui/toolbar/balloon/balloontoolbar
88
*/
99

1010
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
@@ -22,12 +22,12 @@ import normalizeToolbarConfig from '../normalizetoolbarconfig';
2222
*
2323
* @extends module:core/plugin~Plugin
2424
*/
25-
export default class ContextualToolbar extends Plugin {
25+
export default class BalloonToolbar extends Plugin {
2626
/**
2727
* @inheritDoc
2828
*/
2929
static get pluginName() {
30-
return 'ContextualToolbar';
30+
return 'BalloonToolbar';
3131
}
3232

3333
/**
@@ -83,7 +83,7 @@ export default class ContextualToolbar extends Plugin {
8383
this._handleSelectionChange();
8484
this._handleFocusChange();
8585

86-
// The appearance of the ContextualToolbar method is event–driven.
86+
// The appearance of the BalloonToolbar method is event–driven.
8787
// It is possible to stop the #show event and this prevent the toolbar from showing up.
8888
this.decorate( 'show' );
8989
}
@@ -95,7 +95,7 @@ export default class ContextualToolbar extends Plugin {
9595
* @inheritDoc
9696
*/
9797
afterInit() {
98-
const config = normalizeToolbarConfig( this.editor.config.get( 'contextualToolbar' ) );
98+
const config = normalizeToolbarConfig( this.editor.config.get( 'balloonToolbar' ) );
9999
const factory = this.editor.ui.componentFactory;
100100

101101
this.toolbarView.fillFromConfig( config.items, factory );
@@ -283,20 +283,20 @@ function getBalloonPositions( isBackward ) {
283283
}
284284

285285
/**
286-
* Contextual toolbar configuration. Used by the {@link module:ui/toolbar/contextual/contextualtoolbar~ContextualToolbar}
286+
* Contextual toolbar configuration. Used by the {@link module:ui/toolbar/balloon/balloontoolbar~BalloonToolbar}
287287
* feature.
288288
*
289289
* const config = {
290-
* contextualToolbar: [ 'bold', 'italic', 'undo', 'redo' ]
290+
* balloonToolbar: [ 'bold', 'italic', 'undo', 'redo' ]
291291
* };
292292
*
293293
* You can also use `'|'` to create a separator between groups of items:
294294
*
295295
* const config = {
296-
* contextualToolbar: [ 'bold', 'italic', | 'undo', 'redo' ]
296+
* balloonToolbar: [ 'bold', 'italic', | 'undo', 'redo' ]
297297
* };
298298
*
299299
* Read also about configuring the main editor toolbar in {@link module:core/editor/editorconfig~EditorConfig#toolbar}.
300300
*
301-
* @member {Array.<String>|Object} module:core/editor/editorconfig~EditorConfig#contextualToolbar
301+
* @member {Array.<String>|Object} module:core/editor/editorconfig~EditorConfig#balloonToolbar
302302
*/

tests/manual/contextualtoolbar/contextualtoolbar.html renamed to tests/manual/balloontoolbar/balloontoolbar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div id="editor">
2-
<p><em>ContextualToolbar</em> won't show for the first block element.</p>
2+
<p><em>BalloonToolbar</em> won't show for the first block element.</p>
33
<p><em>This</em> is a <strong>first line</strong> of text.</p>
44
<p><em>This</em> is a <strong>second line</strong> of text.</p>
55
<p><em>This</em> is the <strong>end</strong> of text.</p>

tests/manual/contextualtoolbar/contextualtoolbar.js renamed to tests/manual/balloontoolbar/balloontoolbar.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@
77

88
import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
99
import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset';
10-
import ContextualToolbar from '../../../src/toolbar/contextual/contextualtoolbar';
10+
import BalloonToolbar from '../../../src/toolbar/balloon/balloontoolbar';
1111
import Range from '@ckeditor/ckeditor5-engine/src/model/range';
1212

1313
ClassicEditor
1414
.create( document.querySelector( '#editor' ), {
15-
plugins: [ ArticlePluginSet, ContextualToolbar ],
15+
plugins: [ ArticlePluginSet, BalloonToolbar ],
1616
toolbar: [ 'bold', 'italic', 'link', 'undo', 'redo' ],
17-
contextualToolbar: [ 'bold', 'italic', 'link' ]
17+
balloonToolbar: [ 'bold', 'italic', 'link' ]
1818
} )
1919
.then( editor => {
2020
window.editor = editor;
2121

22-
const contextualToolbar = editor.plugins.get( 'ContextualToolbar' );
22+
const balloonToolbar = editor.plugins.get( 'BalloonToolbar' );
2323

24-
contextualToolbar.on( 'show', evt => {
24+
balloonToolbar.on( 'show', evt => {
2525
const selectionRange = editor.model.document.selection.getFirstRange();
2626
const blockRange = Range.createOn( editor.model.document.getRoot().getChild( 0 ) );
2727

File renamed without changes.

tests/manual/contextualballoon/contextualballoon.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77

88
import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
99
import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset';
10-
import ContextualToolbar from '../../../src/toolbar/contextual/contextualtoolbar';
10+
import BalloonToolbar from '../../../src/toolbar/balloon/balloontoolbar';
1111

1212
// Finally the editor.
1313
ClassicEditor
1414
.create( document.querySelector( '#editor' ), {
15-
plugins: [ ArticlePluginSet, ContextualToolbar ],
15+
plugins: [ ArticlePluginSet, BalloonToolbar ],
1616
toolbar: [ 'bold', 'link' ],
17-
contextualToolbar: [ 'bold', 'link' ]
17+
balloonToolbar: [ 'bold', 'link' ]
1818
} )
1919
.then( editor => {
2020
window.editor = editor;

tests/manual/contextualballoon/externalchanges.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/* globals console:false, document, setTimeout */
77

88
import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
9-
import ContextualToolbar from '../../../src/toolbar/contextual/contextualtoolbar';
9+
import BalloonToolbar from '../../../src/toolbar/balloon/balloontoolbar';
1010
import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset';
1111

1212
import Position from '@ckeditor/ckeditor5-engine/src/model/position';
@@ -15,9 +15,9 @@ import Range from '@ckeditor/ckeditor5-engine/src/model/range';
1515
// Editor for the external insert.
1616
ClassicEditor
1717
.create( document.querySelector( '#editor-insert' ), {
18-
plugins: [ ArticlePluginSet, ContextualToolbar ],
18+
plugins: [ ArticlePluginSet, BalloonToolbar ],
1919
toolbar: [ 'bold', 'link' ],
20-
contextualToolbar: [ 'bold', 'link' ]
20+
balloonToolbar: [ 'bold', 'link' ]
2121
} )
2222
.then( editor => {
2323
const element = document.querySelector( '#button-insert' );
@@ -32,9 +32,9 @@ ClassicEditor
3232
// Editor for the external delete.
3333
ClassicEditor
3434
.create( document.querySelector( '#editor-delete' ), {
35-
plugins: [ ArticlePluginSet, ContextualToolbar ],
35+
plugins: [ ArticlePluginSet, BalloonToolbar ],
3636
toolbar: [ 'bold', 'link' ],
37-
contextualToolbar: [ 'bold', 'link' ]
37+
balloonToolbar: [ 'bold', 'link' ]
3838
} )
3939
.then( editor => {
4040
const element = document.querySelector( '#button-delete' );

tests/manual/contextualballoon/externalchanges.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Link panel opened from ContextualToolbar should be updated on external changes.
1+
## Link panel opened from BalloonToolbar should be updated on external changes.
22

33
### Create #1:
44

tests/manual/tickets/198/1.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77

88
import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
99
import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset';
10-
import ContextualToolbar from '../../../../src/toolbar/contextual/contextualtoolbar';
10+
import BalloonToolbar from '../../../../src/toolbar/balloon/balloontoolbar';
1111

1212
import Position from '@ckeditor/ckeditor5-engine/src/model/position';
1313
import Range from '@ckeditor/ckeditor5-engine/src/model/range';
1414

1515
// Editor for the external insert.
1616
ClassicEditor
1717
.create( document.querySelector( '#editor-insert' ), {
18-
plugins: [ ArticlePluginSet, ContextualToolbar ],
18+
plugins: [ ArticlePluginSet, BalloonToolbar ],
1919
toolbar: [ 'undo', 'redo' ],
20-
contextualToolbar: [ 'bold', 'italic' ]
20+
balloonToolbar: [ 'bold', 'italic' ]
2121
} )
2222
.then( editor => {
2323
const element = document.querySelector( '#button-insert' );
@@ -32,9 +32,9 @@ ClassicEditor
3232
// Editor for the external delete.
3333
ClassicEditor
3434
.create( document.querySelector( '#editor-delete' ), {
35-
plugins: [ ArticlePluginSet, ContextualToolbar ],
35+
plugins: [ ArticlePluginSet, BalloonToolbar ],
3636
toolbar: [ 'undo', 'redo' ],
37-
contextualToolbar: [ 'bold', 'italic' ]
37+
balloonToolbar: [ 'bold', 'italic' ]
3838
} )
3939
.then( editor => {
4040
const element = document.querySelector( '#button-delete' );

tests/manual/tickets/198/1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Issue [#198](https://github.com/ckeditor/ckeditor5-ui/issues/198) manual test.
22

3-
## Position of the `ContextualToolbar` should be updated on external changes.
3+
## Position of the `BalloonToolbar` should be updated on external changes.
44

55
### Insert:
66

0 commit comments

Comments
 (0)