This repository has been archived by the owner on Jun 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from ckeditor/t/ckeditor5/479
Feature: Enabled the balloon editor placeholder (see ckeditor/ckeditor5#479). BREAKING CHANGE: The second argument of `BalloonEditorUIView.constructor()` is an editing view instance now.
- Loading branch information
Showing
8 changed files
with
239 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<div id="editor-1" placeholder="Placeholder from the attribute"> | ||
<p>Remove this text to see the placeholder.</p> | ||
</div> | ||
<br /> | ||
<div id="editor-2" placeholder="Placeholder from the attribute"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/** | ||
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md. | ||
*/ | ||
|
||
/* globals console:false, document, window */ | ||
|
||
import BalloonEditor from '../../src/ballooneditor'; | ||
import Enter from '@ckeditor/ckeditor5-enter/src/enter'; | ||
import Typing from '@ckeditor/ckeditor5-typing/src/typing'; | ||
import Heading from '@ckeditor/ckeditor5-heading/src/heading'; | ||
import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph'; | ||
import Undo from '@ckeditor/ckeditor5-undo/src/undo'; | ||
import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold'; | ||
import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic'; | ||
|
||
window.editors = {}; | ||
|
||
function initEditor( element, placeholder ) { | ||
BalloonEditor | ||
.create( element, { | ||
plugins: [ Enter, Typing, Paragraph, Undo, Heading, Bold, Italic ], | ||
toolbar: [ 'heading', '|', 'bold', 'italic', 'undo', 'redo' ], | ||
placeholder | ||
} ) | ||
.then( newEditor => { | ||
console.log( 'Editor was initialized', newEditor ); | ||
|
||
window.editors[ element.id ] = newEditor; | ||
} ) | ||
.catch( err => { | ||
console.error( err.stack ); | ||
} ); | ||
} | ||
|
||
initEditor( document.querySelector( '#editor-1' ) ); | ||
initEditor( document.querySelector( '#editor-2' ), 'The placeholder from editor.config.placeholder' ); |
Oops, something went wrong.