en:code:data:clipboard
Differences
This shows you the differences between two versions of the page.
Previous revision | |||
— | en:code:data:clipboard [2021/02/13 11:23] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Clipboard ====== | ||
+ | This object allows you to have access to the system' | ||
+ | Under Linux you also have access to the selection buffer. | ||
+ | ===== Functions ===== | ||
+ | |||
+ | ==== Clipboard ==== | ||
+ | Constructor function. | ||
+ | |||
+ | === Syntax === | ||
+ | <code javascript> | ||
+ | var myObject = new Clipboard(); | ||
+ | </ | ||
+ | <code javascript> | ||
+ | var myObject = new Clipboard(mode); | ||
+ | </ | ||
+ | |||
+ | === Arguments === | ||
+ | - mode - ([[# | ||
+ | |||
+ | === Example === | ||
+ | Create a Clipboard object. | ||
+ | <code javascript> | ||
+ | var myObject = new Clipboard(); | ||
+ | </ | ||
+ | Create a Clipboard object to the selection buffer. | ||
+ | <code javascript> | ||
+ | var myObject = new Clipboard(Clipboard.Selection); | ||
+ | </ | ||
+ | |||
+ | ===== Methods ===== | ||
+ | |||
+ | ==== setMode ==== | ||
+ | Set the clipboard mode. | ||
+ | |||
+ | === Syntax === | ||
+ | <code javascript> | ||
+ | myObject.setMode(mode); | ||
+ | </ | ||
+ | |||
+ | === Arguments === | ||
+ | - mode - ([[# | ||
+ | |||
+ | === Returns === | ||
+ | * (Clipboard) this Clipboard | ||
+ | |||
+ | === Exceptions === | ||
+ | * (UnsupportedSelectionModeError) this mode is not supported under this operating system | ||
+ | |||
+ | ==== setText ==== | ||
+ | Sets the clipboard text. | ||
+ | |||
+ | === Syntax === | ||
+ | <code javascript> | ||
+ | myObject.setText(text); | ||
+ | </ | ||
+ | |||
+ | === Arguments === | ||
+ | - text - (string) the text to write to the clipboard | ||
+ | |||
+ | === Returns === | ||
+ | * (Clipboard) this Clipboard | ||
+ | |||
+ | ==== setImage ==== | ||
+ | Sets the clipboard image. | ||
+ | |||
+ | === Syntax === | ||
+ | <code javascript> | ||
+ | myObject.setImage(image); | ||
+ | </ | ||
+ | |||
+ | === Arguments === | ||
+ | - image - ([[en: | ||
+ | |||
+ | === Returns === | ||
+ | * (Clipboard) this Clipboard | ||
+ | |||
+ | ==== text ==== | ||
+ | Returns the content of the clipboard as text. | ||
+ | |||
+ | === Syntax === | ||
+ | <code javascript> | ||
+ | myObject.text(); | ||
+ | </ | ||
+ | |||
+ | === Returns === | ||
+ | * (string) the content of the clipboard as text | ||
+ | |||
+ | ==== image ==== | ||
+ | Returns the content of the clipboard as an image. | ||
+ | |||
+ | === Syntax === | ||
+ | <code javascript> | ||
+ | myObject.image(); | ||
+ | </ | ||
+ | |||
+ | === Returns === | ||
+ | * ([[en: | ||
+ | |||
+ | ==== dataType ==== | ||
+ | Returns the current clipboard content type. | ||
+ | |||
+ | === Syntax === | ||
+ | <code javascript> | ||
+ | myObject.dataType(); | ||
+ | </ | ||
+ | |||
+ | === Returns === | ||
+ | * ([[# | ||
+ | |||
+ | ===== Attributes ===== | ||
+ | |||
+ | ==== text ==== | ||
+ | The clipboard' | ||
+ | |||
+ | ==== image ==== | ||
+ | The clipboard' | ||
+ | |||
+ | ===== Enumerations ===== | ||
+ | |||
+ | ==== Mode ==== | ||
+ | Clipboard mode. | ||
+ | |||
+ | === Values === | ||
+ | - Standard: standard clipboard | ||
+ | - Selection: selection buffer (Linux only) | ||
+ | - FindBuffer: find buffer (Mac only) | ||
+ | |||
+ | ==== DataType ==== | ||
+ | The clipboard' | ||
+ | |||
+ | === Values === | ||
+ | - Text: text | ||
+ | - Image: an image |