canAcceptCommand(): enable the toolbar item
The
canAcceptCommand()
there is a current Document Object Model (DOM) and whether the document is parsed as
HTML. The function returns the results of those tests. If the conditions are
Dreamweaver enables the text box item on the toolbar. If the function returns the value
, Dreamweaver disables the item.
false
The function is as follows:
function canAcceptCommand()
{
return (dw.getDocumentDOM() != null && dw.getDocumentDOM().getParseMode()
== 'html');
}
receiveArguments(): set the title
Dreamweaver invokes the
when the user enters a value in the Title text box and presses the Enter key or moves the focus
away from the control.
The function is as follows:
function receiveArguments(newTitle)
{
var dom = dw.getDocumentDOM();
if (dom)
dom.setTitle(newTitle);
}
Dreamweaver passes
receiveArguments()
whether a current DOM exists. If it does, the
document title by passing
getCurrentValue(): get the title
Whenever an update cycle occurs, as determined by the default update frequency of the
event handler, Dreamweaver calls the
onEdit
what value to display for the control. The default update frequency of the
determines the update frequency because the Title text edit control has no update attribute.
For the Title text box, the following
application programming interface (API) function
current title.
function consists of one line of code that checks to see whether
receiveArguments()
, which is the value that the user enters, to the
newTitle
function. The
receiveArguments()
to the
newTitle
getCurrentValue()
function, shown in the following example,
function first checks to see
receiveArguments()
function.
dom.setTitle()
getCurrentValue()
function calls the JavaScript
dom.getTitle()
A simple toolbar command file
,
true
function sets the new
function to determine
handler
onEdit
to obtain and return the
219
Need help?
Do you have a question about the DREAMWEAVER 8-EXTENDING DREAMWEAVER and is the answer not in the manual?