Adobe Extending Dreamweaver CS4 User Manual

Browse online or download User Manual for Software Adobe Extending Dreamweaver CS4. Adobe Extending Dreamweaver CS4 User Manual

  • Download
  • Add to my manuals
  • Print
  • Page
    / 387
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews

Summary of Contents

Page 1 - DREAMWEAVER

Extending ADOBE® DREAMWEAVER® CS4

Page 2 - Copyright

4Chapter 2: Customizing DreamweaverIn addition to creating and using Adobe Dreamweaver extensions, you can customize Dreamweaver in many ways, which l

Page 3 - Contents

94EXTENDING DREAMWEAVER CS4User interfaces for extensions<html xmlns:MMStr ing="http://www.adobe.com /schemes/data/ string/"> <h

Page 4

95Chapter 6: The Dreamweaver Document Object ModelIn Adobe Dreamweaver, the Document Object Model (DOM) is a critically important structure for extens

Page 5

96EXTENDING DREAMWEAVER CS4The Dreamweaver Document Object ModelIf you are familiar with JavaScript in browsers, you can reference objects in the acti

Page 6

97EXTENDING DREAMWEAVER CS4The Dreamweaver Document Object ModelObject Properties Methods Eventswindow navigator •document •innerWidth •innerHeight •s

Page 7 - Chapter 1: Introduction

