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>
Summary of Contents for DREAMWEAVER 8-EXTENDING DREAMWEAVER
Page 1: ...Extending Dreamweaver...
Page 8: ...8 Contents...
Page 14: ...14 Introduction...
Page 16: ......
Page 54: ...54 Customizing Dreamweaver...
Page 96: ...96 Customizing Code View...
Page 98: ......
Page 110: ...110 Extending Dreamweaver...
Page 138: ......
Page 166: ...166 Insert Bar Objects...
Page 180: ...180 Commands...
Page 248: ...248 Toolbars...
Page 260: ...260 Reports...
Page 278: ...278 Tag Libraries and Editors...
Page 288: ...288 Property Inspectors...
Page 378: ...378 Server Behaviors...
Page 398: ...398 Data Sources...
Page 432: ...432 Server Models...
Page 456: ...456 Data Translators...
Page 482: ......
Page 492: ...492 The Shared Folder...