MACROMEDIA DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER Specifikace Strana 199

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 504
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 198
A simple menu command example 199
function canAcceptCommand()
{
var selarray;
if (arguments.length != 1) return false;
var bResult = false;
var whatToDo = arguments[0];
if (whatToDo == "undo")
{
bResult = dw.canUndo();
}
else if (whatToDo == "redo")
{
bResult = dw.canRedo();
}
return bResult;
}
receiveArguments()
Dreamweaver calls the receiveArguments() function to process any arguments that you
defined for the
menuitem tag. For the Undo and Redo menu items, the receiveArguments()
function calls either the
dw.undo() function or the dw.redo() function, depending on
whether the value of the argument,
arguments[0], is "undo" or "redo". The dw.undo()
function undoes the previous step that the user performed in the document window, dialog
box, or panel that has focus. The
dw.redo() function redoes the last operation that was
undone.
The
receiveArguments() function looks like the following example code:
function receiveArguments()
{
if (arguments.length != 1) return;
var whatToDo = arguments[0];
if (whatToDo == "undo")
{
dw.undo();
}
else if (whatToDo == "redo")
{
dw.redo();
}
}
Zobrazit stránku 198
1 2 ... 194 195 196 197 198 199 200 201 202 203 204 ... 503 504

Komentáře k této Příručce

Žádné komentáře