MACROMEDIA DREAMWEAVER 8-DREAMWEAVER API Spezifikationen Seite 98

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 692
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 97
Chapter 898
Example
The following example determines which item, if any, should be checked in a pop-up menu of
paragraph formats and CSS styles.
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 = (textFormat == "h1");
else if (style == "Heading 2")
bChecked = (textFormat == "h2");
else if (style == "Heading 3")
bChecked = (textFormat == "h3");
else if (style == "Heading 4")
bChecked = (textFormat == "h4");
else if (style == "Heading 5")
bChecked = (textFormat == "h5");
else if (style == "Heading 6")
bChecked = (textFormat == "h6");
else
bChecked = (dw.cssStylePalette.getSelectedStyle() == style);
return bChecked;
}
isDOMRequired()
Description
The isDOMRequired() function specifies whether the toolbar command requires a valid DOM
to operate. If this function returns
true 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 true if the DOM is required; false if the DOM is not required.
Example
function isDOMRequired()
{
return false;
}
Seitenansicht 97
1 2 ... 93 94 95 96 97 98 99 100 101 102 103 ... 691 692

Kommentare zu diesen Handbüchern

Keine Kommentare