MACROMEDIA DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER Dokumentacja Strona 199

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 504
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 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();
}
}
Przeglądanie stron 198
1 2 ... 194 195 196 197 198 199 200 201 202 203 204 ... 503 504

Komentarze do niniejszej Instrukcji

Brak uwag