History functions handle undoing, redoing, recording, and playing steps that appear in the History panel. A step is any repeatable change to the document or to a selection in the document. Methods of the dreamweaver.historyPalette object either control or act on the selection in the History panel, not in the current document.

dom.redo()

Availability

Dreamweaver 3.

Description

Redoes the step that was most recently undone in the document.

Arguments

None.

Returns

Nothing.

Enabler

dom.undo()

Availability

Dreamweaver 3.

Description

Undoes the previous step in the document.

Arguments

None.

Returns

Nothing.

Enabler

dreamweaver.getRedoText()

Availability

Dreamweaver 3.

Description

Gets the text that is associated with the editing operation that will be redone if the user selects Edit > Redo or presses Control+Y (Windows) or Command+Y (Macintosh).

Arguments

None.

Returns

A string that contains the text that is associated with the editing operation that will be redone.

Example

If the user’s last action applied bold to selected text, a call to the dreamweaver.getRedoText() function returns "Repeat Apply Bold".

dreamweaver.getUndoText()

Availability

Dreamweaver 3.

Description

Gets the text that is associated with the editing operation that will be undone if the user selects Edit > Undo or presses Control+Z (Windows) or Command+Z (Macintosh).

Arguments

None.

Returns

A string that contains the text that is associated with the editing operation that will be undone.

Example

If the user’s last action applied a Cascading Style Sheet (CSS) style to a selected range of text, a call to the dreamweaver.getUndoText() function returns "Undo Apply <span>".

dreamweaver.playRecordedCommand()

Availability

Dreamweaver 3.

Description

Plays the recorded command in the active document.

Arguments

None.

Returns

Nothing.

Enabler

dreamweaver.redo()

Availability

Dreamweaver 3.

Description

Redoes the step that was most recently undone in the active Document window, dialog box, floating panel, or Site panel.

Arguments

None.

Returns

Nothing.

Enabler

dreamweaver.startRecording()

Availability

Dreamweaver 3.

Description

Starts recording steps in the active document; the previously recorded command is immediately discarded.

Arguments

None.

Returns

Nothing.

Enabler

See dreamweaver.isRecording() (must return a value of false).

dreamweaver.stopRecording()

Availability

Dreamweaver 3.

Description

Stops recording without prompting the user.

Arguments

None.

Returns

Nothing.

Enabler

See dreamweaver.isRecording() (must return a value of true).

dreamweaver.undo()

Availability

Dreamweaver 3.

Description

Undoes the previous step in the Document window, dialog box, floating panel, or Site panel that has focus.

Arguments

None.

Returns

Nothing.

Enabler

dreamweaver.historyPalette.clearSteps()

Availability

Dreamweaver 3.

Description

Clears all steps from the History panel and disables the Undo and Redo menu items.

Arguments

None.

Returns

Nothing.

dreamweaver.historyPalette.copySteps()

Availability

Dreamweaver 3.

Description

Copies the specified history steps to the Clipboard. Dreamweaver warns the user about possible unintended consequences if the specified steps include an unrepeatable action.

Arguments

arrayOfIndices

  • The arrayOfIndices argument is an array of position indices in the History panel.

Returns

A string that contains the JavaScript that corresponds to the specified history steps.

Example

The following example copies the first four steps in the History panel:

 dreamweaver.historyPalette.copySteps([0,1,2,3]);

dreamweaver.historyPalette.getSelectedSteps()

Availability

Dreamweaver 3.

Description

Determines which portion of the History panel is selected.

Arguments

None.

Returns

An array that contains the position indices of all the selected steps. The first position is position 0 (zero).

Example

If the second, third, and fourth steps are selected in the History panel, as shown in the following figure, a call to the dreamweaver.historyPalette.getSelectedSteps() function returns [1,2,3]:

dreamweaver.historyPalette.getSelectedSteps() function returns [1,2,3]

dreamweaver.historyPalette.getStepCount()

Availability

Dreamweaver 3.

Description

Gets the number of steps in the History panel.

Arguments

None.

Returns

An integer that represents the number of steps that are currently listed in the History panel.

dreamweaver.historyPalette.getStepsAsJavaScript()

Availability

Dreamweaver 3.

Description

Gets the JavaScript equivalent of the specified history steps.

Arguments

arrayOfIndices

  • The arrayOfIndices argument is an array of position indices in the History panel.

Returns

A string that contains the JavaScript that corresponds to the specified history steps.

Example

If the three steps shown in the following example are selected in the History panel, a call to the dreamweaver.historyPalette.getStepsAsJavaScript(dw.historyPalette.getSelectedSteps()) function returns "dw.getDocumentDOM().insertText('Hey diddle diddle, a cat and a fiddle, the cow jumped over the moon.');\ ndw.getDocumentDOM().newBlock();\n dw.getDocumentDOM().insertHTML('<img src=\ "../wdw99/50browsers/images/sun.gif\">', true);\n":

dreamweaver.historyPalette.getStepsAsJavaScript(dw.historyPalette.getSelectedSteps()) function returns "dw.getDocumentDOM()

dreamweaver.historyPalette.getUndoState()

Availability

Dreamweaver 3.

Description

Gets the current undo state.

Arguments

None.

Returns

The position of the Undo marker in the History panel.

dreamweaver.historyPalette.replaySteps()

Availability

Dreamweaver 3.

Description

Replays the specified history steps in the active document. Dreamweaver warns the user of possible unintended consequences if the specified steps include an unrepeatable action.

Arguments

arrayOfIndices

  • The arrayOfIndices argument is an array of position indices in the History panel.

Returns

A string that contains the JavaScript that corresponds to the specified history steps.

Example

A call to dreamweaver.historyPalette.replaySteps([0,2,3]) function plays the first, third, and fourth steps in the History panel.

dreamweaver.historyPalette.saveAsCommand()

Availability

Dreamweaver 3.

Description

Opens the Save As Command dialog box, which lets the user save the specified steps as a command. Dreamweaver warns the user of possible unintended consequences if the steps include an unrepeatable action.

Arguments

arrayOfIndices

  • The arrayOfIndices argument is an array of position indexes in the History panel.

Returns

A string that contains the JavaScript that corresponds to the specified history steps.

Example

The following example saves the fourth, sixth, and eighth steps in the History panel as a command:

 dreamweaver.historyPalette.saveAsCommand([3,5,7]);

dreamweaver.historyPalette.setSelectedSteps()

Availability

Dreamweaver 3.

Description

Selects the specified steps in the History panel.

Arguments

arrayOfIndices

  • The arrayOfIndices function is an array of position indices in the History panel. If no argument is supplied, all the steps are unselected.

Returns

Nothing.

Example

The following example selects the first, second, and third steps in the History panel

 dreamweaver.historyPalette.setSelectedSteps([0,1,2]);

dreamweaver.historyPalette.setUndoState()

Availability

Dreamweaver 3.

Description

Performs the correct number of undo or redo operations to arrive at the specified undo state.

Arguments

undoState

  • The undoState argument is the object that the dreamweaver.historyPalette.getUndoState() function returns.

Returns

Nothing.

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy