Kaynağa Gözat

Docs: Added balloon toolbar editor example. [skip ci]

Wiktor Walc 8 yıl önce
ebeveyn
işleme
9fe66a8238

+ 20 - 0
docs/_snippets/examples/balloon-toolbar-editor.html

@@ -0,0 +1,20 @@
+<div id="snippet-balloon-toolbar-editor">
+	<h2>Walking the capitals of Europe: Warsaw</h2>
+	<figure class="image"><img alt="Picture of the Warsaw Old Town." height="auto" width="100%"
+	                           src="https://c.cksource.com/a/1/img/demo/warsaw.jpg">
+		<figcaption>Medieval Old Town square, destroyed in 1944 & rebuilt after WWII.</figcaption>
+	</figure>
+	<p>If you enjoyed my previous articles in which we discussed wandering around <a href="https://en.wikipedia.org/wiki/Copenhagen" target="_blank" rel="external">Copenhagen</a> and <a href="https://en.wikipedia.org/wiki/Vilnius" target="_blank" rel="external">Vilnius</a>, you’ll definitely love exploring <a href="https://en.wikipedia.org/wiki/Warsaw" target="_blank" rel="external">Warsaw</a>.</p>
+	<h3>Time to put comfy sandals on!</h3>
+	<p>Best time to visit the city is July and August, when it’s cool enough to not break a sweat and hot enough to enjoy summer. The city which has quite a combination of both old and modern textures is located by the river of Vistula.</p>
+	<p>The historic <strong>Old Town</strong>, which was reconstructed after the World War II, with its late 18th century characteristics, is a must-see. You can start your walk from the <strong>Nowy Świat Street</strong> which will take you straight to the Old Town.</p>
+	<p>Then you can go to the <strong>Powiśle</strong> area and take a walk on the newly renovated promenade on  the riverfront. There are also lots of cafes, bars and restaurants where you can shake off the exhaustion of the day. On Sundays, there are many parks where you can enjoy nature or listen to pianists from around the world playing Chopin.</p>
+	<p>For museum lovers, you can add these to your list:</p>
+	<ul>
+		<li><a href="http://www.polin.pl/en" target="_blank" rel="external">POLIN</a></li>
+		<li><a href="http://www.1944.pl/en" target="_blank" rel="external">Warsaw Uprising Museum</a></li>
+		<li><a href="http://chopin.museum/en" target="_blank" rel="external">Fryderyk Chopin Museum</a></li>
+	</ul>
+	<h3>Next destination</h3>
+	<p>We will go to Berlin and have a night's walk in the city that never sleeps! Make sure you subscribe to our newsletter!</p>
+</div>

+ 25 - 0
docs/_snippets/examples/balloon-toolbar-editor.js

@@ -0,0 +1,25 @@
+/**
+ * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+/* globals console, window, document */
+
+import BalloonToolbarEditor from '@ckeditor/ckeditor5-editor-balloon-toolbar/src/balloontoolbareditor';
+
+import ArticlePreset from '@ckeditor/ckeditor5-presets/src/article';
+
+BalloonToolbarEditor
+	.create( document.querySelector( '#snippet-balloon-toolbar-editor' ), {
+		plugins: [ ArticlePreset ],
+		toolbar: [ 'headings', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', 'blockQuote', 'undo', 'redo' ],
+		image: {
+			toolbar: [ 'imageStyleFull', 'imageStyleSide', '|', 'imageTextAlternative' ]
+		}
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err );
+	} );

+ 9 - 0
docs/examples/builds/balloon-toolbar-editor.md

@@ -0,0 +1,9 @@
+---
+title: Balloon toolbar editor
+category: examples-builds
+order: 30
+---
+
+{@link builds/guides/overview#Editor-with-balloon-toolbar Balloon toolbar editor} example.
+
+{@snippet examples/balloon-toolbar-editor}