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 18
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 #554 from ckeditor/i/6449
Feature: The `BlockToolbar` should group items when there is no place to show them all. Closes ckeditor/ckeditor5#6449. Closes ckeditor/ckeditor5#6575. Closes ckeditor/ckeditor5#6570. Bulletproofed the `ToolbarView#maxWidth` and items grouping when the toolbar is invisible.
- Loading branch information
Showing
10 changed files
with
461 additions
and
9 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,63 @@ | ||
<button class="external-type">Start external typing</button> | ||
<button class="external-delete">Start external deleting</button> | ||
|
||
<div class="wrapper"> | ||
<div id="editor"> | ||
<h2>The three greatest things you learn from traveling</h2> | ||
<p> | ||
Like all the great things on earth traveling teaches us by example. Here are some of the most precious lessons | ||
I’ve learned over the years of traveling. | ||
</p> | ||
|
||
<figure class="image"> | ||
<img src="./umbrellas.jpg" alt="Three Monks walking on ancient temple."> | ||
<figcaption>Leaving your comfort zone might lead you to such beautiful sceneries like this one.</figcaption> | ||
</figure> | ||
|
||
<h3>Appreciation of diversity</h3> | ||
<p> | ||
Getting used to an entirely different culture can be challenging. While it’s also nice to learn about | ||
cultures online or from books, nothing comes close to experiencing cultural diversity in person. | ||
You learn to appreciate each and every single one of the differences while you become more culturally fluid. | ||
</p> | ||
|
||
<h3>Improvisation</h3> | ||
<p> | ||
Life doesn't allow us to execute every single plan perfectly. This especially seems to be the case when | ||
you travel. You plan it down to every minute with a big checklist; but when it comes to executing it, | ||
something always comes up and you’re left with your improvising skills. You learn to adapt as you go. | ||
Here’s how my travel checklist looks now: | ||
</p> | ||
|
||
<ul> | ||
<li>buy the ticket</li> | ||
<li>start your adventure</li> | ||
</ul> | ||
|
||
<h3>Confidence</h3> | ||
<p> | ||
Going to a new place can be quite terrifying. While change and uncertainty makes us scared, traveling | ||
teaches us how ridiculous it is to be afraid of something before it happens. The moment you face your | ||
fear and see there was nothing to be afraid of, is the moment you discover bliss. | ||
</p> | ||
</div> | ||
</div> | ||
|
||
<style> | ||
#editor { | ||
margin: 0 auto; | ||
max-width: 800px; | ||
} | ||
|
||
.wrapper { | ||
padding: 50px 20px; | ||
} | ||
|
||
.ck-block-toolbar-button { | ||
transform: translateX( -10px ); | ||
} | ||
|
||
[dir="rtl"] .ck-block-toolbar-button { | ||
transform: translateX( 10px ); | ||
} | ||
</style> |
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,34 @@ | ||
/** | ||
* @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license | ||
*/ | ||
|
||
/* globals window, document, console:false, */ | ||
|
||
import BalloonEditor from '@ckeditor/ckeditor5-editor-balloon/src/ballooneditor'; | ||
import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials'; | ||
import List from '@ckeditor/ckeditor5-list/src/list'; | ||
import Image from '@ckeditor/ckeditor5-image/src/image'; | ||
import ImageCaption from '@ckeditor/ckeditor5-image/src/imagecaption'; | ||
import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph'; | ||
import Heading from '@ckeditor/ckeditor5-heading/src/heading'; | ||
import HeadingButtonsUI from '@ckeditor/ckeditor5-heading/src/headingbuttonsui'; | ||
import ParagraphButtonUI from '@ckeditor/ckeditor5-paragraph/src/paragraphbuttonui'; | ||
import BlockToolbar from '../../../src/toolbar/block/blocktoolbar'; | ||
|
||
BalloonEditor | ||
.create( document.querySelector( '#editor' ), { | ||
plugins: [ Essentials, List, Paragraph, Heading, Image, ImageCaption, HeadingButtonsUI, ParagraphButtonUI, BlockToolbar ], | ||
blockToolbar: [ | ||
'paragraph', 'heading1', 'heading2', 'heading3', 'bulletedList', 'numberedList', 'paragraph', | ||
'heading1', 'heading2', 'heading3', 'bulletedList', 'numberedList', 'paragraph', 'heading1', 'heading2', 'heading3', | ||
'bulletedList', 'numberedList' | ||
], | ||
language: 'ar' | ||
} ) | ||
.then( editor => { | ||
window.editor = editor; | ||
} ) | ||
.catch( err => { | ||
console.error( err.stack ); | ||
} ); |
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,4 @@ | ||
## Block toolbar in RTL editor | ||
|
||
1. Check if the button appears on the right side of editable. | ||
2. Check if the toolbar shows up attached correctly to the button. |
Oops, something went wrong.