400
Server Formats
One example might be to create a new currency format. Essentially, all currency formatting
consists of converting a number to a string, inserting commas and decimal points, and
inserting a currency symbol, such as a dollar ($) sign. The Currency format data type collects
all the common parameters and prompts you for the required values.
How data formatting works
All format files reside in the Configuration/ServerFormats/
currentServerModel
folder
.
Each
subfolder contains one XML file and multiple HTML files.
The Formats.xml file describes all the choices in the Format menu. Dreamweaver
automatically adds the Edit Format List and None options.
The folder also contains one HTML file for each currently installed format type, which
includes
AlphaCase
,
Currency
,
DateTime
,
Math
,
Number
,
Percent
,
Simple
, and
Trim
.
The Formats.xml file
The Formats.xml file contains one
format
tag for each item in the Format menu. Each
format
tag contains the following mandatory attributes:
■
The
file=
fileName
attribute is the HTML file for this format type, such as
"Currency"
.
■
The
title=
string
attribute is the string that appears in the Format menu, such as
"Currency - default"
.
■
The
expression=
regexp
attribute is a regular expression that matches the dynamic data
objects that use this format. The expression determines what format is currently applied to
a dynamic data object. For example, the expression for the
"Currency - default"
format is
"<%\s*=\s*FormatCurrency\(.*, -1, -2, -2,
-
2\)\s*%>|<%\s*=\s*DoCurrency\(.*, -1, -2, -2, -2\)\s*%>"
. The value of the
expression attribute must be unique among all
format
tags in the file; it must be specific
enough to guarantee that only instances of this format match the expression.
■
The
visibility=
[hidden | visible]
attribute indicates whether the value appears in
the Format menu. If the value of the
visibility
attribute is
hidden
, the format does not
appear in the Format menu.
The
format
tag can contain additional, arbitrarily named attributes.
Some data formatting functions require an argument,
format
, which is a JavaScript object.
This object is the node that corresponds to the
format
tag in the Formats.xml file. The object
has a JavaScript property for each attribute of the corresponding
format
tag.
Содержание DREAMWEAVER 8-EXTENDING DREAMWEAVER
Страница 1: ...Extending Dreamweaver...
Страница 8: ...8 Contents...
Страница 14: ...14 Introduction...
Страница 16: ......
Страница 54: ...54 Customizing Dreamweaver...
Страница 96: ...96 Customizing Code View...
Страница 98: ......
Страница 110: ...110 Extending Dreamweaver...
Страница 138: ......
Страница 166: ...166 Insert Bar Objects...
Страница 180: ...180 Commands...
Страница 248: ...248 Toolbars...
Страница 260: ...260 Reports...
Страница 278: ...278 Tag Libraries and Editors...
Страница 288: ...288 Property Inspectors...
Страница 378: ...378 Server Behaviors...
Страница 398: ...398 Data Sources...
Страница 432: ...432 Server Models...
Страница 456: ...456 Data Translators...
Страница 482: ......
Страница 492: ...492 The Shared Folder...