Adobe Extending Dreamweaver CS4 Manuale Utente

Navigare online o scaricare Manuale Utente per Software Adobe Extending Dreamweaver CS4. Adobe Extending Dreamweaver CS4 User Manual Manuale Utente

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 387
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti

Sommario

Pagina 1 - DREAMWEAVER

Extending ADOBE® DREAMWEAVER® CS4

Pagina 2 - Copyright

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

Pagina 3 - Contents

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

Pagina 4

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

Pagina 5

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

Pagina 6

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

Pagina 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

Pagina 8 - Creating an extension

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

Pagina 9 - Introduction

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

Pagina 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

Pagina 11

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

Pagina 12 - • String-delimited tags

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

Pagina 13 - <tagspec>

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

Pagina 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

Pagina 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

Pagina 16

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

Pagina 17 - <deleteditems>

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

Pagina 18 - Changing FTP mappings

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

Pagina 19 - 5 Save the file

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

Pagina 20

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

Pagina 21

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

Pagina 22

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

Pagina 23

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

Pagina 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,

Pagina 25 - See also

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

Pagina 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

Pagina 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

Pagina 28 - <document>

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

Pagina 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

Pagina 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

Pagina 31

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

Pagina 32

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

Pagina 33

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

Pagina 34

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

Pagina 35

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

Pagina 36 - About code hints

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

Pagina 37 - JavaScript code hinting

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

Pagina 38 - Customizing Code view

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

Pagina 39

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

Pagina 40

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

Pagina 41 - Code hints tags

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

Pagina 42 - <description>

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

Pagina 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

Pagina 44 - <function>

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

Pagina 45 - <method>

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

Pagina 46 - <parammenu>

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

Pagina 47 - <optionparammenu>

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

Pagina 48 - <property>

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

Pagina 49 - <event>

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

Pagina 50 - About code coloring

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

Pagina 51 - <scheme>

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

Pagina 52 - <blockEnd>

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

Pagina 53 - <charStart>

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

Pagina 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

Pagina 55 - <cssProperty/>

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

Pagina 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

Pagina 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

Pagina 58 - <idCharRest>

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

Pagina 59 - <isLocked>

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

Pagina 60 - <numbers/>

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

Pagina 61 - <sampleText>

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

Pagina 62 - <stringStart>

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

Pagina 63 - <tagGroup>

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

Pagina 64

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

Pagina 65 - Scheme processing

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

Pagina 66 - Wildcard characters

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

Pagina 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

Pagina 68 - Scheme precedence

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

Pagina 69 - Editing schemes

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

Pagina 70 - Code coloring examples

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

Pagina 71

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

Pagina 72

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

Pagina 73 - About Code validation

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

Pagina 74 - <css-support>

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

Pagina 75 - <value>

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

Pagina 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

Pagina 77 - About related files

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

Pagina 78

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

Pagina 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

Pagina 80

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

Pagina 81

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

Pagina 82

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

Pagina 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

Pagina 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

Pagina 85 - Extension APIs

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

Pagina 86 - Localizing an extension

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

Pagina 87 - Extending Dreamweaver

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

Pagina 88

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

Pagina 89 - Editable select lists

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

Pagina 90

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

Pagina 91 - Database controls

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

Pagina 92

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

Pagina 93 - Tree controls

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

Pagina 94 - Creating a tree control

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

Pagina 95

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

Pagina 96

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

Pagina 97

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

Pagina 98

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

Pagina 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

Pagina 100

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

Pagina 101 - Object Model

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

Pagina 102 - The Dreamweaver DOM

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

Pagina 103 - EXTENDING DREAMWEAVER CS4

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

Pagina 104

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

Pagina 105

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

Pagina 106

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

Pagina 107

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

Pagina 108

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

Pagina 109 - The site object

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

Pagina 110 - Chapter 7: Insert bar objects

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

Pagina 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

Pagina 112 - <insertbar>

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

Pagina 113 - <checkbutton />

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

Pagina 114 - <separator />

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

Pagina 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.

Pagina 116

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

Pagina 117 - Modifying the Insert bar

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

Pagina 118

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

