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 "";
}
Placing the command file in the Menu folder
To implement the menu Undo and Redo menu items, you must save the MyMenu.htm
command file in the Dreamweaver Configuration/Menus folder or a subfolder that you
create. The location of the file must agree with the location that you specified in the
tag. To make it accessible to Dreamweaver, either restart Dreamweaver or reload
menuitem
extensions. For information on how to reload extensions, see
on page
104.
To run the menu commands, select the menu item when it is enabled. Dreamweaver will
invoke the functions in the command file, as described in
on page
196.
A dynamic menu example
This example implements the Dreamweaver Preview in Browser submenu that displays a list
of available browsers. The example also opens the current file, or the selected files in the Site
panel, in the user-specified browser. Implementing this dynamic menu consists of the
following steps:
Creating the dynamic menu items
Writing the JavaScript code
function looks like the following example code:
"Reloading extensions"
"How menu commands work"
A dynamic menu example
201
Need help?
Do you have a question about the DREAMWEAVER 8-EXTENDING DREAMWEAVER and is the answer not in the manual?
Questions and answers