beautypg.com

Isdomrequired() – Adobe Extending Dreamweaver CS4 User Manual

Page 196

background image

190

EXTENDING DREAMWEAVER CS4

Toolbars

function isCommandChecked()

{

var bChecked = false;
var style = arguments[0];
var textFormat = dw.getDocumentDOM().getTextFormat();

if (dw.getDocumentDOM() == null)

bChecked = false;

if (style == "(None)")

bChecked = (dw.cssStylePalette.getSelectedStyle() == '' || textFormat ==

"" || textFormat == "P" || textFormat == "PRE");

else if (style == "Heading 1")

bChecked =0(textFormat == "h1");

else if (style == "Heading 2")

bChecked =0(textFormat == "h2");

else if (style == "Heading 3")

bChecked =0(textFormat == "h3");

else if (style == "Heading 4")

bChecked =0(textFormat == "h4");

else if (style == "Heading 5")

bChecked =0(textFormat == "h5");

else if (style == "Heading 6")

bChecked =0(textFormat == "h6");

else

bChecked = (dw.cssStylePalette.getSelectedStyle() == style);

return bChecked;

}

isDOMRequired()

Availability
Dreamweaver MX.

Description
Specifies whether the toolbar command requires a valid DOM to operate. If this function returns a

true

value or if the

function is not defined, Dreamweaver assumes that the command requires a valid DOM and synchronizes the Code
view and Design view for the document before executing the associated command. This function is equivalent to the

domRequired

attribute in a toolbar item tag.

Arguments
None.

Returns
Dreamweaver expects a Boolean value:

true

if the DOM is required;

false

otherwise.

Example

function isDOMRequired()

{

return false;

}

This manual is related to the following products: