MACROMEDIA DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER Specifikace Strana 220

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 504
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 219
220 Toolbars
The function is as follows:
function getCurrentValue()
{
var title = "";
var dom = dw.getDocumentDOM();
if (dom)
title = dom.getTitle();
return title;
}
Until the user enters a title for the document, the getTitle() function returns Untitled
Document, which appears in the text box. After the user enters a title, the
getTitle()
function returns that value, and Dreamweaver displays it as the new document title.
To see the complete HTML file that contains the JavaScript functions for the Title text box,
see the EditTitle.htm file in the Toolbars/MM folder.
The MM folder is reserved for Macromedia files. Create another folder inside the Toolbars
folder, and place your JavaScript code in that folder.
The toolbar definition file
A toolbar is simply a list of radio buttons, check buttons, edit boxes, and other toolbar items,
optionally divided by
separator tags. Each toolbar item can be a reference to an item using
the
itemref tag, a separator using the separator tag, or a complete toolbar item definition,
for a checkbox or an edit box, for example, as described in “Toolbar item tags” on page 226.
Each toolbar definition file starts with the following declarations:
<?xml version="1.0" encoding="optional_encoding"?>
<!DOCTYPE toolbarset SYSTEM "-//Macromedia//DWExtension toolbar 5.0">
If the encoding is omitted, Dreamweaver uses the default encoding of the operating system.
After the declarations, the file consists of a single
toolbarset tag, which contains any
number of the following tags:
toolbar, itemref, separator, include, and itemtype tags,
where
itemtype is a button, checkbutton, radiobutton, menubutton, dropdown,
combobox, editcontrol, or colorpicker. The following example, which is an abbreviated
excerpt from the toolbars.xml file, illustrates the hierarchy of tags in the toolbar file. The
example substitutes ellipses (. . .) for the toolbar item attributes that are described in the
following sections.
<?xml version="1.0"?>
<!DOCTYPE toolbarset SYSTEM "-//Macromedia//DWExtension toolbar 5.0">
<toolbarset>
Zobrazit stránku 219
1 2 ... 215 216 217 218 219 220 221 222 223 224 225 ... 503 504

Komentáře k této Příručce

Žádné komentáře