瀏覽代碼

Docs: Added reusable, short classic editor example. [skip ci]

Wiktor Walc 8 年之前
父節點
當前提交
dd649b781b
共有 2 個文件被更改,包括 27 次插入0 次删除
  1. 12 0
      docs/_snippets/examples/classic-editor-short.html
  2. 15 0
      docs/_snippets/examples/classic-editor-short.js

+ 12 - 0
docs/_snippets/examples/classic-editor-short.html

@@ -0,0 +1,12 @@
+<div id="snippet-classic-editor-short">
+	<h2>Walking the capitals of Europe: Warsaw</h2>
+	<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>
+</div>

+ 15 - 0
docs/_snippets/examples/classic-editor-short.js

@@ -0,0 +1,15 @@
+/**
+ * @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-classic-editor-short' ) )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err );
+	} );