Pagina 119 - Create the HTML file

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

Pagina 120

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

Pagina 121

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

Pagina 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

Pagina 123

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

Pagina 124 - 2 Add the following code:

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

Pagina 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

Pagina 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

Pagina 127

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

Pagina 128

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

Pagina 129

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

Pagina 130

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

Pagina 131 - An Issues example

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

Pagina 132

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

Pagina 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

Pagina 134

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

Pagina 135

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

Pagina 136

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

Pagina 137 - Chapter 9: Commands

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

Pagina 138 - A simple command example

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

Pagina 139 - Writing the JavaScript code

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

Pagina 140 - 1 Create a new blank file

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

Pagina 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

Pagina 142 - Commands

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

Pagina 143 - The commands API functions

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

Pagina 144

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

Pagina 145

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

Pagina 146

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

Pagina 147 - The menus.xml file

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

Pagina 148 - <menu>

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

Pagina 149 - <menuitem>

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

Pagina 150 - <separator>

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

Pagina 151 - <shortcut>

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

Pagina 152 - <tool>

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

Pagina 153 - <activate>

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

Pagina 154 - <override>

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

Pagina 155 - Change keyboard shortcuts

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

Pagina 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

Pagina 157 - Menu commands

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

Pagina 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

Pagina 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

Pagina 160

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

Pagina 161

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

Pagina 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

Pagina 163

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

Pagina 164

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

Pagina 165

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

Pagina 166

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

Pagina 167

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

Pagina 168

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

Pagina 169

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

Pagina 170

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

Pagina 171

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

Pagina 172

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

Pagina 173 - Chapter 11: Toolbars

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

Pagina 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

Pagina 175 - A simple toolbar command file

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

Pagina 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

Pagina 177 - <toolbar>

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

Pagina 178 - Toolbars

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

Pagina 179 - <itemref/>

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

Pagina 180 - <separator/>

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

Pagina 181 - Toolbar item tags

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

Pagina 182 - <radiobutton>

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

Pagina 183 - <dropdown>

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

Pagina 184 - <combobox>

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

Pagina 185 - <colorpicker>

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

Pagina 186 - Item tag attributes

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

Pagina 187

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

Pagina 188

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

Pagina 189

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

Pagina 190 - • Clicks a button

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

Pagina 191

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

Pagina 192

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

Pagina 193

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

Pagina 194

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

Pagina 195

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

Pagina 196

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

Pagina 197

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

Pagina 198

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

Pagina 199 - Chapter 12: Reports

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

Pagina 200 - A simple site report example

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

Pagina 201 - Stand-alone reports

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

Pagina 202 - How stand-alone reports work

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

Pagina 203 - Write the JavaScript code

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

Pagina 204 - The reports API functions

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

Pagina 205

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

Pagina 206

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

Pagina 207

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

Pagina 208

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

Pagina 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

Pagina 210

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

Pagina 211

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

Pagina 212 - The Tag Chooser

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

Pagina 213

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

Pagina 214

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

Pagina 215 - Create a tag editor UI

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

Pagina 216 - Tag libraries and editors

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

Pagina 217 - Add a tag to Tag Chooser

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

Pagina 218 - The tag editor API functions

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

Pagina 219

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

Pagina 220 - Property inspector files

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

Pagina 221 - Property inspectors

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

Pagina 222 - Create the user interface

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

Pagina 223

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

Pagina 224

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

Pagina 225 - Test the Property inspector

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

Pagina 226

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

Pagina 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

Pagina 228 - Chapter 15: Floating panels

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

Pagina 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

Pagina 230

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

Pagina 231 - Floating panels

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

Pagina 232

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

Pagina 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.

Pagina 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

Pagina 235

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

Pagina 236

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

Pagina 237

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

Pagina 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

Pagina 239

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

Pagina 240 - Chapter 16: Behaviors

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

Pagina 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

Pagina 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

Pagina 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

Pagina 244

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

Pagina 245 - The behaviors API functions

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

Pagina 246

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

Pagina 247

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

Pagina 248

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

Pagina 249

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

Pagina 250

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

Pagina 251

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

Pagina 252 - Chapter 17: Server behaviors

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

