瀏覽代碼

Merge branch 'master' into t/ckeditor5-engine/1554

Piotrek Koszuliński 7 年之前
父節點
當前提交
f59a7bc57e

+ 3 - 0
packages/ckeditor5-clipboard/.travis.yml

@@ -12,6 +12,9 @@ node_js:
 - '8'
 cache:
 - node_modules
+branches:
+   except:
+   - stable
 before_install:
 - export DISPLAY=:99.0
 - sh -e /etc/init.d/xvfb start

+ 1 - 1
packages/ckeditor5-clipboard/CONTRIBUTING.md

@@ -1,4 +1,4 @@
 Contributing
 ========================================
 
-Information about contributing can be found on the following page: <https://github.com/ckeditor/ckeditor5/blob/master/CONTRIBUTING.md>.
+See the [official contributors' guide to CKEditor 5](https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html) to learn more.

+ 21 - 21
packages/ckeditor5-clipboard/docs/framework/guides/deep-dive/clipboard.md

@@ -4,45 +4,45 @@ category: framework-deep-dive
 
 # Clipboard
 
-The clipboard feature (implemented by the {@link module:clipboard/clipboard~Clipboard} plugin) is responsible for integrating with the native clipboard – a feature of the operating system and the browser used when the user copies/cuts/pastes or drag&drop a content within the editor or from/to the "outside".
+The clipboard feature (implemented by the {@link module:clipboard/clipboard~Clipboard} plugin) is responsible for the integration with the native clipboard &mdash; a feature of the operating system and the browser used when the user copies, cuts, pastes or drags and drops content within the editor or from/to the "outside".
 
-CKEditor 5 intercepts all the native events like `copy`, `cut` or `drop` and handles them on its side. The goal is to not allow the browser to touch the content in the editor which would lead to the browser messing it up.
+CKEditor 5 intercepts all native events like `copy`, `cut` or `drop` and handles them on its side. The goal is to not allow the browser to touch the content in the rich text editor which would lead to the browser messing it up.
 
 There are two directions in which the content is processed:
 
-* When a content is being pasted or dropped into the editor it goes through the [input pipeline](#input-pipeline).
-* When a content is being copied, cut or dragged from the editor it goes through the [output pipeline](#output-pipeline).
+* When the content is being pasted or dropped into the editor, it goes through the [input pipeline](#input-pipeline).
+* When the content is being copied, cut or dragged from the editor it goes through the [output pipeline](#output-pipeline).
 
-Both pipelines allow the features to process the content to be inserted or set to the clipboard as well as overriding the default mechanisms at different stages of those processes.
+Both pipelines allow the features to process the content to be inserted or set to the clipboard as well as override the default mechanisms at different stages of those processes.
 
 ## Input pipeline
 
-When the user pastes or drops a content into the editor the browser fires an event which is intercepted by the clipboard feature and which originates this mechanism:
+When the user pastes or drops content into the editor, the browser fires an event which is intercepted by the clipboard feature and which kickstarts the following mechanism:
 
 1. {@link module:clipboard/clipboardobserver~ClipboardObserver} turns that event into a synthetic {@link module:engine/view/document~Document#event:paste `view.Document#paste`} or {@link module:engine/view/document~Document#event:drop `view.Document#drop`}.
-2. Since the content to be inserted by both actions (paste and drop) should usually be processed in the same way and both actions have very simillar effect, both events are turned into a single {@link module:engine/view/document~Document#event:clipboardInput `view.Document#clipboardInput`} event for easier handling.
-3. Next, the clipboard feature listens to the `view.Document#clipboardInput` event, retrieves and pre-process the `text/html` or `text/plain` content which it finds in the {@link module:clipboard/datatransfer~DataTransfer event's `dataTransfer`} and fires the {@link module:clipboard/clipboard~Clipboard#event:inputTransformation `Clipboard#inputTransformation`} event with the retrieved content.
+2. Since the content to be inserted by both actions (paste and drop) should usually be processed in the same way and both actions have a very simillar effect, both events are turned into a single {@link module:engine/view/document~Document#event:clipboardInput `view.Document#clipboardInput`} event for easier handling.
+3. Next, the clipboard feature listens to the `view.Document#clipboardInput` event, retrieves and pre-processes the `text/html` or `text/plain` content which it finds in the {@link module:clipboard/datatransfer~DataTransfer event's `dataTransfer`} and fires the {@link module:clipboard/clipboard~Clipboard#event:inputTransformation `Clipboard#inputTransformation`} event with the retrieved content.
 4. Finally, the clipboard feature listens to the `Clipboard#inputTransformation` event, takes the processed content and {@link module:engine/model/model~Model#insertContent inserts} it into the editor.
 
-The clipboard feature listens to the `view.Document#clipboardInput` and `Clipboard#inputTransformation` events using low priority listeners. This means that adding a normal listener and calling `evt.stop()` allows overriding the behavior implemented by the clipboard feature. It is a similar mechanism to DOM's `evt.preventDefault()` that lets you override the default browser's behavior.
+The clipboard feature listens to the `view.Document#clipboardInput` and `Clipboard#inputTransformation` events using low priority listeners. This means that adding a normal listener and calling `evt.stop()` allows overriding the behavior implemented by the clipboard feature. It is a similar mechanism to DOM's `evt.preventDefault()` that lets you override the default browser behavior.
 
 ### Handling clipboard input differently
 
-By default the clipboard feature retrieves `text/html` or `text/plain` from the clipboard, normalizes that data a bit (e.g. cleans up a [mess with whitespaces](https://github.com/ckeditor/ckeditor5-clipboard/issues/2)), converts that to a {@link module:engine/view/documentfragment~DocumentFragment view `DocumentFragment`} and fires the `Clipboard#inputTransformation` event with that document fragment for further processing.
+By default the clipboard feature retrieves `text/html` or `text/plain` from the clipboard, normalizes that data a bit (e.g. cleans up the [mess with whitespaces](https://github.com/ckeditor/ckeditor5-clipboard/issues/2)), converts that to a {@link module:engine/view/documentfragment~DocumentFragment view `DocumentFragment`} and fires the `Clipboard#inputTransformation` event with that document fragment for further processing.
 
 The {@link module:engine/view/document~Document#event:clipboardInput `view.Document#clipboardInput`} event can be used to override this behavior. For example, you can use it to:
 
-* Handle pasted/droppped files (which you can retrieve from the `dataTransfer`).
+* Handle pasted or droppped files (that you can retrieve from the `dataTransfer`).
 
-	Handling file upload requires, however, a lot more than reading {@link module:clipboard/datatransfer~DataTransfer#files `dataTransfer.files`} so for a complete code we recommend checking the source code of plugins like [`ImageUploadEditing`](https://github.com/ckeditor/ckeditor5-image/blob/master/src/imageupload/imageuploadediting.js).
-* Change the type of data which the clipboard features reads from the clipboard. For instance, you may want to use `application/rtf` if it is present in the `dataTransfer` (and ignore `text/html` in that case).
+	Handling file upload requires, however, a lot more than reading {@link module:clipboard/datatransfer~DataTransfer#files `dataTransfer.files`} so for a complete code example we recommend checking the source code of plugins like [`ImageUploadEditing`](https://github.com/ckeditor/ckeditor5-image/blob/master/src/imageupload/imageuploadediting.js).
+* Change the type of data that the clipboard feature reads from the clipboard. For instance, you may want to use `application/rtf` if it is present in the `dataTransfer` (and ignore `text/html` in that case).
 
 	```js
 	editor.editing.view.document.on( 'clipboardInput', ( evt, data ) => {
 		const dataTransfer = data.dataTransfer;
 		const rtfContent = dataTransfer.getData( 'application/rtf' );
 
-		// If no RTF pasted, abort and let the clipboard feature handle the input.
+		// If no RTF was pasted, abort and let the clipboard feature handle the input.
 		if ( !rtfContent ) {
 			return;
 		}
@@ -63,9 +63,9 @@ The {@link module:engine/view/document~Document#event:clipboardInput `view.Docum
 
 The {@link module:clipboard/clipboard~Clipboard#event:inputTransformation `view.Document#inputTransformation`} event lets you process the content which is going to be inserted into the editor.
 
-The default action is to {@link module:engine/model/model~Model#insertContent insert} the content (`data.content`, represented by a {@link module:engine/view/documentfragment~DocumentFragment}) to an editor if the data is not empty.
+The default action is to {@link module:engine/model/model~Model#insertContent insert} the content (`data.content`, represented by a {@link module:engine/view/documentfragment~DocumentFragment}) to the editor if the data is not empty.
 
-At this stage the pasted content can be processed by the features. E.g. a feature which wants to transform a pasted text into a link can be implemented in this way:
+At this stage the pasted content can be processed by the features. For example, a feature that wants to transform the pasted text into a link can be implemented in this way:
 
 ```js
 editor.plugins.get( 'Clipboard' ).on( 'inputTransformation', ( evt, data ) => {
@@ -94,15 +94,15 @@ editor.plugins.get( 'Clipboard' ).on( 'inputTransformation', ( evt, data ) => {
 ## Output pipeline
 
 The output pipeline is the equivalent of the input pipeline but for the copy and cut operations.
-It allows to process the content which will be then put into the clipboard or to override the whole process.
+It allows to process the content that will be then put into the clipboard or to override the whole process.
 
 ### 1. On {@link module:engine/view/document~Document#event:copy `view.Document#copy`} and {@link module:engine/view/document~Document#event:cut `view.Document#cut`}
 
 The default action is to:
 
-1. {@link module:engine/model/model~Model#getSelectedContent get selected content} from the editor,
-2. prevent the default action of the native `copy` or `cut` event,
-3. fire {@link module:engine/view/document~Document#event:clipboardOutput `view.Document#clipboardOutput`} with a clone of the selected content converted to a {@link module:engine/view/documentfragment~DocumentFragment view document fragment}.
+1. {@link module:engine/model/model~Model#getSelectedContent Get the selected content} from the editor.
+2. Prevent the default action of the native `copy` or `cut` event.
+3. Fire {@link module:engine/view/document~Document#event:clipboardOutput `view.Document#clipboardOutput`} with a clone of the selected content converted to a {@link module:engine/view/documentfragment~DocumentFragment view document fragment}.
 
 ### 2. On {@link module:engine/view/document~Document#event:clipboardOutput `view.Document#clipboardOutput`}
 
@@ -110,4 +110,4 @@ The default action is to put the content (`data.content`, represented by a {@lin
 
 This action is performed by a low priority listener, so it can be overridden by a normal one.
 
-At this stage the copied/cut content can be processed by other features.
+At this stage the copied or cut content can be processed by other features.