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

Commit

Permalink
Merge branch 't/ckeditor5/550'
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
Reinmar committed Feb 21, 2018
2 parents 04b0312 + 3dc8e34 commit 28f59df
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 87 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

/**
* @module ui/toolbar/contextual/contextualtoolbar
* @module ui/toolbar/balloon/balloontoolbar
*/

import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
Expand All @@ -22,12 +22,12 @@ import normalizeToolbarConfig from '../normalizetoolbarconfig';
*
* @extends module:core/plugin~Plugin
*/
export default class ContextualToolbar extends Plugin {
export default class BalloonToolbar extends Plugin {
/**
* @inheritDoc
*/
static get pluginName() {
return 'ContextualToolbar';
return 'BalloonToolbar';
}

/**
Expand Down Expand Up @@ -83,7 +83,7 @@ export default class ContextualToolbar extends Plugin {
this._handleSelectionChange();
this._handleFocusChange();

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

this.toolbarView.fillFromConfig( config.items, factory );
Expand Down Expand Up @@ -283,20 +283,20 @@ function getBalloonPositions( isBackward ) {
}

/**
* Contextual toolbar configuration. Used by the {@link module:ui/toolbar/contextual/contextualtoolbar~ContextualToolbar}
* Contextual toolbar configuration. Used by the {@link module:ui/toolbar/balloon/balloontoolbar~BalloonToolbar}
* feature.
*
* const config = {
* contextualToolbar: [ 'bold', 'italic', 'undo', 'redo' ]
* balloonToolbar: [ 'bold', 'italic', 'undo', 'redo' ]
* };
*
* You can also use `'|'` to create a separator between groups of items:
*
* const config = {
* contextualToolbar: [ 'bold', 'italic', | 'undo', 'redo' ]
* balloonToolbar: [ 'bold', 'italic', | 'undo', 'redo' ]
* };
*
* Read also about configuring the main editor toolbar in {@link module:core/editor/editorconfig~EditorConfig#toolbar}.
*
* @member {Array.<String>|Object} module:core/editor/editorconfig~EditorConfig#contextualToolbar
* @member {Array.<String>|Object} module:core/editor/editorconfig~EditorConfig#balloonToolbar
*/
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div id="editor">
<p><em>ContextualToolbar</em> won't show for the first block element.</p>
<p><em>BalloonToolbar</em> won't show for the first block element.</p>
<p><em>This</em> is a <strong>first line</strong> of text.</p>
<p><em>This</em> is a <strong>second line</strong> of text.</p>
<p><em>This</em> is the <strong>end</strong> of text.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@

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

ClassicEditor
.create( document.querySelector( '#editor' ), {
plugins: [ ArticlePluginSet, ContextualToolbar ],
plugins: [ ArticlePluginSet, BalloonToolbar ],
toolbar: [ 'bold', 'italic', 'link', 'undo', 'redo' ],
contextualToolbar: [ 'bold', 'italic', 'link' ]
balloonToolbar: [ 'bold', 'italic', 'link' ]
} )
.then( editor => {
window.editor = editor;

const contextualToolbar = editor.plugins.get( 'ContextualToolbar' );
const balloonToolbar = editor.plugins.get( 'BalloonToolbar' );

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

Expand Down
6 changes: 3 additions & 3 deletions tests/manual/contextualballoon/contextualballoon.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@

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

// Finally the editor.
ClassicEditor
.create( document.querySelector( '#editor' ), {
plugins: [ ArticlePluginSet, ContextualToolbar ],
plugins: [ ArticlePluginSet, BalloonToolbar ],
toolbar: [ 'bold', 'link' ],
contextualToolbar: [ 'bold', 'link' ]
balloonToolbar: [ 'bold', 'link' ]
} )
.then( editor => {
window.editor = editor;
Expand Down
10 changes: 5 additions & 5 deletions tests/manual/contextualballoon/externalchanges.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* globals console:false, document, setTimeout */

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

import Position from '@ckeditor/ckeditor5-engine/src/model/position';
Expand All @@ -15,9 +15,9 @@ import Range from '@ckeditor/ckeditor5-engine/src/model/range';
// Editor for the external insert.
ClassicEditor
.create( document.querySelector( '#editor-insert' ), {
plugins: [ ArticlePluginSet, ContextualToolbar ],
plugins: [ ArticlePluginSet, BalloonToolbar ],
toolbar: [ 'bold', 'link' ],
contextualToolbar: [ 'bold', 'link' ]
balloonToolbar: [ 'bold', 'link' ]
} )
.then( editor => {
const element = document.querySelector( '#button-insert' );
Expand All @@ -32,9 +32,9 @@ ClassicEditor
// Editor for the external delete.
ClassicEditor
.create( document.querySelector( '#editor-delete' ), {
plugins: [ ArticlePluginSet, ContextualToolbar ],
plugins: [ ArticlePluginSet, BalloonToolbar ],
toolbar: [ 'bold', 'link' ],
contextualToolbar: [ 'bold', 'link' ]
balloonToolbar: [ 'bold', 'link' ]
} )
.then( editor => {
const element = document.querySelector( '#button-delete' );
Expand Down
2 changes: 1 addition & 1 deletion tests/manual/contextualballoon/externalchanges.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Link panel opened from ContextualToolbar should be updated on external changes.
## Link panel opened from BalloonToolbar should be updated on external changes.

### Create #1:

Expand Down
10 changes: 5 additions & 5 deletions tests/manual/tickets/198/1.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@

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

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

// Editor for the external insert.
ClassicEditor
.create( document.querySelector( '#editor-insert' ), {
plugins: [ ArticlePluginSet, ContextualToolbar ],
plugins: [ ArticlePluginSet, BalloonToolbar ],
toolbar: [ 'undo', 'redo' ],
contextualToolbar: [ 'bold', 'italic' ]
balloonToolbar: [ 'bold', 'italic' ]
} )
.then( editor => {
const element = document.querySelector( '#button-insert' );
Expand All @@ -32,9 +32,9 @@ ClassicEditor
// Editor for the external delete.
ClassicEditor
.create( document.querySelector( '#editor-delete' ), {
plugins: [ ArticlePluginSet, ContextualToolbar ],
plugins: [ ArticlePluginSet, BalloonToolbar ],
toolbar: [ 'undo', 'redo' ],
contextualToolbar: [ 'bold', 'italic' ]
balloonToolbar: [ 'bold', 'italic' ]
} )
.then( editor => {
const element = document.querySelector( '#button-delete' );
Expand Down
2 changes: 1 addition & 1 deletion tests/manual/tickets/198/1.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Issue [#198](https://github.com/ckeditor/ckeditor5-ui/issues/198) manual test.

## Position of the `ContextualToolbar` should be updated on external changes.
## Position of the `BalloonToolbar` should be updated on external changes.

### Insert:

Expand Down
Loading

0 comments on commit 28f59df

Please sign in to comment.