macromedia™®Extending Dreamweaver MX
Chapter 8100Examplefunction showif(){var retval = false;var dom = dw.getDocumentDOM();if(dom){var view = dom.getView();if(view == ‘design’){retval = t
To o l b a r s 101The file attribute in this text box item causes Dreamweaver to invoke the Toolbars/MM/EditTitle.htm command file when the user inter
Chapter 8102
103CHAPTER 9ReportsYou can use the Reports API functions to create custom site reports or modify the set of prewritten reports that come with Dreamwea
Chapter 91044 After the reports are selected and their settings are set, the user clicks the Run button. At this point, Dreamweaver clears all items f
Reports 105ReturnsDreamweaver expects nothing.beginReporting()DescriptionCalled at the start of the reporting process, before any reports are run. If
Chapter 9106ExampleThe following instance of commandButtons() defines three buttons: OK, Cancel, and Help.function commandButtons(){return new Array(&
107CHAPTER 10Tag Libraries and EditorsDreamweaver MX users can use tag editors to insert new tags, edit existing tags, and access reference informatio
Chapter 10108The following example illustrates the structure of the TagLibraries.vtm file:<taglibraries><taglibrary name="Name of tag li
Tag Libraries and Editors 109The following table lists tagref attributes:Because the tagref.prefix attribute can override taglibrary.prefix, the relat
11CHAPTER 1IntroductionThis book contains descriptions of the tools that are available for developers to extend Dreamweaver using Dreamweaver applicat
Chapter 10110The following table lists the attributes that define tags: Attribute Description Mandatory/optionaltag.bind Used by the Data Binding pane
Tag Libraries and Editors 111Note: In versions before Dreamweaver MX, tag information is stored in the Configuration/TagAttributeList.txt file. The Ta
Chapter 10112TagChooser.xml files are stored in Configuration/TagLibraries/TagLibraryName folder. The following example illustrates the structure of T
Tag Libraries and Editors 113The ELEMENT tag represents the tag to insert, with attributes as described in the following table:Creating a new tag edit
Chapter 10114For Windows NT platforms: <drive>:\WinNT\profiles\<username>\ ¬Application Data\Macromedia\Dreamweaver MX\Configuration For M
Tag Libraries and Editors 115Creating a tag editor UITo create the CFWEATHER tag editor user interface:1 Save the following file as Configuration/Tagl
Chapter 10116<div name="General"> <table border="0" cellspacing="4"> <tr> <td valign=&qu
Tag Libraries and Editors 117• The <cfweather> tag appears in the list box on the right. • Select cfweather, and click the Insert button. The ta
Chapter 10118ReturnsDreamweaver expects a Boolean value: true if the input for HTML form elements is valid; false if input values are not valid. Examp
119CHAPTER 11Property InspectorsThe Property inspector is perhaps the most familiar floating panel in the Dreamweaver interface. It is indispensable f
Chapter 1124 Save the extension package in the Dreamweaver MX\Downloaded Extensions folder of your installed Dreamweaver folder. 5 In the Extension Ma
Chapter 11120In some cases, you might want to specify that your extension use only Dreamweaver MX extension rendering (and not the previous rendering
Property Inspectors 121The Property inspector APITwo of the Property inspector API functions (canInspectSelection() and inspectSelection()) are requir
Chapter 11122inspectSelection()DescriptionRefreshes the contents of the text fields based on the attributes of the current selection.ArgumentsmaxOrMin
Property Inspectors 123A simple Property inspector exampleThe following Property inspector inspects a fictional tag called INTJ. The INTJ tag is empty
Chapter 11124 var theObj = theDOM.getSelectedNode(); // Get the index of the selected option in the pop-up menu // in the interface var typeInde
125CHAPTER 12Floating PanelsYou can create any kind of floating panel or inspector without the size and layout limitations of Property inspectors. Alt
Chapter 12126When one of the files inside the Configuration folder calls dw.getFloaterVisibility(floaterName), dw.setFloaterVisibility(floaterName), o
Floating Panels 127displayHelp()DescriptionIf this function is defined, a Help button appears below the OK and Cancel buttons in your dialog box. This
Chapter 12128getDockingSide()AvailabilityDreamweaver MX (Windows only)DescriptionSpecifies the locations at which a floating panel can dock. The funct
Floating Panels 129initialTabs()DescriptionDetermines which other floating panels are tabbed together the first time that this floating panel appears.
Introduction 13What’s new in Extending Dreamweaver MXDreamweaver MX includes the following new features and interfaces that you can access to develop
Chapter 12130isAvailableInCodeView()DescriptionDefined by a floating panel to determine whether the floating panel should be enabled when Code view is
Floating Panels 131ExampleThe following example of selectionChanged() shows a different layer in the floating panel, depending on whether the selectio
Chapter 12132The following example is from a floating panel that displays information about every layer in the document. It uses setTimeout() to pause
Floating Panels 133A simple floating panel exampleThe following floating panel example contains a text field that shows the contents of the selected S
Chapter 12134</form></div></body></html>Remember that it is not sufficient to save this code in a file called scriptEditor.htm
135CHAPTER 13BehaviorsBehaviors let users make their HTML pages interactive. They offer web designers an easy way to assign actions to page elements b
Chapter 131363 Dreamweaver calls the windowDimensions() function, if defined, to determine the size of the Parameters dialog box. If windowDimensions(
Behaviors 137ReturnsDreamweaver expects a string that contains the function call to be inserted in the user’s document, usually after accepting parame
Chapter 13138Note: Quotation marks within the returned string must be preceded by a backslash (\) to avoid errors that the JavaScript interpreter repo
Behaviors 139ExampleThe following instance of canAcceptBehavior() returns a list of preferred events for the behavior if the document has any named im
Chapter 114Importing/exporting sitesYou can programmatically export a Dreamweaver MX site to an XML file, which can then be imported by any Dreamweave
Chapter 13140identifyBehaviorArguments()DescriptionIdentifies arguments from a behavior function call as navigation links, dependent files, URLs, Nets
Behaviors 141A more complex version of identifyBehaviorArguments() is necessary for behavior functions that have a variable number of arguments (such
Chapter 13142ExampleThe following instance of inspectBehavior(), taken from Display Status Message.htm, fills in the Message field in the parameters f
Behaviors 143A simple behavior exampleTo understand how behaviors work and how you can create one, it’s helpful to look at an example. The Configurati
Chapter 13144 var ieURL = unescape(argArray[2]); document.theForm.nsURL.value = nsURL; document.theForm.ieURL.value = ieURL;}//***************** LO
145CHAPTER 14Server BehaviorsDreamweaver MX provides users with an interface for adding server behaviors into their documents to perform server-side t
Chapter 14146Dreamweaver architectureWhen you use the Server Behavior Builder to create a Dreamweaver-specific extension, Dreamweaver creates several
Server Behaviors 147For example, the moveTo_declareParam.edml file contains the following code:<participant> <quickSearch><![CDATA[
Chapter 141483 Click Create.Use the Server Behavior Builder to define your new server behavior.Note: If the Server Behaviors panel is not open and vis
Server Behaviors 149How the Server Behavior API functions are calledThe Server Behavior API functions are called in the following scenarios:• The find
Introduction 15New document typesExtensible document typesDreamweaver MX lets you create new document types, including types that have file extensions
Chapter 14150• When the user clicks the plus (+) button in the Server Behaviors panel, the pop-up menu appears.To determine the content of the menu, D
Server Behaviors 151The Server Behavior APIYou can manage server behaviors with the following API functions.analyzeServerBehavior()AvailabilityDreamwe
Chapter 14152applyServerBehavior()AvailabilityDreamweaver UltraDev 1DescriptionReads values from the form elements in the dialog box and adds the beha
Server Behaviors 153copyServerBehavior()AvailabilityDreamweaver UltraDev 1DescriptionImplementing copyServerBehavior() is optional. Users can copy ins
Chapter 14154displayHelp()DescriptionIf this function is defined, a Help button appears below the OK and Cancel buttons in the dialog box. This functi
Server Behaviors 155ArgumentsserverBehaviorserverBehavior is a JavaScript object that represents the behavior. It is the same object that findServerBe
Chapter 14156ReturnsThe function returns an array that contains all instances of the specified participant (or, in the case of a group file, any insta
Server Behaviors 157dwscripts.applySB()AvailabilityDreamweaver MX (this function replaces applySB() from earlier versions of Dreamweaver)DescriptionIn
Chapter 14158ExampleThe following example deletes all the participants of the sbObj server behavior, except the participants that are protected by the
Server Behaviors 159To extract parameter values from <% if (@@rs@@.EOF) Response.Redirect("@@new__url@@"); %>,write a regular expressi
Chapter 116Enhanced database explorationDreamweaver MX enhances database exploration in the following ways.• For ColdFusion, you have the option of ac
Chapter 14160Group EDML file tagsThese tags and attributes are valid within the EDML group files.EDML Tag: groupDescriptionContains all specifications
Server Behaviors 161ValueThe exact name (without a path) of any server behavior HTML file within a Configuration/ServerBehaviors folder, as shown in t
Chapter 14162TypeAttribute.RequiredNo.ValueA unique string that determines which group to apply, as shown in the following example:<group serverBeh
Server Behaviors 163TypeBlock tag.RequiredYes.Attribute: selectParticipantDescriptionIndicates which participant should be selected and highlighted in
Chapter 14164TypeAttribute.RequiredYes.ValueThe exact name (without the .edml extension) of any participant file, as shown in the following example:&l
Server Behaviors 165Participant EDML filesThese tags and attributes are valid within the EDML participant files.EDML Tag: participantDescriptionContai
Chapter 14166RequiredNo.ValuesearchString is a literal string that exists on the page if the participant exists. It should be as unique as possible, b
Server Behaviors 167TypeAttribute.RequiredYes.ValuesaboveHTML[+weight], belowHTML[+weight], beforeSelection, replaceSelection, wrapSelection, afterSel
Chapter 14168• lastChildOfNode inserts the text as the last child of a block tag; for example, if you want to insert something at the end of a FORM ta
Server Behaviors 169EDML Tag: searchPatternsDescriptionProvides information about how to find the participant text in the document and contains a list
17CHAPTER 2Extending Dreamweaver MXMost Dreamweaver extensions are written in HTML and JavaScript. Extensions typically perform the following types of
Chapter 14170• comment searches only within the HTML comments <! ... >, as shown in the following example:<searchPatterns whereToSearch="
Server Behaviors 171Note: It is important that the regular expression start and end with a slash (/). Otherwise it is used as a literal string search.
Chapter 14172Attribute: limitSearchDescriptionLimits the search to some part of the whereToSearch tag.ParentsearchPatternTypeAttribute.RequiredNo.Valu
Server Behaviors 173• true if the searchPattern does not have to be found to identify the participant.• false (default) if the searchPattern must be f
Chapter 14174EDML Tag: updatePatternDescriptionA specific type of regular expression that allows precise updates of participant text. There should be
Server Behaviors 175To update the recordset name in all three positions, you need three update patterns for a single parameter, as shown in the follow
Chapter 14176Attribute: deleteTypeDescriptionUsed to indicate the type of delete to perform. It has different meanings, depending on whether the parti
Server Behaviors 177EDML Tag: searchPatternsDescriptionProvides a way for Dreamweaver to find each specified instance in a document. If multiple searc
Chapter 14178Attribute: whereToSearchDescriptionSpecifies where to search for the text. This is related to the insert location, so be sure to set both
Server Behaviors 179Valuesdynamic data, dynamic image, dynamic source, tabbed region start, tabbed region end, custom• dynamic data indicates that the
Chapter 218Extension APIsThe extension APIs provide the framework that you use to add functionality to Dreamweaver. You write the bodies of the functi
Chapter 14180ValuestagName is a valid tag name. It should be unique to prevent conflicts with known tag types. For example, if you specify <openTag
Server Behaviors 181EDML Tag: displayDescriptionAn optional display string that should be inserted in the translation.ParenttranslationTypeBlock tag.R
Chapter 14182dreamweaver.getExtDataValue()AvailabilityDreamweaver UltraDev 4DescriptionRetrieves the field values from an EDML file for the specified
Server Behaviors 183dreamweaver.getExtGroups()AvailabilityDreamweaver UltraDev 4DescriptionRetrieves the name of the group, which is the equivalent to
Chapter 14184In this case, the following quickSearch string checks for it:<quickSearch>Response.Redirect</quickSearch>For performance reas
Server Behaviors 185In the previous example, the telephone number must be specified. However, you can make the telephone number optional, by adding th
Chapter 14186If you add the server behavior again with a different name, such as "bbb", the document now looks like this:<% //test_p1 nam
Server Behaviors 187This server behavior no longer works correctly because only one parameter is named total. To solve this problem, make sure that th
Chapter 14188The tag/attribute combination (see the previous example) does not apply to translation because Dreamweaver always translates to straight
Server Behaviors 189These shortened search patterns are flexible, so the user can add to the code. However, if the server behavior changes the URL, wh
Extending Dreamweaver MX 19You can use the files that come with the product within the Configuration folder as examples, but these files are generally
Chapter 14190Avoiding conflicts with share-in-memory JavaScript filesIf several HTML files reference a particular JavaScript file, Dreamweaver loads t
191CHAPTER 15Data SourcesThe Dreamweaver MX Data Sources API functions let you add data sources, which appear in the plus (+) menu of the Bindings pan
Chapter 151923 Dreamweaver goes through each file in the appropriate server model folder, calling findDynamicSources() in each file. For each value in
Data Sources 193The Data Sources APIaddDynamicSource()AvailabilityDreamweaver UltraDev 1DescriptionAdds a dynamic data source. Because there is one im
Chapter 15194displayHelp()DescriptionIf this function is defined, a Help button appears below the OK and Cancel buttons in the dialog box. This functi
Data Sources 195DescriptionReturns the top-level nodes from the data source tree that appears in the Dynamic Data or Dynamic Text dialog box or the Bi
Chapter 15196generateDynamicSourceBindings() AvailabilityDreamweaver UltraDev 1DescriptionReturns the children of a top-level node.ArgumentssourceName
Data Sources 197inspectDynamicDataRef() AvailabilityDreamweaver UltraDev 1DescriptionFrom a dynamic data object, determines the corresponding node in
Chapter 15198
199CHAPTER 16Server Formats“Data Sources” on page 191 discusses how Dreamweaver MX inserts dynamic data into the user’s document by adding a server ex
TrademarksAfterburner, AppletAce, Attain, Attain Enterprise Learning System, Attain Essentials, Attain Objects for Dreamweaver, Authorware, Authorware
Chapter 220Types of extension APIs in DreamweaverThe following list describes the types of extension APIs that are documented in this guide:Object ext
Chapter 16200How data formatting works All format files reside in the ServerFormats folder within the Configuration folder. Each server model has its
Server Formats 201The Edit Format List plus (+) menuIf you do not want a file in the ServerFormats folder to appear in the Edit Format List plus (+) m
Chapter 16202The Data Formatting API applyFormat()AvailabilityDreamweaver UltraDev 1DescriptionAdds a format function declaration to the user’s docume
Server Formats 203ReturnsDreamweaver expects the format object, if the function completes successfully. If an error occurs, the function returns an er
Chapter 16204ArgumentsdynamicDataObject, format• dynamicDataObject is a string that contains the dynamic data object.• format is a JavaScript object t
205CHAPTER 17ComponentsComponents are modularized groups of functions, or objects, that can be used as building blocks for applications and web pages.
Chapter 17206You can set a component type to work at the level of an individual web page, to a set of web pages, or to an entire site. Your JavaScript
Components 207Populating the tree controlUse the ComponentRec property to populate a Component panel tree control, so that it appears within the Compo
Chapter 17208displayHelp()AvailabilityDreamweaver MXDescriptionDisplays help text for the current tree node item using the Help System using the help
Components 209Examplefunction getComponentChildren(componentRec){var cs_Children = new Array();if (!componentRec){//read saved entries for java beans.
Extending Dreamweaver MX 21Data Translator extensions convert non-HTML code into HTML that appears in the Design view of the Document window. These ex
Chapter 17210getContextMenuId()AvailabilityDreamweaver MXDescription: An optional function that gets the Context Menu ID for the component type. Every
Components 211Examplefunction getContextMenuId(){return "DWConnectionsContext";}<shortcutlist app="ultradev" id="DWConnect
Chapter 17212getCodeViewDropCode()AvailabilityDreamweaver MXDescriptionGets the code that is dragged and dropped in Code view from the Component panel
Components 213• "Event:SetCurSite" pops up a dialog box to set the current site. • "Event:CreateSite" pops up a dialog box to crea
Chapter 17214• toolTipText Optional tool tip text for the tree node item.• isCodeViewDraggable A Boolean value that indicates whether the tree node it
Components 215ArgumentsNone.ReturnsDreamweaver expects an array of toolbar buttons in left-to-right order.Examplefunction toolbarControls(){var toolBa
Chapter 17216
217CHAPTER 18Server ModelsServer models are the technologies that run scripts on a server. When users define a new site, they can identify the server
Chapter 18218Note: All Dreamweaver MX-defined server models return a value of 1 so third-party server models can override the file-extension associati
Server Models 219getLanguageSignatures()AvailabilityDreamweaver MXDescriptionReturns an object that describes the method and array signatures that the
Chapter 222For all extensions, Dreamweaver executes code in other event handlers (for example, onBlur="alert(’This is a required field.’)")
Chapter 18220getServerInfo()AvailabilityDreamweaver MXDescriptionReturns a JavaScript object, which can be accessed from within the JavaScript code. Y
Server Models 221ArgumentsNone.ReturnsDreamweaver expects an array of strings that represent the supported scripting languages. getServerModelExtDataN
Chapter 18222getServerModelDisplayName()AvailabilityDreamweaver MXDescriptionReturns the name that should appear in the user interface for this server
Server Models 223getVersionArray() AvailabilityDreamweaver UltraDev 1, deprecated in Dreamweaver MXDescriptionProvides a mapping of server technologie
Chapter 18224
225CHAPTER 19Data TranslatorsData translators translate specialized markup—server-side includes, conditional JavaScript statements, or other code such
Chapter 19226• Invokes a command, behavior, server behavior, Property inspector, or other extension that sets the innerHTML or outerHTML property of a
Data Translators 2277 runDefault specifies when this translator executes. The following table lists the possible values:If you set runDefault to "
Chapter 19228translateMarkup()DescriptionPerforms the translation.ArgumentsdocName, siteRoot, docContent• docName is a string that contains the file:/
Data Translators 229ReturnsA string that contains the translated document or an empty string if nothing is translated.ExampleThe following instance of
Extending Dreamweaver MX 23Document type definition fileThe central component of extensible document types is the document type definition file. There
Chapter 19230The mmTranslatedValue attribute must be unique within the tag. If it is likely that your translator needs to translate more than one attr
Data Translators 231The poco.xml file that contains this tagspec is stored in the Configuration/ThirdPartyTags folder, along with the icon for Poco ta
Chapter 19232 back3FromStart = start-3; end = outStr.indexOf(’ #>’,start); equalSign = outStr.indexOf(’="<# if’,back3FromStart); at
Data Translators 233 } // Return the translated string. return outStr}function getTranslatorInfo(){ returnArray = new Array(7); returnArray[0] = &q
Chapter 19234The fields in the Property inspector are still editable; users can enter values for attributes that might be controlled by server markup,
Data Translators 235The following example shows the locked portion of code that might be generated from the translation of the server-side include <
Chapter 19236 returnArray[0] = "DREAMWEAVER_TEAM"// The translatorClass returnArray[1] = "Kent Tags"// The title returnArray[
Data Translators 237/*************************************************************** The replaceKentTag() function assembles the HTML that will ** re
Chapter 19238 // Now determine which photo to show based on whether it’s a workday or a // weekend; what time it is; and, if it’s a time and day
Data Translators 239Creating Property inspectors for locked contentAfter you’ve created a translator, you need to create a Property inspector for the
Chapter 224If you need to create a new document type, you can either add your entry to the document definition file that Macromedia provides (MMDocume
Chapter 19240To populate the fields in the Property inspector for the translated tag, you must parse the value of the orig attribute. For example, if
Data Translators 241The Property inspector for translated server-side includes (Configuration/Inspectors/ssi_translated.js) demonstrates this techniqu
Chapter 192423 At the end of the translateMarkup() function, comment out the return whateverTheReturnValueIs line, and replace it with dreamweaver.get
243CHAPTER 20JavaScript Debugger ModulesA JavaScript Debugger module is an extensibility module that inserts special code into a document so the code
Chapter 202444 When Dreamweaver finds a script tag or event handler, it calls the startBlock() function of the module and passes in the name of the fi
JavaScript Debugger Modules 245The JavaScript Debugger module API The JavaScript Debugger module API lets you customize the way you create the debug v
Chapter 20246getFunctionStartInstrument()AvailabilityDreamweaver 4DescriptionCalled before the first statement in a function declaration. The getStepI
JavaScript Debugger Modules 247getIncludedFileList()AvailabilityDreamweaver 4DescriptionCalled to get a list of files that are referenced by the code
Chapter 20248getStepInstrument()AvailabilityDreamweaver 4DescriptionCalled for each statement that is parsed inside a block. A call is always made to
JavaScript Debugger Modules 249reportWarning()AvailabilityDreamweaver 4DescriptionCalled when a warning is detected in the file.ArgumentsfileURL, file
Extending Dreamweaver MX 25The following table describes the tags and attributes that you can use within a document type definition file. Element Typ
Chapter 20250
251CHAPTER 21C-Level ExtensibilityThe C-level extensibility mechanism lets you implement Macromedia Dreamweaver MX extensibility files using a combina
Chapter 21252The readContentsOfFile() function accepts a list of arguments from the user, unpacks the argument that contains the filename, reads the c
C-Level Extensibility 253Your library must include exactly one instance of the following macro:/* MM_STATE is a macro that expands to some definitions
Chapter 21254typedef enum { JS_FALSE = 0, JS_TRUE = 1 } JSBoolDescriptionA simple data type that stores a Boolean value.The C-level APIThe C-level ext
C-Level Extensibility 255char *JS_ValueToString()DescriptionExtracts a function argument from a jsval, converts it to a string, if possible, and passe
Chapter 21256JSBool JS_ValueToBoolean()DescriptionExtracts a function argument from a jsval, converts it to a Boolean value (if possible), and passes
C-Level Extensibility 257ReturnsA Boolean value that indicates success (JS_TRUE) or failure (JS_FALSE).JSBool JS_DoubleToValue()DescriptionStores a fl
Chapter 21258char *JS_ObjectType()DescriptionGiven an object reference, JS_ObjectType() returns the class name of the object. For example, if the obje
C-Level Extensibility 259JSBool JS_GetElement()DescriptionReads a single element of an array object.ArgumentsJSContext *cx, JSObject *obj, unsigned in
Chapter 226Note: When the user saves a new document, Dreamweaver MX examines the list of extensions for the current platform that are associated with
Chapter 21260• sz is the size of the string, in bytes. If sz is 0, the length of the null-terminated string is computed automatically. • rval is a poi
C-Level Extensibility 261Dreamweaver MX creates the user configuration folder in a location where the user has full read and write access. The followi
Chapter 21262For example, if you used the trash can in the Snippets panel to delete a Snippets folder called javascript and a file called onepixelbord
C-Level Extensibility 263JSBool MM_ConfigFileExists()AvailabilityDreamweaver MXDescriptionChecks whether the specified file exists. If it is a file in
Chapter 21264If you open the file in "write" mode, any existing data in the file is truncated prior to writing new data. If you open the fil
C-Level Extensibility 265Examplechar dwConfig = "file:///c|/Program Files/Macromedia/Dreamweaver MX/Configuration/Extensions.txt";unsigned l
Chapter 21266JSBool MM_CreateConfigFolder()AvailabilityDreamweaver MXDescriptionCreates a folder in the specified location.If fileURL specifies a fold
C-Level Extensibility 267If fileURL is not in the Dreamweaver MX Configuration folder, the function deletes the specified file.Argumentschar *fileURL
Chapter 212684 Add the line alert(Sample.computeSum(2,2)); to the objectTag() function so that it appears as shown in the following example:function o
Part IIIUtility APIsUnderstand the Dreamweaver utility functions that you can use to acccess local and web-based files, work with Fireworks and Flash
Extending Dreamweaver MX 27When Dreamweaver MX launches, it reads all document type definition files and builds a list of valid document types. Dreamw
271CHAPTER 22The File I/O APIMacromedia Dreamweaver MX includes a C shared library called DWfile that gives authors ofobjects, commands, behaviors, da
Chapter 22272Returnstrue if the copy succeeds; false otherwise.ExampleThe following code copies a file called myconfig.cfg to myconfig_backup.cfg.var
The File I/O API 273ExampleThe following code checks for a file called mydata.txt and displays an alert box that tells the user whether the file exist
Chapter 22274DWfile.getModificationDate()AvailabilityDreamweaver 2DescriptionGets the time when the file was last modified.ArgumentsfileURLThe argumen
The File I/O API 275ReturnsA string that contains a hexadecimal number that represents the number of time units that have elapsed since some base time
Chapter 22276DWfile.getSize()AvailabilityDreamweaver MXDescriptionGets the size of a specified file.ArgumentsfileURLThe argument, which is expressed a
The File I/O API 277DWfile.read()AvailabilityDreamweaver 2DescriptionReads the contents of the specified file into a string.ArgumentsfileURLThe argume
Chapter 22278DWfile.setAttributes()AvailabilityDreamweaver MXDescriptionSets the system-level attributes of a particular file.ArgumentsfileURL, strAtt
The File I/O API 279Returnstrue if the string is successfully written to the file, false otherwise.ExampleThe following code attempts to write the str
Chapter 228Document extensionsAfter creating a new document type, extension developers need to update the appropriate Extensions.txt file. If the user
Chapter 22280
281CHAPTER 23The HTTP APIExtensions are not limited to working within the local file system. Macromedia Dreamweaver MX provides a mechanism to get inf
Chapter 23282MMHttp.clearTemp()DescriptionDeletes all the files in the Configuration/Temp folder, which is located inside the Dreamweaver application
The HTTP API 283ReturnsAn object that represents the reply from the server. The data property of this object is a string that contains the location wh
Chapter 23284MMHttp.getFileCallback()DescriptionGets the file at the specified URL, saves it in the Configuration/Temp folder inside the Dreamweaver a
The HTTP API 285ExampleThe following code gets the contents of a file on a web server and puts it in a new, untitled Dreamweaver document:var httpRepl
Chapter 23286MMHttp.postText()DescriptionUses an HTTP post request to pass the specified data to the specified URL. Typically the data that is associa
287CHAPTER 24The Design Notes APIMacromedia Dreamweaver, Fireworks, and Flash MX give web designers and developers a way to store and retrieve extra i
Chapter 24288The Design Notes JavaScript APIAll functions in the Design Notes JavaScript API are methods of the MMNotes object. Optional arguments are
The Design Notes API 289ReturnsA string that contains the value of the key.ExampleSee “MMNotes.getKeys()” on page 289.MMNotes.getKeyCount()Description
Extending Dreamweaver MX 29To provide localized strings, perform the following steps:1 Place the following statement at the top of the document type d
Chapter 24290MMNotes.getSiteRootForFile()DescriptionDetermines the site root for the specified Design Notes file.ArgumentsfileURLThe argument is the p
The Design Notes API 291The argument is the path to a local file, which is expressed as a file:// URL.ReturnsA string that contains the local drive pa
Chapter 24292MMNotes.set()DescriptionCreates or updates one key/value pair in a Design Notes file.ArgumentsfileHandle, keyName, valueString• The first
The Design Notes API 293BOOL FilePathToLocalURL()DescriptionConverts the specified local drive path to a file:// URL.Argumentsconst char* drivePath, c
Chapter 24294int GetNoteLength()DescriptionGets the length of the value associated with the specified key.ArgumentsFileHandle noteHandle, const char k
The Design Notes API 295ExampleThe following code prints the key names and values of all the keys in the Design Notes file that are associated with we
Chapter 24296BOOL GetVersionName()DescriptionGets the version name of the MMNotes shared library, which indicates the application that implemented it.
The Design Notes API 297FileHandle OpenNotesFile()DescriptionOpens the Design Notes file that is associated with the specified file or creates one if
Chapter 24298BOOL SetNote()DescriptionCreates or updates one key/value pair in a Design Notes file.ArgumentsFileHandle noteHandle, const char keyName[
299CHAPTER 25The Fireworks Integration APIFWLaunch is a C shared library that gives authors of objects, commands, behaviors, and Property inspectors t
3CONTENTSPart IOverviewCHAPTER 1Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter 230Opening a document in DreamweaverWhen a user opens a file, Dreamweaver MX follows a series of steps to identify the document type based on
Chapter 25300FWLaunch.execJsInFireworks()AvailabilityDreamweaver 3, Fireworks 3DescriptionPasses the specified string of JavaScript to Fireworks for e
The Firework s Integration API 301• Error launching Fireworks process; the function does not launch a valid version of Fireworks (3 or later).• User c
Chapter 25302FWLaunch.optimizeInFireworks()AvailabilityDreamweaver 2, Fireworks 2DescriptionLaunches a Fireworks optimization session for the specifie
The Firework s Integration API 303ExampleThe following code checks whether Fireworks 3 is installed:if (FWLaunch.validateFireworks(3.0)){alert( "
Chapter 25304A simple Fireworks integration exampleThe following command asks Fireworks to prompt the user for his or her name and returns the name to
The Firework s Integration API 305alert("cancel clicked");} else {// We’re still going, ask Fireworks how it’s doingif (gProgressTrackerCook
Chapter 25306
307CHAPTER 26The Flash Objects APIThe Flash Objects API lets extension developers build objects that create simple Macromedia Flash content. This API
Chapter 26308• {pngFileName} is the output filename of a .png filename, which is expressed as a file:// URL. Optional.• {jpgFileName} is the output fi
The Flash Objects API 309SWFFile.getNaturalSize() DescriptionReturns the natural size of any Flash movie.ArgumentsfileNamefileName is a path to the Fl
31CHAPTER 3User Interfaces for ExtensionsMost extensions are built to receive information from the user through a user interface (UI). If you plan to
Chapter 26310ExampleCalling var params = SWFFile.readFile("file:///MyMac/test.swf") returns the following values in the parameters array:&qu
311CHAPTER 27The Database APIFunctions in the Database API let you manage database connections and access information that is stored in databases. In
Chapter 27312Note: This example uses the MMDB.getColumnList() function.function getDynamicBindings(elementNode){var ss = findSSrec(elementNode, LABEL_
The Database API 313Example//deletes a connectionfunction clickedDelete(){var selectedObj = dw.serverComponents.getSelectedNode();if (selectedObj &
Chapter 27314Note: These properties are the standard ones implemented by Dreamweaver MX. Developers can define their own connection types and add new
The Database API 315MMDB.getConnectionName()AvailabilityDreamweaver UltraDev 1DescriptionGets the connection name that corresponds to the specified co
Chapter 27316ReturnsA connection string that corresponds to the named connection.ExampleThe code var connectionString = MMDB.getConnectionString (&quo
The Database API 317In summary, Dreamweaver UltraDev 4 developers need to add a new entry to the XML, and Dreamweaver MX developers need to implement
Chapter 27318MMDB.getRdsPassword()AvailabilityDreamweaver UltraDev 4DescriptionGets the Remote Development Services (RDS) password.ArgumentsNone.Retur
The Database API 319MMDB.getRuntimeConnectionType()AvailabilityDreamweaver UltraDev 1DescriptionReturns the runtime connection type of the specified c
Chapter 332Consider the following basic guidelines as you design an extension UI:• If you want a name for your extension, place the name in the Title
Chapter 27320MMDB.hasConnectionWithName()AvailabilityDreamweaver UltraDev 4DescriptionDetermines whether a connection of a given name exists.Arguments
The Database API 321MMDB.popupConnection()AvailabilityDreamweaver MXDescriptionInvokes a connection dialog box. This function has the following three
Chapter 27322MMDB.setRdsUserName()AvailabilityDreamweaver UltraDev 4DescriptionSets the RDS user name.Argumentsusername is the name of a valid RDS use
The Database API 323MMDB.showOdbcDialog()AvailabilityDreamweaver UltraDev 4 (Windows only)DescriptionDisplays the System ODBC Administration dialog bo
Chapter 27324MMDB.testConnection()AvailabilityDreamweaver UltraDev 4DescriptionTests connection settings. Displays a modal dialog box that describes t
The Database API 325MMDB.getColumnAndTypeList()AvailabilityDreamweaver UltraDev 1DescriptionGets a list of columns and their types from an executed SQ
Chapter 27326ExampleThe code var columnArray = MMDB.getColumnList("EmpDB","Select * from Employees") returns the following array o
The Database API 327MMDB.getColumnsOfTable()AvailabilityDreamweaver UltraDev 1DescriptionGets a list of all the columns in the specified table.Argumen
Chapter 27328MMDB.getProcedures()AvailabilityDreamweaver MXDescriptionReturns an array of procedure objects that are associated with a named connectio
The Database API 329MMDB.getSPColumnList()AvailabilityDreamweaver UltraDev 1DescriptionGets a list of result set columns that are generated by a call
User Interfaces for Extensions 33In addition to letting you make extension UIs more closely match the built-in dialog boxes and panels, the new DOCTYP
Chapter 27330• paramNameArray is an array that contains a list of parameter names. You can use the MMDB.getSPParamsAsString() function to get the para
The Database API 331ReturnsAn array of parameter objects, each specifying the following set of properties:Examplevar paramNameObjs = MMDB.getSPParamet
Chapter 27332MMDB.getTables()AvailabilityDreamweaver UltraDev 1DescriptionGets a list of all the tables that are defined for the specified database. E
The Database API 333ExampleThe following example returns the views for a given connection value, CONN_LIST.getValue():var viewObjects = MMDB.getViews(
Chapter 27334MMDB.showSPResultset()AvailabilityDreamweaver UltraDev 1DescriptionDisplays a dialog box that has the results of executing the specified
The Database API 335• paramNameArray is an array that contains a list of parameter names. You can use the MMDB.getSPParamsAsString() function to get t
Chapter 27336
337CHAPTER 28The Database Connectivity APIAs a developer, you can create a new connection types and corresponding dialog boxes for new or existing ser
Chapter 28338Note: At runtime, Dreamweaver MX dynamically builds the list of connection types that are available to the user from the collection of di
The Database Connectivity API 339The applyConnection() function returns an HTML source within an include file. You can see examples of the HTML source
Chapter 334The following example illustrates the settings for an editable select list: <select name="travelOptions" style="width:250
Chapter 28340ReturnsA connection object that provides values for a particular combination of the properties that are listed in the following table. Th
The Database Connectivity API 341inspectConnection()AvailabilityDreamweaver UltraDev 4DescriptionDreamweaver calls this function, when the user edits
Chapter 28342ASP JavaScriptThe ASP and JavaScript include file should be named MyConnection1.asp, where MyConnection1 is the name of the connection. T
The Database Connectivity API 343The server behavior file includes this connection by using the relative file include statement, as shown in the follo
Chapter 28344Note: If you change the format of your include file or define an include file for a new server model, you need to map the connection para
345CHAPTER 29The JavaBeans APIThis chapter explains the APIs for JavaBeans, the MMJB*() functions are JavaScript hooks that invoke Java introspection
Chapter 29346MMJB.getEvents()AvailabilityDreamweaver UltraDev 4DescriptionIntrospects the JavaBeans class and returns its events. ArgumentspackageName
The JavaBeans API 347MMJB.getClassesFromPackage()AvailabilityDreamweaver UltraDev 4DescriptionReads all the JavaBeans classes from the package.Argumen
Chapter 29348
349CHAPTER 30The Source Control Integration APIThe Source Control Integration API lets you write shared libraries to extend the Macromedia Dreamweaver
User Interfaces for Extensions 35The following example creates a command that contains an editable select list using common JavaScript functions:<h
Chapter 30350Check In/Check Out is treated differently than the Design Notes feature; if the source control system supports it, the user cannot overri
The Source Control Integration API 351Argumentsvoid **connectionData, const char siteName[64]• connectionData is a handle to the data that the agent w
Chapter 30352bool SCS_GetRootFolder()DescriptionReturns the name of the root folder.Argumentsvoid *connectionData, char remotePath[], const int folder
The Source Control Integration API 353• itemList is a preallocated list of itemInfo structures: • numItems is the number of items that are allocated f
Chapter 30354• connectionData is a pointer to the agent’s data that passed into Dreamweaver during the Connect() call.• localPathList is the list of l
The Source Control Integration API 355To find out if an invocation of this function is a move or a rename, check the parent paths of the two input val
Chapter 30356bool SCS_SiteDeleted()DescriptionNotifies the DLL that the site has been deleted or that the site is no longer tied to this source contro
The Source Control Integration API 357Argumentschar menuItemList[][32], scFunction functionList[], scFunction enablerList[], const int numNewFeatures•
Chapter 30358Argumentsvoid *connectionData, const char *localPathList[], const char *remotePathList[], bool successList[], const int numItems• connect
The Source Control Integration API 359Argumentsvoid *connectionData, const char *remotePathList[], const char *localPathList[], bool successList[], co
Chapter 336Database controlsUsing Dreamweaver, you can extend the HTML <select> tag to create a database tree control. You can also add a variab
Chapter 30360• emailAddressList is a list of strings that corresponds to the users’ e-mail addresses. Each e-mail address string cannot exceed a maxim
The Source Control Integration API 361• connectionData is a pointer to the agent’s data that passed into Dreamweaver during the Connect() call.• remot
Chapter 30362• showColumnList is a list of Boolean values that correspond to the Design Note keys, which indicate whether Dreamweaver can display the
The Source Control Integration API 363• connectionData is a pointer to the agent’s data that passed into Dreamweaver during the Connect() call.• remot
Chapter 30364bool SCS_canCheckout()DescriptionReturns whether the Checkout menu item should be enabled.Argumentsvoid *connectionData, const char *remo
The Source Control Integration API 365• remotePathList is a mirrored list of remote file or folder path names.• numItems is the number of items in eac
Chapter 30366bool SCS_canDelete()DescriptionReturns whether the Delete menu item should be enabled.Argumentsvoid *connectionData, const char *remotePa
The Source Control Integration API 367ExampleTo get a group of files, Dreamweaver makes calls to the DLL in the following order:SCS_BeforeGet(connecti
Chapter 30368bool SCS_AfterPut()DescriptionDreamweaver calls this function after putting or checking in one or more files. This function lets the DLL
Part IVJavaScript APIUse any of the more than 600 core JavaScript functions available in Dreamweaver, which encapsulate the kinds of tasks users perfo
User Interfaces for Extensions 37Adding a variable grid controlThe variable grid control has the following attributes:The following example adds a sim
371CHAPTER 31The Dreamweaver JavaScript APIThe Macromedia Dreamweaver MX JavaScript API provides an extensive set of tools that are useful to extensio
Chapter 31372Functions that refer to Dreamweaver are methods of the dreamweaver object. For example, dreamweaver.closeDocument() is a function of the
The Dreamweaver JavaScript API 373dreamweaver.assetPalette.addToFavoritesFromSiteAssets()AvailabilityDreamweaver 4DescriptionAdds elements that are se
Chapter 31374dreamweaver.assetPalette.edit()AvailabilityDreamweaver 4DescriptionEdits selected elements with primary external editor or Custom Edit co
The Dreamweaver JavaScript API 375Note: If nothing is selected in the Assets panel, this function returns an array of one empty string.ExampleIf URLs
Chapter 31376dreamweaver.assetPalette.locateInSite()AvailabilityDreamweaver 4DescriptionSelects files that are associated with the selected elements i
The Dreamweaver JavaScript API 377dreamweaver.assetPalette.recreateLibraryFromDocument()AvailabilityDreamweaver 4DescriptionReplaces the deprecated li
Chapter 31378dreamweaver.assetPalette.renameNickname()AvailabilityDreamweaver 4DescriptionEdits the folder name or the file’s nickname by displaying a
The Dreamweaver JavaScript API 379dreamweaver.referencePalette.getFontSize() Availability Dreamweaver 4 Description Returns the current font size of t
Chapter 338Adding tree controlsTree controls display data in a hierarchical format and let users expand and collapse nodes in the tree. The mm:treecon
Chapter 31380Behavior functions Behavior functions let you add behaviors to and remove them from an object, find out which behaviors are attached to a
The Dreamweaver JavaScript API 381ReturnsA string that represents the function call (for example, "MM_swapImage(’document.Image1’,’document.Image
Chapter 31382ArgumentsNone.ReturnsA DOM object or null. This function returns null under the following circumstances:• When the current script is not
The Dreamweaver JavaScript API 383ExampleIf you write an action that can be applied only to a hypertext link (A HREF), you can use getBehaviorTag() as
Chapter 31384dreamweaver.behaviorInspector.getBehaviorAt()AvailabilityDreamweaver 3DescriptionGets the event/action pair at the specified position in
The Dreamweaver JavaScript API 385ArgumentsNone.ReturnsAn integer that represents the position of the selected action in the Behaviors panel, or –1 if
Chapter 31386ExampleAssuming the Behaviors panel setup shown in the following example, calling dreamweaver.behaviorInspector.moveBehaviorDown(2) swaps
The Dreamweaver JavaScript API 387dreamweaver.behaviorInspector.setSelectedBehavior()AvailabilityDreamweaver 3DescriptionSelects the action at the spe
Chapter 31388Clipboard functionsClipboard functions are related to cutting, copying, and pasting. On the Macintosh, some Clipboard functions can also
The Dreamweaver JavaScript API 389ReturnsNothing.dom.clipPaste()AvailabilityDreamweaver 3DescriptionPastes the contents of the Clipboard into the curr
User Interfaces for Extensions 39MM:TREECOLUMN tags have the following attributes:For readability, TREECOLUMN tags should follow immediately after the
Chapter 31390ArgumentsNone.ReturnsNothing.Enabler“dom.canClipPasteText()” on page 410ExampleIf the Clipboard contains <code>return true;</cod
The Dreamweaver JavaScript API 391dreamweaver.clipCut()AvailabilityDreamweaver 3DescriptionRemoves the selection from the active Document window, dial
Chapter 31392ReturnsA string that contains the contents of the Clipboard, if the Clipboard contains text (which can be HTML); otherwise, nothing.Examp
The Dreamweaver JavaScript API 393The following example shows the format of the CodeHints.xml file.<codehints><menugroup name="HTML Enti
Chapter 31394<menugroup>DescriptionEach menugroup tag corresponds to a type of menu. You can see the menu types that Dreamweaver MX defines by s
The Dreamweaver JavaScript API 395Example<description><![CDATA[ To add or remove tags and attributes, use the <a href="javascript:dw.
Chapter 31396Attributeslabel value {icon} {texticon}label is the string that Dreamweaver displays in the pop-up menu. value is the string that Dreamwe
The Dreamweaver JavaScript API 397pattern specifies the name of the function and its argument list. For methods, the pattern attribute describes the n
Chapter 31398labelArray is an array of strings. Each string is the text for a single menu item in the pop-up menu. valueArray is an array of strings,
The Dreamweaver JavaScript API 399casesensitive specifies whether the pattern is case-sensitive. The possible values for casesensitive are the Boolean
Contents4Part IIExtension APIsCHAPTER 5Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter 340Adding nodes To add a node to an existing tree control programmatically, set the innerHTML property of the mm:treecontrol tag or one of the
Chapter 31400dw.codeHints.showCodeHints()AvailabilityDreamweaver MXDescriptionDreamweaver calls this function when the user invokes the Edit > Show
The Dreamweaver JavaScript API 401ArgumentscommandFile, {commandArg1}, {commandArg2},...{commandArgN}• commandFile is a filename in the Configuration/
Chapter 31402Conversion functionsConversion functions convert tables to layers, layers to tables, and Cascading Style Sheets (CSS) styles to HTML mark
The Dreamweaver JavaScript API 403CSS Styles functionsCSS styles functions handle the application, removal, creation, and deletion of CSS styles. Meth
Chapter 31404ArgumentselementNode, {classOrID}• elementNode is an element node in the DOM. If elementNode is specified as an empty string (" &quo
The Dreamweaver JavaScript API 405dreamweaver.cssStylePalette.deleteSelectedStyle()AvailabilityDreamweaver 3DescriptionDeletes the style that is curre
Chapter 31406dreamweaver.cssStylePalette.editStyleSheet()AvailabilityDreamweaver 3DescriptionOpens the Edit Style Sheet dialog box.ArgumentsNone.Retur
The Dreamweaver JavaScript API 407ArgumentsNone.ReturnsThe object to which the style should be applied, or NULL if the target is the current selection
Chapter 31408dreamweaver.cssStylePalette.newStyle()AvailabilityDreamweaver 3DescriptionOpens the New Style dialog box.ArgumentsNone.ReturnsNothing.Dat
The Dreamweaver JavaScript API 409• The dataSource property is the simple name of the file in which the findDynamicSources() function is defined. For
41CHAPTER 4The Dreamweaver Document Object ModelIn Dreamweaver, the Document Object Model (DOM) is a critically important tool for extension builders.
Chapter 31410dom.canArrange()AvailabilityDreamweaver 3DescriptionChecks whether Dreamweaver can perform a Bring to Front or Move to Back operation.Arg
The Dreamweaver JavaScript API 411ReturnsA Boolean value that indicates whether the clipboard contains any content that can be pasted into Dreamweaver
Chapter 31412dom.canDecreaseRowspan()AvailabilityDreamweaver 3DescriptionChecks whether Dreamweaver can perform a Decrease Rowspan operation.Arguments
The Dreamweaver JavaScript API 413ArgumentsNone.ReturnsA Boolean value that indicates whether the current document is a frameset or within a frameset.
Chapter 31414dom.canInsertTableRows()AvailabilityDreamweaver 3DescriptionChecks whether Dreamweaver can perform an Insert Row(s) operation.ArgumentsNo
The Dreamweaver JavaScript API 415ArgumentsNone.ReturnsA Boolean value that indicates whether the selection is an adjacent grouping of table cells. do
Chapter 31416dom.canSelectTable()AvailabilityDreamweaver 3DescriptionChecks whether Dreamweaver can perform a Select Table operation.ArgumentsNone.Ret
The Dreamweaver JavaScript API 417ArgumentsNone.ReturnsA Boolean value that indicates whether the selection is within a frame.dom.canSplitTableCell()A
Chapter 31418dom.hasTracingImage()AvailabilityDreamweaver 3DescriptionChecks whether the document has a tracing image.ArgumentsNone.ReturnsA Boolean v
The Dreamweaver JavaScript API 419ArgumentsNone.ReturnsA Boolean value that indicates whether there is any content selected that can be copied to the
Chapter 442For example, to refer to the first image in the active document you can write dw.getDocumentDOM().images[0]. You can also store the documen
Chapter 31420dreamweaver.canExportCSS()AvailabilityDreamweaver 3DescriptionChecks whether Dreamweaver can perform an Export CSS Styles operation.Argum
The Dreamweaver JavaScript API 421DescriptionChecks whether Dreamweaver can perform an Open in Frame operation.ArgumentsNone.ReturnsA Boolean value th
Chapter 31422dreamweaver.canRevertDocument()AvailabilityDreamweaver 3DescriptionChecks whether Dreamweaver can perform a Revert (to the last-saved ver
The Dreamweaver JavaScript API 423dreamweaver.canSaveDocumentAsTemplate()AvailabilityDreamweaver 3DescriptionChecks whether Dreamweaver can perform a
Chapter 31424dreamweaver.canSelectAll()AvailabilityDreamweaver 3DescriptionChecks whether Dreamweaver can perform a Select All operation.ArgumentsNone
The Dreamweaver JavaScript API 425ReturnsA Boolean value: true if the selected style has a class selector; false otherwise.dreamweaver.cssStylePalette
Chapter 31426ArgumentsNone.ReturnsA Boolean value: true if the selection is a stylesheet node or a style definition within a stylesheet node and the s
The Dreamweaver JavaScript API 427dreamweaver.resultsPalette.canClipCopy()AvailabilityDreamweaver MXDescriptionChecks whether the current Results wind
Chapter 31428Return ValueA Boolean value: true if the contents can be displayed; false otherwise.dreamweaver.resultsPalette.canOpenInEditor()Availabil
The Dreamweaver JavaScript API 429DescriptionChecks whether you can edit the currently selected item and returns true or false so that you can enable
The Dreamweaver Document Object Model 43all tags/elements nodeType •parentNode •childNodes •tagName •attributes by nameinnerHTMLouterHTMLgetAttribute(
Chapter 31430dreamweaver.tagInspector.tagAfterEnabled()AvailabilityDreamweaver MXDescriptionChecks whether the dreamweaver.treeViewPalette.tagAfter()
The Dreamweaver JavaScript API 431ReturnsA Boolean value that indicates whether the Timelines panel has any animation bars or behaviors.dreamweaver.ti
Chapter 31432dreamweaver.timelineInspector.canRemoveFrame()AvailabilityDreamweaver 3DescriptionChecks whether Dreamweaver can perform a Remove Frame o
The Dreamweaver JavaScript API 433ArgumentsbrowserNamebrowserName is the name of a browser as defined in the Preview in Browser preferences. If omitte
Chapter 31434ReturnsA Boolean value that indicates whether all the following conditions are true:• A remote site has been defined.• If a Document wind
The Dreamweaver JavaScript API 435site.canConnect()AvailabilityDreamweaver 3DescriptionChecks whether Dreamweaver can connect to the remote site.Argum
Chapter 31436site.canLocateInSite()AvailabilityDreamweaver 3DescriptionDetermines whether Dreamweaver can perform a Locate in Local Site or Locate in
The Dreamweaver JavaScript API 437ReturnsA Boolean value that indicates whether any files are visible in the selected pane of the Site panel.site.canO
Chapter 31438site.canRefresh()AvailabilityDreamweaver 3DescriptionChecks whether Dreamweaver can perform a Refresh [Local | Remote] operation.Argument
The Dreamweaver JavaScript API 439ArgumentsNone.ReturnsA Boolean value: true if the site allows Check In/Check Out; false otherwise.site.canSelectNewe
Chapter 444Properties and methods of the document object The following table details the properties and methods of the document object that are taken
Chapter 31440site.canUncloak()AvailabilityDreamweaver MXDescriptionDetermines whether Dreamweaver can perform an uncloaking operation. ArgumentssiteOr
441External application functionsExternal application functions handle operations that are related to the Macromedia Flash MX application and to the b
442dreamweaver.getBrowserList()AvailabilityDreamweaver 3DescriptionGets a list of all the browsers in the Preview in Browser submenuArgumentsNone.Retu
443ReturnsA string that contains the name of the text editor that is suitable for presentation in the UI, not the full path.dreamweaver.getFlashPath()
444ReturnsAn array that contains a pair of strings. The first string in the pair is the name of the editor, and the second string is its location on t
445• help.xml The help.xml file maps book IDs to Help book names. For example, the following XML code maps the book ID for Dreamweaver MX Help to the
446dreamweaver.openWithBrowseDialog()AvailabilityDreamweaver 3DescriptionOpens the Select External Editor dialog box to let the user choose the applic
447dreamweaver.validateFlash()AvailabilityDreamweaver MXDescriptionDetermines whether Flash MX (or a later version) is installed on the local computer
448dom.convertToXHTML()AvailabilityDreamweaver MXDescriptionParses the HTML into a DOM tree, inserts missing items that are required for XHTML, cleans
449dom.getIsXHTMLDocument() AvailabilityDreamweaver MXDescriptionChecks a document (specifically, the <!DOCTYPE> declaration) to see whether it
The Dreamweaver Document Object Model 45Properties and methods of HTML tag objects Every HTML tag is represented by a JavaScript object. Tags are orga
450DescriptionOpens the Choose Folder dialog box with the specified label in the title bar.Arguments{titleBarLabel} {, directoryToStartIn}• titleBarLa
451ReturnsThe document object for the newly created document. This is the same value that dreamweaver.getDocumentDOM()returns.dreamweaver.createXHTMLD
452dreamweaver.createXMLDocument()AvailabilityDreamweaver MXDescriptionCreates and opens a new XML file, which is empty except for the XML directive.A
453Enabler“dreamweaver.canExportTemplateDataAsXML()” on page 420Exampleif(dreamweaver.canExportTemplateDataAsXML()){dreamweaver.exportTemplateDataAsXM
454dreamweaver.newDocumentDOM()AvailabilityDreamweaver MXDescriptionProvides access to the editable tree for a new, empty document. This works in the
455dreamweaver.newFromTemplate()AvailabilityDreamweaver 3DescriptionCreates a new document from the specified template. If no argument is supplied, th
456Note: This function cannot be called from Behavior action or object files because it causes an error.ArgumentsfileNamefileName is the filename to o
457dreamweaver.revertDocument()AvailabilityDreamweaver 3DescriptionReverts the specified document to the previously saved version.ArgumentsdocumentObj
458ArgumentsdocumentObject {, fileURL}• documentObject is the object at the root of a document’s DOM tree, which is the value that dreamweaver.getDocu
459dreamweaver.saveFrameset()AvailabilityDreamweaver 3DescriptionSaves the specified frameset, or opens the Save As dialog box if the frameset has not
Chapter 446Properties and methods of text objects Each contiguous block of text in an HTML document (for example, the text within a P tag) is represen
460Find/replace functions Find/replace functions handle find and replace operations. They cover basic functionality, such as finding the next instance
461ArgumentsNone.ReturnsNothing.dreamweaver.setUpComplexFind()AvailabilityDreamweaver 3DescriptionPrepares for an advanced text or tag search by loadi
462ExampleThe first statement in the following example sets up a tag search and specifies that the scope of the search should be four files. The secon
463dreamweaver.setUpFindReplace()AvailabilityDreamweaver 3DescriptionPrepares for a text or HTML source search by defining the search parameters and t
464ReturnsNothing.Enabler“dreamweaver.canShowFindDialog()” on page 424dreamweaver.showFindReplaceDialog()AvailabilityDreamweaver 3DescriptionOpens the
465dom.isDocumentInFrame()AvailabilityDreamweaver 4DescriptionIdentifies whether the current document is being viewed inside a frameset.ArgumentsNone.
466General editing functionsYou handle general editing functions in the Document window. These functions insert text, HTML, and objects; apply, change
467ReturnsNothing.dom.editAttribute()AvailabilityDreamweaver 3DescriptionDisplays the appropriate interface for editing the specified attribute. In mo
468dom.getFontMarkup()AvailabilityDreamweaver 3DescriptionGets the value of the specified attribute of the FONT tag for the current selection.Argument
469DescriptionGets the style of the selected list.ArgumentsNone.ReturnsA string that contains the tag that is associated with the list ("ul"
The Dreamweaver Document Object Model 47The dreamweaver and site objectsDreamweaver implements the standard objects that are accessible through the DO
470markupTagName is the name of the tag that you’re checking. It must be one of the following strings: "b", "cite", "code&quo
471The result appears in the Document window, as shown in the following figure:dom.insertObject()AvailabilityDreamweaver 3DescriptionInserts the speci
472ExampleThe following code inserts <b>130</b> into the current document:var theDOM = dreamweaver.getDocumentDOM();theDOM
473dom.outdent()AvailabilityDreamweaver 3DescriptionOutdents the selection.ArgumentsNone.ReturnsNothing.dom.removeCharacterMarkup()AvailabilityDreamwe
474dom.removeLink()AvailabilityDreamweaver 3DescriptionRemoves the hypertext link from the selection.ArgumentsNone.ReturnsNothing.dom.resizeSelection(
475ArgumentslinkHREFlinkHREF is the URL (document-relative path, root-relative path, or absolute URL) comprising the link. If this argument is omitted
476ArgumentsNone.ReturnsNothing.Enabler“dom.canShowListPropertiesDialog()” on page 416dom.setListTag()AvailabilityDreamweaver 3DescriptionSets the sty
477dom.setTextFormat()AvailabilityDreamweaver 4DescriptionSets the block format of the selected text.ArgumentsblockFormat blockFormat is a string that
478dreamweaver.editFontList()AvailabilityDreamweaver 3DescriptionOpens the Edit Font List dialog box.ArgumentsNone.ReturnsNothing.dreamweaver.getFontL
479ReturnsAn array of three Boolean values that indicates what the font supports. The first value indicates whether the font supports Bold, the second
Chapter 448The site objectThe site object has no properties. For information about the methods of the dreamweaver and site objects, see “The Dreamweav
480dreamweaver.getSystemFontList()AvailabilityDreamweaver 4DescriptionReturns a list of fonts for the system. This function can get either all fonts o
481ArgumentsNone.ReturnsA Boolean value that indicates whether the option is ondreamweaver.quitApplication()AvailabilityDreamweaver 3DescriptionQuits
482Argumentssource, title• source is a string that contains source code, which represents the dynamic data object. It is the same string that returned
483ReturnsNothing.Global document functionsGlobal document functions act on an entire document. They check spelling, check target browsers, set page p
484ReturnsNothing.Enabler“canAcceptCommand()” on page 62.dom.showPagePropertiesDialog()AvailabilityDreamweaver 3DescriptionOpens the Page Properties d
485ArgumentsNSorIE, tagObject• NSorIE must be either "NS 4.0" or "IE 4.0". The DOM and rules for nested references differ in Netsc
486dreamweaver.getPreferenceString()AvailabilityDreamweaver MXDescriptionLets you retrieve a string preference setting that you stored for an extensio
487dreamweaver.setPreferenceString()AvailabilityDreamweaver MXDescriptionAllows you to write a string preference setting for an extension, to be store
488dom.undo()AvailabilityDreamweaver 3DescriptionUndoes the previous step in the document.ArgumentsNone.ReturnsNothing.Enabler“dom.canUndo()” on page
489dreamweaver.playRecordedCommand()AvailabilityDreamweaver 3DescriptionPlays the recorded command in the active document.ArgumentsNone.ReturnsNothing
Part IIExtension APIsUnderstand about functions that you need to write when you create new objects, toolbars, tag editors, floating panels, server beh
490dreamweaver.stopRecording()AvailabilityDreamweaver 3DescriptionStops recording without prompting the user.ArgumentsNone.ReturnsNothing.Enabler“drea
491DescriptionCopies the specified history steps to the Clipboard. Dreamweaver warns the user of possible unintended consequences if the specified ste
492dreamweaver.historyPalette.getStepCount()AvailabilityDreamweaver 3DescriptionGets the number of steps in the History panel.ArgumentsNone.ReturnsAn
493dreamweaver.historyPalette.getUndoState()AvailabilityDreamweaver 3DescriptionGets the current undo state.ArgumentsNone.ReturnsThe position of the U
494ExampleThe following code saves the fourth, sixth, and eighth steps in the History panel as a command:dreamweaver.historyPalette.saveAsCommand([3,5
495HTML style functionsHTML style functions handle applying, creating, and deleting HTML styles. Methods of the dreamweaver.htmlStylePalette object ei
496dreamweaver.htmlStylePalette.editSelectedStyle()AvailabilityDreamweaver 3DescriptionOpens the Define HTML Style dialog box for the selected style.A
497ArgumentsNone.ReturnsNothing.dreamweaver.htmlStylePalette.setSelectedStyle()AvailabilityDreamweaver 3DescriptionSelects the specified style in the
498JavaScript debugger functionsThese commands customize the behavior of the Dreamweaver JavaScript Debugger. For more information about the Dreamweav
499ArgumentsdebuggerModule, outputFileName• debuggerModule is the name of a special Dreamweaver module file that implements the instrumentation API. T
Contents 5CHAPTER 12Floating Panels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125How float
500dreamweaver.debugDocument()AvailabilityDreamweaver 4DescriptionCreates the debug version of the current document and opens it in the browser. This
501dreamweaver.getIsAnyBreakpoints()AvailabilityDreamweaver 4DescriptionFinds any breakpoints that are set in any files.ArgumentsNone.ReturnsA Boolean
502ReturnsNothing.Keyboard functionsKeyboard functions mimic document navigation tasks that are accomplished by pressing the arrow, Backspace, Delete,
503dom.arrowRight()AvailabilityDreamweaver 3DescriptionMoves the insertion point right the specified number of times.Arguments{nTimes}, {bShiftIsDown}
504ReturnsNothing.dom.deleteKey()AvailabilityDreamweaver 3DescriptionEquivalent to pressing the Delete key the specified number of times. The exact be
505ReturnsNothing.dom.nextParagraph()AvailabilityDreamweaver 3DescriptionMoves the insertion point to the beginning of the next paragraph or skips mul
506Arguments{nTimes}, {bShiftIsDown}• nTimes is the number of pages that the insertion point is to move down. If this argument is omitted, the default
507dom.previousWord()AvailabilityDreamweaver 3DescriptionMoves the insertion point to the beginning of the previous word or skips multiple words if nT
508ReturnsNothing.dreamweaver.mapKeyCodeToChar()AvailabilityDreamweaver 4DescriptionTakes a key code as retrieved from the event object’s keyCode fiel
509ArgumentstoBackOrFronttoBackOrFront is the direction in which the hotspots are to move—that is front or back. ReturnsNothing.Enabler“dom.canArrange
51CHAPTER 5ObjectsObjects are designed to insert a specific string of code into a user’s document. An object appears in a tab in the Insert bar and in
510Argumentsleft, top, bottom, right• left is the new position of the left boundary of the layer or hotspot.• top is the new position of the top bound
511Layout environment functionsLayout environment functions handle operations that are related to the settings for working on a document. They affect
512Enabler “dom.hasTracingImage()” on page 418dom.loadTracingImage()AvailabilityDreamweaver 3DescriptionOpens the Select Image Source dialog box. If t
513DescriptionSets the origin of the ruler.ArgumentsxCoordinate, yCoordinate• xCoordinate is a value, expressed in pixels, on the horizontal axis.• yC
514ArgumentsopacityPercentageopacityPercentage must be a number between 0 and 100.ReturnsNothing.Enabler“dom.hasTracingImage()” on page 418ExampleThe
515ArgumentsNone.ReturnsA Boolean value that indicates whether the selection is currently being played with a plug-in.Enabler“dom.canStopPlugin()” on
516Layout view functionsLayout view functions handle operations that change the layout elements within a document. They affect table, column, and cell
517DescriptionCreates a layout table in the current document at the specified position and dimensions, either within an existing table or in the area
518dom.getClickedHeaderColumn()AvailabilityDreamweaver 4DescriptionIf the user clicked a menu button in the header of a table in Layout view, causing
519DescriptionDetermines whether a column is set to expand and contract automatically, depending on the document size. This function fails if the curr
Chapter 552Adding objects to the Insert barEach Object file has an associated 18 x 18 pixel image that appears in the Insert bar. If you create a larg
520ArgumentscolNumcolNum is the column from which to remove the spacer image.ReturnsNothing.dom.setColumnAutostretch()AvailabilityDreamweaver 4Descrip
521DescriptionPlaces the current document in Layout view if bShow is true.ArgumentsbShowbShow is a Boolean value that toggles the current document bet
522ArgumentsNone.ReturnsNothing.dom.detachFromTemplate()AvailabilityDreamweaver 3DescriptionDetaches the current document from its associated template
523dom.getIsLibraryDocument()AvailabilityDreamweaver 3DescriptionDetermines whether the document is a library itemArgumentsNone.ReturnsA Boolean value
524dom.insertLibraryItem()AvailabilityDreamweaver 3DescriptionInserts an instance of a library item into the document.ArgumentslibraryItemURLlibraryIt
525dom.removeEditableRegion()AvailabilityDreamweaver 3DescriptionRemoves an editable region from the document. If the editable region contains any con
526Enabler“dreamweaver.canExportTemplateDataAsXML()” on page 420Exampleif(dreamweaver.canExportTemplateDataAsXML()){dreamweaver.exportTemplateDataAsXM
527dreamweaver.getLiveDataMode()AvailabilityDreamweaver UltraDev 1DescriptionDetermines whether the Live Data window is currently visible.ArgumentsNon
528ReturnsAn array that contains the URL parameters for the current document. The array contains an even number of parameter strings. Each two element
529DescriptionSpecifies the error message to display if an error occurs while the liveDataTranslateMarkup() function executes in a translator. If the
Objects 53ContainerNone.Example<insertbar><category>DescriptionDefines a tab on the Insert bar. Attributesid, folder, {showif}ContentsCont
530You enter the URL parameters in name-value pairs. For example, if you reference the URL variables ID and Name in server scripts in your document, y
531ReturnsA Boolean value that indicates whether the menu needs to be updated. This function returns false only if “dreamweaver.notifyMenuUpdated()” o
532Path functionsPath functions get and manipulate the paths to various files and folders on a user’s hard disk. These functions determine the path to
533dreamweaver.getSiteRoot()AvailabilityDreamweaver 1.2DescriptionGets the local root folder (as specified in the Site Definition dialog box) for the
534Print functionThe print function lets the user print code from Code view.dreamweaver.PrintCode()AvailabilityDreamweaver MXDescriptionIn Windows, pr
535ArgumentsNone.ReturnsNothing.dom.selectParent()AvailabilityDreamweaver 3DescriptionSelects the parent of the current selection. Calling this functi
536ExampleThe following code wraps a link around the current selection:var theDOM = dw.getDocumentDOM();var theSel = theDOM.getSelectedNode();if (theS
537DescriptionOpens the Reports dialog box.ArgumentsNone.ReturnsNothing.Results window functionsResults window functions let you create a stand-alone
538• strIcon is the path to the icon to use. To display a built-in icon, use a value 1 through 10 instead of the fully qualified path name of the icon
539• strDesc is the description to go along with the entry.• iLineNo is the number of lines in file (optional).• iStartSel is the start of offset into
Chapter 554Attributesid, image, {disabledImage}, {showIf}, {enabled}, {checked}, {command}, {file}, {tag}, {name}ContentsNone.ContainerThe category ta
540• arrFilePaths is an array of file or folder paths to iterate through.• bRecursive is a Boolean value that indicates whether the iteration should b
541Working with the built-in Results panel groupThese functions produce output in the Results panel group. The Results panel group displays tabbed rep
542ReturnsNothing.Enabler“dreamweaver.resultsPalette.canClipCopy()” on page 427dreamweaver.resultsPalette.clipCut()AvailabilityDreamweaver MXDescripti
543ReturnsNothing.Enabler“dreamweaver.resultsPalette.canOpenInBrowser()” on page 427dreamweaver.resultsPalette.openInEditor()AvailabilityDreamweaver M
544ReturnsNothing.Enabler“dreamweaver.resultsPalette.canSelectAll()” on page 428Server debuggingDreamweaver can request files from ColdFusion and disp
545For example:<serverdebuginfo><context><template><![CDATA[/ooo/master.cfm]]></template><path><![CDATA[C:\serv
546Selection functions Selection functions get and set the selection in open documents. For information on getting or setting the selection in the Sit
547DescriptionGets the position of a specific node in the DOM tree, which is expressed as character offsets into the document’s source code. It is val
548dom.selectAll()AvailabilityDreamweaver 3DescriptionPerforms a Select All operation.Note: In most cases this function selects all the content in the
549ReturnsNothing.dom.setSelection()AvailabilityDreamweaver 3DescriptionSets the selection in the document.ArgumentsoffsetBegin, offsetEndThe argument
Objects 55image="image_path" Required. Specifies the path, relative to the Dreamweaver Configuration folder, to the icon file that appears o
550Examplefunction applyFormatToSelectedTable(){// get current selectionvar selObj = dw.getDocumentDOM().getSelectedNode();alternateRows(dwscripts.fin
551Server behavior functions Server behavior functions let you manipulate the Server Behaviors panel, which you can display by selecting Window > S
552Server model functionsIn Macromedia Dreamweaver MX, each document has an associated document type. For dynamic document types, Dreamweaver also ass
553ExampleIf the user creates a site and specifies that the testing server is on the local computer and that the root folder is named "employeeap
554ReturnsA string, the value of which is the name of the folder.dom.serverModel.getServerExtension()AvailabilityDreamweaver UltraDev 4, deprecated in
555ExampleThe following snippet from a participant file illustrates a translator searchPatterns tag:<searchPatterns whereToSearch="comment&quo
556ReturnsA JavaScript object that contains a variety of information that is specific to the current server model.dom.serverModel.getServerLanguage()A
557Note: In addition to letting you call this function from the JavaScript layer, Dreamweaver MX calls this function when the user changes the encodin
558Site functionsSite functions handle operations that are related to files in the site files or site map. These functions let you perform the followi
559ArgumentsNone.ReturnsNothing.Enabler“site.canAddLink()” on page 433site.addLinkToNewFile()AvailabilityDreamweaver 3DescriptionOpens the Link to New
Chapter 556command="script " Required unless the command attribute is specified. Do not specify both the command and the file attributes for
560site.changeLink()AvailabilityDreamweaver 3DescriptionOpens the Select HTML File dialog box to let the user select a new file for the link.Arguments
561ArgumentsscopeOfCheckscopeOfCheck specifies where links will be checked. It must be "document", "selection", or "site"
562site.cloak()AvailabilityDreamweaver MXDescriptionCloaks the current selection in the Site panel or the specified folder.ArgumentssiteOrURLsiteOrURL
563site.editColumns()DescriptionIn Dreamweaver MX, displays the Edit Sites dialog box; in Dreamweaver 4 and earlier versions, displays the Edit Sites
564homepage="C:\Documents and Settings\jlondon\Desktop\DWServer\Untitled-2.htm" pagesperrow="200" columnwidth="125" show
565site.findLinkSource()AvailabilityDreamweaver 3DescriptionOpens the file that contains the selected link or dependent file, and highlights the text
566DescriptionReturns the access method that is used for all files on the current site’s application server. The current site is the site that is asso
567ExampleA call to site.getCheckOutUser() might return "denise (deniseLaptop)". If no check-out name is specified, only the login is return
568ReturnsA Boolean value that indicates whether the remote site is connected.Enabler“site.canConnect()” on page 435site.getCurrentSite()AvailabilityD
569site.getLocalPathToFiles()AvailabilityDreamweaver MXDescriptionDetermines the disk path to the local files that are defined for the current site. T
Objects 57The Objects APIThis section describes the functions in the Objects API. You must define either the insertObject() function or the objectTag(
570site.getSites()AvailabilityDreamweaver 3DescriptionGets a list of the defined sites.ArgumentsNone.ReturnsAn array of strings that represents the na
571site.isCloaked()AvailabilityDreamweaver MXDescriptionDetermines whether the current selection in the Site panel or the specified folder is cloaked.
572Enabler“site.canMakeEditable()” on page 436site.makeNewDreamweaverFile()AvailabilityDreamweaver 3DescriptionCreates a new Dreamweaver file in the S
573site.newSite()AvailabilityDreamweaver 3DescriptionOpens the Site Definition dialog box for a new, unnamed site.ArgumentsNone.ReturnsNothing.site.op
574ReturnsNothing.Enabler“site.canPut()” on page 437site.recreateCache()AvailabilityDreamweaver 3DescriptionRecreates the cache for the current site.A
575ReturnsA Boolean value that indicates whether a remote site has been defined and, if the server type is Local/Network, whether the drive is mounted
576Enabler“canAcceptCommand()” on page 62site.saveAsImage()AvailabilityDreamweaver 3DescriptionOpens the Save As dialog box to let the user save the s
577site.selectNewer()AvailabilityDreamweaver 3DescriptionSelects all files that are newer on the specified side of the Site panel.ArgumentswhichSidewh
578site.setConnectionState()AvailabilityDreamweaver 3DescriptionSets the connection state of the current site.ArgumentsbConnectedbConnected is a Boole
579site.setLayout()AvailabilityDreamweaver 3DescriptionOpens the Site Map Layout pane of the Site Definition dialog box.ArgumentsNone.ReturnsNothing.E
Chapter 558isDomRequired()DescriptionDetermines whether the object requires a valid DOM to operate. If this function returns true or if the function i
580site.synchronize()AvailabilityDreamweaver 3DescriptionOpens the Synchronize Files dialog box.ArgumentsNone.ReturnsNothing.Enabler“site.canSynchroni
581ReturnsNothing.Enabler“site.canUncloak()” on page 440site.undoCheckOut()AvailabilityDreamweaver 3DescriptionRemoves the lock files that are associa
582Snippets panel functionsUsing Macromedia Dreamweaver MX, web developers can edit and save reusable blocks of code in the Snippets panel and retriev
583dreamweaver.snippetPalette.newFolder()AvailabilityDreamweaver MXDescriptionCreates a new folder with the default name untitled and puts an text box
584DescriptionApplies selected snippet from Panel to the current selection.ArgumentsNone.ReturnsNothing.Enabler“dw.snippetpalette.canInsert()” on page
585String manipulation functionsString manipulation functions help you get information about a string as well as convert a string from Latin 1 encodin
586dreamweaver.latin1ToNative()AvailabilityDreamweaver 2DescriptionConverts a string in Latin 1 encoding to the native encoding on the user’s computer
587Dreamweaver calls the seven callback functions on the following occasions:1 Dreamweaver calls openTagBegin() for each opening tag (for example, <
588ExampleThe following sequence of steps provide an example of how to use the dreamweaver.scanSourceString() function.Steps1 You create an implementa
589dom.formatSelection()AvailabilityDreamweaver MXDescriptionApplies Dreamweaver automatic syntax formatting to the selected content (the same as choo
Objects 59Example function insertObject() { var theForm = document.forms[0];var nameVal = theForm.firstField.value;var passwordVal = theForm.secondFie
590dom.isSelectionValid()AvailabilityDreamweaver 4DescriptionDetermines whether a selection is valid, meaning it is currently synchronized with the De
591ReturnsNothing.dom.source.arrowLeft()AvailabilityDreamweaver 4DescriptionMoves the insertion point to the left in the current line of the Source vi
592Arguments{nTimes}, {bShiftIsDown}• nTimes is the number of lines that the insertion point is to move. If the nTimes argument is omitted, the defaul
593DescriptionPlaces the insertion point at the end of the current line. If content is already selected, this function extends the selection to the en
594ArgumentsNone.ReturnsA pair of integers that represent offsets from the beginning of the source document. The first integer is the beginning of the
595dom.source.insert()DescriptionInserts the specified string into the source code at the specified offset from the beginning of the source file. If t
596dom.source.pageDown()AvailabilityDreamweaver 4DescriptionMoves the insertion point down the source view document, page by page. If content is alrea
597Arguments{nTimes}, {bShiftIsDown}• nTimes is the number of words that the insertion point is to move. If nTimes is omitted, the default is 1.• bShi
598DescriptionScrolls the Source view down line by line without moving the insertion point.ArgumentsnTimesnTimes is the number of lines to scroll. If
599ReturnsNothing.dom.source.scrollTopFile()AvailabilityDreamweaver 4DescriptionScrolls the Source view to the top of the document file without moving
Contents6CHAPTER 20JavaScript Debugger Modules. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243How the JavaScript Debugger
Chapter 560windowDimensions()DescriptionSets specific dimensions for the Options dialog box. If this function is not defined, the window dimensions ar
600dom.source.startOfDocument()AvailabilityDreamweaver 4DescriptionPlaces the insertion point at the beginning of the source view document. If content
601ReturnsNothing.dom.source.wrapSelection()AvailabilityDreamweaver 4DescriptionInserts the text of startTag before the current selection and the text
602Table editing functionsTable functions add and remove table rows and columns, change column widths and row heights, convert measurements from pixel
603dom.decreaseRowspan()AvailabilityDreamweaver 3DescriptionDecreases the row span by oneArgumentsNone.ReturnsNothing.Enabler“dom.canDecreaseRowspan()
604dom.doDeferredTableUpdate()AvailabilityDreamweaver 3DescriptionIf the Faster Table Editing option is selected in the General preferences, it forces
605DescriptionIncreases the row span by one.ArgumentsNone.ReturnsNothing.Enabler“dom.canDecreaseRowspan()” on page 412dom.insertTableColumns()Availabi
606dom.mergeTableCells()AvailabilityDreamweaver 3DescriptionMerges the selected table cells.ArgumentsNone.ReturnsNothing.Enabler“dom.canMergeTableCell
607ArgumentstdOrThtdOrTh must be either "td" or "th".ReturnsNothing.dom.setTableColumns()AvailabilityDreamweaver 3DescriptionSets
608dom.splitTableCell()AvailabilityDreamweaver 3DescriptionSplits the current table cell into the specified number of rows or columns. If one or both
609DescriptionChecks the .vtm files to see if a tag editor has been defined for the tag. If so, the editor for that tag pops up and accepts the start
61CHAPTER 6CommandsCommands can be used to perform almost any kind of edit to a user’s current document, other open documents, or to any HTML document
610ArgumentsNone.ReturnsNone.dreamweaver.tagLibrary.getTagLibraryDOM()AvailabilityDreamweaver MXDescriptionGiven the URL of a filename.vtm file, this
611dreamweaver.tagLibrary.importDTDOrSchema()AvailabilityDreamweaver MXDescriptionImports a DTD or schema file from a remote server into the Tag Libra
612Tag inspector functionsThese JavaScript functions manipulate the generic Tag inspector panel, specifically the context menus in the Tag inspector p
613ReturnsNothing.Enabler“dreamweaver.tagInspector.tagAfterEnabled()” on page 430dreamweaver.tagInspector.deleteTags()AvailabilityDreamweaver MXDescri
614Timeline functions Timeline functions act on timelines. They add, remove, and change objects in a timeline; add behaviors, frames, and keyframes to
615Enabler“dreamweaver.timelineInspector.canAddKeyFrame()” on page 431dreamweaver.timelineInspector.addObject()AvailabilityDreamweaver 3DescriptionAdd
616DescriptionGets the state of the Autoplay option for the current timeline.ArgumentsNone.ReturnsA Boolean value that indicates whether the Autoplay
617dreamweaver.timelineInspector.removeBehavior()AvailabilityDreamweaver 3DescriptionRemoves the selected behavior from the timeline.ArgumentsNone.Ret
618dreamweaver.timelineInspector.removeObject()AvailabilityDreamweaver 3DescriptionRemoves the currently selected object from the timeline.ArgumentsNo
619ArgumentsbAutoplaybAutoplay is a Boolean value that indicates whether to turn on the Autoplay option.ReturnsNothing.dreamweaver.timelineInspector.s
Chapter 662The Command APIThe custom functions in the Command API are not required.canAcceptCommand()DescriptionDetermines whether the command is appr
620Toggle functionsToggle functions get and set various options either on or off.dom.getEditNoFramesContent()AvailabilityDreamweaver 3DescriptionGets
621DescriptionDetermines whether auto-indenting is on in the Code view of the Document window.ArgumentsNone.ReturnsReturns true if auto-indenting is o
622dom.getShowInvalidHTML()AvailabilityDreamweaver 4DescriptionDetermines whether invalid HTML code is currently highlighted in the Code view of the D
623ArgumentsNone.ReturnsA Boolean value that indicates whether layer borders are visible (true) or not (false).dom.getShowLineNumbers()AvailabilityDre
624DescriptionGets the current state of the View > Table Borders option.ArgumentsNone.ReturnsA Boolean value that indicates whether table borders a
625dom.getSnapToGrid()AvailabilityDreamweaver 3DescriptionGets the current state of the View > Grid > Snap To option.ArgumentsNone.ReturnsA Bool
626DescriptionTurns the Prevent Layer Overlaps option on (true) or off (false).ArgumentsbPreventLayerOverlapsReturnsNothing.dom.setShowFrameBorders()A
627dom.setShowInvalidHTML()AvailabilityDreamweaver 4DescriptionTurns highlighting of invalid HTML code on or off in the Code view of the Document wind
628ArgumentsbShowLayerBordersReturnsNothing.dom.setShowLineNumbers()AvailabilityDreamweaver 4DescriptionShows or hides the line numbers in the Code vi
629dom.setShowTableBorders()AvailabilityDreamweaver 3DescriptionTurns the View > Table Borders option on (true) or off (false).ArgumentsbShowTableB
Commands 63isDomRequired()DescriptionDetermines whether the command requires a valid DOM to operate. If this function returns true or if the function
630ArgumentsbShowbShow is a Boolean value that indicates whether the line numbers should be visible (true) or not (false).ReturnsNothing.dom.setSnapTo
631dreamweaver.htmlInspector.getShowAutoIndent()AvailabilityDreamweaver 4DescriptionDetermines whether auto-indenting is on in the Code view of the Co
632ReturnsReturns true if syntax coloring is on.dreamweaver.htmlInspector.getShowWordWrap()AvailabilityDreamweaver 4DescriptionDetermines whether word
633dreamweaver.htmlInspector.setShowLineNumbers()AvailabilityDreamweaver 4DescriptionShows or hides the line numbers in the Code view of the Code insp
634dreamweaver.setHideAllFloaters()AvailabilityDreamweaver 3DescriptionTurns on either the Hide Floating panels option (true) or the Show Floating pan
635ArgumentsNone.ReturnsA Boolean value that indicates whether hidden files are visible in the site map (true) or not (false).site.getShowPageTitles()
636site.setShowHiddenFiles()AvailabilityDreamweaver 3DescriptionTurns the Show Files Marked as Hidden option in the site map on (true) or off (false).
637Toolbar functionsThe following JavaScript functions let you get and set the visibility of toolbars and toolbar labels, obtain the labels of toolbar
638Examplevar dom = dw.getDocumentDOM();if(dom != null && dom.getToolbarVisibility("myEditbar") == false){dom.setToolbarVisibility(&
639ArgumentsNone.ReturnsAn array of all toolbar IDs.Examplevar tb_ids = new Array();tb_ids = dom.getToolbarIdArray();dom.getToolbarLabel()Availability
Chapter 664windowDimensions()DescriptionSets specific dimensions for the Parameters dialog box. If this function is not defined, the window dimensions
640dom.getShowToolbarIconLabels()AvailabilityDreamweaver MXDescriptionDetermines whether labels for buttons are visible in the current document window
641DescriptionDepending on the value of the argument, this function makes locked regions editable or noneditable. By default, locked regions are noned
642The default value of the argument is false. Dreamweaver automatically uses the untranslated source for subsequent calls to dw.getSelection(), dw.se
643DescriptionDetermines which view is visible.ArgumentsNone.Returns"design", "code", or "split", depending on the visib
644ReturnsNothing.Exampleif(dw.isMDI()){dw.cascade()}dreamweaver.getActiveWindow()AvailabilityDreamweaver 3DescriptionGets the document in the active
645The floaterName values for built-in Dreamweaver panels are the strings to the right of the panel names in the following list: Assets = "assets
646• "textView" if the Text view is in focus• "html" if the Code inspector is in focus• floaterName, if bAllowFloaters is true and
647Returnstrue if Dreamweaver is in MDI mode; false if Dreamweaver is in classic mode.Exampleif(dw.isMDI()){dw.cascade()}dreamweaver.minimizeRestoreAl
648ArgumentsfloaterName, bIsVisible• floaterName is the name of a floating panel. If floaterName does not match one of the built-in panel names, Dream
649ArgumentsviewStringviewString is the view to bring to the top of the Document window; it can be one of the following values: "design" or
Commands 65A simple command exampleThe following command converts the selected text to all lowercase characters. The command is very simple. It does n
650ReturnsNothing.Exampleif(dw.isMDI()){dw.tileHorizontally()}dreamweaver.tileVertically()AvailabilityDreamweaver MX (Windows only)DescriptionIn MDI m
651dreamweaver.updateReference()AvailabilityDreamweaver 4DescriptionUpdates the Reference floating panel. If the Reference floating panel is not visib
652
653APPENDIX ADeprecated JavaScript API functionsThe functions in this appendix are deprecated JavaScript API functions. Deprecated functions work but
Appendix A654ArgumentsNone.ReturnsA string that represents the event. This is the same string that is passed as an argument (event) to the canAcceptBe
655• Dreamweaver does not return references for unnamed objects. If an object does not contain either a NAME or an ID attribute, Dreamweaver returns &
Appendix A656Exampledreamweaver.getObjectTags("document", "IMG"), depending on the contents of the active document, might return a
657ArgumentsNone.ReturnsA string that contains the path of the library item, which is expressed as a file:// URL.dreamweaver.libraryPalette.newFromDoc
Appendix A658ReturnsNothing.dreamweaver.nodeToOffsets()AvailabilityDreamweaver 2, deprecated in 3 in favor of dom.nodeToOffsets().DescriptionGets the
659dreamweaver.popupCommand()AvailabilityDreamweaver 2, deprecated in 3 in favor of dreamweaver.runCommand().DescriptionExecutes the specified command
Chapter 666Adding commands to the Commands menuDreamweaver automatically adds any files that are inside the Configuration/Commands folder to the botto
Appendix A660ArgumentsNone.ReturnsNothing.dreamweaver.templatePalette.renameSelectedTemplate()AvailabilityDreamweaver 3, deprecated in Dreamweaver 4 i
661INDEXAaction files 135addBehavior() 380, 614addDebugContextData() 544addDynamicSource() 193addFrame() 614addItem() 537addKeyframe() 614addL
Index662assetPalette.edit() 374assetPalette.getSelectedCategory() 374assetPalette.getSelectedItems() 374assetPalette.getSelectedView() 375assetPal
Index 663JS_ValueToBoolean() 256JS_ValueToDouble() 255JS_ValueToInteger() 255JS_ValueToObject() 256JS_ValueToString() 255MM_ConfigFileExists() 2
Index664category tag 53changeLink() 560changeLinkSitewide() 559changeObject() 615checkbox object 42checkbutton tag 53, 84checked attribute 91c
Index 665names 324connectivity functions overview 337conventions, in book 12conversion functions 402convertLayersToTable() 402convertTablesToLaye
Index666MMDB.showResultset() 333MMDB.showSPResultset() 334MMDB.showSPResultsetNamedParams() 334MMDB.testConnection() 324database connection dialog
Index 667doesColumnHaveSpacer() 517doesGroupHaveSpacers() 517DOM. See Document Object Model.dom.addBehavior() 380dom.addSpacerToColumn() 516dom.al
Index668dom.getRulerOrigin() 511dom.getRulerUnits() 511dom.getSelectedEditableRegion() 523dom.getSelectedNode() 546dom.getSelection() 546dom.getS
Index 669dom.setColumnAutostretch() 520dom.setEditNoFramesContent() 625dom.setHideAllVisualAids() 625dom.setLayerTag() 510dom.setLinkHref() 474do
67CHAPTER 7Menu CommandsMenu commands make menus more flexible and dynamic. As with regular commands, menu commands can be used to perform almost any
Index670dreamweaver.assetPalette.addToFavoritesFromSiteAssets() 373dreamweaver.assetPalette.addToFavoritesFromSiteWindow() 373dreamweaver.assetPalet
Index 671dreamweaver.findNext() 460dreamweaver.getActiveWindow() 644dreamweaver.getBehaviorElement() 381dreamweaver.getBehaviorEvent() 653dreamwea
Index672dreamweaver.loadSitesFromPrefs() 558dreamweaver.minimizeRestoreAll() 647dreamweaver.nativeToLatin1() 586dreamweaver.newDocumentDOM() 454dr
Index 673dreamweaver.snippetPalette.remove() 584dreamweaver.snippetPalette.rename() 584dreamweaver.startDebugger() 501dreamweaver.startRecording()
Index674dw.canExportTemplateDataAsXML() 420dw.canFindNext() 420dw.canOpenInFrame() 420dw.canPlayRecordedCommand() 421dw.canPopupEditTagDialog() 4
Index 675dw.getPrimaryView() 646dw.getRecentFileList() 454dw.getRedoText() 488dw.getSecondaryBrowser() 444dw.getShowDialogsOnInsert() 480dw.getSh
Index676dw.resultsPalette.canSelectAll() 428dw.revertDocument() 457dw.runCommand() 400dw.saveAll() 457dw.saveDocument() 457dw.saveDocumentAs() 4
Index 677Dynamic Data dialog box 191dynamic menussample code 75user experience 67dynamic templates 27Dynamic Text dialog box 191EEdit Format List
Index678Ffile (field) object 42file attribute 90file I/O API 271DWfile.copy() 271DWfile.createFolder() 272DWfile.exists() 272DWfile.getAttribute
Index 679getAttribute() 45getAttributes() 273getAutoplay() 615getBehavior() 380getBehaviorAt() 384getBehaviorCount() 384getBehaviorElement() 38
Chapter 7685 Dreamweaver calls the receiveArguments() function, if defined, in the selected Menu Commands file to let the command process any argument
Index680getModificationDateObj() 275GetNote() 293GetNoteLength() 294GetNotesKeyCount() 294GetNotesKeys() 294getObjectRefs() 654getObjectTags()
Index 681getToolbarIdArray() 638getToolbarLabel() 639getToolbarVisibility() 637getTracingImageOpacity() 511getTranslatedAttribute() 45getTranslat
Index682insertObject() 51, 58, 471insertTableColumns() 605insertTableRows() 605insertText tag 166insertText() 471inspectBehavior() 141inspectC
Index 683locked content, inspecting 239*LOCKED* keyword 239MmakeCellWidthsConsistent() 519makeEditable() 571makeNewDreamweaverFile() 572makeNewFo
Index684MMNotes.getSiteRootForFile() 290MMNotes.getVersionName() 290MMNotes.getVersionNum() 290MMNotes.localURLToFilePath() 290MMNotes.open() 291
Index 685outputResultsPanel.debugWindow.addDebugContextData() 544outputResultsPanel.openInBrowser() 542outputResultsPanel.openInEditor() 543outputR
Index686removeSpacerFromColumn() 519removeTimeline() 618renameSelectedItem() 657renameSelectedTemplate() 660renameSelection() 575renameTimeline()
Index 687SCS_IsConnected() 351SCS_IsRemoteNewer() 362SCS_ItemExists() 355SCS_NewFolder() 354SCS_Put() 353SCS_Rename() 354SCS_SetDesignNotes() 3
Index688setInterval() 42setLayerTag() 510setLayout() 579setLinkHref() 474setLinkTarget() 475setLinkVisibility() 579setListBoxKind() 475setListT
Index 689Shutdown folder 22site object 48methods of 371properties of 47site reports 103, 541site.addLinkToExistingFile() 558site.addLinkToNewFi
Menu Commands 69commandButtons()DescriptionDefines the buttons that should appear on the right side of the Options dialog box and their behavior when
Index690snapTracingImageToSelection() 514snippet tag, attributes 582snippetPalette.editSnippet() 583snippetPalette.insert() 583snippetPalette.inse
Index 691Tag C hoo ser 111Tag D ialo g ex t ens ion sdefinition 20Tag editor APIapplyTag() 118inspectTag() 117validateTag() 117Tag editor func
Index692updateCurrentPage() 525updatePages() 526updatePattern tag 174updatePatterns tag 173updateReference() 651URL property 44user configuratio
Contents 7CHAPTER 29The JavaBeans API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345CHAPTER 30The S
Chapter 770isCommandChecked()DescriptionDetermines whether to display a check mark next to the menu itemArguments{arg1}, {arg2},...{argN}If it is a dy
Menu Commands 71ReturnsDreamweaver expects nothing.Examplefunction receiveArguments(){var styleName = arguments[0];if (styleName == "(None)"
Chapter 772windowDimensions()DescriptionSets specific dimensions for the Parameters dialog box. If this function is not defined, the window dimensions
Menu Commands 73A simple menu commandThe following menu command is associated with two menu items: Undo and Redo. It checks the arguments attribute of
Chapter 774In this command, the receiveArguments() function processes the arguments and executes the command. More complex menu commands might call di
Menu Commands 75A simple dynamic menuThe following menu command generates the Preview in Browser submenu, and it launches the current file (or the sel
Chapter 776 { var bHaveDocument; if (dw.getFocus() == ’site’) bHaveDocument = site.getSelection().length > 0; else bHaveDoc
77CHAPTER 8ToolbarsYou can create a toolbar for Macromedia Dreamweaver MX simply by creating a file that defines the toolbar and placing that file in
Chapter 878How toolbars behaveIn Windows, Dreamweaver MX toolbars generally act the same as standard Windows toolbars. Dreamweaver MX toolbars have th
To o l b a r s 79How toolbar commands workWhen Dreamweaver draws a toolbar, the following events occur: 1 For each toolbar control item, Dreamweaver d
Contents8Report Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536Results window f
Chapter 880After the declarations, the file consists of a single toolbarset tag, which contains any number of the following tags: toolbar, itemref, se
To o l b a r s 81initiallyVisible="true" or "false". Specifies whether the toolbar should be visible the first time Dreamweaver lo
Chapter 882<include/>DescriptionLoads toolbar items from the specified file before continuing to load the current file. Toolbar items that are d
To o l b a r s 83showIf="script" Specifies that this item appears only on the toolbar if the specified script returns true. For example, you
Chapter 884Attributesid, image, tooltip, command, {showif}, {disabledImage}, {overimage}, {label}, {file}, {domRequired}, {enabled}, {update}, {argume
To o l b a r s 85<radiobutton>DescriptionA radio button is exactly the same as a check button, except that when it is off, it appears as a raise
Chapter 886Example<MENUBUTTON ID="DW_CodeNav"image="Toolbars/images/MM/codenav.gif"disabledImage="Toolbars/images/MM/coden
To o l b a r s 87Example<COMBOBOX ID="Address_URL"width="300"tooltip="Address"label="Address: "file="T
Chapter 888Example<colorpicker id="Color_Example"image="Toolbars/images/colorpickerIcon.gif"disabledImage="Toolbars/images
To o l b a r s 89disabledImage="image_path"Optional. Dreamweaver ignores the disabledImage attribute for items other than buttons, check but
Part IOverviewOrient yourself to concepts fundamental to writing Dreamweaver extensions These concepts include understanding available API categories,
Chapter 890menuID="menu_id"Required for menu buttons and combo buttons, unless you specify getMenuID() in an associated command file. Dreamw
To o l b a r s 91checked="script"Required for check buttons and radio buttons. Dreamweaver ignores the checked attribute for other types of
Chapter 892The following table lists the possible values for update_frequency_list, from least to most frequent. If you do not specify the update attr
To o l b a r s 93arguments="argument_list" Optional. The arguments attribute specifies the comma-separated list of arguments to pass to ther
Chapter 894If you specified the arguments attribute for this toolbar item in the toolbars.xml file, those arguments are passed next. If you did not sp
To o l b a r s 95The name getDynamicContent() is a misnomer because this function should be used even if the list of entries in the menu is fixed. For
Chapter 896Examplefunction getMenuID(){var dom = dw.getDocumentDOM();var menuID = ’’;if (dom){var view = dom.getView();var focus = dw.getFocus();if (v
To o l b a r s 97Examplefunction getUpdateFrequency(){return onSelChange”;}isCommandChecked()DescriptionReturns a value that specifies whether the ite
Chapter 898ExampleThe following example determines which item, if any, should be checked in a pop-up menu of paragraph formats and CSS styles.function
To o l b a r s 99receiveArguments()DescriptionProcesses any arguments that are passed from a toolbar item. The receiveArguments() function is equivale
Comments to this Manuals