The configuration
paste
property defines options related to editor
paste behavior.
Example Configuration
In this example, a simple configuration
object is created that overrides the default paste behavior. The simple configuration
object is then passed to
replace
to create an editor
.
var configPaste = { paste : { style : 'clean', // Overrides default: 'prompt' for MS Office content enableFlashImport: true // Note, true is the default } }; var editor = textboxio.replace('#targetId', configPaste);
Properties
Property | Type | Default | Values |
---|---|---|---|
style | String | 'prompt' | 'clean', 'retain', 'plain' or 'prompt' |
enableFlashImport | Boolean | true | false or true |
Style Values
Value | Description |
---|---|
prompt | (Default for importing MS Office content) A prompt is displayed to the user on paste. The prompt asks the user to either remove or retain inline CSS styling. |
clean | Inline CSS styling is stripped from pasted content. |
plain | Only the plain text clipboard content is pasted, if any is available |
retain | (Default for all other content) Inline CSS styling is retained in pasted content. |
Enable Flash Import
This option was introduced in Textbox.io release 1.3.1
On some browsers, a flash plugin is used to extract images when pasting from MS Office documents. On these browsers the use of flash can be disabled.
This option has no impact on browsers that do not require flash; on those browsers images will still be included. To disable local image pasting completely use the allowLocal configuration option.
Value | Description |
---|---|
true | Allow flash to be used to extract images when pasting from MS Office documents |
false | On browsers that require flash, no images will be pasted when copying and pasting from MS Office documents. If there are images in the document, the user will see a warning that images were blocked. Other content will still be pasted as normal. |
Inline CSS styling is CSS that is applied directly to HTML elements via the HTML style attribute (W3C).
Protected View
Note: When using the Windows operating system, copying and pasting content from Word 2013 or later in Protected View will result in plain, unformatted text. This is due to how Protected View interacts with the clipboard.