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 10
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 #92 from ckeditor/t/ckeditor5-engine/1198
Enhancement: Added support for `ConverterDefinition` in the heading options configuration. Closes #72. Closes ckeditor/ckeditor5#651. BREAKING CHANGE: `config.heading.options` format has changed. The valid `HeadingOption` syntax is now compatible with `ConverterDefinition`: `{ model: 'heading1', view: 'h2', title: 'Heading 1' }`.
- Loading branch information
Showing
9 changed files
with
216 additions
and
69 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<style> | ||
h2.fancy, .ck-heading_heading2_fancy { | ||
color: #ff0050; | ||
font-size: 1.3em; | ||
} | ||
</style> | ||
|
||
<div id="snippet-custom-heading-elements"> | ||
<h1>Heading 1</h1> | ||
<h2>Heading 2</h2> | ||
<h2 class="fancy">Fancy Heading 2</h2> | ||
<p>This is <a href="https://ckeditor5.github.io">CKEditor 5</a>.</p> | ||
</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,35 @@ | ||
/** | ||
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md. | ||
*/ | ||
|
||
/* globals ClassicEditor, console, window, document */ | ||
|
||
ClassicEditor | ||
.create( document.querySelector( '#snippet-custom-heading-elements' ), { | ||
heading: { | ||
options: [ | ||
{ model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' }, | ||
{ model: 'heading1', view: 'h1', title: 'Heading 1', class: 'ck-heading_heading1' }, | ||
{ model: 'heading2', view: 'h2', title: 'Heading 2', class: 'ck-heading_heading2' }, | ||
{ | ||
model: 'headingFancy', | ||
view: { | ||
name: 'h2', | ||
class: 'fancy', | ||
priority: 'high' | ||
}, | ||
title: 'Heading 2 (fancy)', class: 'ck-heading_heading2_fancy' | ||
} | ||
] | ||
}, | ||
toolbar: { | ||
viewportTopOffset: 60 | ||
} | ||
} ) | ||
.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
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
Oops, something went wrong.