For more information about the
Reference.
In this command, the
command. More complex menu commands might call different functions to execute the
command. For example, the following code checks whether the first argument is
calls the
doOperationX()
, it calls the
"bar"
doOperationY()
or
doOperationX()
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
item. If you do not define the
specified on the name attribute of the
The
setMenuText()
. If the value of the argument is
arguments[0]
dw.getUndoText()
dw.getUndoText()
undo. For example, if the user executes multiple Redo operations,
return the menu text, Undo Edit Source. Likewise, the
that specifies the operation that Dreamweaver will redo. If the user executes multiple Undo
operations, the
dw.RedoText()
The
setMenuText()
function setMenuText()
{
if (arguments.length != 1) return "";
var whatToDo = arguments[0];
if (whatToDo == "undo")
return dw.getUndoText();
else if (whatToDo == "redo")
return dw.getRedoText();
else return "";
}
dw.undo()
receiveArguments()
function and passes it the second argument. If the first argument is
function and passes it the second argument. The
function is responsible for executing the command.
doOperationY()
function to determine what text appears for the menu
setMenuText()
setMenuText()
menuitem
function checks the value of the argument that Dreamweaver passes,
function; if it is
"redo"
function returns text that specifies the operation that Dreamweaver will
function could return the menu text, Redo Edit Source.
function looks like the following example code:
functions, see the Dreamweaver API
and
dw.redo()
function processes the arguments and executes the
function, Dreamweaver uses the text that you
tag.
, Dreamweaver calls the
"undo"
, Dreamweaver calls
dw.getRedoText()
dw.getRedoText()
; if it is, it
"foo"
. The
could
dw.getUndoText()
function returns text
A simple menu command
163
Need help?
Do you have a question about the DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER and is the answer not in the manual?