Pagina 253 - Dreamweaver architecture

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

Pagina 254 - The script file

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

Pagina 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

Pagina 256 - Server behaviors

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

Pagina 257 - The server behavior API

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

Pagina 258

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

Pagina 259

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

Pagina 260

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

Pagina 261

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

Pagina 262

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

Pagina 263

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

Pagina 264 - EDML files

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

Pagina 265 - Group EDML file tags

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

Pagina 266 - <group> attributes

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

Pagina 267

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

Pagina 268 - <groupParticipants>

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

Pagina 269 - <groupParticipant>

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

Pagina 270

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

Pagina 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

Pagina 272 - <insertText>

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

Pagina 273 - <insertText> attributes

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

Pagina 274

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

Pagina 275 - <searchPatterns>

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

Pagina 276 - <searchPattern>

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

Pagina 277

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

Pagina 278

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

Pagina 279

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

Pagina 280 - <updatePattern>

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

Pagina 281

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

Pagina 282 - <delete> attributes

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

Pagina 283 - <translator>

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

Pagina 284 - <translation>

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

Pagina 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

Pagina 286 - <openTag>

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

Pagina 287 - <attribute>

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

Pagina 288 - <closeTag>

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

Pagina 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

Pagina 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

Pagina 291

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

Pagina 292 - Search pattern resolution

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

Pagina 293 - Updating server behaviors

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

Pagina 294 - Deleting server behaviors

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

Pagina 295

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

Pagina 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

Pagina 297 - Data sources

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

Pagina 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

Pagina 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

Pagina 300

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

Pagina 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

Pagina 302

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

Pagina 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

Pagina 304

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

Pagina 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

Pagina 306

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

Pagina 307

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

Pagina 308

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

Pagina 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

Pagina 310 - Server formats

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

Pagina 311

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

Pagina 312

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

Pagina 313

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

Pagina 314

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

Pagina 315 - Chapter 20: Components

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

Pagina 316

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

Pagina 317 - Properties of tree control

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

Pagina 318

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

Pagina 319 - Components

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

Pagina 320

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

Pagina 321

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

Pagina 322

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

Pagina 323

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

Pagina 324

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

Pagina 325

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

Pagina 326 - • When server model changes

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

Pagina 327

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

Pagina 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

Pagina 329 - Server models

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

Pagina 330

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

Pagina 331

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

Pagina 332

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

Pagina 333

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

Pagina 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

Pagina 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

Pagina 336 - Data translators

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

Pagina 337

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

Pagina 338

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

Pagina 339

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

Pagina 340

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

Pagina 341

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

Pagina 342 - Create the icon

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

Pagina 343

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

Pagina 344

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

Pagina 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.

Pagina 346

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

Pagina 347

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

Pagina 348

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

Pagina 349

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

Pagina 350

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

Pagina 351 - • The dom argument

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

Pagina 352

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

Pagina 353

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

Pagina 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

Pagina 355 - The C-level API

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

Pagina 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

Pagina 357 - JSBool JS_ValueToDouble()

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

Pagina 358 - JS_ValueToUCString()

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

Pagina 359 - JSBool JS_UCStringToValue()

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

Pagina 360 - JSVal JS_IntegerToValue()

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

Pagina 361 - JSObject *JS_NewArrayObject()

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

Pagina 362 - JSBool JS_SetElement()

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

Pagina 363 - JSBool JS_ReportError()

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

Pagina 364 - C-level extensibility

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

Pagina 365

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

Pagina 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

Pagina 367

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

Pagina 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

Pagina 369

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

Pagina 370 - JSBool MM_DeleteConfigFile()

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

Pagina 371

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

Pagina 372

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

Pagina 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

Pagina 374 - The MM folder

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

Pagina 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,

Pagina 376 - The CMN folder

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

Pagina 377 - Other folders

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

Pagina 378 - Using the Shared folder

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

Pagina 379

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

Pagina 380

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

Pagina 381

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

Pagina 382

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

Pagina 383

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

Pagina 384

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

Pagina 385

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

Pagina 386

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

Pagina 387

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

Commenti su questo manuale

Nessun commento