Clipboard functions

 < Day Day Up > 

Clipboard functions are related to cutting, copying, and pasting. On the Macintosh, some Clipboard functions can also apply to text fields in dialog boxes and floating panels. Functions that can operate in text fields are implemented as methods of the dreamweaver object and as methods of the DOM object. The dreamweaver version of the function operates on the selection in the active window: the current Document window, the Code inspector, or the Site panel. On the Macintosh, the function can also operate on the selection in a text box if it is the current field. The DOM version of the function always operates on the selection in the specified document.

dom.clipCopy()

Availability

Dreamweaver 3.

Description

Copies the selection, including any HTML markup that defines the selection, to the Clipboard.

Arguments

None.

Returns

Nothing.

dom.clipCopyText()

Availability

Dreamweaver 3.

Description

Copies the selected text to the Clipboard, ignoring any HTML markup.

Arguments

None.

Returns

Nothing.

Enabler

See "dom.canClipCopyText()" on page 1056.

dom.clipCut()

Availability

Dreamweaver 3.

Description

Removes the selection, including any HTML markup that defines the selection, to the Clipboard.

Arguments

None.

Returns

Nothing.

dom.clipPaste()

Availability

Dreamweaver 3.

Description

Pastes the contents of the Clipboard into the current document at the current insertion point or in place of the current selection. If the Clipboard contains HTML, it is interpreted as such.

Arguments

None.

Returns

Nothing.

Enabler

See "dom.canClipPaste()" on page 1057.

Example

If the Clipboard contains ABC Widgets, a call to dw.getDocumentDOM().clipPaste() results in the following figure:

dom.clipPasteText() (deprecated)

Availability

Dreamweaver 3. Deprecated in Dreamweaver 8. Use the dom.clipPaste("text") function instead.

Description

Pastes the contents of the Clipboard into the current document at the insertion point or in place of the current selection. It replaces any linefeeds in the Clipboard content with BR tags. If the Clipboard contains HTML, it is not interpreted; angle brackets are pasted as &lt; and &gt;.

Arguments

None.

Returns

Nothing.

Enabler

See "dom.canClipPasteText()" on page 1057.

Example

If the Clipboard contains <code>return true;</code>, a call to dw.getDocumentDOM().clipPasteText() results in the following figure:

dreamweaver.clipCopy()

Availability

Dreamweaver 3.

Description

Copies the current selection from the active Document window, dialog box, floating panel, or Site panel to the Clipboard.

Arguments

None.

Returns

Nothing.

Enabler

See "dreamweaver.canClipCopy()" on page 1068.

dreamweaver.clipCut()

Availability

Dreamweaver 3.

Description

Removes the selection from the active Document window, dialog box, floating panel, or Site panel to the Clipboard.

Arguments

None.

Returns

Nothing.

Enabler

See "dreamweaver.canClipCut()" on page 1069.

dreamweaver.clipPaste()

Availability

Dreamweaver 3. Added the strPasteOption argument in Dreamweaver 8.

Description

Pastes the contents of the Clipboard into the current document, dialog box, floating panel, or Site panel.

Arguments

 {strPasteOption} 

  • The strPasteOption argument, which is optional, specifies the type of paste to perform. Values include: "text", "structured", "basicFormat", and "fullFormat".

Returns

Nothing.

Enabler

See "dreamweaver.canClipPaste()" on page 1069.

Example

The following example pasts the contents of the Clipboard as text:

 dw.clipPaste("text"); 

dreamweaver.getClipboardText()

Availability

Dreamweaver 3.

Description

Gets all the text that is stored on the Clipboard.

Arguments

 {bAsText} 

  • The bAsText Boolean value, which is optional, specifies whether the Clipboard content is retrieved as text. If bAsText is a value of TRue, the Clipboard content is retrieved as text. If bAsText is a value of false, the content retains formatting. This argument defaults to false.

Returns

A string that contains the contents of the Clipboard, if the Clipboard contains text (which can be HTML); otherwise, it returns nothing.

Example

If dreamweaver.getClipboardText() returns "text <b>bold</b> text", dreamweaver.getClipboardText(true) returns "text bold text".

     < Day Day Up > 


    Developing Extensions for Macromedia Dreamweaver 8
    Developing Extensions for Macromedia Dreamweaver 8
    ISBN: 0321395409
    EAN: 2147483647
    Year: 2005
    Pages: 282

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net