Adobe 38040334 - Dreamweaver CS3 User Manual page 156

Extending dreamweaver
Hide thumbs Also See for 38040334 - Dreamweaver CS3:
Table of Contents

Advertisement

receiveArguments()
Dreamweaver calls the
receiveArguments()
tag. For the Undo and Redo menu items, the
the
function, depending on whether the value of the argument,
dw.redo()
The
function undoes the previous step that the user performed in the document window, dialog box, or
dw.undo()
panel that has focus. The
dw.redo()
The
receiveArguments()
function receiveArguments()
{
if (arguments.length != 1) return;
var whatToDo = arguments[0];
if (whatToDo == "undo")
{
dw.undo();
}
else if (whatToDo == "redo")
{
dw.redo();
}
}
In this command, the
receiveArguments()
complex menu commands might call different functions to execute the command. For example, the following code
checks whether the first argument is
argument. If the first argument is
The
or
doOperationX()
doOperationY()
function receiveArguments(){
if (arguments.length != 2) return;
var whatToDo = arguments[0];
if (whatToDo == "foo"){
doOperationX(arguments[1]);
}else if (whatToDo == "bar"){
doOperationX(arguments[1]);
}
}
setMenuText()
Dreamweaver calls the
setMenuText()
define the
setMenuText()
tag.
menuitem
The
function checks the value of the argument that Dreamweaver passes,
setMenuText()
value of the argument is
"undo"
calls
. The
dw.getRedoText()
Dreamweaver will undo. For example, if the user executes multiple Redo operations,
return the menu text "Undo Edit Source. " Likewise, the
operation that Dreamweaver will redo. If the user executes multiple Undo operations, the
could return the menu text "Redo Edit Source. "
function to process any arguments that you defined for the
receiveArguments()
function redoes the last operation that was undone.
function looks like the following example code:
function processes the arguments and executes the command. More
; if it is, it calls the
"foo"
, it calls the
"bar"
doOperationY()
function is responsible for executing the command.
function to determine what text appears for the menu item. If you do not
function, Dreamweaver uses the text that you specified in the
, Dreamweaver calls the
function returns text that specifies the operation that
dw.getUndoText()
function calls either the
arguments[0]
function and passes it the second
doOperationX()
function and passes it the second argument.
function; if it is
dw.getUndoText()
function returns text that specifies the
dw.getRedoText()
DREAMWEAVER CS3
Extending Dreamweaver
menuitem
function or
dw.undo()
, is
or
"undo"
"redo"
attribute of the
name
. If the
arguments[0]
, Dreamweaver
"redo"
could
dw.getUndoText()
function
dw.RedoText()
150
.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dreamweaver cs3

Table of Contents