98EXTENDING DREAMWEAVER CS4The Dreamweaver Document Object Modelform In addition to the properties that are available for all tags: tags:elements • (a

Page 8 - Creating an extension

99EXTENDING DREAMWEAVER CS4The Dreamweaver Document Object ModelProperties and methods of the document object The following table details the properti

Page 9 - Introduction

100EXTENDING DREAMWEAVER CS4The Dreamweaver Document Object ModelProperty or method Return valuenodeType • Node.DOCUMENT_NODEparentNode • null paren

Page 10 - Ways to customize Dreamweaver

101EXTENDING DREAMWEAVER CS4The Dreamweaver Document Object ModelProperties and methods of HTML The following table lists the properties and methods o

Page 11

102EXTENDING DREAMWEAVER CS4The Dreamweaver Document Object ModelProperties and methods of text objects Each contiguous block of text in an HTML docum

Page 12 - • String-delimited tags

103EXTENDING DREAMWEAVER CS4The Dreamweaver Document Object ModelThe dreamweaver and site objectsDreamweaver implements the standard objects that are

Page 13 - <tagspec>

5EXTENDING DREAMWEAVER CS4Customizing DreamweaverChange the appearance of a dialog box1 In Dreamweaver, select Edit > Preferences, and then select

Page 14 - Customizing Dreamweaver

104Chapter 7: Insert bar objectsYou can add items to the Insert bar to automate repetitive tasks for your users or even create dialog boxes for users

Page 15 - • Remove Extra Closing Tags

105EXTENDING DREAMWEAVER CS4Insert bar objects2 If Dreamweaver displays a dialog box in step 1, the user enters parameters for the object (such as the

Page 16

106EXTENDING DREAMWEAVER CS4Insert bar objects<insertbar>DescriptionThis tag signals the content of the Insert bar definition file. The </ins

Page 17 - <deleteditems>

107EXTENDING DREAMWEAVER CS4Insert bar objectsExample <menubutton id="DW_ImageMenu" name="Images" image="Common\imageme

Page 18 - Changing FTP mappings

108EXTENDING DREAMWEAVER CS4Insert bar objects<separator />DescriptionThis tag displays a vertical line on the Insert bar.Attributes{showIf}Exam

Page 19 - 5 Save the file

109EXTENDING DREAMWEAVER CS4Insert bar objectsshowIf="enabler"DescriptionThis attribute specifies that this button should appear on the Inse

Page 20

110EXTENDING DREAMWEAVER CS4Insert bar objectscommand="API_function"DescriptionInstead of referring Dreamweaver to an HTML file that contain

Page 21

111EXTENDING DREAMWEAVER CS4Insert bar objectsModifying the Insert barYou can move objects from one category to another, rename categories, and comple

Page 22

112EXTENDING DREAMWEAVER CS4Insert bar objectsCreate a new category1 Save a backup copy of insertbar.xml (with a name such as “insertbar.backup.xml”).

Page 23

113EXTENDING DREAMWEAVER CS4Insert bar objectsBecause this example performs text manipulation, you may want to explore some of the objects from the Te

Page 24 - Defining dynamic templates

6EXTENDING DREAMWEAVER CS4Customizing Dreamweaver2 Open Extensions.txt in a text editor. 3 Add a new line for each new file type. In capital letters,

Page 25 - See also

114EXTENDING DREAMWEAVER CS4Insert bar objectsWithin the objectTag() function, use dw.getFocus() to determine whether the Code view is the current vie

Page 26 - Providing localized strings

115EXTENDING DREAMWEAVER CS4Insert bar objects5 Save the file that now contains the JavaScript functions as Strikethrough.js in the Configuration/Obje

Page 27 - Customizing workspace layouts

116EXTENDING DREAMWEAVER CS4Insert bar objectsAdding a dialog boxYou can add a form to your object to let the user enter parameters before Dreamweaver

Page 28 - <document>

117EXTENDING DREAMWEAVER CS4Insert bar objects2 Save the file as Strikethrough.htm.3 Reload the extensions (see “Reloading extensions” on page 78).Te

Page 29 - <panelframe>

118EXTENDING DREAMWEAVER CS4Insert bar objects• Strike through the content they want to remove or make new content blueOrganize the files1 Create a ne

Page 30 - <panel>

119EXTENDING DREAMWEAVER CS4Insert bar objectsCreate the image1 Create a GIF file that is 18 x 18 pixels, which looks like the following figure:2 Save

Page 31

120EXTENDING DREAMWEAVER CS4Insert bar objects <button id="DW_Blue_Text" image="Editorial\AddBlue.gif name="Blue Text" fil

Page 32

121EXTENDING DREAMWEAVER CS4Insert bar objectsExample The following code tells Dreamweaver to check to see that the document contains a particular str

Page 33

122EXTENDING DREAMWEAVER CS4Insert bar objectsinsertObject() AvailabilityDreamweaver MX.Description This function is required if the objectTag() funct

Page 34

123EXTENDING DREAMWEAVER CS4Insert bar objectsobjectTag()DescriptionThe objectTag() and insertObject() functions are mutually exclusive: If both are d

Page 35

7EXTENDING DREAMWEAVER CS4Customizing DreamweaverString-delimited tags start with one string and end with another string. They are like empty HTML tag

Page 36 - About code hints

124EXTENDING DREAMWEAVER CS4Insert bar objectsReturnsDreamweaver expects a string of the form "widthInPixels,heightInPixels".The returned di

Page 37 - JavaScript code hinting

125Chapter 8: Browser compatibility check issues APIIn Adobe Dreamweaver, the browser compatibility check (BCC) feature helps you create page layouts

Page 38 - Customizing Code view

126EXTENDING DREAMWEAVER CS4Browser compatibility check issues APIColAndColgroupCapturedByCaption.htm <!DOCTYPE HTML SYSTEM "-// //DWExtensi

Page 39

127EXTENDING DREAMWEAVER CS4Browser compatibility check issues API // if styles are declared for any colgroup or col // tag in thi

Page 40

128EXTENDING DREAMWEAVER CS4Browser compatibility check issues APIDescriptionSearches the document for the combination of CSS and HTML that will trigg

Page 41 - Code hints tags

129EXTENDING DREAMWEAVER CS4Browser compatibility check issues APIgetAffectedBrowserDisplayNames()AvailabilityDreamweaver CS3.DescriptionProvides Drea

Page 42 - <description>

130EXTENDING DREAMWEAVER CS4Browser compatibility check issues APIDescriptionProvides Dreamweaver with the name or a short description of the issue.Ar

Page 43

131Chapter 9: CommandsAdobe Dreamweaver commands can perform almost any kind of edit to a user’s current document, other open documents, or any HTML d

Page 44 - <function>

132EXTENDING DREAMWEAVER CS4CommandsAdding commands to the Commands menuDreamweaver automatically adds any files that are inside the Configuration/Com

Page 45 - <method>

133EXTENDING DREAMWEAVER CS4Commands <!DOCTYPE HTML SYSTEM "-//Adobe//DWExtension layout-engine 10.0//dialog"> <HTML> <HEAD

Page 46 - <parammenu>

8EXTENDING DREAMWEAVER CS4Customizing Dreamweaver• start_string specifies a delimiter that marks the beginning of a string-delimited tag. String-delim

Page 47 - <optionparammenu>

134EXTENDING DREAMWEAVER CS4CommandsDetermine whether the command should be enabled or dimmedThe first task in creating a command is to determine when

Page 48 - <property>

135EXTENDING DREAMWEAVER CS4CommandsOtherwise, canAcceptCommand() returns the value false and Dreamweaver dims the item, as shown in the following fig

Page 49 - <event>

136EXTENDING DREAMWEAVER CS4Commands function changeCase() { var uorl; // Check whether user requested uppercase or lowercase. if (document.forms

Page 50 - About code coloring

137EXTENDING DREAMWEAVER CS4CommandsThe changeCase() function first tests the property document.forms[0].elements[0].checked. The document.forms[0].el

Page 51 - <scheme>

138EXTENDING DREAMWEAVER CS4CommandscanAcceptCommand()DescriptionThis function determines whether the command is appropriate for the current selection

Page 52 - <blockEnd>

139EXTENDING DREAMWEAVER CS4CommandsExampleThe following instance of commandButtons() defines three buttons: OK, Cancel, and Help that appear at the u

Page 53 - <charStart>

140EXTENDING DREAMWEAVER CS4CommandsreceiveArguments()DescriptionThis function processes any arguments that pass from a menu item or from the dw.runCo

Page 54 - <commentEnd>

141Chapter 10: Menus and menu commandsAdobe Dreamweaver creates all its menus from the structure defined in the menus.xml file in the Dreamweaver Conf

Page 55 - <cssProperty/>

142EXTENDING DREAMWEAVER CS4Menus and menu commands<menubar>DescriptionProvides information about a menu bar in the Dreamweaver menu structure.A

Page 56 - <defaultTag>

143EXTENDING DREAMWEAVER CS4Menus and menu commandsContentsThis tag can contain one or more menuitem tags, and one or more separator tags. It can also

Page 57 - <entity/>

9EXTENDING DREAMWEAVER CS4Customizing DreamweaverHow custom tags appear in the Design viewThe way that custom tags appear in the Design view of the Do

Page 58 - <idCharRest>

144EXTENDING DREAMWEAVER CS4Menus and menu commands• arguments Provides arguments for Dreamweaver to pass to the code in the JavaScript file that you

Page 59 - <isLocked>

145EXTENDING DREAMWEAVER CS4Menus and menu commandsAttributes{app}app The name of the application in which the separator is shown. Not currently use

Page 60 - <numbers/>

146EXTENDING DREAMWEAVER CS4Menus and menu commandsAttributeskey, {app}, {platform}, {file}, {arguments}, {command}, id, {name}• key The key combinat

Page 61 - <sampleText>

147EXTENDING DREAMWEAVER CS4Menus and menu commandsExample <tool name="Hand tool" id="com.Macromedia.dreamweaver.tools.hand">

Page 62 - <stringStart>

148EXTENDING DREAMWEAVER CS4Menus and menu commandsExample <activate name="Switch to Hand tool" key="H" id="DWTools_Hand_A

Page 63 - <tagGroup>

149EXTENDING DREAMWEAVER CS4Menus and menu commandsCreate a submenu while moving a menu command1 Place the insertion point inside a menu (somewhere be

Page 64

150EXTENDING DREAMWEAVER CS4Menus and menu commandsIf you reassign a keyboard shortcut, change it on a printed copy of the matrix for future reference

Page 65 - Scheme processing

151EXTENDING DREAMWEAVER CS4Menus and menu commandsMenu commandsMenu commands make menus more flexible and dynamic. Menu commands can perform almost a

Page 66 - Wildcard characters

152EXTENDING DREAMWEAVER CS4Menus and menu commandsDelete a command you’ve created1 Select Commands > Edit Command List.A dialog box appears, listi

Page 67 - Maximum string length

153EXTENDING DREAMWEAVER CS4Menus and menu commands12 The dialog box remains visible until one of the scripts in the menu commands file calls the wind

Page 68 - Scheme precedence

10EXTENDING DREAMWEAVER CS4Customizing Dreamweaver• Deselect the Never Rewrite Code: In Files With Extensions option. (Deselecting this option lets Dr

Page 69 - Editing schemes

154EXTENDING DREAMWEAVER CS4Menus and menu commands function canAcceptCommand() { var selarray; if (arguments.length != 1) return false; var bResu

Page 70 - Code coloring examples

155EXTENDING DREAMWEAVER CS4Menus and menu commands function receiveArguments(){ if (arguments.length != 2) return; var whatToDo = arguments[0];

Page 71

156EXTENDING DREAMWEAVER CS4Menus and menu commandsA dynamic menu exampleThis example implements the Dreamweaver Preview In Browser submenu that displ

Page 72

157EXTENDING DREAMWEAVER CS4Menus and menu commands function getDynamicContent(itemID) { var browsers = null; var PIB = null; var i; var j=0; br

Page 73 - About Code validation

158EXTENDING DREAMWEAVER CS4Menus and menu commands function canAcceptCommand() { var PIB = dw.getBrowserList(); if (arguments[0] == 'primar

Page 74 - <css-support>

159EXTENDING DREAMWEAVER CS4Menus and menu commandsbHavePreviewTarget = false; else if (strTemp.indexOf("/") == -1) bHavePreviewTarget = f

Page 75 - <value>

160EXTENDING DREAMWEAVER CS4Menus and menu commandsreceiveArguments()Dreamweaver calls the receiveArguments() function to let the command process any

Page 76 - About Vertical Split view

161EXTENDING DREAMWEAVER CS4Menus and menu commands} else { // Otherwise, F12 or Ctrl+F12 was pressed, ask if the user wants // to specify a prima

Page 77 - About related files

162EXTENDING DREAMWEAVER CS4Menus and menu commandscanAcceptCommand()DescriptionDetermines whether the menu item is active or dimmed.Arguments{arg1},

Page 78

163EXTENDING DREAMWEAVER CS4Menus and menu commandsArgumentsmenuIDThe menuIDargument is the value of the id attribute in the menuitem tag that is asso

Page 79 - About Live view

11EXTENDING DREAMWEAVER CS4Customizing DreamweaverNote: To install extensions that all users can use in a multiuser operating system, you must be logg

Page 80

164EXTENDING DREAMWEAVER CS4Menus and menu commandsExample function isCommandChecked() { var bChecked = false; var cssStyle = arguments[0]; if (

Page 81

165EXTENDING DREAMWEAVER CS4Menus and menu commandssetMenuText()DescriptionSpecifies the text that should appear in the menu.Note: Do not use this fun

Page 82

166EXTENDING DREAMWEAVER CS4Menus and menu commandsExampleThe following example of windowDimensions() sets the dimensions of the Parameters dialog box

Page 83

167Chapter 11: ToolbarsYou can create a toolbar for Adobe Dreamweaver simply by creating a file that defines the toolbar and placing that file in the

Page 84 - Reloading extensions

168EXTENDING DREAMWEAVER CS4Toolbars• You can horizontally dock toolbars to the top or bottom of the frame window. • Toolbars remain a fixed size. A t

Page 85 - Extension APIs

169EXTENDING DREAMWEAVER CS4ToolbarsA simple toolbar command fileThis simple example implements a Title text box item as seen on the Dreamweaver Docum

Page 86 - Localizing an extension

170EXTENDING DREAMWEAVER CS4Toolbars function receiveArguments(newTitle) { var dom = dw.getDocumentDOM(); if (dom) dom.setTitle(newTitle); }Dream

Page 87 - Extending Dreamweaver

171EXTENDING DREAMWEAVER CS4ToolbarsAfter the declarations, the file consists of a single toolbarset tag, which contains any number of the following t

Page 88

172EXTENDING DREAMWEAVER CS4Toolbars• container="mainframe" or "document" Defaults to "mainframe". Specifies where the t

Page 89 - Editable select lists

173EXTENDING DREAMWEAVER CS4Toolbars<include/>DescriptionLoads toolbar items from the specified file before continuing to load the current file.

Page 90

12EXTENDING DREAMWEAVER CS4Customizing DreamweaverExample <deleteditems> <!-- item tags here --> </deleteditems><item>Descri

Page 91 - Database controls

174EXTENDING DREAMWEAVER CS4ToolbarsAttributesid, {showIf}• id="id_reference" Required. Must be the ID of an item that was previously define

Page 92

175EXTENDING DREAMWEAVER CS4ToolbarsToolbar item tagsEach type of toolbar item has its own tag and set of required and optional attributes. You can de

Page 93 - Tree controls

176EXTENDING DREAMWEAVER CS4ToolbarsFor a description of each attribute, see “Item tag attributes” on page 180.ContentsNone.ContainerThe toolbar tag

Page 94 - Creating a tree control

177EXTENDING DREAMWEAVER CS4ToolbarsExample <RADIOBUTTON ID="DW_CodeView" image="Toolbars/images/MM/codeView.gif" disabledIma

Page 95

178EXTENDING DREAMWEAVER CS4ToolbarsAttributes id, tooltip, file, enabled, checked, value, command, {showIf}, {label}, {width}, {domRequired}, {update

Page 96

179EXTENDING DREAMWEAVER CS4Toolbars<editcontrol>DescriptionAn edit control box is a text-editing box that executes its command when the user ch

Page 97

180EXTENDING DREAMWEAVER CS4ToolbarsExample <colorpicker id="Color_Example" image="Toolbars/images/colorpickerIcon.gif" disab

Page 98

181EXTENDING DREAMWEAVER CS4ToolbarsExample image="Toolbars/images/MM/codenav.gif"disabledImage="image_path"Optional. Dreamweaver

Page 99 - A Smart Object example

182EXTENDING DREAMWEAVER CS4ToolbarsmenuID="menu_id"This attribute is required for menu buttons and combo buttons, unless you specify the ge

Page 100

183EXTENDING DREAMWEAVER CS4Toolbarschecked="script"This attribute is required for check buttons and radio buttons. Dreamweaver ignores the

Page 101 - Object Model

13EXTENDING DREAMWEAVER CS4Customizing Dreamweaver HTML DmWr TEXT ASCIIIn both the FTPExtensionMap.txt file and FTPExtensionMapMac.txt file (Macintosh

Page 102 - The Dreamweaver DOM

184EXTENDING DREAMWEAVER CS4Toolbars• onEveryIdle executes regularly when the application is idle. This can be time-consuming because the enabler/chec

Page 103 - EXTENDING DREAMWEAVER CS4

185EXTENDING DREAMWEAVER CS4Toolbars <button id="DW_Undo" image="Toolbars/images/MM/undo.gif" disabledImage="Toolbars/

Page 104

186EXTENDING DREAMWEAVER CS4ToolbarsExample function canAcceptCommand() { return (dw.getDocumentDOM() != null); }getCurrentValue()AvailabilityDream

Page 105

187EXTENDING DREAMWEAVER CS4ToolbarsThe name getDynamicContent() is a misnomer because this function should be used even if the list of entries in the

Page 106

188EXTENDING DREAMWEAVER CS4ToolbarsReturnsDreamweaver expects a string that contains a menu ID, which is defined in the menus.xml file.Example functi

Page 107

189EXTENDING DREAMWEAVER CS4ToolbarsArgumentsNone.ReturnsDreamweaver expects a string that contains a comma-separated list of update handlers. For a c

Page 108

190EXTENDING DREAMWEAVER CS4Toolbars function isCommandChecked() { var bChecked = false; var style = arguments[0]; var textFormat = dw.getDocument

Page 109 - The site object

191EXTENDING DREAMWEAVER CS4ToolbarsreceiveArguments()AvailabilityDreamweaver MX.DescriptionProcesses any arguments that pass from a toolbar item. The

Page 110 - Chapter 7: Insert bar objects

192EXTENDING DREAMWEAVER CS4ToolbarsExample function showif() { var retval = false; var dom = dw.getDocumentDOM(); if(dom) { var view = dom.ge

Page 111 - Insert bar definition tags

193Chapter 12: ReportsAdobe Dreamweaver supports two types of reports: site reports and stand-alone reports.Site reportsYou use the reports API to cre

Page 112 - <insertbar>

Copyright© 2008 Adobe Systems Incorporated. All rights reserved.Extending Adobe® Dreamweaver® CS4 for Windows® and Mac OSIf this guide is distributed

Page 113 - <checkbutton />

14EXTENDING DREAMWEAVER CS4Customizing DreamweaverIf you need to create a new document type, you can either add your entry to the document definition

Page 114 - <separator />

194EXTENDING DREAMWEAVER CS4ReportsAt this point, Dreamweaver clears all items from the Site Reports tab of the Results panel. Dreamweaver calls the b

Page 115 - Insert bar objects

195EXTENDING DREAMWEAVER CS4ReportsWrite the JavaScript codeDreamweaver includes the Reports.js file. You can call any of the functions in Reports.js.

Page 116

196EXTENDING DREAMWEAVER CS4ReportsHow stand-alone reports work1 The custom command, which is the command you create to generate the report, opens a n

Page 117 - Modifying the Insert bar

197EXTENDING DREAMWEAVER CS4Reports <html> <head> <title>Standalone report example</title> <script src="Listimages.

Page 118

198EXTENDING DREAMWEAVER CS4Reports function stdaloneresultwin() { var curDOM = dw.getDocumentDOM("document"); var tagList = curDOM.getEl

Page 119 - Create the HTML file

199EXTENDING DREAMWEAVER CS4ReportsArgumentsstrFilePathThe strFilePath argument is the full path and filename of the file to process.ReturnsDreamweave

Page 120

200EXTENDING DREAMWEAVER CS4ReportsDescriptionDefines the buttons that should appear on the right side of the Options dialog box and their behavior wh

Page 121

201EXTENDING DREAMWEAVER CS4ReportsArgumentsplatformThe value of the platform argument is either "macintosh" or "windows", dependi

Page 122 - Adding a dialog box

202Chapter 13: Tag libraries and editorsDreamweaver stores information about each tag, including all tag attributes, in a set of subfolders that resid

Page 123

203EXTENDING DREAMWEAVER CS4Tag libraries and editorsTag library file formatA tag library consists of a single root file, the TagLibraries.vtm file th

Page 124 - 2 Add the following code:

15EXTENDING DREAMWEAVER CS4Customizing Dreamweaver <?xml version="1.0" encoding="utf-8"?> <documenttypes xmlns:MMStr

Page 125

204EXTENDING DREAMWEAVER CS4Tag libraries and editorsThe taglibrary tag groups one or more tags into a tag library. When you import tags or create a n

Page 126 - The objects API functions

205EXTENDING DREAMWEAVER CS4Tag libraries and editorsTo define tags, Dreamweaver uses a modified version of the VTML file format. The following exampl

Page 127

206EXTENDING DREAMWEAVER CS4Tag libraries and editorsNote: In versions before Dreamweaver MX, tag information is stored in the Configuration/TagAttrib

Page 128

207EXTENDING DREAMWEAVER CS4Tag libraries and editors <?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>

Page 129

208EXTENDING DREAMWEAVER CS4Tag libraries and editorsA simple example of creating a new tag editorThe examples in this section use cfweather, a hypoth

Page 130

209EXTENDING DREAMWEAVER CS4Tag libraries and editorsIf Dreamweaver cannot find the TagLibraries.vtm file in the user Configuration folder, it searche

Page 131 - An Issues example

210EXTENDING DREAMWEAVER CS4Tag libraries and editors <!DOCTYPE HTML SYSTEM "-//Adobe//DWExtension layout-engine 10.0//dialog"> <h

Page 132

211EXTENDING DREAMWEAVER CS4Tag libraries and editors<table border="0" cellspacing="4"> <tr> <td valign="bas

Page 133 - The issues API functions

212EXTENDING DREAMWEAVER CS4Tag libraries and editorsThe tag editor API functionsIn order to create a new tag editor, you must provide an implementati

Page 134

213EXTENDING DREAMWEAVER CS4Tag libraries and editorsReturnsDreamweaver expects a Boolean value: true if the input for HTML form elements is valid; fa

Page 135

16EXTENDING DREAMWEAVER CS4Customizing Dreamweaver internaltype Yes A broad classification of how Dreamweaver treats a file. The internaltype identif

Page 136

214Chapter 14: Property inspectorsThe Property inspector is perhaps the most familiar floating panel in the interface. The Property inspector is indis

Page 137 - Chapter 9: Commands

215EXTENDING DREAMWEAVER CS4Property inspectors• The serverModel element (optional) indicates the server model of the Property inspector. The server m

Page 138 - A simple command example

216EXTENDING DREAMWEAVER CS4Property inspectorsA simple Property inspector exampleThe following Property inspector inspects the marquee tag, which is

Page 139 - Writing the JavaScript code

217EXTENDING DREAMWEAVER CS4Property inspectors <!-- Specify the image that will appear in the Property inspector --> <SPAN ID="image&q

Page 140 - 1 Create a new blank file

218EXTENDING DREAMWEAVER CS4Property inspectors function inspectSelection(){ // Get the DOM of the current document. var theDOM = dw.getDocumentDOM(

Page 141 - 3 Save the file

219EXTENDING DREAMWEAVER CS4Property inspectorsCreate the imageYou can optionally create the image that appears in the Property inspector.1 Create an

Page 142 - Commands

220EXTENDING DREAMWEAVER CS4Property inspectors function canInspectSelection(){3 var theDOM = dw.getDocumentDOM(); var theObj = theDOM.getSelectedNo

Page 143 - The commands API functions

221EXTENDING DREAMWEAVER CS4Property inspectors function inspectSelection(){ var dom = dreamweaver.getDocumentDOM(); var theObj = dom.getSelectedNod

Page 144

222Chapter 15: Floating panelsYou can create floating panels or inspectors without the size and layout limitations of Property inspectors. A custom Pr

Page 145

223EXTENDING DREAMWEAVER CS4Floating panelsWhen one of the files inside the Configuration folder calls the dw.getFloaterVisibility(floaterName), dw.se

Page 146

17EXTENDING DREAMWEAVER CS4Customizing DreamweaverNote: When the user saves a new document, Dreamweaver examines the list of extensions for the curren

Page 147 - The menus.xml file

224EXTENDING DREAMWEAVER CS4Floating panels <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head>

Page 148 - <menu>

225EXTENDING DREAMWEAVER CS4Floating panelsselectionChanged(): is a script marker selected?The selectionChanged() function determines whether a script

Page 149 - <menuitem>

226EXTENDING DREAMWEAVER CS4Floating panels2 Enter the following code in the header section of the file. function selectionChanged(){ /* get the sele

Page 150 - <separator>

227EXTENDING DREAMWEAVER CS4Floating panelsCreating a menu itemIt is not sufficient to save the Script Editor code in the Configuration/Floaters folde

Page 151 - <shortcut>

228EXTENDING DREAMWEAVER CS4Floating panelsExample // the following instance of displayHelp() opens // in a browser a file that explains how to use

Page 152 - <tool>

229EXTENDING DREAMWEAVER CS4Floating panelsArgumentsNone.ReturnsDreamweaver expects a string containing the words "left", "right",

Page 153 - <activate>

230EXTENDING DREAMWEAVER CS4Floating panelsReturnsDreamweaver expects a string of the form "floaterName1,floaterName2,...floaterNameN".Examp

Page 154 - <override>

231EXTENDING DREAMWEAVER CS4Floating panelsisResizable()AvailabilityDreamweaver 4. DescriptionDetermines whether a user can resize a floating panel. I

Page 155 - Change keyboard shortcuts

232EXTENDING DREAMWEAVER CS4Floating panels function selectionChanged(){ /* get the selected node */ var theDOM = dw.getDocumentDOM(); var theNode

Page 156 - Menus and menu commands

233EXTENDING DREAMWEAVER CS4Floating panels /* create a flag that specifies whether an edit is being processed, and set it to false.*/ document.runni

Page 157 - Menu commands

18EXTENDING DREAMWEAVER CS4Customizing DreamweaverDefining dynamic templatesYou can create templates that are based on dynamic document types. These t

Page 158 - How menu commands work

234Chapter 16: BehaviorsThe term behavior refers to the combination of an event and an action. onClick, onLoad, and onSubmit are examples of events. C

Page 159 - A simple menu command example

235EXTENDING DREAMWEAVER CS4Behaviors4 Dreamweaver displays a dialog box that contains the BODY elements of the Action file. If the Action file’s body

Page 160

236EXTENDING DREAMWEAVER CS4BehaviorsCreate the behavior extensionThe following code presents a relatively simple example. The code checks the brand o

Page 161

237EXTENDING DREAMWEAVER CS4Behaviorsvar ieURL = unescape(argArray[2]); document.theForm.nsURL.value = nsURL; document.theForm.ieURL.value = ieURL;

Page 162 - A dynamic menu example

238EXTENDING DREAMWEAVER CS4BehaviorsCreate the HTML files to browse (deprecated)Create the HTML files to browse, the file to go to if the browser is

Page 163

239EXTENDING DREAMWEAVER CS4Behaviors10 Click OK.Dreamweaver adds the specified JavaScript to the whichbrowser.htm file, so that the file appears as f

Page 164

240EXTENDING DREAMWEAVER CS4BehaviorsThe argument is a unique identifier among all instances of all behaviors in the user’s document. Its format is fu

Page 165

241EXTENDING DREAMWEAVER CS4BehaviorsReturnsDreamweaver expects either a string that contains the JavaScript functions or a string that contains the n

Page 166

242EXTENDING DREAMWEAVER CS4BehaviorsExampleThe following instance of the canAcceptBehavior() function returns a list of preferred events for the beha

Page 167

243EXTENDING DREAMWEAVER CS4BehaviorsReturnsDreamweaver expects nothing.identifyBehaviorArguments()DescriptionThis function identifies arguments from

Page 168

19EXTENDING DREAMWEAVER CS4Customizing Dreamweaverhard disk:\Users\username\AppData\Roaming\Adobe\Dreamweaver CS4\ConfigurationMac OS X platform uses

Page 169

244EXTENDING DREAMWEAVER CS4Behaviors function identifyBehaviorArguments(fnCallStr) { var listOfArgTypes; var itemArray = dreamweaver.getTokens(fnCa

Page 170

245EXTENDING DREAMWEAVER CS4BehaviorsExampleThe following instance of the inspectBehavior() function, taken from the Display Status Message.htm file,

Page 171

246Chapter 17: Server behaviorsAdobe® Dreamweaver® provides users with an interface for adding server behaviors into their documents to perform server

Page 172

247EXTENDING DREAMWEAVER CS4Server behaviorsDreamweaver architectureWhen you use the Server Behavior Builder to create a Dreamweaver-specific extensio

Page 173 - Chapter 11: Toolbars

248EXTENDING DREAMWEAVER CS4Server behaviors <participant> <quickSearch><![CDATA[MM_paramName]]></quickSearch> <insertTex

Page 174 - How toolbar commands work

249EXTENDING DREAMWEAVER CS4Server behaviorsDefining the new server behaviorNote: If the Server Behaviors panel is not open and visible, select the Wi

Page 175 - A simple toolbar command file

250EXTENDING DREAMWEAVER CS4Server behaviorsWhen the findServerBehaviors() function creates a behavior object, it usually sets the four properties (in

Page 176 - The toolbar definition file

251EXTENDING DREAMWEAVER CS4Server behaviors• When the user selects a server behavior and uses the Cut or Copy commands, Dreamweaver passes the object

Page 177 - <toolbar>

252EXTENDING DREAMWEAVER CS4Server behaviorsobject that belongs to Recordset1 cannot be found, the incomplete property is set to the value true so tha

Page 178 - Toolbars

253EXTENDING DREAMWEAVER CS4Server behaviorsArgumentsserverBehaviorThe serverBehavior JavaScript object represents the behavior; it is necessary to mo

Page 179 - <itemref/>

20EXTENDING DREAMWEAVER CS4Customizing DreamweaverProviding localized stringsWithin a document type definition file, the <title> and <descrip

Page 180 - <separator/>

254EXTENDING DREAMWEAVER CS4Server behaviorsArgumentsserverBehavior• The serverBehavior JavaScript object represents the behavior.ReturnsDreamweaver e

Page 181 - Toolbar item tags

255EXTENDING DREAMWEAVER CS4Server behaviorsReturnsDreamweaver expects an array of JavaScript objects; the length of the array is equal to the number

Page 182 - <radiobutton>

256EXTENDING DREAMWEAVER CS4Server behaviorsReturnsDreamweaver expects a Boolean value: true if the behavior pastes successfully from the Clipboard; f

Page 183 - <dropdown>

257EXTENDING DREAMWEAVER CS4Server behaviorsArgumentsparamObj, sbObj• The paramObj argument is the object that contains the user settings. • The sbObj

Page 184 - <combobox>

258EXTENDING DREAMWEAVER CS4Server behaviorsEDML filesYou must maintain Dreamweaver coding conventions when you edit a file. Pay attention to the depe

Page 185 - <colorpicker>

259EXTENDING DREAMWEAVER CS4Server behaviorsEDML structureYou should use a unique filename to identify your server behavior group. If only one group f

Page 186 - Item tag attributes

260EXTENDING DREAMWEAVER CS4Server behaviorsRequiredYes.<group> attributesThe following items are valid attributes of the group tag.versionDescr

Page 187

261EXTENDING DREAMWEAVER CS4Server behaviorsdataSourceDescriptionThis advanced feature supports new data sources that can be added to Dreamweaver.Mult

Page 188

262EXTENDING DREAMWEAVER CS4Server behaviorsRequiredNo.ValueThe value is a unique string that determines which group to apply, as shown in the followi

Page 189

263EXTENDING DREAMWEAVER CS4Server behaviorsTypeBlock tag.RequiredYes.<groupParticipants> attributesThe following items are valid attributes of

Page 190 - • Clicks a button

21EXTENDING DREAMWEAVER CS4Customizing DreamweaverDreamweaver does not let document types that are not associated with a server model share file exten

Page 191

264EXTENDING DREAMWEAVER CS4Server behaviors<groupParticipant> attributesThe following items are valid attributes of the groupParticipant tag.na

Page 192

265EXTENDING DREAMWEAVER CS4Server behaviors• The multiple value indicates that the participant is optional and multiple copies of it can be associate

Page 193

266EXTENDING DREAMWEAVER CS4Server behaviorsTypeAttribute.RequiredNo.<quickSearch> DescriptionThis tag is a simple search string that is used fo

Page 194

267EXTENDING DREAMWEAVER CS4Server behaviorsRequiredNo.ValueThe value is the text to insert in the document. If any parts of the text need customizing

Page 195

268EXTENDING DREAMWEAVER CS4Server behaviors• The belowHTML[+weight] value is similar to the aboveHTML value, except that participants are added below

Page 196

269EXTENDING DREAMWEAVER CS4Server behaviorsRequiredThis attribute is required only if the insert location contains the word node.ValueThe tagtype_Tag

Page 197

270EXTENDING DREAMWEAVER CS4Server behaviorsParentsearchPatternsTypeAttribute.RequiredYes.Valuesdirective, tag+tagName, tag+*, comment, text• The dire

Page 198

271EXTENDING DREAMWEAVER CS4Server behaviorsParentsearchPatternsTypeBlock tag.RequiredYes.ValuessearchString, /regularExpression/, <empty>• The

Page 199 - Chapter 12: Reports

272EXTENDING DREAMWEAVER CS4Server behaviorsparamNamesDescriptionThis attribute is a comma-separated list of parameter names whose values are being ex

Page 200 - A simple site report example

273EXTENDING DREAMWEAVER CS4Server behaviorsValuesall, attribute+attribName, tagOnly, innerOnly• The all value (default) searches the entire tag that

Page 201 - Stand-alone reports

22EXTENDING DREAMWEAVER CS4Customizing DreamweaverContainerNone.Example <panelset> <!-- panelset tags here --> </panelset><appl

Page 202 - How stand-alone reports work

274EXTENDING DREAMWEAVER CS4Server behaviorsThe search patterns must identify the participant and extract several parameters. However, if a parameter

Page 203 - Write the JavaScript code

275EXTENDING DREAMWEAVER CS4Server behaviorsValuesThe value is a regular expression that finds a parameter between two parenthetical subexpressions, i

Page 204 - The reports API functions

276EXTENDING DREAMWEAVER CS4Server behaviorsparamNameDescriptionThis attribute indicates the name of the parameter whose value is used to update the p

Page 205

277EXTENDING DREAMWEAVER CS4Server behaviorsParentdeleteTypeAttribute.RequiredNo.Valuesall, none, tagOnly, innerOnly, attribute+attribName, attribute+

Page 206

278EXTENDING DREAMWEAVER CS4Server behaviors<searchPatterns>DescriptionThis tag lets Dreamweaver find each specified instance in a document. If

Page 207

279EXTENDING DREAMWEAVER CS4Server behaviors<translation> attributesThe following items are valid attributes of the translation tag.whereToSearc

Page 208

280EXTENDING DREAMWEAVER CS4Server behaviorsRequiredYes.Valuesdynamic data, dynamic image, dynamic source, tabbed region start, tabbed region end, cus

Page 209 - Tag library file format

281EXTENDING DREAMWEAVER CS4Server behaviorsRequiredNo.ValuesThe tagName value is a valid tag name. It should be unique to prevent conflicts with know

Page 210

282EXTENDING DREAMWEAVER CS4Server behaviors <attribute> mmTranslatedValueDynValue="VALUE={@@rs@@.@@col@@}" </attribute><di

Page 211

283EXTENDING DREAMWEAVER CS4Server behaviorsServer behavior techniquesThis section covers the common and advanced techniques that create and edit serv

Page 212 - The Tag Chooser

23EXTENDING DREAMWEAVER CS4Customizing DreamweaverContainerThis tag must be contained in a panelset tag.Example <panelset> <document rect=&q

Page 213

284EXTENDING DREAMWEAVER CS4Server behaviorsOptional search patternsSometimes you want to identify a participant even if some parameters are not found

Page 214

285EXTENDING DREAMWEAVER CS4Server behaviors <% //test_p1 %> <% //test_p2 %> <html>These participants are found and matched, and T

Page 215 - Create a tag editor UI

286EXTENDING DREAMWEAVER CS4Server behaviors <% total = Recordset1.Fields.Item("itemPrice").Value * 1.0825 %> <% total = Recordset

Page 216 - Tag libraries and editors

287EXTENDING DREAMWEAVER CS4Server behaviors <searchPatterns whereToSearch="tag+cfinclude"> <searchPattern paramNames="includ

Page 217 - Add a tag to Tag Chooser

288EXTENDING DREAMWEAVER CS4Server behaviors <quickSearch>Response.Write</quickSearch> <searchPatterns whereToSearch="directive&q

Page 218 - The tag editor API functions

289EXTENDING DREAMWEAVER CS4Server behaviorsAnother approach is to remove the entire tag; typing <delete deleteType="tagOnly"/> delete

Page 219

290Chapter 18: Data sourcesData source files are stored in the Configuration/DataSources/ServerModelName folder. Dreamweaver currently supports the fo

Page 220 - Property inspector files

291EXTENDING DREAMWEAVER CS4Data sources3 Dreamweaver goes through each file in the appropriate server model folder, calling the findDynamicSources()

Page 221 - Property inspectors

292EXTENDING DREAMWEAVER CS4Data sourcesA simple data source exampleThis extension adds a custom data source to the Bindings panel for Adobe ColdFusio

Page 222 - Create the user interface

293EXTENDING DREAMWEAVER CS4Data sourcesFor the MyDatasource Variable, you want Dreamweaver to insert the ColdFusion code <cfoutput>#MyXML.varia

Page 223

iiiContentsChapter 1: IntroductionAbout extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Page 224

24EXTENDING DREAMWEAVER CS4Customizing Dreamweaver<panelcontainer>DescriptionDescribes an entire panel group.Attributesexpanded, title,{ height,

Page 225 - Test the Property inspector

294EXTENDING DREAMWEAVER CS4Data sources{ alert(MM.MSG_DefineMyDatasource); } } } function findDynamicSources() { var retList = new Array();

Page 226

295EXTENDING DREAMWEAVER CS4Data sourcesvar paramObj = new Object(); paramObj.bindingName = bindingName; var retStr = extPart.getInsertString("

Page 227

296EXTENDING DREAMWEAVER CS4Data sourcesTo provide a dialog box for the user, create a set of command files: a command definition file in HTML and a c

Page 228 - Chapter 15: Floating panels

297EXTENDING DREAMWEAVER CS4Data sources //******************* API ********************** function commandButtons(){ return new Array(MM.BTN_OK,&q

Page 229 - Creating the floating panels

298EXTENDING DREAMWEAVER CS4Data sources4 Drag the variable to your document, and Dreamweaver inserts the appropriate code from the EDML file:The data

Page 230

299EXTENDING DREAMWEAVER CS4Data sourcesFor example, in Dreamweaver, if the selection is a recordset or command, the deleteDynamicSource() function ca

Page 231 - Floating panels

300EXTENDING DREAMWEAVER CS4Data sourcesArgumentssourceName, bindingName• The sourceName argument is the name of the top-level node to which the child

Page 232

301EXTENDING DREAMWEAVER CS4Data sourcesgenerateDynamicDataRef()AvailabilityDreamweaver UltraDev 1.DescriptionThis function generates the dynamic data

Page 233 - Creating a menu item

302EXTENDING DREAMWEAVER CS4Data sources• The name property is the name of the server behavior that is associated with the data source, if one exists.

Page 234

303Chapter 19: Server formats“Data sources” on page 290 discusses how Adobe Dreamweaver inserts dynamic data into a user document by adding a server

Page 235

25EXTENDING DREAMWEAVER CS4Customizing DreamweaverAttributesid, visibleTab• id is a number that indicates the ID for the panel. The following table co

Page 236

304EXTENDING DREAMWEAVER CS4Server formats• The expression=regexp attribute is a regular expression that matches the dynamic data objects that use thi

Page 237

305EXTENDING DREAMWEAVER CS4Server formatsScenarios in which the data formatting functions are calledThe data formatting functions are called in the f

Page 238 - About performance

306EXTENDING DREAMWEAVER CS4Server formatsThe applyFormat() function should use the DOM to add function declarations to the top of the user’s document

Page 239

307EXTENDING DREAMWEAVER CS4Server formatsUse the DOM with the deleteFormat() function to remove the function declaration from the top of the current

Page 240 - Chapter 16: Behaviors

308EXTENDING DREAMWEAVER CS4Server formatsDescriptionInitializes form controls when a user edits a format in the Edit Format List dialog box. Argument

Page 241 - A simple behavior example

309Chapter 20: ComponentsAdobe Dreamweaver supports the creation of many of the most popular types of components. In addition, Dreamweaver lets you ex

Page 242 - Create the behavior extension

310EXTENDING DREAMWEAVER CS4ComponentsIn some cases, writing some JavaScript code that calls certain component-related function, is a must for alterin

Page 243 - Behaviors

311EXTENDING DREAMWEAVER CS4ComponentsNote: Keep the same prefix throughout all the files that correspond to one component so that each file and its c

Page 244

312EXTENDING DREAMWEAVER CS4ComponentsFor example, the following WebServicesClass node has web methods as its children: this.name = "TrafficLocat

Page 245 - The behaviors API functions

313EXTENDING DREAMWEAVER CS4ComponentsgetContextMenuId()AvailabilityDreamweaver MX.Description Returns the context menu ID for the component type. Eve

Page 246

26EXTENDING DREAMWEAVER CS4Customizing DreamweaverExample <panelset> <panelframe rect="196 453 661 987" visible="true" d

Page 247

314EXTENDING DREAMWEAVER CS4Components <menubar xmlns:MMString="http://www.macromedia.com/schemes/dat/string/" name="" id="

Page 248

315EXTENDING DREAMWEAVER CS4Components function getCodeVi e wDropCode(compone nt Rec ) { var codeToDrop=""; if (componentRec) {

Page 249

316EXTENDING DREAMWEAVER CS4Components• An "Event:CreateSite" handler opens a dialog box to create a new site.• An "Event:SetDocType&qu

Page 250

317EXTENDING DREAMWEAVER CS4ComponentsDescriptionDreamweaver calls this function before the Components tab appears. Dreamweaver then calls the getSetu

Page 251

318EXTENDING DREAMWEAVER CS4Components function handleDesignViewDrop(componentRec) { var bHandled = false; if (componentRec) { if ((componentRec.

Page 252 - Chapter 17: Server behaviors

319EXTENDING DREAMWEAVER CS4Components function handleDoubleClick(componentRec) { var selectedObj = dw.serverComponentsPalette.getSelectedNode(); i

Page 253 - Dreamweaver architecture

320EXTENDING DREAMWEAVER CS4ComponentsArgumentsNone.ReturnsAn array of toolbar buttons in left-to-right order.ExampleThe following example assigns pro

Page 254 - The script file

321EXTENDING DREAMWEAVER CS4ComponentsplusButton.pressedImage = PLUSDROPBUTTONDOWN; plusButton.disabledImage = PLUSDROPBUTTONUP; plusButton.toolS

Page 255 - Defining the code to insert

322Chapter 21: Server modelsServer models are the technologies that run scripts on a server. When users define a new site, they can identify the serve

Page 256 - Server behaviors

323EXTENDING DREAMWEAVER CS4Server modelsArgumentsdomThe dom argument is the Adobe document object, which is returned by the dreamweaver.getDocumentDO

Page 257 - The server behavior API

27EXTENDING DREAMWEAVER CS4Customizing DreamweaverChanging keyboard shortcut mappingsDreamweaver includes many keyboard shortcuts to Dreamweaver featu

Page 258

324EXTENDING DREAMWEAVER CS4Server modelsDescriptionThis function returns an object that describes the method and array signatures that the scripting

Page 259

325EXTENDING DREAMWEAVER CS4Server modelsDescriptionThis function returns a JavaScript object that can be accessed from within the JavaScript code. Yo

Page 260

326EXTENDING DREAMWEAVER CS4Server modelsReturnsDreamweaver expects an array of strings that represent the supported scripting languages. getServerMod

Page 261

327EXTENDING DREAMWEAVER CS4Server modelsDescriptionThis function returns the name that should appear in the user interface for this server model. You

Page 262

328EXTENDING DREAMWEAVER CS4Server modelsgetVersionArray() AvailabilityDreamweaver UltraDev 1, deprecated in Dreamweaver MX.DescriptionThis function r

Page 263

329Chapter 22: Data translatorsData translators translate specialized markups into code that Adobe Dreamweaver can read and display. Server-side inclu

Page 264 - EDML files

330EXTENDING DREAMWEAVER CS4Data translators• Selects Modify > Convert > Convert Tables To AP Divs• Selects Modify > Convert > Convert AP

Page 265 - Group EDML file tags

331EXTENDING DREAMWEAVER CS4Data translatorsTranslating more than one attribute at a timeThe mmTranslatedValue attribute can contain more than one val

Page 266 - <group> attributes

332EXTENDING DREAMWEAVER CS4Data translators <MM:BeginLock translatorClass="translatorClass" ¬ type="tagNameOrType" depFiles=&

Page 267

333EXTENDING DREAMWEAVER CS4Data translators <script language="javascript"> <!-- function foo() { alert('<bean:message k

Page 268 - <groupParticipants>

28EXTENDING DREAMWEAVER CS4Customizing DreamweaverCreate a keyboard mappings file1 Make a copy of one of the keyboard mappings files in the Configurat

Page 269 - <groupParticipant>

334EXTENDING DREAMWEAVER CS4Data translators if (theSelection.nodeType == node.ELEMENT_NODE && ¬ theSelection.getAttribute('type')

Page 270

335EXTENDING DREAMWEAVER CS4Data translators // Assemble the new include comment. radioStr and URL are // variables defined earlier in the code. new

Page 271 - Participant EDML files

336EXTENDING DREAMWEAVER CS4Data translators5 Restart Dreamweaver, and select your translator command from the Commands menu. When you click OK, the t

Page 272 - <insertText>

337EXTENDING DREAMWEAVER CS4Data translators <html> <head> <title>Conditional Translator</title> <meta http-equiv="

Page 273 - <insertText> attributes

338EXTENDING DREAMWEAVER CS4Data translatorsend = outStr.indexOf(' #>',start); equalSign = outStr.indexOf('="<# if',ba

Page 274

339EXTENDING DREAMWEAVER CS4Data translatorsstart = outStr.indexOf('<# if',end); } // Return the translated string. return outStr }

Page 275 - <searchPatterns>

340EXTENDING DREAMWEAVER CS4Data translators <html> <head> <title>Kent Tag Translator</title> <meta http-equiv="Con

Page 276 - <searchPattern>

341EXTENDING DREAMWEAVER CS4Data translators // locking tags. For more information on the repacement operation, see // the comments in the replaceKe

Page 277

342EXTENDING DREAMWEAVER CS4Data translatorsvar hour = today.getUTCHours(); // The current hour in GMT, based on the

Page 278

343EXTENDING DREAMWEAVER CS4Data translators}else{ imageRef = "images/kent_hardAtWorkOnWin.jpg"; } }else{ imageRef = "images/kent

Page 279

29EXTENDING DREAMWEAVER CS4Customizing Dreamweaver <shortcutset language="French"> <shortcut key="Cmd+[" newkey="Cm

Page 280 - <updatePattern>

344EXTENDING DREAMWEAVER CS4Data translators6 The regExps string specifies a regular expression that you can check. The array should contain the same

Page 281

345EXTENDING DREAMWEAVER CS4Data translatorsDescriptionDreamweaver performs two translation passes. The first pass goes through all the translators an

Page 282 - <delete> attributes

346EXTENDING DREAMWEAVER CS4Data translators function translateMarkup(docName, siteRoot, docContent){ var translatedString = ""; if (docCo

Page 283 - <translator>

347Chapter 23: C-level extensibility The C-level extensibility mechanism lets you implement Adobe Dreamweaver extensibility files using a combination

Page 284 - <translation>

348EXTENDING DREAMWEAVER CS4C-level extensibility JSBool readContentsOfFile(JSContext *cx, JSObject *obj, unsigned int ¬ argc, jsval *argv, jsval *r

Page 285

349EXTENDING DREAMWEAVER CS4C-level extensibilityNote: The library can be implemented in either C or C++, but the file that contains the MM_Init() fun

Page 286 - <openTag>

350EXTENDING DREAMWEAVER CS4C-level extensibilitytypedef JSBool (*JSNative)(JSContext *cx, JSObject *obj, unsigned int argc, jsval *argv, jsval *rval)

Page 287 - <attribute>

351EXTENDING DREAMWEAVER CS4C-level extensibilityArgumentsJSContext *cx, JSVal v, unsigned integer *pLength• The *cx argument is the opaque JSContext

Page 288 - <closeTag>

352EXTENDING DREAMWEAVER CS4C-level extensibilityJSBool JS_ValueToBoolean()DescriptionThis function extracts a function argument from a JSVal structur

Page 289 - Server behavior techniques

353EXTENDING DREAMWEAVER CS4C-level extensibility• The *pLengthargument is a pointer to an unsigned integer. This function sets *pLength equal to the

Page 290

30Chapter 3: Customizing Code viewAdobe Dreamweaver uses two devices in Code view that help you enter code quickly and make your code readable and acc

Page 291

354EXTENDING DREAMWEAVER CS4C-level extensibilityNote: The JS_UCStringToValue() method is like the JSBool JS_StringToValue() in every way, except tha

Page 292 - Search pattern resolution

355EXTENDING DREAMWEAVER CS4C-level extensibilityJSVal JS_ObjectToValue()DescriptionThis function stores an object return value in a JSVal. Use JS_ Ne

Page 293 - Updating server behaviors

356EXTENDING DREAMWEAVER CS4C-level extensibilitylong JS_GetArrayLength()DescriptionGiven a pointer to an array object, this function gets the number

Page 294 - Deleting server behaviors

357EXTENDING DREAMWEAVER CS4C-level extensibilityReturnsA Boolean value: JS_TRUE indicates success; JS_FALSE indicates failure.JSBool JS_ExecuteScript

Page 295

358EXTENDING DREAMWEAVER CS4C-level extensibilityFile access and multiuser configuration APIAdobe recommends that you always use the file access and m

Page 296 - Chapter 18: Data sources

359EXTENDING DREAMWEAVER CS4C-level extensibilityNote: Most JavaScript extensions need not be changed to write to the user Configuration folder. Only

Page 297 - Data sources

360EXTENDING DREAMWEAVER CS4C-level extensibilityReturnsJSObject is an array that contains the list of files or folders in either the user Configurati

Page 298 - A simple data source example

361EXTENDING DREAMWEAVER CS4C-level extensibilityNote: If you want to read the file before writing to it, open the file in "read" mode. When

Page 299 - 2 Enter the following:

362EXTENDING DREAMWEAVER CS4C-level extensibility• The unsigned long *modtime argument is the address of an integer in which the function returns the

Page 300

363EXTENDING DREAMWEAVER CS4C-level extensibilityExample char *dwConfig = "file:///c|/Program Files/Adobe/Adobe Dreamweaver CS3/ Configuration/

Page 301 - MyDatasource Variable

31EXTENDING DREAMWEAVER CS4Customizing Code view• The description for each menu group The description appears in the Preferences dialog box for the co

Page 302

364EXTENDING DREAMWEAVER CS4C-level extensibilityReturnsA Boolean value: JS_TRUE indicates success; JS_FALSE indicates failure.Example char *dwConfig

Page 303 - Test the new data source

365EXTENDING DREAMWEAVER CS4C-level extensibility• The Sample.c example file defines the computeSum() function.• The Sample.mak make file lets you bui

Page 304

366EXTENDING DREAMWEAVER CS4C-level extensibility function objectTag() { // Return the html tag that should be inserted alert(Sample.computeSum(2,2)

Page 305

367Chapter 24: The Shared folderThe Shared folder is the central repository for utility functions, classes, and images that are commonly used by all e

Page 306

368EXTENDING DREAMWEAVER CS4The Shared folderThe MM folderThe MM folder contains the shared scripts, images, and classes used by the extensions that c

Page 307

369EXTENDING DREAMWEAVER CS4The Shared folderThe Scripts subfolderThe Scripts subfolder contains the following utility functions:The Scripts folder al

Page 308

370EXTENDING DREAMWEAVER CS4The Shared folderThe CMN folderThe CMN folder contains the following utility functions:File DescriptionclassCheckbox.js He

Page 309 - Chapter 19: Server formats

371EXTENDING DREAMWEAVER CS4The Shared folderOther foldersThe following list describes other folders of interest in the Shared folder:Controls The C

Page 310 - Server formats

372EXTENDING DREAMWEAVER CS4The Shared folderUsing the Shared folder Look first in the Dreamweaver Configuration/Shared/Common folder for useful exten

Page 311

373IndexAaction files 234action tag 147activate tag 147addDynamicSource() 298alert() 96analyzeServerBehavior() 251APIs, types ofbehaviors 239C-

Page 312

32EXTENDING DREAMWEAVER CS4Customizing Code viewThe <method> tag and its attributes are similar to the function tag and its attributes, but the

Page 313

374EXTENDING DREAMWEAVER CS4IndexcanInsertObject() 120canRecognizeDocument() 322category tag 106changing default file type 5charEnd tag, code color

Page 314

375EXTENDING DREAMWEAVER CS4IndexComponents panelextending 309files 310tree control 311Components panel API functionsgetCodeViewDropCode() 314getC

Page 315 - Chapter 20: Components

376EXTENDING DREAMWEAVER CS4Indexdynamic menussample code 156user experience 152dynamic templates 18Dynamic Text dialog box 290Eeditmenu items 14

Page 316

377EXTENDING DREAMWEAVER CS4Indexperformance issues 232user experience 222focus() 96folders and files server behavior 247form object 96formatDynam

Page 317 - Properties of tree control

378EXTENDING DREAMWEAVER CS4IndexJS_BooleanToValue() 354JS_DefineFunction() 350JS_DoubleToValue() 354JS_ExecuteScript() 357JS_GetArrayLength() 356

Page 318

379EXTENDING DREAMWEAVER CS4Indexof tag objects 101of text objects 102number object 96numbers tag, code coloring 54Oobject object 96objectsadding

Page 319 - Components

380EXTENDING DREAMWEAVER CS4Indexseparator tag 108, 144, 174server behaviordeleting 288dwscripts functions 256example 248extensions, about 76findi

Page 320

381EXTENDING DREAMWEAVER CS4Indexdocking 168dropdown tag 177editcontrol tag 179file definition 170include/ tag 173item tags 175itemref/ tag 173i

Page 321

33EXTENDING DREAMWEAVER CS4Customizing Code view<method pattern="openFirstPanel()" icon= ".../hintMisc.gif" /> ... ...

Page 322

ivEXTENDING DREAMWEAVER CS4ContentsChapter 7: Insert bar objectsHow object files work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Page 323

34EXTENDING DREAMWEAVER CS4Customizing Code viewSpry attribute grouping formatThe following code shows the format of the .vtm file. This format allows

Page 324

35EXTENDING DREAMWEAVER CS4Customizing Code viewExample <crosstag_attributes> <attribgroup id="spryRegionAttrs" name="Spry1.

Page 325

36EXTENDING DREAMWEAVER CS4Customizing Code viewExample <codehints><menugroup>DescriptionEach menugroup tag corresponds to a type of menu

Page 326 - • When server model changes

37EXTENDING DREAMWEAVER CS4Customizing Code viewContainerThe menugroup tag.Example <description> <![CDATA[ To add or remove tags and attribu

Page 327

38EXTENDING DREAMWEAVER CS4Customizing Code view<menuitem>DescriptionThis tag specifies the text for an item in a code hints pop-up menu. The me

Page 328 - Chapter 21: Server models

39EXTENDING DREAMWEAVER CS4Customizing Code viewFor object methods, when you type the object name, Dreamweaver opens a menu of the methods that are de

Page 329 - Server models

40EXTENDING DREAMWEAVER CS4Customizing Code viewAttributespattern, icon, object, source, constructor, static, retType• The pattern attribute specifies

Page 330

41EXTENDING DREAMWEAVER CS4Customizing Code view• optionArray, which indicates a list of nested <optionparammenu> and <parammenuitem> to d

Page 331

42EXTENDING DREAMWEAVER CS4Customizing Code view• The value attribute specifies the value of the parameter to insert when the user selects the code hi

Page 332

43EXTENDING DREAMWEAVER CS4Customizing Code view• The value attribute is the string that Dreamweaver inserts in the document when you select the comma

Page 333

vEXTENDING DREAMWEAVER CS4ContentsA simple Property inspector example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Page 334 - • ADODB version 2.1

44EXTENDING DREAMWEAVER CS4Customizing Code viewAbout code coloringDreamweaver lets you customize or extend the code coloring schemes that you see in

Page 335 - Chapter 22: Data translators

45EXTENDING DREAMWEAVER CS4Customizing Code viewThe following excerpt from the CodeColoring.xml file illustrates the hierarchy of tags in a code color

Page 336 - Data translators

46EXTENDING DREAMWEAVER CS4Customizing Code viewAttributesname, id, priority, {doctypes}• name="scheme_name" A string that assigns a name to

Page 337

47EXTENDING DREAMWEAVER CS4Customizing Code view<blockStart>DescriptionOptional. Specified only if the coloring scheme can be embedded inside a

Page 338

48EXTENDING DREAMWEAVER CS4Customizing Code viewAttributesNone.Example <charStart><![CDATA[']]></charStart><charEnd>Descr

Page 339

49EXTENDING DREAMWEAVER CS4Customizing Code viewAttributesNone.Example <commentEnd><![CDATA[--%>]]></commentEnd><cssImport/>

Page 340

50EXTENDING DREAMWEAVER CS4Customizing Code viewExample <cssProperty name="Property" id="CodeColor_CSSProperty" /><cssSel

Page 341

51EXTENDING DREAMWEAVER CS4Customizing Code viewAttributesname, id• name="display_name" A string that Dreamweaver displays in the code colo

Page 342 - Create the icon

52EXTENDING DREAMWEAVER CS4Customizing Code viewExample <entity name="Special Characters" id="CodeColor_HTMLEntity" /><fu

Page 343

53EXTENDING DREAMWEAVER CS4Customizing Code view<ignoreCase>DescriptionSpecifies whether case should be ignored when comparing tokens to keyword

Page 344

viEXTENDING DREAMWEAVER CS4ContentsAdding a translated attribute to a tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Page 345 - 2 Enter the following code:

54EXTENDING DREAMWEAVER CS4Customizing Code view<keyword>DescriptionA string of text that defines a keyword. Multiple keyword tags are allowed.

Page 346

55EXTENDING DREAMWEAVER CS4Customizing Code view<operators>DescriptionA list of characters to be recognized as operators.Attributesname, id• nam

Page 347

56EXTENDING DREAMWEAVER CS4Customizing Code viewExample <sampleText doctypes="JavaScript"><![CDATA[/* JavaScript */ function displ

Page 348

57EXTENDING DREAMWEAVER CS4Customizing Code view<stringEnd>DescriptionContains a text string that represents the delimiter of the end of a code

Page 349

58EXTENDING DREAMWEAVER CS4Customizing Code viewinnerTextThis value tells Dreamweaver to color the block delimiters the same as the default text of th

Page 350

59EXTENDING DREAMWEAVER CS4Customizing Code viewExample <blockStart doctypes="PHP_MySQL" scheme="outerTag"> <![CDATA[<

Page 351 - • The dom argument

60EXTENDING DREAMWEAVER CS4Customizing Code viewTo make the process of defining schemes more flexible, Dreamweaver lets you specify wildcard and escap

Page 352

61EXTENDING DREAMWEAVER CS4Customizing Code viewEscape charactersThe following is a list of escape characters that Dreamweaver supports, along with th

Page 353

62EXTENDING DREAMWEAVER CS4Customizing Code view <!-- #BeginEditable "\*" -->This leaves an editable region name that can be as many a

Page 354 - • A pointer to the function

63EXTENDING DREAMWEAVER CS4Customizing Code viewEditing schemesYou can edit the styles for a code coloring scheme either by editing the code coloring

Page 355 - The C-level API

1Chapter 1: IntroductionThe Extending Dreamweaver CS4 guide describes the Adobe® Dreamweaver® CS4 framework and application programming interface (API

Page 356 - JSBool JS_DefineFunction()

64EXTENDING DREAMWEAVER CS4Customizing Code viewTo edit styles for a scheme using the Code Coloring category in the Preferences dialog box, double-cli

Page 357 - JSBool JS_ValueToDouble()

65EXTENDING DREAMWEAVER CS4Customizing Code viewCSS code coloring <scheme name="CSS" id="CSS" doctypes="CSS" priorit

Page 358 - JS_ValueToUCString()

66EXTENDING DREAMWEAVER CS4Customizing Code view <scheme name="JavaScript" id="JavaScript" doctypes="JavaScript" prio

Page 359 - JSBool JS_UCStringToValue()

67EXTENDING DREAMWEAVER CS4Customizing Code view</keywords> <keywords id="CodeColor_JavascriptNumber"> <keyword>Infinity

Page 360 - JSVal JS_IntegerToValue()

68EXTENDING DREAMWEAVER CS4Customizing Code viewDreamweaver stores browser profiles in the Browser Profile folder inside the Dreamweaver Configuration

Page 361 - JSObject *JS_NewArrayObject()

69EXTENDING DREAMWEAVER CS4Customizing Code view <property names="foo,bar"> <value type="named" name="top"/>

Page 362 - JSBool JS_SetElement()

70EXTENDING DREAMWEAVER CS4Customizing Code view• message="message_string" The message attribute defines a message string that Dreamweaver d

Page 363 - JSBool JS_ReportError()

71EXTENDING DREAMWEAVER CS4Customizing Code viewAbout related filesThe related files feature provides users access to the supporting and related files

Page 364 - C-level extensibility

72EXTENDING DREAMWEAVER CS4Customizing Code viewThe following related files are supported:Related files APIsYou can customize the related files menu t

Page 365

73EXTENDING DREAMWEAVER CS4Customizing Code viewAbout Live viewThe Live view feature facilitates previewing your web pages as it would appear in a bro

Page 366 - JSBool MM_ConfigFileExists()

2EXTENDING DREAMWEAVER CS4IntroductionSome extensions need Dreamweaver to restart before you can use them. If you are running Dreamweaver when you ins

Page 367

74EXTENDING DREAMWEAVER CS4Customizing Code view{ var browser = document.getElementById("browser"); browser.addEventListener("Browser

Page 368

75Chapter 4: Extending DreamweaverDreamweaver provides an extensive set of tools that you can use to add to or customize its functionality.When you cr

Page 369

76EXTENDING DREAMWEAVER CS4Extending DreamweaverFloating panel extensions add floating panels to the Dreamweaver user interface. Floating panels can

Page 370 - JSBool MM_DeleteConfigFile()

77EXTENDING DREAMWEAVER CS4Extending DreamweaverConfiguration folders and extensionsThe folders and files that are stored in the Dreamweaver Configura

Page 371

78EXTENDING DREAMWEAVER CS4Extending DreamweaverMultiuser Configuration foldersFor the multiuser operating systems of Windows XP, Windows 2000, and Ma

Page 372

79EXTENDING DREAMWEAVER CS4Extending DreamweaverExtension APIsThe extension APIs provide you with the functions that Dreamweaver calls to implement ea

Page 373 - Chapter 24: The Shared folder

80EXTENDING DREAMWEAVER CS4Extending DreamweaverPlug-ins (set to play at all times) are supported in the BODY of extensions. The document.write() stat

Page 374 - The MM folder

81EXTENDING DREAMWEAVER CS4Extending Dreamweaver <strings> <!-- errors for feature X --> <string id="featureX/subProblemY"

Page 375 - The Class folder

82Chapter 5: User interfaces for extensionsMost extensions are built to receive information from the user through a user interface (UI). For example,

Page 376 - The CMN folder

83EXTENDING DREAMWEAVER CS4User interfaces for extensions• Applying changes to the user documentDreamweaver HTML rendering controlIn earlier versions

Page 377 - Other folders

3EXTENDING DREAMWEAVER CS4IntroductionDocumentation Resource CenterImprove your Dreamweaver skills with books from Adobe. Check out the latest content

Page 378 - Using the Shared folder

84EXTENDING DREAMWEAVER CS4User interfaces for extensionsThe following example shows the settings for an editable select list: <select name="

Page 379

85EXTENDING DREAMWEAVER CS4User interfaces for extensions} </script> </head> <body> <div name="test"> <for

Page 380

86EXTENDING DREAMWEAVER CS4User interfaces for extensionsThe following figure shows an advanced Recordset dialog box that uses a database tree control

Page 381

87EXTENDING DREAMWEAVER CS4User interfaces for extensionsYou can change the connection attribute to retrieve selected data and display it in the tree.

Page 382

88EXTENDING DREAMWEAVER CS4User interfaces for extensionsTree controls display data in a hierarchical format and let users expand and collapse nodes i

Page 383

89EXTENDING DREAMWEAVER CS4User interfaces for extensionsFor readability, TREECOLUMN tags should follow immediately after the MM:TREECONTROL tag, as s

Page 384

90EXTENDING DREAMWEAVER CS4User interfaces for extensionsManipulating content within a tree controlTree controls and the nodes within them are impleme

Page 385

91EXTENDING DREAMWEAVER CS4User interfaces for extensionsIn this example, the user changes the value of the text box and then tabs or clicks elsewhere

Page 386

92EXTENDING DREAMWEAVER CS4User interfaces for extensions<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html>

Page 387

93EXTENDING DREAMWEAVER CS4User interfaces for extensionsThis example shows a simple implementation of the SWF file support of Dreamweaver. After you

Comments to this Manuals

No comments