MACROMEDIA DREAMWEAVER MX 2004-DREAMWEAVER API Reference
MACROMEDIA DREAMWEAVER MX 2004-DREAMWEAVER API Reference

MACROMEDIA DREAMWEAVER MX 2004-DREAMWEAVER API Reference

Dreamweaver api reference
Table of Contents

Advertisement

Quick Links

Dreamweaver API Reference

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DREAMWEAVER MX 2004-DREAMWEAVER API and is the answer not in the manual?

Questions and answers

Summary of Contents for MACROMEDIA DREAMWEAVER MX 2004-DREAMWEAVER API

  • Page 1 Dreamweaver API Reference...
  • Page 2 If you access a third-party website mentioned in this guide, then you do so at your own risk. Macromedia provides these links only as a convenience, and the inclusion of the link does not imply that Macromedia endorses or accepts any responsibility for the content on those third-party sites.
  • Page 3: Table Of Contents

    CONTENTS CHAPTER 1: Introduction ..........25 Background.
  • Page 4 DWfile.setAttributes() ......... . . 41 DWfile.write() .
  • Page 5 CHAPTER 6: Flash Integration ........71 How Flash elements work .
  • Page 6 MMDB.getSPParameters() ........97 MMDB.getSPParamsAsString() .
  • Page 7 bool SCS_UndoCheckout() ........128 int SCS_GetNumCheckedOut() .
  • Page 8 dreamweaver.showDynamicDataDialog() ......150 dreamweaver.showPreferencesDialog() ......151 dreamweaver.showTagChooser() .
  • Page 9 Menu functions..........170 dreamweaver.getMenuNeedsUpdating() .
  • Page 10 dom.setShowFrameBorders() ........189 dom.setShowGrid() ..........190 dom.setShowHeadView() .
  • Page 11 Window functions..........207 dom.getFocus().
  • Page 12 site.getAppServerPathToFiles() ........229 site.getAppURLPrefixForSite() ........230 site.getCheckOutUser() .
  • Page 13 CHAPTER 14: Document ......... . 249 Conversion functions .
  • Page 14 dreamweaver.getObjectTags() (deprecated) ......273 dreamweaver.getPreferenceInt() ........274 dreamweaver.getPreferenceString() .
  • Page 15 dreamweaver.assetPalette.locateInSite() ......297 dreamweaver.assetPalette.newAsset()....... . 297 dreamweaver.assetPalette.newFolder().
  • Page 16 dom.getIsLibraryDocument() ........319 dom.getIsTemplateDocument() ........319 dom.getSelectedEditableRegion() .
  • Page 17 dom.serverModel.getServerExtension() (deprecated)....340 dom.serverModel.getServerIncludeUrlPatterns()..... . . 340 dom.serverModel.getServerInfo() .
  • Page 18 dom.setTracingImagePosition()........360 dom.setTracingImageOpacity()........360 dom.snapTracingImageToSelection() .
  • Page 19 CHAPTER 18: Code ..........379 Code functions .
  • Page 20 dom.setTextAlignment() ......... 401 dom.setTextFieldKind() .
  • Page 21 dom.source.scrollLineUp() ........420 dom.source.scrollPageDown().
  • Page 22 dom.canSetLinkHref() ......... . 439 dom.canShowListPropertiesDialog().
  • Page 23 site.canCheckIn() ..........456 site.canCheckOut() .
  • Page 24 Contents...
  • Page 25: Chapter 1 Introduction

    Introduction The Dreamweaver API Reference describes two application programming interfaces (APIs) that let you perform various supporting tasks when developing Macromedia Dreamweaver MX 2004 extensions and adding program code to your Dreamweaver web pages. These two APIs are the utility API and the JavaScript API. The utility API contains subsets of related functions that let you perform specific types of tasks.
  • Page 26: Background

    To communicate with other developers who are involved in writing extensions, you might want to join the Dreamweaver extensibility newsgroup. You can access the website for this newsgroup at www.macromedia.com/go/extending_newsgrp/. New functions in Dreamweaver MX 2004 The following new functions have been added to the Dreamweaver MX 2004 JavaScript API.
  • Page 27: Document

    Document The following new Global document functions have been added to the Document chapter. Global document • “dom.hideInfoMessagePopup()” on page 268 • “dreamweaver.showTargetBrowsersDialog()” on page 276 • “dom.showInfoMessagePopup()” on page 269 Design The following new CSS, HTML, and Table Editing functions have been added to the Design chapter.
  • Page 28: Page Content

    Page content In the Page Content chapter, the following Timeline functions have been removed: Timeline functions • dreamweaver.timelineInspector.addBehavior() • dreamweaver.timelineInspector.addFrame() • dreamweaver.timelineInspector.addKeyframe() • dreamweaver.timelineInspector.addObject() • dreamweaver.timelineInspector.addTimeline() • dreamweaver.timelineInspector.changeObject() • dreamweaver.timelineInspector.getAutoplay() • dreamweaver.timelineInspector.getCurrentFrame() • dreamweaver.timelineInspector.getLoop() • dreamweaver.timelineInspector.recordPathOfLayer() • dreamweaver.timelineInspector.removeBehavior() • dreamweaver.timelineInspector.removeFrame() •...
  • Page 29: Code

    Code In the Code chapter, the following JavaScript Debugger and Tag Inspector functions have been removed: JS Debugger functions • dreamweaver.debugDocument() • dreamweaver.startDebugger() • dreamweaver.getIsAnyBreakpoints() • dreamweaver.removeAllBreakpoints() Tag Inspector functions • dreamweaver.tagInspector.deleteTags() • dreamweaver.tagInspector.deleteTagsEnabled() • dreamweaver.tagInspector.editTagName() • dreamweaver.tagInspector.editTagNameEnabled() • dreamweaver.tagInspector.tagAfter() •...
  • Page 30: Errata

    The Enabler functions have been organized into their own chapter with cross references to their relevant API functions. Errata A current list of known issues can be found in the Extensibility section of the Dreamweaver Support Center (www.macromedia.com/go/extending_errata). Conventions used in this guide The following typographical conventions are used in this guide: •...
  • Page 31: Part I Utility Apis

    PART I Utility APIs Learn about the Macromedia Dreamweaver MX 2004 utility functions that you can use to access local and web-based files, work with Macromedia Fireworks MX 2004, and Macromedia Flash MX 2004 objects, manage database connections, create new database connection types, access JavaBeans fscomponents, and integrate Dreamweaver with various source control systems.
  • Page 33: Chapter 2 The File I/O Api

    CHAPTER 2 The File I/O API Macromedia Dreamweaver MX 2004 includes a C shared library called DWfile, which gives authors of objects, commands, behaviors, data translators, floating panels, and Property inspectors the ability to read and write files on the local file system. This chapter describes the File I/O API and how to use it.
  • Page 34: Dwfile.copy()

    DWfile.copy() Availability Dreamweaver 3. Description This function copies the specified file to a new location. Arguments originalURL copyURL • argument, which is expressed as a file:// URL, is the file you want to copy. originalURL • argument, which is expressed as a file:// URL, is the location where you want to copyURL save the copied file.
  • Page 35: Dwfile.exists()

    DWfile.exists() Availability Dreamweaver 2. Description This function tests for the existence of the specified file. Arguments fileURL • argument, which is expressed as a file:// URL, is the requested file. fileURL Returns A Boolean value: if the file exists; otherwise. true false Example...
  • Page 36: Dwfile.getmodificationdate()

    Example The following code gets the attributes of the mydata.txt file and displays an alert box if the file is read only: var fileURL = "file:///c|/temp/mydata.txt"; var str = DWfile.getAttributes(fileURL); if (str && (str.indexOf("R") != -1)){ alert(fileURL + " is read only!"); DWfile.getModificationDate() Availability Dreamweaver 2.
  • Page 37: Dwfile.getcreationdate()

    DWfile.getCreationDate() Availability Dreamweaver 4. Description This function gets the time when the file was created. Arguments fileURL • argument, which is expressed as a file:// URL, is the file for which you are fileURL checking the creation time. Returns A string that contains a hexadecimal number that represents the number of time units that have elapsed since some base time.
  • Page 38: Dwfile.getmodificationdateobj()

    DWfile.getModificationDateObj() Availability Dreamweaver MX. Description This function gets the JavaScript object that represents the time when the file was last Date modified. Arguments fileURL • argument, which is expressed as a file:// URL, is the file for which you are fileURL checking the time of the most recent modification.
  • Page 39: Dwfile.read()

    Arguments folderURL, {constraint} • argument is the folder for which you want a contents list, which is expressed as folderURL a file:// URL, plus an optional wildcard file mask. Valid wildcards are asterisks (*), which match one or more characters, and question marks (?), which match a single character. •...
  • Page 40: Dwfile.remove()

    DWfile.remove() Availability Dreamweaver 3. Description This function moves the specified file to the Recycling Bin or Trash. Arguments fileURL • argument, which is expressed as a file:// URL, is the file you want to remove. fileURL Returns A Boolean value: value if the operation succeeds;...
  • Page 41: Dwfile.setattributes()

    DWfile.setAttributes() Availability Dreamweaver MX. Description This function sets the system-level attributes of a particular file. Arguments fileURL strAttrs • argument, which is expressed as a file:// URL, identifies the file for which you fileURL are setting the attributes. • argument specifies the system-level attributes for the file that is identified by the strAttrs argument.
  • Page 42: Dwfile.write()

    DWfile.write() Availability Dreamweaver 2. Description This function writes the specified string to the specified file. If the specified file does not yet exist, it is created. Arguments fileURL text {mode} • argument, which is expressed as a file:// URL, is the file to which you are writing. fileURL •...
  • Page 43: Chapter 3 The Http Api

    CHAPTER 3 The HTTP API Extensions are not limited to working within the local file system. Macromedia Dreamweaver MX 2004 provides a mechanism to get information from and send information to a web server by using hypertext transfer protocol (HTTP). This chapter describes the HTTP API and how to use it.
  • Page 44: The Http Api

    The HTTP API This section details the functions that are methods of the object. MMHttp MMHttp.clearServerScriptsFolder() Availability Dreamweaver MX. Description Deletes the _mmServerScripts folder—and all its files—under the root folder for the current site, which can be local or remote. The _mmServerScripts folder is located in Configuration/ Connections/Scripts/ /_mmDBScripts folder.
  • Page 45: Mmhttp.cleartemp()

    MMHttp.clearTemp() Description This function deletes all the files in the Configuration/Temp folder, which is located in the Dreamweaver application folder. Arguments None. Returns Nothing. Example The following code, when saved in a file within the Configuration/Shutdown folder, removes all the files from the Configuration/Temp folder when the user quits Dreamweaver: <html>...
  • Page 46 Returns An object that represents the reply from the server. The property of this object is a string data that contains the location where the file is saved, which is expressed as a file:// URL. Normally, property of the object contains the status code that is received from the server. statusCode However, if a disk error occurs while Dreamweaver is saving the file on the local drive, the property contains an integer that represents one of the following error codes if the...
  • Page 47: Mmhttp.getfilecallback()

    See MMHttp.getFile() statusCode a list of possible error codes. MMHttp.getText() Availability Macromedia Dreamweaver UltraDev 4, enhanced in Dreamweaver MX. Description Retrieves the contents of the document at the specified URL. Arguments {serverScriptsFolder} •...
  • Page 48 • argument is an optional string that names a particular folder— serverScriptsFolder relative to the Configuration folder on the application server—from which you want to retrieve server scripts. To retrieve the scripts, Dreamweaver uses the appropriate transfer protocol (such as FTP, WebDAV, or Remote File System). Dreamweaver copies these files to the _mmServerScripts subfolder under the root folder for the current site.
  • Page 49 • argument is the data to post. If the third argument is dataToPost "application/x-www- or omitted, must be form-encoded according to section 8.2.1 form-urlencoded" dataToPost of the RFC 1866 specification (available at www.faqs.org/rfcs/rfc1866.html). • argument, which is optional, is the content type of the data to post. If contentType omitted, this argument defaults to "application/x-www-form-urlencoded"...
  • Page 50 • argument is the data to be posted. If the third argument is dataToPost "application/x- or omitted, must be form-encoded according to section 8.2.1 www-form-urlencoded" data of the RFC 1866 specification (available at www.faqs.org/rfcs/rfc1866.html). • argument, which is optional, is the content type of the data to be posted. If contentType omitted, this argument defaults to "application/x-www-form-urlencoded"...
  • Page 51: Chapter 4: The Design Notes Api

    CHAPTER 4 The Design Notes API Macromedia Dreamweaver MX 2004, Macromedia Fireworks MX 2004, and Macromedia Flash MX 2004 give web designers and developers a way to store and retrieve extra information about documents—information such as review comments, change notes, or the source file for a GIF or JPEG—in files that are called Design Notes.
  • Page 52: The Design Notes Javascript Api

    The Design Notes JavaScript API All functions in the Design Notes JavaScript API are methods of the object. MMNotes MMNotes.close() Description This function closes the specified Design Notes file and saves any changes. If all the key/value pairs are removed, Dreamweaver deletes the Design Notes file. If it is the last Design Notes file in the _notes folder, Dreamweaver also deletes the folder.
  • Page 53: Mmnotes.get()

    MMNotes.get() Description This function gets the value of the specified key in the specified Design Notes file. Arguments fileHandle keyName • argument is the file handle that returns. fileHandle MMNotes.open() • argument is a string that contains the name of the key. keyName Returns A string that contains the value of the key.
  • Page 54: Mmnotes.getsiterootforfile()

    Example The following code might be used in a custom floating panel to display the Design Notes information for the active document: var noteHandle = MMNotes.open(dw.getDocumentDOM().URL); var theKeys = MMNotes.getKeys(noteHandle); var noteString = ""; var theValue = ""; for (var i=0; i < theKeys.length; i++){ theValue = MMNotes.get(noteHandle,theKeys[i]);...
  • Page 55: Mmnotes.getversionnum()

    MMNotes.getVersionNum() Description This function gets the version number of the MMNotes shared library. Arguments None. Returns A string that contains the version number. MMNotes.localURLToFilePath() Description This function converts the specified file:// URL to a local drive path. Arguments fileURL • argument, which is expressed as a file:// URL, is the path to a local file.
  • Page 56: Mmnotes.remove()

    MMNotes.remove() Description The function removes the specified key (and its value) from the specified Design Notes file. Arguments fileHandle keyName • argument is the file handle that the function returns. fileHandle MMNotes.open() • argument is a string that contains the name of the key to remove. keyName Returns A Boolean value:...
  • Page 57: The Design Notes C Api

    The Design Notes C API In addition to the JavaScript API, the MMNotes shared library also exposes a C API that lets other applications create Design Notes files. It is not necessary to call these C functions directly if you use the MMNotes shared library in Dreamweaver because the JavaScript versions of the functions call them.
  • Page 58: Bool Getnote()

    BOOL GetNote() Description This function gets the value of the specified key in the specified Design Notes file. Arguments FileHandle noteHandle const char keyName[64] char* valueBuf int valueBufLength • argument is the file handle that the function returns. noteHandle OpenNotesFile() •...
  • Page 59: Int Getnoteskeycount()

    int GetNotesKeyCount() Description This function gets the number of key/value pairs in the specified Design Notes file. Arguments FileHandle noteHandle • argument is the file handle that the function returns. noteHandle OpenNotesFile() Returns An integer that represents the number of key/value pairs in the Design Notes file. BOOL GetNotesKeys() Description This function gets a list of all the keys in a Design Notes file.
  • Page 60: Bool Getsiterootforfile()

    BOOL GetSiteRootForFile() Description This function determines the site root for the specified Design Notes file. Arguments const char* filePath char* siteRootBuf int siteRootBufMaxLen {InfoPrefs* infoPrefs} • argument is the file://URL of the file for which you want the site root. filePath •...
  • Page 61: Bool Getversionnum()

    BOOL GetVersionNum() Description This function gets the version number of the MMNotes shared library, which lets you determine whether certain functions are available. Arguments char* versionNumBuf int versionNumBufMaxLen • argument is the buffer where the version number is stored. versionNumBuf •...
  • Page 62: Filehandle Opennotesfilewithopenflags()

    FileHandle OpenNotesFilewithOpenFlags() Description This function opens the Design Notes file that is associated with the specified file or creates one if none exists. You can open the file in read-only mode. Arguments const char* localFileURL {BOOL bForceCreate} {BOOL bReadOnly} • argument, which is expressed as a file:// URL, is a string that contains the localFileURL path to the main file with which the Design Notes file is associated.
  • Page 63: Chapter 5: Fireworks Integration

    Fireworks Integration FWLaunch is a C shared library that gives authors of objects, commands, behaviors, and Property inspectors the ability to communicate with Macromedia Fireworks MX 2004. Using FWLaunch, you write JavaScript to open the Fireworks user interface (UI) and provide commands to Fireworks through its own JavaScript API documented in the Extending Fireworks manual.
  • Page 64: Fwlaunch.bringfwtofront()

    FWLaunch.bringFWToFront() Availability Dreamweaver 3, Fireworks 3. Description This function brings Fireworks to the front if it is running. Arguments None. Returns Nothing. FWLaunch.execJsInFireworks() Availability Dreamweaver 3, Fireworks 3. Description This function passes the specified JavaScript, or a reference to a JavaScript file, to Fireworks to execute.
  • Page 65: Fwlaunch.getjsresponse()

    FWLaunch.getJsResponse() Availability Dreamweaver 3, Fireworks 3. Description This function determines whether Fireworks is still executing the JavaScript passed to it by the function, whether the script completed successfully, or FWLaunch.execJsInFireworks() whether an error occurred. Arguments progressTrackerCookie • argument is the cookie object that the progressTrackerCookie function returns.
  • Page 66: Fwlaunch.maylaunchfireworks()

    // got a valid response! alert("Nice to meet you, " + response); window.close(); doneFlag = true; FWLaunch.mayLaunchFireworks() Availability Dreamweaver 2, Fireworks 2. Description This function determines whether it is possible to open a Fireworks optimization session. Arguments None. Returns A Boolean value that indicates whether the platform is Windows or the Macintosh; if it is the Macintosh, the value indicates if another Fireworks optimization session is already running.
  • Page 67: Fwlaunch.validatefireworks()

    Returns Zero, if a Fireworks optimization session successfully opens for the specified image; otherwise, a nonzero error code that indicates one of the following errors occurred: • Invalid usage, which indicates that the argument, the argument, or both, are docURL imageURL specified as a value or an empty string.
  • Page 68 A simple FWLaunch communication example The following command asks Fireworks to prompt the user for their name and returns the name to Dreamweaver: <html> <head> <title>Prompt in Fireworks</title> <meta http-equiv="Content-Type" content="text/html; ¬ charset=iso-8859-1"> <script> function commandButtons(){ return new Array("Prompt", "promptInFireworks()", "Cancel", ¬ "readyToCancel()", "Close","window.close()");...
  • Page 69 window.close(); alert("cancel clicked"); } else { // We're still going, ask Fireworks how it's doing if (gProgressTrackerCookie != null) response = ¬ FWLaunch.getJsResponse(gProgressTrackerCookie); if (response == null) { // still waiting for a response, call us again in 1/2 a // second checkOneMoreTime();...
  • Page 70 Chapter 5: Fireworks Integration...
  • Page 71: Chapter 6 Flash Integration

    Flash elements are packaged as SWC files. A SWC file is a compiled component movie clip that is generated by Flash for use by Macromedia and third-party products. Dreamweaver can make these components available to users through the Insert bar, Insert menu, or a toolbar. You create...
  • Page 72: Adding A Flash Element To The Insert Bar

    Adding a Flash element to the Insert Bar As with other objects, you add a Flash element to the Insert Bar using the tag. However, a button tag for a Flash element must have both attributes to add the element button file command...
  • Page 73: Swffile.createfile()

    SWFFile.createFile() Description This function generates a new Flash Object file with the specified template and array of parameters. It also creates a GIF, PNG, JPEG, and MOV version of the title if filenames for those formats are specified. If you want to specify an optional parameter that follows optional parameters that you do not want to include, you need to specify empty strings for the unused parameters.
  • Page 74: Swffile.getnaturalsize()

    Returns A string that contains one of the following values: • means the call completed successfully. "noError" • means the specified template file is invalid or not found. "invalidTemplateFile" • means at least one of the specified output filenames is invalid. "invalidOutputFile"...
  • Page 75: Swffile.getobjecttype()

    SWFFile.getObjectType() Description This function returns the Flash object type; the value that passed in the parameter when dwType function created the file. SWFFile.createFile() Arguments fileName • argument, which is expressed as a file:// URL, is a path to a Flash Object file. fileName This file is usually a SWF file.
  • Page 76 Chapter 6: Flash Integration...
  • Page 77: Chapter 7 The Database Api

    Database API functions are used at design time when users are building web applications, not at runtime when the web application is deployed. You can use these functions in any extension. In fact, the Macromedia Dreamweaver MX 2004 Server Behavior, Data Format, and Data Sources API functions all use these database functions.
  • Page 78: Database Connection Functions

    if (ss.ParamArray != null) { for (var i = 0; i < ss.ParamArray.length; i++) { pa[i] = new Array(); pa[i][0] = ss.ParamArray[i].name; pa[i][1] = ss.ParamArray[i].value; var statement = replaceParamsWithVals(statement, pa, serverModel); bindingsAndTypeArray = MMDB.getColumnAndTypeList(connName, statement); return bindingsAndTypeArray; Database connection functions Database connection functions let you make and manage any connection, including the Dreamweaver-provided ADO, ColdFusion, and JDBC connections.
  • Page 79: Mmdb.getcoldfusiondsnlist()

    MMDB.getColdFusionDsnList() Availability Dreamweaver UltraDev 4. Description This function gets the ColdFusion data source names (DSNs) from the site server, using the functions. getRDSUserName() getRDSPassword() Arguments None. Returns An array that contains the ColdFusion DSNs that are defined on the server for the current site. MMDB.getConnection() Availability Dreamweaver UltraDev 4, enhanced in Dreamweaver MX.
  • Page 80: Mmdb.getconnectionlist()

    Property Description includePattern Regular expression used to find the file include statement on the page during Live Data and Preview In Browser Array of page variable names and their corresponding values used during Live variables Data and Preview In Browser Used to restrict the metadata that appears (for more information, see catalog “MMDB.getProcedures()”...
  • Page 81: Mmdb.getconnectionstring()

    • Connection 1 has the following properties: ConnectionString="jdbc:inetdae:velcro-qa-5:1433?database=pubs" DriverName="com.inet.tds.TdsDriver" • Connection 2 has the following properties: ConnectionString="jdbc:inetdae:velcro-qa-5:1433?database=pubs" DriverName="com.inet.tds.TdsDriver2" The connection strings for Connection 1 and Connection 2 are the same. Connection 2 connects to a more recent version of the driver.
  • Page 82: Mmdb.getdrivername()

    Example The code returns different var connectionString = MMDB.getConnectionString ("EmpDB") strings for an ADO or JDBC connection. • For an ADO connection, the following string can return: "dsn=EmpDB;uid=;pwd="; • For a JDBC connection, the following string can return: "jdbc:inetdae:192.168.64.49:1433?database=pubs&user=JoeUser&¬ password=joesSecret" MMDB.getDriverName() Availability Dreamweaver UltraDev 1.
  • Page 83: Mmdb.getlocaldsnlist()

    In summary, Dreamweaver UltraDev 4 developers need to add a new entry to the XML, and Dreamweaver MX (or later), developers need to implement a new dialog box. Description This function gets JDBC Drivers and respective URL templates. Arguments None. Returns An array that contains JDBC drivers that have been detected on the user’s system and their respective URL templates, if they are specified.
  • Page 84: Mmdb.getrdspassword()

    MMDB.getRDSPassword() Availability Dreamweaver UltraDev 4. Description This function gets the Remote Development Services (RDS) password (for use with ColdFusion connections). Arguments None. Returns A string that contains the RDS password. MMDB.getRDSUserName() Availability Dreamweaver UltraDev 4. Description This function gets the RDS user name (for use with ColdFusion connections). Arguments None.
  • Page 85: Mmdb.getruntimeconnectiontype()

    • argument, which is optional, is a string that contains a list of urlParams name=value expressions, which are separated by ampersand (&) characters. You must not enclose values with quotes. Some characters, such as the space in the value , need to be encoded. Hello World The following example shows a valid sample argument that you can pass to MMDB.getRemoteDsnList()
  • Page 86: Mmdb.hasconnectionwithname()

    Arguments connName • argument is a connection name that is specified in the Connection Manager. It connName identifies the connection string that Dreamweaver should use to make a database connection to a live data source. Returns A user name string that is associated with the connection name. Example The statement might return...
  • Page 87: Mmdb.needtorefreshcoldfusiondsnlist()

    MMDB.needToRefreshColdFusionDsnList() Availability Dreamweaver MX. Description This function tells the Connection Manager to empty the cache and get the ColdFusion data source list from the application server the next time a user requests the list. Arguments None. Returns Nothing. MMDB.popupConnection() Availability Dreamweaver MX.
  • Page 88: Mmdb.setrdspassword()

    • argument is a reference to an existing Connection object. connRec • argument is a Boolean value. bDuplicate Returns Nothing. The defined connection dialog box appears. MMDB.setRDSPassword() Availability Dreamweaver UltraDev 4. Description This function sets the RDS password. Arguments password •...
  • Page 89: Mmdb.showconnectionmgrdialog()

    Returns Nothing. The ColdFusion Administrator dialog box appears. MMDB.showConnectionMgrDialog() Availability Dreamweaver UltraDev 1. Description This function displays the Connection Manager dialog box. Arguments Nothing. Returns Nothing. The Connection Manager dialog box appears. MMDB.showOdbcDialog() Availability Dreamweaver UltraDev 4 (Windows only). Description This function displays the System ODBC Administration dialog box or the ODBC Data Source Administrator dialog box.
  • Page 90: Mmdb.showrestrictdialog()

    Returns An object that contains the new values in the properties. If either username password property is not defined, it indicates that the user cancelled the dialog box. MMDB.showRestrictDialog() Availability Dreamweaver UltraDev 4. Description This function displays the Restrict dialog box. Arguments catalog, schema •...
  • Page 91: Database Access Functions

    Database access functions Database access functions let you query a database. For the collection of functions that manage a database connection, see “Database connection functions” on page The following list describes some of the arguments that are common to the functions that are available: •...
  • Page 92: Mmdb.getcolumnlist()

    MMDB.getColumnList() Availability Dreamweaver UltraDev 1. Description This function gets a list of columns from an executed SQL statement. SELECT Arguments connName, statement • argument is a connection name that is specified in the Connection Manager. It connName identifies the connection string that Dreamweaver should use to make a database connection to a live data source.
  • Page 93: Mmdb.getcolumnsoftable()

    Returns An array of objects, one object for each column. Each object defines the following three properties for the column with which it is associated. Property Name Description Name of the column (for example, name price Data type of the column (for example, datatype small money Defined size of the column (for example,...
  • Page 94: Mmdb.getprimarykeys()

    Example The statement returns the MMDB.getColumnsOfTable ("EmpDB","Employees"); following strings: ["EmpID", "FirstName", "LastName"] MMDB.getPrimaryKeys() Availability Dreamweaver MX. Description This function returns the column names that combine to form the primary key of the named table. A primary key serves as the unique identifier for a database row and consists of at least one column.
  • Page 95 Returns An array of procedure objects where each procedure object has the following set of three properties: Property Name Description Name of the schema that is associated with the object. schema* This property identifies the user that is associated with the stored procedure in the SQL database that the getProcedures() function accesses.
  • Page 96: Mmdb.getspcolumnlist()

    MMDB.getSPColumnList() Availability Dreamweaver UltraDev 1. Description This function gets a list of result set columns that are generated by a call to the specified stored procedure. Arguments connName, statement, paramValuesArray • argument is a connection name that is specified in the Connection Manager. It connName identifies the connection string that Dreamweaver should use to make a database connection to a live data source.
  • Page 97: Mmdb.getspparameters()

    Arguments connName, statement, paramNameArray, paramValuesArray • argument is a connection name that is specified in the Connection Manager. It connName identifies the connection string that Dreamweaver should use to make a database connection to a live data source. • argument is the name of the stored procedure that returns the result set when statement it executes.
  • Page 98: Mmdb.getspparamsasstring()

    Returns An array of parameter objects, each specifying the following set of properties: Property name Description Name of the parameter (for example, name @@lolimit datatype Datatype of the parameter (for example, smallmoney Direction of the parameter: direction -The parameter is used for input only. –The parameter is used for output only.
  • Page 99: Mmdb.gettables()

    Example The code MMDB.getSPParamsAsString ("EmpDB","getNewEmployeesMakingAtLeast") return a string of form name startDate;direction:in;datatype:date, salary;direction:in;datatype:integer In this example, the stored procedure, , has two parameters: getNewEmployeesMakingAtLeast . For , the direction is and the data type is . For startDate Salary startDate date , the direction is and the data type is...
  • Page 100: Mmdb.showresultset()

    Arguments connName • argument is a connection name that is specified in the Connection Manager. It connName identifies the connection string that Dreamweaver should use to make a database connection to a live data source. Returns An array of view objects where each object has three properties: , and .
  • Page 101: Mmdb.showspresultset()

    Example The following code displays the results of the executed SQL statement: MMDB.showResultset("EmpDB","Select EmpName,EmpFirstName,Age ¬ from Employees") MMDB.showSPResultset() Availability Dreamweaver UltraDev 1. Description This function displays a dialog box that contains the results of executing the specified stored procedure. The dialog box displays a tabular grid in which the header provides column information that describes the result set.
  • Page 102: Mmdb.showspresultsetnamedparams()

    MMDB.showSPResultsetNamedParams() Availability Dreamweaver UltraDev 1. Description This function displays a dialog box that contains the result set of the specified stored procedure. The dialog box displays a tabular grid in which the header provides column information that describes the result set. If the connection string or the stored procedure is invalid, an error appears.
  • Page 103: Chapter 8: The Database Connectivity Api

    As a developer, you can create new connection types and corresponding dialog boxes for new or existing server models for Macromedia Dreamweaver MX 2004. Then, when a user sets up a site to start building pages, he or she creates a new connection object after selecting the particular type of connection that you created.
  • Page 104 The Configuration/ServerModels folder has HTML files that define each server model. Inside each HTML file is the function, which returns the name of getServerModelFolderName() the folder that is associated with the server model. The following example shows the function for the ASP JavaScript document type: function getServerModelFolderName() return "ASP_JS";...
  • Page 105: The Connection Api

    The Connection API To create a new type of connection, including the dialog box with which users interact, you must implement the following three functions: , and findConnection() inspectConnection() . You write these three functions and include them in the JavaScript applyConnection() implementation file that is associated with your new connection type (see Step 2 “Create a...
  • Page 106 argument is the HTML source for a connection. htmlSource Returns A connection object that provides values for a particular combination of the properties that are listed in the following table. The properties for which this function returns a value depend on the document type.
  • Page 107: Applyconnection()

    inspectConnection() Availability Dreamweaver UltraDev 4. Description Dreamweaver calls this function to initialize the dialog box data for defining a connection when the user edits an existing connection. This process lets Dreamweaver populate the dialog box with the appropriate connection information. Argument parameters argument is the same object that the...
  • Page 108: The Generated Include File

    The generated include file The include file that generates declares all the properties of a applyConnection() connection.The filename for the include file is the connection name and has the file extension that is defined for the server model associated with the current site. Note: Connections are shared, so set the value to .
  • Page 109: The Definition File For Your Connection Type

    The server behavior file includes this connection by using the statement, as shown in cfinclude the following example: <cfinclude template="Connections/MyConnection1.cfm"> The JSP include file should be named MyConnection1.jsp, where MyConnection1 is the name of your connection. The following example is the include file for a JDBC connection to a database: <% // Filename="Connection_jdbc_conn1.htm"...
  • Page 110 Note: 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 parameters with the Dreamweaver UI, Live Data, and Preview In Browser. The following sample EDML file, which is associated with the default ASP JS server model, maps all connection page variables with their respective live values before sending the page to the server.
  • Page 111: Chapter 9: The Javabeans Api

    Java introspection calls for JavaBeans support. These functions get class names, methods, properties, and events from the JavaBeans, which can appear in the Dreamweaver user interface (UI). To use these JavaScript functions and let Macromedia Dreamweaver MX 2004 access your JavaBeans, the JavaBeans must reside in the Configuration/Classes folder.
  • Page 112: Mmjb.geterrormessage()

    Arguments packageName.pathName • argument is the path to the package. It must be a Java JAR or packageName.pathName ZIP Java archive (for example, C:/jdbcdrivers/Una2000_Enterprise.zip) Returns A string array of class names inside the particular JAR or ZIP Java archive; an error returns an empty array.
  • Page 113: Mmjb.getindexedproperties()

    MMJB.getIndexedProperties() Availability Dreamweaver UltraDev 4, enhanced in Dreamweaver MX. Description Introspects the JavaBeans class and returns its indexed properties, which are design patterns that behave the same way as collections. Arguments packageName.className packagePath • argument is the name of the class. The class must reside in a packageName.className JAR or ZIP Java archive.
  • Page 114 MMJB.getProperties() Availability Dreamweaver UltraDev 4, enhanced in Dreamweaver MX. Description Introspects the JavaBeans class and returns its properties. Arguments packageName.className packagePath • argument is the name of the class. The class must reside in a packageName.className JAR or ZIP Java archive. If is omitted, the archive must reside in your system packagePath or be a class file that is installed in the Configuration/Classes folder.
  • Page 115 MMJB.getWriteProperties() Availability Dreamweaver MX. Description Gets write-only properties for JavaBeans that support set method calls. Arguments packageName.className, packagePath • argument is the name of the class. The class must reside in a packageName.className JAR or ZIP Java archive. If is omitted, the archive must reside in your system packagePath or be a class file that is installed in the Configuration/Classes folder.
  • Page 116 Chapter 9: The JavaBeans API...
  • Page 117: Chapter 10: The Source Control Integration Api

    CHAPTER 10 The Source Control Integration API The Source Control Integration API lets you write shared libraries to extend the Macromedia Dreamweaver MX 2004 Check In/Check Out feature using source control systems (such as Sourcesafe or CVS). Your libraries must support a minimum set of API functions for Dreamweaver to integrate with a source control system.
  • Page 118: Adding Source Control System Functionality

    The source control system can optionally support Design Notes and Check In/Check Out. The Dreamweaver user enables Design Notes in source control systems by selecting the Design Notes tab in the Edit Sites dialog box and checking the box that enables the feature; this process is same to enable Design Notes with FTP and LAN.
  • Page 119: Bool Scs_Connect()

    Returns A Boolean value: if successful; otherwise. true false bool SCS_Connect() Description This function connects the user to the source control system. If the DLL does not have log-in information, the DLL must display a dialog box to prompt the user for the information and must store the data for later use.
  • Page 120: Int Scs_Getrootfolderlength()

    int SCS_GetRootFolderLength() Description This function returns the length of the name of the root folder. Arguments void *connectionData • argument is a pointer to the agent’s data that passed into Dreamweaver connectionData during the call. Connect() Returns An integer that indicates the length of the name of the root folder. If the function returns <...
  • Page 121: Bool Scs_Getfolderlist()

    bool SCS_GetFolderList() Description This function returns a list of files and folders in the passed-in folder, including pertinent information such as modified date, size, and whether the item is a folder or file. Arguments [ ], void *connectionData const char remotePath itemInfo itemList const int...
  • Page 122: Bool Scs_Get()

    bool SCS_Get() Description This function gets a list of files or folders and stores them locally. Arguments void *connectionData const char remotePathList[] const char *localPathList[] const int numItems • argument is a pointer to the agent’s data that passed into Dreamweaver connectionData during the call.
  • Page 123: Bool Scs_Delete()

    • argument is the full path of the remote folder that the DLL creates. remotePath Returns A Boolean value: if successful; otherwise. true false bool SCS_Delete() Description This function deletes a list of files or folders from the source control system. Arguments void *connectionData const char...
  • Page 124: Bool Scs_Itemexists()

    bool SCS_ItemExists() Description This function determines whether a file or folder exists on the server. Arguments void *connectionData const char remotePath • argument is a pointer to the agent’s data that passed into Dreamweaver connectionData during the call. Connect() • argument is a remote file or folder path.
  • Page 125: Bool Scs_Sitedeleted()

    bool SCS_SiteDeleted() Description This function notifies the DLL that the site has been deleted or that the site is no longer tied to this source control system. It indicates that the source control system can delete its persistent information for this site. Arguments const char siteName[64] •...
  • Page 126: Bool Scs_Getnewfeatures()

    bool SCS_GetNewFeatures() Description This function returns a list of menu items to add to the Dreamweaver main and context menus. For example, the Sourcesafe DLL can add History and File Differences to the main menu. Arguments char menuItemList[][32] scFunction functionList[], scFunction enablerList[] const int numNewFeatures •...
  • Page 127: Bool Scs_Checkin()

    bool SCS_Checkin() Description This function checks a list of local files or folders into the source control system. The DLL is responsible for making the file read-only. If it is unsupported by the source control system and this feature is enabled by the user, this function uses the Dreamweaver internal Check In/Check Out functionality, which transports LCK files to and from the source control system.
  • Page 128: Bool Scs_Undocheckout()

    bool SCS_UndoCheckout() Description This function undoes the check-out status of a list of files or folders. The DLL is responsible for making the file read-only. If it is unsupported by the source control system and this feature is enabled by the user, this function uses the Dreamweaver internal Check In/Check Out functionality, which transports LCK files to and from the source control system.
  • Page 129: Bool Scs_Getfilecheckoutlist()

    bool SCS_GetFileCheckoutList() Description This function returns a list of users who have a file checked out. If the list is empty, no one has the file checked out. Arguments void *connectionData const char remotePath char checkOutList[][64] char emailAddressList[][64] const int numCheckedOut •...
  • Page 130: Bool Scs_Geterrormessage()

    bool SCS_GetErrorMessage() Description This function returns the last error message. If you implement getErrorMessage() Dreamweaver calls it each time one of your API functions returns the value false If a routine returns , it indicates an error message should be available. false Arguments void *connectionData...
  • Page 131: Bool Scs_Getdesignnotes()

    Arguments void *connectionData const char *remotePath • argument is a pointer to the agent’s data that passed into Dreamweaver connectionData during the call. Connect() • argument is the remote file or folder path that the DLL checks for the remotePath maximum Design Note length.
  • Page 132: Bool Scs_Isremotenewer()

    Arguments void *connectionData, const char *remotePath, const char keyList[][64], const char *valueList[], bool showColumnList[], const int noteCount, const int noteLength • argument is a pointer to the agent’s data that passed into Dreamweaver connectionData during the call. Connect() • argument is the remote file or folder path that the DLL checks for the remotePath number of items.
  • Page 133: Enablers

    Enablers If the optional enablers are not supported by the source control system or the application is not connected to the server, Dreamweaver determines when the menu items are enabled, based on the information it has about the remote files. bool SCS_canConnect() Description This function returns whether the Connect menu item should be enabled.
  • Page 134: Bool Scs_Canput()

    Returns A Boolean value: if successful; otherwise. true false bool SCS_canPut() Description This function returns whether the Put menu item should be enabled. Arguments void *connectionData const char localPathList[] const char *remotePathList[] const int numItems • argument is a pointer to the agent’s data that passed into Dreamweaver connectionData during the call.
  • Page 135: Bool Scs_Canundocheckout()

    bool SCS_CanUndoCheckout() Description This function returns whether the Undo Checkout menu item should be enabled. Arguments void *connectionData const char *remotePathList[] const char localPathList[] const int numItems • argument is a pointer to the agent’s data that passed into Dreamweaver connectionData during the call.
  • Page 136: Bool Scs_Canrename()

    Returns A Boolean value: if successful; otherwise. true false bool SCS_canRename() Description This function returns whether the Rename menu item should be enabled. Arguments void *connectionData const char remotePath • argument is a pointer to the agent’s data that passed into Dreamweaver connectionData during the call.
  • Page 137: Bool Scs_Beforeput()

    bool SCS_BeforePut() Description Dreamweaver calls this function before putting or checking in one or more files. This function lets your DLL perform one operation, such as adding a check-in comment, to a group of files. Arguments *connectionData • The * argument is a pointer to the agent’s data that passed into Dreamweaver connectionData during the...
  • Page 138: Bool Scs_Afterput()

    bool SCS_AfterPut() Description Dreamweaver calls this function after putting or checking in one or more files. This function lets the DLL perform any operation after a batch put or check in, such as creating a summary dialog box. Arguments *connectionData •...
  • Page 139 PART II JavaScript API Use any of the more than 600 core JavaScript functions available in Macromedia Dreamweaver MX 2004, which encapsulate the kinds of tasks users perform when creating or editing a document. You can use these functions to perform any task that the user can accomplish using menus, floating panels, property inspectors, the Site panel, or the Document window.
  • Page 141: Chapter 11 Application

    (setting preferences, exiting Dreamweaver, and other functions). External application functions External application functions handle operations that are related to the Macromedia Flash MX 2004 application and to the browsers and external editors that are defined in the Preview in Browser and External Editors preferences.
  • Page 142: Dreamweaver.getbrowserlist()

    Example The following function uses the function to open the dreamweaver.browseDocument() Hotwired home page in a browser: function goToHotwired(){ dreamweaver.browseDocument('http://www.hotwired.com/'); In Dreamweaver 4, you can expand this operation to open the document in Microsoft Internet Explorer using the following code: function goToHotwired(){ var prevBrowsers = dw.getBrowserList();...
  • Page 143: Dreamweaver.getexternaltexteditor()

    A call to the function might return an array dreamweaver.getExtensionEditorList(".gif") that contains the following strings: • "Fireworks 3" • "file:///C|/Program Files/Macromedia/Fireworks 3/Fireworks 3.exe" dreamweaver.getExternalTextEditor() Availability Dreamweaver 4. Description Gets the name of the currently configured external text editor. Arguments None.
  • Page 144: Dreamweaver.getprimarybrowser()

    Example The following example calls the function to obtain the path to the Flash dw.getFlashPath() application and then passes the path in the form of a file://URL to the dw.openWithApp() function to open the document with Flash: var myDoc = dreamweaver.getDocumentDOM(); if (dreamweaver.validateFlash()) { var flashArray = dreamweaver.getFlashPath();...
  • Page 145: Dreamweaver.getsecondarybrowser()

    dreamweaver.getSecondaryBrowser() Availability Dreamweaver 3. Description Gets the path to the secondary browser. Arguments None. Returns A string that contains the path on the user’s computer to the secondary browser, which is expressed as a file:// URL. If no secondary browser is defined, it returns nothing. dreamweaver.openHelpURL() Availability Dreamweaver MX.
  • Page 146: Dreamweaver.openwithapp()

    Each entry has the following attributes: book-id attribute is the book ID that is used in the help.map and HelpDoc.js files. attribute is the Windows book name, which is win-mapping in this example. "UsingDreamweaver.chm" attribute is the Macintosh book name, which is mac-mapping "Dreamweaver Help"...
  • Page 147: Dreamweaver.openwithbrowsedialog()

    Description Opens the named file with the specified image editor. Note: This function invokes a special Macromedia Fireworks MX 2004 integration mechanism that returns information to the active document if Fireworks is specified as the image editor. To prevent errors if no document is active, this function should never be called from the Site panel.
  • Page 148: Dreamweaver.validateflash()

    Returns Nothing. dreamweaver.validateFlash() Availability Dreamweaver MX. Description Determines whether Flash MX (or a later version) is installed on the local computer. Arguments None. Returns A Boolean value: if Flash MX (or a later version) is installed on the local computer; true otherwise.
  • Page 149: Dreamweaver.getshowdialogsoninsert()

    dreamweaver.getShowDialogsOnInsert() Availability Dreamweaver 3. Description Checks whether the Show Dialog When Inserting Objects option is turned on in the General category of Preferences. Arguments None. Returns A Boolean value that indicates whether the option is on. dreamweaver.quitApplication() Availability Dreamweaver 3. Description Quits Dreamweaver after the script that calls this function finishes executing.
  • Page 150: Dreamweaver.showdynamicdatadialog()

    dreamweaver.showDynamicDataDialog() Availability Dreamweaver UltraDev 1. Description Displays the Dynamic Data or the Dynamic Text dialog box, and waits for the user to dismiss the dialog box. If the user clicks OK, the function returns a string to showDynamicDataDialog() insert into the user’s document. (This string returns from the Data Sources API function, , and passes to the Data Format API function, generateDynamicDataRef() ;...
  • Page 151: Dreamweaver.showpreferencesdialog()

    dreamweaver.showPreferencesDialog() Availability Dreamweaver 3. Description Opens the Preferences dialog box. Arguments {strCategory} • argument, which is optional, must be one of the following strings to open strCategory the correlating category of the Preferences dialog box: "general" "accessibility" "html (for the Code Coloring category), (for the Code Format category), colors"...
  • Page 152 Chapter 11: Application...
  • Page 153: Chapter 12: Workspace

    CHAPTER 12 Workspace Workspace API functions create or operate on an element of the Macromedia Dreamweaver MX 2004 workspace. They perform tasks such as redoing steps that appear in the History panel, placing an object on the Insert bar, navigating with Keyboard functions, reloading menus, manipulating standalone or built-in results windows, setting options, positioning a toolbar, and getting or setting focus.
  • Page 154: Dom.undo()

    dom.undo() Availability Dreamweaver 3. Description Undoes the previous step in the document. Arguments None. Returns Nothing. Enabler “dom.canUndo()” on page 441 dreamweaver.getRedoText() Availability Dreamweaver 3. Description Gets the text that is associated with the editing operation that will be redone if the user selects Edit >...
  • Page 155: Dreamweaver.playrecordedcommand()

    Returns A string that contains the text that is associated with the editing operation that will be undone. Example If the user’s last action applied a cascading style sheet (CSS) style to a selected range of text, a call to the function returns dreamweaver.getUndoText() "Undo Apply <span>"...
  • Page 156: Dreamweaver.startrecording()

    dreamweaver.startRecording() Availability Dreamweaver 3. Description Starts recording steps in the active document; the previously recorded command is immediately discarded. Arguments None. Returns Nothing. Enabler “dreamweaver.isRecording()” on page 451 (must return a value of false dreamweaver.stopRecording() Availability Dreamweaver 3. Description Stops recording without prompting the user. Arguments None.
  • Page 157: Dreamweaver.historypalette.clearsteps()

    Returns Nothing. Enabler “dom.canUndo()” on page 441 dreamweaver.historyPalette.clearSteps() Availability Dreamweaver 3. Description Clears all steps from the History panel and disables the Undo and Redo menu items. Arguments None. Returns Nothing. dreamweaver.historyPalette.copySteps() Availability Dreamweaver 3. Description Copies the specified history steps to the Clipboard. Dreamweaver warns the user about possible unintended consequences if the specified steps include an unrepeatable action.
  • Page 158: Dreamweaver.historypalette.getselectedsteps()

    dreamweaver.historyPalette.getSelectedSteps() Availability Dreamweaver 3. Description Determines which portion of the History panel is selected. Arguments None. Returns An array that contains the position indices of all the selected steps. The first position is position 0 (zero). Example If the second, third, and fourth steps are selected in the History panel, as shown in the following figure, a call to the function returns dreamweaver.historyPalette.getSelectedSteps()
  • Page 159: Dreamweaver.historypalette.getstepsasjavascript()

    dreamweaver.historyPalette.getStepsAsJavaScript() Availability Dreamweaver 3. Description Gets the JavaScript equivalent of the specified history steps. Arguments arrayOfIndices • argument is an array of position indices in the History panel. arrayOfIndices Returns A string that contains the JavaScript that corresponds to the specified history steps. Example If the three steps shown in the following example are selected in the History panel, a call to the dreamweaver.historyPalette.getStepsAsJavaScript(dw.historyPalette.getSelectedS...
  • Page 160: Dreamweaver.historypalette.replaysteps()

    dreamweaver.historyPalette.replaySteps() Availability Dreamweaver 3. Description Replays the specified history steps in the active document. Dreamweaver warns the user of possible unintended consequences if the specified steps include an unrepeatable action. Arguments arrayOfIndices • argument is an array of position indices in the History panel. arrayOfIndices Returns A string that contains the JavaScript that corresponds to the specified history steps.
  • Page 161: Dreamweaver.historypalette.setundostate()

    Arguments arrayOfIndices • function is an array of position indices in the History panel. If no arrayOfIndices argument is supplied, all the steps are unselected. Returns Nothing. Example The following code selects the first, second, and third steps in the History panel: dreamweaver.historyPalette.setSelectedSteps([0,1,2]);...
  • Page 162: Dreamweaver.objectpalette.getmenudefault()

    Returns Nothing. Example The following example inserts the navigation bar Flash component, which resides in the Components/Objects/FlashElements/Navigation folder, into the current document: dom.insertFlashElement("\Navigation\navBar.swc"); dreamweaver.objectPalette.getMenuDefault() Availability Dreamweaver MX 2004. Description Retrieves the ID string of the default item for the associated menu. Arguments menuId •...
  • Page 163: Dreamweaver.reloadobjects()

    Returns A Boolean value: if the new default is successfully set; otherwise. true false Example The following example sets the Flash object as the default object for the Media menu: dw.objectPalette.setMenuDefault("DW_Media", "DW_Flash"); dreamweaver.reloadObjects() Availability Dreamweaver MX 2004. Description Reloads all the objects on the Insert bar. This function is the equivalent of Control+left-clicking the mouse on the Categories menu on the Insert bar and selecting the Reload Extensions menu option.
  • Page 164: Dom.arrowleft()

    Returns Nothing. dom.arrowLeft() Availability Dreamweaver 3. Description Moves the insertion point to the left the specified number of times. Arguments {nTimes} {bShiftIsDown} • argument, which is optional, is the number of times that the insertion point must nTimes move left. If this argument is omitted, the default is 1. •...
  • Page 165: Dom.backspacekey()

    Arguments {nTimes} {bShiftIsDown} • argument, which is optional, is the number of times that the insertion point must nTimes move up. If this argument is omitted, the default is 1. • argument, which is optional, is a Boolean value that indicates whether to bShiftIsDown extend the selection.
  • Page 166: Dom.endofdocument()

    dom.endOfDocument() Availability Dreamweaver 3. Description Moves the insertion point to the end of the document (that is, after the last visible content in the Document window or after the closing tag in the Code inspector, depending on which HTML window has focus). Arguments {bShiftIsDown} •...
  • Page 167: Dom.nextword()

    Arguments {nTimes} {bShiftIsDown} • argument, which is optional, is the number of paragraphs that the insertion point nTimes must move ahead. If this argument is omitted, the default is 1. • argument is a Boolean value that indicates whether to extend the selection. bShiftIsDown If this argument is omitted, the default is false...
  • Page 168: Dom

    dom.pageUp() Availability Dreamweaver 3. Description Moves the insertion point up one page (equivalent to pressing the Page Up key). Arguments {nTimes} {bShiftIsDown} • argument, which is optional, is the number of pages that the insertion point must nTimes move up. If this argument is omitted, the default is 1. •...
  • Page 169: Dom.startofdocument()

    Arguments {nTimes} {bShiftIsDown} • argument, which is optional, is the number of words that the insertion point must nTimes move back. If this argument is omitted, the default is 1. • argument, which is optional, is a Boolean value that indicates whether to bShiftIsDown extend the selection.
  • Page 170: Dreamweaver.mapkeycodetochar()

    dreamweaver.mapKeyCodeToChar() Availability Dreamweaver 4. Description Takes a key code as retrieved from the event object’s field and translates it to a character. keyCode You should check whether the key code is a special key, such as HOME, PGUP, and so on. If the key code is not a special key, this method can be used to translate it to a character code that is suitable for display to the user.
  • Page 171: Dreamweaver.notifymenuupdated()

    dreamweaver.notifyMenuUpdated() Availability Dreamweaver 3. Description Notifies Dreamweaver when the specified menu needs to be updated. Arguments menuId menuListFunction • argument is a string that contains the value of the attribute for the menu item, menuId as specified in the menus.xml file. •...
  • Page 172: Results Window Functions

    Results window functions Results window functions let you create a stand-alone window that displays columns of formatted data, or you can interact with the built-in windows of the Results panel group. Creating a Stand-alone Results window These functions create custom windows that are similar to the output from the JavaScript Debugger window.
  • Page 173: Reswin.additem()

    Example The following example checks for errors at the offset of the current selection in the document and, if there are errors, displays them in the specified window ( ) of the Results floaterName panel. Otherwise, it opens the Target Browser Check window of the Results panel and displays the first visible item for the document.
  • Page 174: Reswin.addresultitem()

    Returns A Boolean value: if the item was added successfully; otherwise. true false Example The following example creates a Results window called that has the column headings: resWin Frodo, Sam, and Gollum. The call to the function adds a folder icon and resWin.addItem() then the three strings, , and...
  • Page 175: Reswin.setcallbackcommands()

    Returns Nothing. resWin.setCallbackCommands() Availability Dreamweaver 4. Description Tells the Results window on which commands to call the method. If this processFile() function is not called, the command that created the Results window is called. Arguments arrCmdNames • argument is an array of command names on which to call the arrCmdNames function.
  • Page 176: Reswin.settitle()

    Arguments arrFilePaths bRecursive • argument is an array of file or folder paths to iterate through. arrFilePaths • argument is a Boolean value that indicates whether the iteration should be bRecursive recursive ( ) or not ( true false Returns Nothing.
  • Page 177: Working With The Built-In Results Panel Group

    Arguments None. Returns Nothing. Working with the built-in Results panel group These functions produce output in the Results panel group. The Results panel group displays tabbed reports on searches, source validation, sitewide reports, browser targets, console reports, FTP logging, and link-checking. Working with specific child panels The following child panels are built-in Results windows that always exist in the Dreamweaver interface and can be accessed directly.
  • Page 178: Dreamweaver.resultspalette.copy()

    dreamweaver.resultsPalette.Copy() Availability Dreamweaver MX. Description Sends a copied message to the window that is in focus (often used for the FTP logging window). Arguments None. Returns Nothing. Enabler “dreamweaver.resultsPalette.canCopy()” on page 452. dreamweaver.resultsPalette.cut() Availability Dreamweaver MX. Description Sends a cut message to the window in focus (often used for the FTP logging window). Arguments None.
  • Page 179: Dreamweaver.resultspalette.openinbrowser

    Enabler “dreamweaver.resultsPalette.canPaste()” on page 453. dreamweaver.resultsPalette.openInBrowser Availability Dreamweaver MX. Description Sends a report (Site Reports, Browser Target Check, Validation, and Link Checker) to the default browser. Arguments None. Returns Nothing. Enabler “dreamweaver.resultsPalette.canOpenInBrowser()” on page 453. dreamweaver.resultsPalette.openInEditor() Availability Dreamweaver MX. Description Jumps to the selected line for specific reports (Site Reports, Browser Target Check, Validation, and Link Checker), and opens the document in the editor.
  • Page 180: Dreamweaver.resultspalette.selectall()

    Arguments None. Returns Nothing. Enabler “dreamweaver.resultsPalette.canSave()” on page 454. dreamweaver.resultsPalette.selectAll() Availability Dreamweaver MX. Description Sends a Select All command to the window in focus. Arguments None. Returns Nothing. Enabler “dreamweaver.resultsPalette.canSelectAll()” on page 454. Server debugging Dreamweaver can request files from ColdFusion and display the response in its embedded browser.
  • Page 181: Dreamweaver.resultspalette.debugwindow.adddebugcontextdata()

    dreamweaver.resultsPalette.debugWindow.addDebugContextData() Availability Dreamweaver MX. Description Interprets a customized XML file that returns from the server that is specified in the Site Definition dialog box. The contents of the XML file display as tree data in the Server Debug panel, so you can use the Server Debug panel to evaluate server-generated content from various server models.
  • Page 182: Toggle Functions

    <value><![CDATA[jdbc:macromedia:sqlserver:// name.macromedia.com:1111;databaseName=Pubs]]></value> </debugnode> </debugnode> <debugnode> <name><![CDATA[Element Snippet is undefined in class coldfusion.compiler.TagInfoNotFoundException]]></name> <icon><![CDATA[ServerDebugOutput/ColdFusion/Exception.gif]]></icon> <jumptoline linenumber="3" startposition="2" endposition="20"> <template><![CDATA[/ooo/master.cfm]]></template> <path><![CDATA[C:\Neo\wwwroot\ooo\master.cfm]]></path> </jumptoline> </debugnode> </serverdebuginfo> Returns Nothing. Toggle functions Toggle functions get and set various options either on or off. dom.getEditNoFramesContent() Availability Dreamweaver 3.
  • Page 183: Dom.getpreventlayeroverlaps()

    dom.getPreventLayerOverlaps() Availability Dreamweaver 3. Description This function gets the current state of the Prevent Layer Overlaps option. Arguments None. Returns A Boolean value: turns on the Prevent Layer Overlaps option; otherwise. true false dom.getShowAutoIndent() Availability Dreamweaver 4. Description This function determines whether auto-indenting is on in the Code view of the document window.
  • Page 184: Dom.getshowgrid()

    dom.getShowGrid() Availability Dreamweaver 3. Description This function gets the current state of the View > Grid > Show option. Arguments None. Returns A Boolean value: indicates the grid is visible; otherwise. true false dom.getShowHeadView() Availability Dreamweaver 3. Description This function gets the current state of the View > Head Content option. Arguments None.
  • Page 185: Dom.getshowimagemaps()

    dom.getShowImageMaps() Availability Dreamweaver 3. Description This function gets the current state of the View > Image Maps option. Arguments None. Returns A Boolean value: indicates the image maps are visible; otherwise. true false dom.getShowInvisibleElements() Availability Dreamweaver 3. Description This function gets the current state of the View > Invisible Elements option. Arguments None.
  • Page 186: Dom.getshowlinenumbers()

    dom.getShowLineNumbers() Availability Dreamweaver 4. Description This function determines whether line numbers are shown in the Code view. Arguments None. Returns A Boolean value: indicates the line numbers are shown; otherwise. true false dom.getShowRulers() Availability Dreamweaver 3. Description This function gets the current state of the View > Rulers > Show option. Arguments None.
  • Page 187: Dom.getshowtableborders()

    dom.getShowTableBorders() Availability Dreamweaver 3. Description This function gets the current state of the View > Table Borders option. Arguments None. Returns A Boolean value: indicates the table borders are visible; otherwise. true false dom.getShowToolbar() Availability Dreamweaver 4. Description This function determines whether the toolbar appears. Arguments None.
  • Page 188: Dom.getshowwordwrap()

    dom.getShowWordWrap() Availability Dreamweaver 4. Description This function determines whether word wrap is on in the Code view of the document window. Arguments None. Returns A Boolean value: if word wrap is on; otherwise. true false dom.getSnapToGrid() Availability Dreamweaver 3. Description This function gets the current state of the View >...
  • Page 189: Dom.sethideallvisualaids()

    dom.setHideAllVisualAids() Availability Dreamweaver 4. Description This function turns off the display of all borders, image maps, and invisible elements, regardless of their individual settings in the View menu. Arguments bSet • argument is a Boolean value: hides visual aids; otherwise. bSet true false...
  • Page 190: Dom.setshowgrid()

    dom.setShowGrid() Availability Dreamweaver 3. Description This function toggles the View > Grid > Show option on and off. Arguments bShowGrid • argument is a Boolean value: turns on the View > Grid > Show option; bShowGrid true turns it off. false Returns Nothing.
  • Page 191: Dom.setshowimagemaps()

    Returns Nothing. dom.setShowImageMaps() Availability Dreamweaver 3. Description This function toggles the View > Image Maps option on and off. Arguments bShowImageMaps • argument is a Boolean value, turns on the Image Maps option; bShowImageMaps true turns it off. false Returns Nothing.
  • Page 192: Dom.setshowlinenumbers()

    Returns Nothing. dom.setShowLineNumbers() Availability Dreamweaver 4. Description This function shows or hides the line numbers in the Code view of the document window. Arguments bShow • argument is a Boolean value: indicates the line numbers should be visible; bShow true hides them.
  • Page 193: Dom.setshowtableborders()

    Returns Nothing. dom.setShowTableBorders() Availability Dreamweaver 3. Description This function toggles the View > Table Borders option on and off. Arguments bShowTableBorders • argument is a Boolean value: turns on the Table Borders bShowTableBorders true option; turns it off. false Returns Nothing.
  • Page 194: Dom.setshowwordwrap()

    Returns Nothing. dom.setShowWordWrap() Availability Dreamweaver 4. Description This function toggles the Word Wrap option off or on in the Code view of the document window. Arguments bShow • argument is a Boolean value: indicates that the lines should wrap; bShow true otherwise.
  • Page 195: Dreamweaver.getshowstatusbar()

    Returns A Boolean value: indicates whether the Hide Panels option is on; indicates the Show true false Panels option is on. dreamweaver.getShowStatusBar() Availability Dreamweaver 3. Description This function gets the current state of the View > Status Bar option. Arguments None.
  • Page 196: Dreamweaver.htmlinspector.getshowlinenumbers()

    dreamweaver.htmlInspector.getShowLineNumbers() Availability Dreamweaver 4. Description This function determines whether line numbers appear in the Code inspector. Arguments None. Returns A Boolean value: if line numbers appear; otherwise. true false dreamweaver.htmlInspector.getShowSyntaxColoring() Availability Dreamweaver 4. Description This function determines whether syntax coloring is on in the Code inspector. Arguments None.
  • Page 197: Dreamweaver.htmlinspector.setshowautoindent()

    dreamweaver.htmlInspector.setShowAutoIndent() Availability Dreamweaver 4. Description This function turns the Auto Indent option on or off in the Code inspector. Arguments bShow • argument is a Boolean value: true turns the auto-indenting on; turns it off. bShow false Returns Nothing. dreamweaver.htmlInspector.setShowInvalidHTML() Availability Dreamweaver 4.
  • Page 198: Dreamweaver.htmlinspector.setshowsyntaxcoloring()

    dreamweaver.htmlInspector.setShowSyntaxColoring() Availability Dreamweaver 4. Description This function turns syntax coloring on or off in the Code view of the Code inspector. Arguments bShow • argument is a Boolean value: indicates that the syntax coloring should be bShow true visible; turns it off. false Returns Nothing.
  • Page 199: Dreamweaver.setshowstatusbar()

    dreamweaver.setShowStatusBar() Availability Dreamweaver 3. Description This function toggles the View > Status Bar option on or off. Arguments bShowStatusBar • argument is a Boolean value: turns on the Status Bar option; bShowStatusBar true turns it off. false Returns Nothing. site.getShowDependents() Availability Dreamweaver 3.
  • Page 200: Site.getshowpagetitles()

    site.getShowPageTitles() Availability Dreamweaver 3. Description This function gets the current state of the Show Page Titles option. Arguments None. Returns A Boolean value: indicates that the page titles are visible in the site map; otherwise. true false site.getShowToolTips() Availability Dreamweaver 3. Description This function gets the current state of the Tool Tips option.
  • Page 201: Site.setshowhiddenfiles()

    site.setShowHiddenFiles() Availability Dreamweaver 3. Description This function toggles the Show Files Marked as Hidden option in the site map on or off. Arguments bShowHiddenFiles • argument is a Boolean value: turns on the Show Files Marked as bShowHiddenFiles true Hidden option; turns it off.
  • Page 202: Toolbar Functions

    Returns Nothing. Toolbar functions The following JavaScript functions let you get and set the visibility of toolbars and toolbar labels, obtain the labels of toolbar items in the current window, position toolbars, and obtain toolbar IDs. For more information on creating or modifying toolbars, see “Toolbars” in Extending Dreamweaver Help.
  • Page 203: Dom.gettoolbaridarray()

    dom.getToolbarIdArray() Availability Dreamweaver MX. Description This function returns an array of the IDs of all the toolbars in the application. You can use to turn off all toolbars so you can reposition them and make only a dom.getToolbarIdArray() specific set visible. Arguments None.
  • Page 204: Dom.gettoolbarlabel()

    else{ dom.removeFontMarkupAsStyle('font-size'); dom.getToolbarLabel() Availability Dreamweaver MX. Description This function obtains the label of the specified toolbar. You can use dom.getToolbarLabel() menus that show or hide toolbars. Arguments toolbar_id • argument is the ID of the toolbar, which is the value of the ID attribute on toolbar_id the toolbar tag in the toolbars.xml file.
  • Page 205: Dom.settoolbaritemattribute()

    dom.setToolbarItemAttribute() Availability Dreamweaver MX 2004. Description Changes an attribute value for the three image attributes or the tooltip attribute on a toolbar item. Arguments toolbarID, toolbarItemId, attrName, attrValue • argument is a string that specifies the ID of the toolbar. toolbarID •...
  • Page 206: Dom.settoolbarposition()

    Example The following example tells Dreamweaver to show the labels for the buttons on the toolbars: dom.setShowToolbarIconLabels(true); dom.setToolbarPosition() Availability Dreamweaver MX. Description This function moves the specified toolbar to the specified position. Note: There is no way to determine the current position of a toolbar. Arguments toobar_id, position, relative_to •...
  • Page 207: Window Functions

    Arguments toolbar_id, bShow • argument is the ID of the toolbar, the value of the ID attribute on the toolbar_id toolbar tag in the toolbars.xml file. • argument is a Boolean value that indicates whether to show or hide the toolbar. If bShow makes the toolbar visible bshow...
  • Page 208: Dom.getview()

    dom.getView() Availability Dreamweaver 4. Description This function determines which view is visible. Arguments None. Returns , or , depending on the visible view. "design" "code" "split" dom.getWindowTitle() Availability Dreamweaver 3. Description This function gets the title of the window that contains the document. Arguments None.
  • Page 209: Dreamweaver.bringattentiontofloater()

    dreamweaver.bringAttentionToFloater() Availability Dreamweaver MX. Description Brings the specified panel or inspector to the front, and draws attention to the panel or inspector by making it flash, which is slightly different functionality than dw.toggleFloater() Arguments floaterName • argument is the name of the window, panel, or inspector. floaterName Returns Nothing.
  • Page 210: Dreamweaver.getactivewindow()

    dreamweaver.getActiveWindow() Availability Dreamweaver 3. Description This function gets the document in the active window. Arguments None. Returns The document object that corresponds to the document in the active window; or, if the document is in a frame, the document object that corresponds to the frameset. dreamweaver.getDocumentList() Availability Dreamweaver 3.
  • Page 211 values for built-in Dreamweaver panels are the strings to the right of the floaterName panel names in the following list: Assets = "assets" Behaviors = "behaviors" Code inspector = "html" Components = "server components" CSS Styles = "css styles" Bindings = "data sources"...
  • Page 212: Dreamweaver.getfocus()

    dreamweaver.getFocus() Availability Dreamweaver 4. Description This function determines what part of the application is currently in focus. Arguments bAllowFloaters • argument is a Boolean value: if you want the function to return bAllowFloaters true the name of the floating panel, if a floating panel has focus; otherwise.
  • Page 213: Dreamweaver.minimizerestoreall()

    Arguments None. Returns An integer that represents the snapping distance in pixels. The default is 10 pixels; 0 indicates that the Snap feature is off. dreamweaver.minimizeRestoreAll() Availability Dreamweaver 4. Description This function minimizes (reduces to an icon) or restores all windows in Dreamweaver. Arguments bMinimize •...
  • Page 214: Dreamweaver.setfloatervisibility()

    dreamweaver.setFloaterVisibility() Availability Dreamweaver 3. Description This function specifies whether to make a particular floating panel or inspector visible. Arguments floaterName bIsVisible • argument is the name of a floating panel. If does not match floaterName floaterName one of the built-in panel names, Dreamweaver searches in the Configuration/Floaters folder for a file called where is the name of a floating panel.
  • Page 215: Dreamweaver.setprimaryview()

    Tag inspector = "tag inspector" Target Browser Check Results = "btc" Templates = " " templates Validation Results = "validation" argument is a Boolean value that indicates whether to make the floating bIsVisible panel visible. Returns Nothing. dreamweaver.setPrimaryView() Availability Dreamweaver 4. Description This function displays the specified view at the top of the document window.
  • Page 216: Dreamweaver.showproperties()

    dreamweaver.showProperties() Availability Dreamweaver 3. Description This function makes the Property inspector visible and gives it focus. Arguments None. Returns Nothing. dreamweaver.tileHorizontally() Availability Dreamweaver MX (Windows only). Description Tiles the document windows horizontally, positioning each window next to another one without overlapping the documents.
  • Page 217: Dreamweaver.togglefloater()

    Example The following example tiles the open documents vertically: dw.tileVertically() dreamweaver.toggleFloater() Availability Dreamweaver 3. Description This function shows, hides, or brings to the front the specified panel or inspector. Note: This function is meaningful only in the menus.xml file. To show, bring forward, or hide a floating panel, use dw.setFloaterVisibility() Arguments...
  • Page 218 Chapter 12: Workspace...
  • Page 219: Chapter 13: Site

    Report functions Report functions provide access to the Macromedia Dreamweaver MX 2004 reporting features so you can initiate, monitor, and customize the reporting process. For more information, see “Reports” in Extending Dreamweaver Help.
  • Page 220: Site Functions

    Returns Nothing. Site functions Site functions handle operations that are related to files in the site files or site map. These functions let you perform the following tasks: • Create links between files • Get, put, check in, and check out files •...
  • Page 221: Site.addlinktoexistingfile()

    site.addLinkToExistingFile() Availability Dreamweaver 3. Description Opens the Select HTML File dialog box to let the user select a file and creates a link from the selected document to that file. Arguments None. Returns Nothing. Enabler “site.canAddLink()” on page 455. site.addLinkToNewFile() Availability Dreamweaver 3.
  • Page 222: Site.changelinksitewide()

    site.changeLinkSitewide() Availability Dreamweaver 3. Description Opens the Change Link Sitewide dialog box. Arguments None. Returns Nothing. site.changeLink() Availability Dreamweaver 3. Description Opens the Select HTML File dialog box to let the user select a new file for the link. Arguments None.
  • Page 223: Site.checklinks()

    Arguments siteOrURL • argument must be the keyword , which indicates that the function siteOrURL "site" should act on the selection in the Site panel or the URL for a single file. Returns Nothing. Enabler “site.canCheckIn()” on page 456. site.checkLinks() Availability Dreamweaver 3.
  • Page 224: Site.checktargetbrowsers()

    Returns Nothing. Enabler “site.canCheckOut()” on page 456. site.checkTargetBrowsers() Availability Dreamweaver 3. Description Runs a target browser check on the selected files. Arguments None. Returns Nothing. site.cloak() Availability Dreamweaver MX. Description Cloaks the current selection in the Site panel or the specified folder. Arguments siteOrURL argument must contain one of the following two values:...
  • Page 225: Site.definesites()

    site.defineSites() Availability Dreamweaver 3. Description This function opens the Edit Sites dialog box. Arguments None. Returns Nothing. site.deleteSelection() Availability Dreamweaver 3. Description Deletes the selected files. Arguments None. Returns Nothing. site.deployFilesToTestingServerBin() Availability Dreamweaver MX. Description Puts a specified file (or files) in the testing server’s bin folder. If the current site does not have any settings defined for deploying supporting files, this function invokes the Deploy Supporting Files To Testing Server dialog box.
  • Page 226: Site.editcolumns()

    Settings\jlondon\Desktop\DWServer\" imagefolder="C:\Documents and Settings\jlondon\Desktop\DWServer\Images\" spacerfilepath="" refreshlocal="TRUE" cache="FALSE" httpaddress="http://" curserver="webserver" /> <remoteinfo accesstype="ftp" host="dreamweaver" remoteroot="kojak/" user="dream" checkoutname="Jay" emailaddress="jay@macromedia.com" usefirewall="FALSE" usepasv="TRUE" enablecheckin="TRUE" checkoutwhenopen="TRUE" /> <designnotes usedesignnotes="TRUE" sharedesignnotes="TRUE" /> <sitemap homepage="C:\Documents and Settings\jlondon\Desktop\DWServer\Untitled-2.htm" pagesperrow="200" columnwidth="125" showdependentfiles="TRUE" showpagetitles="FALSE" showhiddenfiles="TRUE" /> <fileviewcolumns sharecolumns="TRUE">...
  • Page 227 localwidth="180" remotewidth="180" /> <column name="Notes" align="center" show="TRUE" share="FALSE" builtin="TRUE" localwidth="36" remotewidth="36" /> <column name="Size" align="right" show="TRUE" share="FALSE" builtin="TRUE" localwidth="-2" remotewidth="-2" /> <column name="Type" align="left" show="TRUE" share="FALSE" builtin="TRUE" localwidth="60" remotewidth="60" /> <column name="Modified" align="left" show="TRUE" share="FALSE" builtin="TRUE" localwidth="102" remotewidth="102" /> <column name="Checked Out By" align="left"...
  • Page 228: Site.findlinksource()

    site.findLinkSource() Availability Dreamweaver 3. Description Opens the file that contains the selected link or dependent file, and highlights the text of the link or the reference to the dependent file. This function operates only on files in the Site Map view. Arguments None.
  • Page 229: Site.getappserveraccesstype()

    site.getAppServerAccessType() Availability Dreamweaver MX. Description Returns the access method that is used for all files on the current site’s application server. The current site is the site that is associated with the document that currently has focus. If no document has focus, the site that you opened in Dreamweaver is used. Note: ColdFusion Component Explorer uses this function;...
  • Page 230: Site.getappurlprefixforsite()

    site.getAppURLPrefixForSite() Availability Dreamweaver MX. Description Gets the value of the URL prefix of the currently selected site. Arguments None. Returns A string that contains the URL prefix of the currently selected site. Example sitePrefix = getAppURLPrefixForSite(); site.getCheckOutUser() Availability Dreamweaver 3. Description Gets the login and check-out name that is associated with the current site.
  • Page 231: Site.getcloakingenabled()

    Returns A string that contains the login and check-out name of the user who has the file checked out or an empty string if the file is not checked out. Example A call to site.getCheckOutUserForFile("file://C:/sites/avocado8/index.html") might return . If no check-out name is specified, only the login name "denise (deniseLaptop)"...
  • Page 232: Site.getcurrentsite()

    site.getCurrentSite() Availability Dreamweaver 3. Description Gets the current site. Arguments None. Returns A string that contains the name of the current site. Example If you defined several sites, a call to returns the one that is currently site.getCurrentSite() showing in the Current Sites List in the Site panel. site.getFocus() Availability Dreamweaver 3.
  • Page 233: Site.getlocalpathtofiles()

    Returns A Boolean value: if all the selected links are visible; otherwise. true false site.getLocalPathToFiles() Availability Dreamweaver MX. Description Determines the path to the local files that are defined for the current site. The current site is the site that is associated with the document that currently has focus. If no document has focus, the site that you opened in Dreamweaver is used.
  • Page 234: Site.getsites()

    Arguments fileURL • argument is the fully qualified URL (including the string " ) for a fileURL file://" named file. Returns A string that contains the name of the site, if any, in which the specified file exists. The string is empty when the specified file does not exist in any defined site.
  • Page 235: Site.invertselection()

    site.invertSelection() Availability Dreamweaver 3. Description Inverts the selection in the site map. Arguments None. Returns Nothing. site.isCloaked() Availability Dreamweaver MX. Description Determines whether the current selection in the Site panel or the specified folder is cloaked. Arguments siteOrURL • argument must contain one of the following two values: siteOrURL The keyword , which indicates that the...
  • Page 236: Site.makeeditable()

    Returns Nothing. Enabler “site.canLocateInSite()” on page 458. site.makeEditable() Availability Dreamweaver 3. Description Turns off the read-only flag on the selected files. Arguments None. Returns Nothing. Enabler “site.canMakeEditable()” on page 459. site.makeNewDreamweaverFile() Availability Dreamweaver 3. Description Creates a new Dreamweaver file in the Site panel in the same folder as the first selected file or folder.
  • Page 237: Site.makenewfolder()

    site.makeNewFolder() Availability Dreamweaver 3. Description Creates a new folder in the Site panel in the same folder as the first selected file or folder. Arguments None. Returns Nothing. Enabler “site.canMakeNewFileOrFolder()” on page 459. site.newHomePage() Availability Dreamweaver 3. Description Opens the New Home Page dialog box to let the user create a new home page. Note: This function operates only on files in the Site Map view.
  • Page 238: Site.open()

    site.open() Availability Dreamweaver 3. Description Opens the files that are currently selected in the Site panel. If any folders are selected, they are expanded in the Site Files view. Arguments None. Returns Nothing. Enabler “site.canOpen()” on page 460. site.put() Availability Dreamweaver 3.
  • Page 239: Site.recreatecache()

    site.recreateCache() Availability Dreamweaver 3. Description Re-creates the cache for the current site. Arguments None. Returns Nothing. Enabler “site.canRecreateCache()” on page 460. site.refresh() Availability Dreamweaver 3. Description Refreshes the file listing on the specified side of the Site panel. Arguments whichSide •...
  • Page 240: Site.removelink()

    Returns A Boolean value that indicates whether a remote site has been defined and, if the server type is Local/Network, whether the drive is mounted. site.removeLink() Availability Dreamweaver 3. Description Removes the selected link from the document above it in the site map. Arguments None.
  • Page 241: Site.saveasimage()

    Returns Nothing. site.saveAsImage() Availability Dreamweaver 3. Description Opens the Save As dialog box to let the user save the site map as an image. Arguments fileType • argument is the type of image that should be saved. Valid values for Windows fileType ;...
  • Page 242: Site.selectnewer()

    Returns Nothing. site.selectNewer() Availability Dreamweaver 3. Description Selects all files that are newer on the specified side of the Site panel. Arguments whichSide • argument must be either whichSide "local" "remote" Returns Nothing. Enabler “site.canSelectNewer()” on page 462. site.setAsHomePage() Availability Dreamweaver 3.
  • Page 243: Site.setconnectionstate()

    Returns None. site.setConnectionState() Availability Dreamweaver 3. Description Sets the connection state of the current site. Arguments bConnected • argument is a Boolean value that indicates if there is a connection ( ) or bConnected true not ( ) to the current site. false Returns Nothing.
  • Page 244: Site.setfocus()

    site.setFocus() Availability Dreamweaver 3. Description Gives focus to a specified pane in the Site panel. If the specified pane is not showing, this function displays the pane and gives it focus. Arguments whichPane • argument must be one of the following strings: , or whichPane "local"...
  • Page 245: Site.setselection()

    Returns Nothing. site.setSelection() Availability Dreamweaver 3. Description Selects files or folders in the active pane in the Site panel. Arguments arrayOfURLs • argument is an array of strings where each string is a path to a file or folder arrayOfURLs in the current site, which is expressed as a file:// URL.
  • Page 246: Site.uncloak()

    site.uncloak() Availability Dreamweaver MX. Description Uncloaks the current selection in the Site panel or the specified folder. Arguments siteOrURL • argument must contain one of the following values: siteOrURL The keyword , which indicates that the function should act on the "site"...
  • Page 247: Site.undocheckout()

    site.undoCheckOut() Availability Dreamweaver 3. Description Removes the lock files that are associated with the specified files from the local and remote sites, and replaces the local copy of the specified files with the remote copy. Arguments siteOrURL • argument must be the keyword , which indicates that the function siteOrURL "site"...
  • Page 248 Chapter 13: Site...
  • Page 249: Chapter 14: Document

    CHAPTER 14 Document The Document functions in Macromedia Dreamweaver MX 2004 perform operations that affect the document on which the user is working. These functions perform tasks that convert tables to layers, run a command in the Configuration/Commands folder, browse for a file URL, check spelling or set page properties, convert a relative URL to an absolute URL, get the currently selected node, perform URL encoding on a string, or run a translator on the document.
  • Page 250: Dom.converttablestolayers()

    dom.convertTablesToLayers() Availability Dreamweaver 3. Description Opens the Convert Tables to Layers dialog box. Arguments None. Returns Nothing. Enabler “dom.canConvertTablesToLayers()” on page 434. Command functions Command functions help you make the most of the files in the Configuration/Commands folder. They manage the Command menu and call commands from other types of extension files. dreamweaver.editCommandList() Availability Dreamweaver 3.
  • Page 251: Dreamweaver.runcommand()

    Arguments commandFile • argument is the name of a command file within the Configuration/ commandFile Commands folder (for example, "Format Table.htm" Returns Nothing. dreamweaver.runCommand() Availability Dreamweaver 3. Description Executes the specified command; it works the same as selecting the command from a menu. If a dialog box is associated with the command, it appears and the command script blocks other edits until the user closes the dialog box.
  • Page 252: File Manipulation Functions

    File manipulation functions File manipulation functions handle creating, opening, and saving documents (including XML and XHTML), converting existing HTML documents into XHTML, and exporting CSS to external files. These functions accomplish such tasks as browsing for files or folders, creating files based on templates, closing documents, and getting information about recently opened files.
  • Page 253: Dom.getisxhtmldocument()

    • element title • section body During the conversion, the function converts pure HTML tags and dom.convertToXHTML() attributes to lowercase, writes HTML tags and attributes with correct XHTML syntax, and adds missing HTML attributes where it can. This function treats third-party tags and attributes according to the settings in the Preferences dialog box.
  • Page 254: Dreamweaver.browseforfileurl()

    dreamweaver.browseForFileURL() Availability Dreamweaver 1, enhanced in 2, 3, and 4. Description Opens the specified type of dialog box with the specified label in the title bar. Arguments ¬ openSelectOrSave {titleBarLabel} {bShowPreviewPane}, {bSupressSiteRootWarnings} {arrayOfExtensions} • argument is a string that indicates the type of dialog box as " openSelectOrSave open"...
  • Page 255: Dreamweaver.closedocument()

    Returns A string that contains the name of the folder, which is expressed as a file:// URL. Example The following code returns the URL of a folder: return dreamweaver.browseForFolderURL('Select a Folder', ¬ dreamweaver.getSiteRoot()); dreamweaver.closeDocument() Availability Dreamweaver 2. Description Closes the specified document. Arguments documentObject •...
  • Page 256: Dreamweaver.createxhtmldocument()

    • argument specifies the type of document to create, as declared in the Dreamweaver type Configuration/DocumentTypes/MMDocumentTypes.xml file as the attribute of the tag. For example, the argument could be documenttype type "HTML", "ASP-JS", "ASP- , and so on. For a complete list of VB", "ColdFusion", "CFC", "JSP", "ASP.NET_VB"...
  • Page 257: Dreamweaver.createxmldocument()

    Arguments {bOpenInSameWindow} • argument is a Boolean value that indicates whether to open the new bOpenInSameWindow document in the current window. If this value is or omitted, or if the function is called false on the Macintosh, the new document opens in a separate window. Returns The document object for the newly created document, which is the same value that the function returns.
  • Page 258: Dreamweaver.exporteditableregionsasxml() (Deprecated)

    dreamweaver.exportEditableRegionsAsXML() (deprecated) Availability Dreamweaver 3; deprecated in MX. Description This function opens the Export Editable Regions as XML dialog box. Arguments None. Returns Nothing. dreamweaver.exportTemplateDataAsXML() Availability Dreamweaver MX. Description Exports the current document to the specified file as XML. This function operates on the document that has focus, which must be a template.
  • Page 259: Dreamweaver.getdocumentdom()

    dreamweaver.getDocumentDOM() Availability Dreamweaver 2. Description Provides access to the objects tree for the specified document. After the tree of objects returns to the caller, the caller can edit the tree to change the contents of the document. Arguments {sourceDoc} • argument must be sourceDoc "document"...
  • Page 260: Dreamweaver.getnewdocumentdom()

    dreamweaver.getNewDocumentDOM() Availability Dreamweaver MX. Description Provides access to the editable tree for a new, empty document. This function works in the same way as the function, except that it points to a new document, not an existing getDocumetDOM() one, and does not open the document. Arguments None.
  • Page 261: Dreamweaver.newdocument()

    Arguments {filePath} • argument, which is optional, is a string that specifies the filename to which filePath Dreamweaver exports the template. Express the argument as a URL file string, such filePath "file:///c|/temp/mydata.txt" Returns Nothing. dreamweaver.newDocument() Availability Dreamweaver MX. Description Opens a document in the current site and invokes the New Document dialog box. Arguments {bopenWithCurSiteAndShowDialog} •...
  • Page 262: Dreamweaver.opendocument()

    dreamweaver.openDocument() Availability Dreamweaver 2. Description Opens a document for editing in a new Dreamweaver window and gives it the focus. For a user, the effect is the same as selecting File > Open and selecting a file. If the specified file is already open, the window that contains the document comes to the front.
  • Page 263: Dreamweaver.openinframe()

    dreamweaver.openInFrame() Availability Dreamweaver 3. Description Opens the Open In Frame dialog box. When the user selects a document, it opens into the active frame. Arguments None. Returns Nothing. Enabler “dreamweaver.canOpenInFrame()” on page 445. dreamweaver.releaseDocument() Availability Dreamweaver 2. Description Explicitly releases a previously referenced document from memory. Documents that are referenced by the dreamweaver.getObjectTags() , or...
  • Page 264: Dreamweaver.revertdocument()

    dreamweaver.revertDocument() Availability Dreamweaver 3. Description Reverts the specified document to the previously saved version. Arguments documentObject • argument is the object at the root of a document’s DOM tree, which is documentObject the value that the function returns. dreamweaver.getDocumentDOM() Returns Nothing.
  • Page 265: Dreamweaver.savedocumentas()

    Arguments documentObject {fileURL} • argument is the object at the root of a document’s DOM tree, which is documentObject the value that the function returns. dreamweaver.getDocumentDOM() • argument, which is optional, is a URL that represents a location on a local fileURL computer.
  • Page 266: Dreamweaver.saveframeset()

    Returns Nothing. Enabler “dreamweaver.canSaveDocumentAsTemplate()” on page 447. dreamweaver.saveFrameset() Availability Dreamweaver 3. Description Saves the specified frameset or opens the Save As dialog box if the frameset has not previously been saved. Arguments documentObject • argument is the object at the root of a document’s DOM tree, which is documentObject the value that the function returns.
  • Page 267: Global Document Functions

    Global document functions Global document functions act on an entire document. They check spelling, check target browsers, set page properties, and determine correct object references for elements in the document. dom.checkSpelling() Availability Dreamweaver 3. Description Checks the spelling in the document, opening the Check Spelling dialog box if necessary, and notifies the user when the check is complete.
  • Page 268: Dom.hideinfomessagepopup()

    Returns A string that specifies the current parsing mode: , or "html" "xml" "css" "text" dom.hideInfoMessagePopup() Availability Dreamweaver MX 2004. Description Hides the tooltip-like message, if it is visible, for the document window. Arguments None. Returns Nothing. See also “dom.showInfoMessagePopup()” on page 269.
  • Page 269: Dom.showinfomessagepopup()

    Note: An automatic validation (defined by the value controlString "auto-explicit" "auto- ) is currently available only for a Target Browser Check. implicit" • argument is an optional Boolean value: opens the Validation bOpenResultsWindow true results window; false otherwise. The default value is true •...
  • Page 270: Dom.showpagepropertiesdialog()

    Returns Nothing. Example The following example displays two tooltip messages. The first line of code displays the message in the center of the document. The second call to "This message is in the center" displays the tooltip message showInfoMessagePopup() "Don’t forget the title for the for the Title text edit box, which has the ID , on the toolbar with the ID Window"...
  • Page 271: Dreamweaver.getelementref()

    Example The following example calls to decode the special characters in its dw.doURLDecoding() argument and store the resulting string in outstr outStr = dreamweaver.doURLDecoding(“http://maps.yahoo.com/py/ ddResults.py?Pyt=Tmap&tarname=&tardesc=&newname=&newdesc=&newHash=&newTHash =&newSts=&newTSts=&tlt=&tln=&slt=&sln=&newFL=Use+Address+Below&newaddr=2000 +Shamrock+Rd&newcsz=Metroo+Park%2C+CA&newcountry=us&newTFL=Use+Address+Belo w&newtaddr=500+El+Camino&newtcsz=Santa+Clara%2C+CA&newtcountry=us&Submit=Ge t+Directions”) dreamweaver.getElementRef() Availability Dreamweaver 2. Description Gets the Netscape Navigator or Internet Explorer object reference for a specific tag object in the DOM tree.
  • Page 272: Dreamweaver.getobjectrefs() (Deprecated)

    dreamweaver.getObjectRefs() (deprecated) Availability Dreamweaver 1; deprecated in 3. Description This function scans the specified document for instances of the specified tags or, if no tags are specified, for all tags in the document and formulates browser-specific references to those tags. This function is equivalent to calling and then calling getElementsByTagName()
  • Page 273: Dreamweaver.getobjecttags() (Deprecated)

    dreamweaver.getObjectTags() (deprecated) Availability Dreamweaver1; deprecated in 3. Description This function scans the specified document for instances of the specified tags or, if no tags are specified, for all tags in the document. This function is equivalent to calling and then getting for each element in the getElementsByTagName() outerHTML...
  • Page 274: Dreamweaver.getpreferenceint()

    dreamweaver.getPreferenceInt() Availability Dreamweaver MX. Description Lets you retrieve an integer preference setting for an extension. Arguments section, key, default_value • argument is a string that specifies the preferences section that contains the entry. section • argument is a string that specifies the entry of the value to retrieve. •...
  • Page 275: Dreamweaver.setpreferenceint()

    Example The following example returns the String value of the Text Editor setting in the My Extension section of Preferences. If there is no MyExtension section or no Text Editor entry, the function returns the default value specified by the variable txtEditor var txtEditor = getExternalTextEditor();...
  • Page 276: Dreamweaver.setpreferencestring()

    dreamweaver.setPreferenceString() Availability Dreamweaver MX. Description Lets you write a string preference setting for an extension. This setting is stored with Dreamweaver preferences when Dreamweaver is not running. Arguments section new_value • argument is a string that specifies the Preferences category in which the option is section set.
  • Page 277: Path Functions

    Path functions Path functions get and manipulate the paths to various files and folders on a user’s hard disk. These functions determine the path to the root of the site in which the current document resides, convert relative paths to absolute URLs, and more. dreamweaver.getConfigurationPath() Availability Dreamweaver 2.
  • Page 278: Dreamweaver.getsiteroot()

    Returns Either a string that contains the URL of the specified document if the file was saved or an empty string if the file was not saved. dreamweaver.getSiteRoot() Availability Dreamweaver 1.2. Description Gets the local root folder (as specified in the Site Definition dialog box) for the site that is associated with the currently selected document, which is expressed as a file:// URL.
  • Page 279: Dreamweaver.relativetoabsoluteurl()

    dreamweaver.relativeToAbsoluteURL() Availability Dreamweaver 2. Description Given a relative URL and a point of reference (either the path to the current document or the site root), this function converts the relative URL to an absolute file:// URL. Arguments docPath siteRoot, relURL •...
  • Page 280: Dom.getselection()

    dom.getSelection() Availability Dreamweaver 3. Description Gets the selection, which is expressed as character offsets into the document’s source code. Arguments {bAllowMultiple} • argument, which is optional, is a Boolean value that indicates whether bAllowMultiple the function should return multiple offsets if more than one table cell, image map hotspot, or layer is selected.
  • Page 281: Dom.offsetstonode()

    Example The following code selects the first image object in the current document: var theDOM = dw.getDocumentDOM(); var theImg = theDOM.images[0]; var offsets = theDom.nodeToOffsets(theImg); theDom.setSelection(offsets[0], offsets[1]); dom.offsetsToNode() Availability Dreamweaver 3. Description Gets the object in the DOM tree that completely contains the range of characters between the specified opening and closing points.
  • Page 282: Dom.setselectednode()

    Arguments None. Returns Nothing. dom.setSelectedNode() Availability Dreamweaver 3. Description Sets the selected node. This function is equivalent to calling the function dom.nodeToOffsets() and passing the return value to the function. dom.setSelection() Arguments node {bSelectInside} {bJumpToNode} • argument is a text, comment, or element node in the document. node •...
  • Page 283: Dreamweaver.getselection() (Deprecated)

    dreamweaver.getSelection() (deprecated) Availability Dreamweaver 2; deprecated in 3. See “dom.getSelection()” on page 280. Description Gets the selection in the current document, which is expressed as byte offsets into the document’s source code. Arguments None. Returns An array that contains two integers. The first integer is the byte offset for the beginning of the selection;...
  • Page 284: Dreamweaver.nodetooffsets() (Deprecated)

    var selArr; if (dw.nodeExists(selObj)) selArr = dom.nodeToOffsets(selObj); else selArr = dom.nodeToOffsets(findTable()); dom.setSelection(selArr[0],selArr[1]); dreamweaver.nodeToOffsets() (deprecated) Availability Dreamweaver 2; deprecated in 3 in favor of “dom.nodeToOffsets()” on page 280 Description Gets the position of a specific node in the DOM tree, which is expressed as byte offsets into the document’s source code.
  • Page 285: Dreamweaver.selectall()

    dreamweaver.selectAll() Availability Dreamweaver 3. Description Performs a Select All operation in the active document window, the Site panel or, on the Macintosh, the text field that has focus in a dialog box or floating panel. Note: If the operation takes place in the active document, it usually selects all the content in the active document.
  • Page 286: String Manipulation Functions

    String manipulation functions String manipulation functions help you get information about a string as well as convert a string from Latin 1 encoding to platform-native encoding and back. dreamweaver.doURLEncoding() Availability Dreamweaver 1. Description Takes a string and returns a URL-encoded string by replacing all the spaces and special characters with specified entities.
  • Page 287: Dreamweaver.latin1Tonative()

    Example The following call to the function returns the tokens that come after it: dw.getTokens() dreamweaver.getTokens('foo("my arg1", 34)', '(),') • • "my arg 1" • dreamweaver.latin1ToNative() Availability Dreamweaver 2. Description Converts a string in Latin 1 encoding to the native encoding on the user’s computer. This function is intended to display the UI of an extension file in another language.
  • Page 288: Dreamweaver.scansourcestring()

    dreamweaver.scanSourceString() Availability Dreamweaver UltraDev 1. Description Scans a string of HTML and finds the tags, attributes, directives, and text. For each tag, attribute, directive, and text span that it finds, the function invokes a callback scanSourceString() function that you must supply. Dreamweaver supports the following callback functions: •...
  • Page 289 Dreamweaver calls the function for each HTML comment, ASP script, JSP directive() script, or PHP script. The function accepts two arguments, a string that contains directive() the directive and the document offset, which is the number of bytes in the document before the end of the closing tag.
  • Page 290: Translation Functions

    Translation functions Translation functions deal either directly with translators or with translation results. These functions get information about or run a translator, edit content in a locked region, and specify that the translated source should be used when getting and setting selection offsets. dom.runTranslator() Availability Dreamweaver 3.
  • Page 291: Dreamweaver.gettranslatorlist()

    dreamweaver.getTranslatorList() Availability Dreamweaver 3. Description This function gets a list of the installed translators. Arguments None. Returns An array of strings where each string represents the name of a translator as it appears in the Translation preferences. dreamweaver.useTranslatedSource() Availability Dreamweaver 2. Description This function specifies that the values that dom.nodeToOffsets()
  • Page 292 Chapter 14: Document...
  • Page 293: Chapter 15: Page Content

    Assets panel functions Assets panel functions, which are programmed into the API as an asset panel, let you manage and use the elements in the Assets panel (templates, libraries, images, Macromedia Shockwave and Macromedia Flash content, URLs, colors, and scripts).
  • Page 294: Dreamweaver.assetpalette.addtofavoritesfromsiteassets()

    dreamweaver.assetPalette.addToFavoritesFromSiteAssets() Availability Dreamweaver 4. Description Adds elements that are selected in the Site list to the Favorites list and gives each item a nickname in the Favorites list. This function does not remove the element from the Site list. Arguments None.
  • Page 295: Dreamweaver.assetpalette.edit()

    dreamweaver.assetPalette.edit() Availability Dreamweaver 4. Description Edits selected elements with primary external editor or Custom Edit control. For colors, the color picker appears. For URLs, a dialog box appears and prompts the user for a URL and a nickname. This function is not available for the Site list of colors and URLs. Arguments None.
  • Page 296: Dreamweaver.assetpalette.getselectedview()

    Returns An array of the following three strings for each selected item: • string, which is the name/filename or nickname that appears in the Assets panel. name • string, which is the full path, full URL, or color value, depending on the selected value item.
  • Page 297: Dreamweaver.assetpalette.locateinsite()

    Returns Nothing. Enabler “dreamweaver.assetPalette.canInsertOrApply()” on page 442. dreamweaver.assetPalette.locateInSite() Availability Dreamweaver 4. Description Selects files that are associated with the selected elements in the local side of the Site panel. This function does not work for colors or URLs. It is available in the Site list and the Favorites list. If a folder is selected in the Favorites list, the folder is ignored.
  • Page 298: Dreamweaver.assetpalette.recreatelibraryfromdocument()

    Arguments None. Returns Nothing. dreamweaver.assetPalette.recreateLibraryFromDocument() Availability Dreamweaver 4. Description Replaces the deprecated function, . It libraryPalette recreateLibraryFromDocument() creates a Library item (LBI) file for the selected instance of a library item in the current document. This function is equivalent to clicking Recreate in the Property inspector. Arguments None.
  • Page 299: Dreamweaver.assetpalette.renamenickname()

    Returns Nothing. dreamweaver.assetPalette.renameNickname() Availability Dreamweaver 4. Description Edits the folder name or the file’s nickname by displaying a text box around the existing nickname. It is available only in the Favorites list or in the Library or Template category. Arguments None.
  • Page 300: Dreamweaver.librarypalette.deleteselecteditem() (Deprecated)

    dreamweaver.libraryPalette.deleteSelectedItem() (deprecated) Availability Dreamweaver 3; deprecated in Dreamweaver 4 in favor of using dreamweaver.assetPalette.setSelectedCategory(), and then calling dreamweaver.assetPalette.removeFromFavorites() Description This function removes the selected library item from the Library panel and deletes its associated Dreamweaver LBI file from the Library folder at the root of the current site. Instances of the deleted item might still exist in pages throughout the site.
  • Page 301: Dreamweaver.librarypalette.recreatefromdocument() (Deprecated)

    Returns Nothing. dreamweaver.libraryPalette.recreateFromDocument() (deprecated) Availability Dreamweaver 3; deprecated in Dreamweaver 4 in favor of dreamweaver.assetPalette.recreateLibraryFromDocument() Description This function creates an LBI file for the selected instance of a library item in the current document. This function is equivalent to clicking Recreate in the Property inspector. Arguments None.
  • Page 302: Dreamweaver.referencepalette.setfontsize()

    Returns The relative font size as , or small medium large dreamweaver.referencePalette.setFontSize() Availability Dreamweaver 4. Description Changes the font size that appears in the Reference panel. Arguments fontSize • argument is one of the following relative sizes: , or fontSize small medium large...
  • Page 303: Dreamweaver.templatepalette.renameselectedtemplate() (Deprecated)

    dreamweaver.templatePalette.renameSelectedTemplate() (deprecated) Availability Dreamweaver 3; deprecated in Dreamweaver 4 in favor of using dreamweaver.assetPalette.setSelectedCategory() with as the argument value, and "templates" then calling dreamweaver.assetPalette.renameNickname() Description This function turns the name of the selected template into a text field, so the user can rename the selection.
  • Page 304: Dom.getbehavior()

    dom.getBehavior() Availability Dreamweaver 3. Description Gets the action at the specified position within the specified event. This function acts on the current selection and is valid only for the active document. Arguments event {eventBasedIndex} • argument is the JavaScript event handler through which the action is attached to event the element (for example, , or...
  • Page 305: Dom.removebehavior()

    dom.removeBehavior() Availability Dreamweaver 3. Description Removes the action at the specified position within the specified event. This function acts on the current selection and is valid only for the active document. Arguments event {eventBasedIndex} • argument is the event handler through which the action is attached to the element event (for example, , or...
  • Page 306: Dreamweaver.getbehaviorevent() (Deprecated)

    Example function can be used in the same way as dreamweaver.getBehaviorElement() dreamweaver.getBehaviorTag() to determine whether the selected action is appropriate for the selected HTML tag, except that it gives you access to more information about the tag and its attributes. As shown in the following example, if you write an action that can be applied only to a hypertext link ( ) that does not target another frame or window, you can use the A HREF...
  • Page 307: Dreamweaver.popupaction()

    Returns A string that represents the source of the tag. This is the same string that passes as an argument ) to the function. If this function appears outside an action HTMLelement canAcceptBehavior() file, the return value is an empty string. Example If you write an action that can be applied only to a hypertext link ( ), you can use the...
  • Page 308: Dreamweaver.behaviorinspector.getbehaviorat()

    dreamweaver.behaviorInspector.getBehaviorAt() Availability Dreamweaver 3. Description Gets the event/action pair at the specified position in the Behaviors panel. Arguments positionIndex • argument is the position of the action in the Behaviors panel. The first positionIndex action in the list is at position 0. Returns An array of two items: •...
  • Page 309: Dreamweaver.behaviorinspector.getselectedbehavior()

    dreamweaver.behaviorInspector.getSelectedBehavior() Availability Dreamweaver 3. Description Gets the position of the selected action in the Behaviors panel. Arguments None. Returns An integer that represents the position of the selected action in the Behaviors panel, or –1 if no action is selected. Example If the first action in the Behaviors panel is selected, as shown in the following figure, a call to the function returns 0:...
  • Page 310: Dreamweaver.behaviorinspector.movebehaviorup()

    Example If the Behaviors panel is set up as shown in the following figure, calling the function swaps the positions of the dreamweaver.behaviorInspector.moveBehaviorDown(2) Preload Images and the Change Property actions on the event. Calling the onMouseDown function for any other position has dreamweaver.behaviorInspector.moveBehaviorDown() no effect because the events each have only one associated behavior, and...
  • Page 311: Dreamweaver.behaviorinspector.setselectedbehavior()

    Example If the Behaviors panel is set up as shown in the following figure, calling the function swaps the positions of the dreamweaver.behaviorInspector.moveBehaviorUp(3) Preload Images and the Change Property actions on the event. Calling the onMouseOver function for any other position has no dreamweaver.behaviorInspector.moveBehaviorUp() effect because the events each have only one associated behavior, and the...
  • Page 312: Clipboard Functions

    Example If the Behaviors panel is set up as shown in the following figure, calling the function selects the Change Property dreamweaver.behaviorInspector.setSelection(2) action that is associated with the event: onMouseDown Clipboard functions Clipboard functions are related to cutting, copying, and pasting. On the Macintosh, some Clipboard functions can also apply to text fields in dialog boxes and floating panels.
  • Page 313: Dom.clipcopytext()

    dom.clipCopyText() Availability Dreamweaver 3. Description Copies the selected text to the Clipboard, ignoring any HTML markup. Arguments None. Returns Nothing. Enabler “dom.canClipCopyText()” on page 432. dom.clipCut() Availability Dreamweaver 3. Description Removes the selection, including any HTML markup that defines the selection, to the Clipboard. Arguments None.
  • Page 314: Dom.clippastetext()

    Example If the Clipboard contains , a call to results in ABC Widgets dw.getDocumentDOM().clipPaste() the following figure: dom.clipPasteText() Availability Dreamweaver 3. Description Pastes the contents of the Clipboard into the current document at the insertion point or in place of the current selection. It replaces any linefeeds in the Clipboard content with tags.
  • Page 315: Dreamweaver.clipcopy()

    Example If the Clipboard contains , a call to <code>return true;</code> results in the following figure: dw.getDocumentDOM().clipPasteText() dreamweaver.clipCopy() Availability Dreamweaver 3. Description Copies the current selection from the active Document window, dialog box, floating panel, or Site panel to the Clipboard. Arguments None.
  • Page 316: Dreamweaver.clipcut()

    dreamweaver.clipCut() Availability Dreamweaver 3. Description Removes the selection from the active Document window, dialog box, floating panel, or Site panel to the Clipboard. Arguments None. Returns Nothing. Enabler “dreamweaver.canClipCut()” on page 443. dreamweaver.clipPaste() Availability Dreamweaver 3. Description Pastes the contents of the Clipboard into the current document, dialog box, floating panel, or Site panel.
  • Page 317: Library And Template Functions

    Arguments {bAsText} • Boolean value, which is optional, specifies whether the Clipboard content is bAsText retrieved as text. If is a value of , the Clipboard content is retrieved as text. If bAsText true is a value of , the content retains formatting. This argument defaults to bAsText false false...
  • Page 318: Dom.detachfromlibrary()

    dom.detachFromLibrary() Availability Dreamweaver 3. Description Detaches the selected library item instance from its associated LBI file by removing the locking tags from around the selection. This function is equivalent to clicking Detach from Original in the Property inspector. Arguments None. Returns Nothing.
  • Page 319: Dom.geteditableregionlist()

    dom.getEditableRegionList() Availability Dreamweaver 3. Description Gets a list of all the editable regions in the body of the document. Arguments None. Returns An array of element nodes. Example “dom.getSelectedEditableRegion()” on page 320. dom.getIsLibraryDocument() Availability Dreamweaver 3. Description Determines whether the document is a library item. Arguments None.
  • Page 320: Dom.getselectededitableregion()

    dom.getSelectedEditableRegion() Availability Dreamweaver 3. Description If the selection or insertion point is inside an editable region, this function gets the position of the editable region among all others in the body of the document. Arguments None. Returns An index into the array that the function returns.
  • Page 321: Dom.neweditableregion()

    Arguments None. Returns Nothing. Enabler “dom.canMarkSelectionAsEditable()” on page 437. dom.newEditableRegion() Availability Dreamweaver 3. Description Displays the New Editable Region dialog box. When the user clicks New Region, Dreamweaver inserts the name of the region, surrounded by curly braces ({ }), into the document at the insertion point location.
  • Page 322: Dom.updatecurrentpage()

    dom.updateCurrentPage() Availability Dreamweaver 3. Description Updates the document’s library items, templates, or both. This function is valid only for the active document. Arguments {typeOfUpdate} • The optional argument must be , or . If you typeOfUpdate "library" "template" "both" omit the argument, the default is "both"...
  • Page 323: Snippets Panel Functions

    Snippets panel functions Using Dreamweaver, web developers can edit and save reusable blocks of code in the Snippets panel and retrieve them as needed. The Snippets panel stores each code snippet in a CSN file within the Configuration/Snippets folder. Snippets that come with Dreamweaver are stored in the following folders: •...
  • Page 324: Dreamweaver.snippetpalette.getcurrentsnippetpath()

    dreamweaver.snippetPalette.getCurrentSnippetPath() Availability Dreamweaver MX 2004. Description Returns the path to the snippet that is currently selected in the Snippets panel. Arguments None. Returns The path, relative to the Snippets folder, to the snippet selected in the Snippets panel. Returns an empty string if no snippet is selected.
  • Page 325: Dreamweaver.snippetpalette.editsnippet()

    dreamweaver.snippetPalette.editSnippet() Availability Dreamweaver MX. Description Opens the Edit Snippet dialog box and gives it focus, enabling editing for the selected element. Arguments None. Returns Nothing. Enabler “dreamweaver.snippetpalette.canEditSnippet()” on page 454. dreamweaver.snippetPalette.insert()r Availability Dreamweaver MX. Description Applies the selected snippet from the Snippets panel to the current selection. Arguments None.
  • Page 326: Dreamweaver.snippetpalette.insertsnippet()

    dreamweaver.snippetPalette.insertSnippet() Availability Dreamweaver MX. Description Inserts the indicated snippet into the current selection. Arguments • A string that specifies the path to the snippet relative to the Snippets folder. Returns A Boolean value. Enabler “dreamweaver.snippetpalette.canInsert()” on page 455. Example The following call to the function inserts the code dw.snippetPalette.insertSnippet() snippet at the location specified by the argument into the current document at the...
  • Page 327: Chapter 16 Dynamic Documents

    CHAPTER 16 Dynamic Documents The dynamic documents functions in Macromedia Dreamweaver MX 2004 perform operations that are related to web server pages. These operations include returning a property for the selected node in the Components panel, getting a list of all data sources in the user’s document, displaying dynamic content in Design view, applying a server behavior to a document, or getting the names of all currently defined server models.
  • Page 328: Dreamweaver.servercomponents.refresh()

    dreamweaver.serverComponents.refresh() Availability Dreamweaver MX. Description Refreshes the view of the Components tree. Arguments None. Returns Nothing. Data source functions Data source files are stored in the Configuration/DataSources folder. Each server model has its own folder: ASP.Net/C#, ASP.Net/VisualBasic, ASP/JavaScript, ASP/VBScript, ColdFusion, JSP, and PHP/MySQL.
  • Page 329: Extension Data Manager Functions

    • property is optional. If this property is set to a value of , when the allowDelete false user clicks on this node in the Bindings panel, the Minus (-) button is disabled. If it is set to a value of , the Minus (-) button is enabled.
  • Page 330: Dreamweaver.getextdataarray()

    dreamweaver.getExtDataArray() Availability Dreamweaver UltraDev 4. Description This function retrieves an array of values from an EDML file for the specified nodes. Arguments qualifier(s) • argument is a variable-length list of comma-separated node qualifiers, qualifier(s) including group or participant name, subblock (if any), and field name. Returns Dreamweaver expects an array of child-node names.
  • Page 331: Dreamweaver.refreshextdata()

    Arguments value qualifier(s) • argument is a property value or is blank to ignore. value • argument is a variable length list of comma-separated node qualifiers of qualifier(s) the required property. Returns Dreamweaver expects an array of group names that have the specified property, if it is given, and the property matches the specified value, if it is given.
  • Page 332: Dreamweaver.getlivedatamode()

    Arguments None. Returns A string that contains the initialization tags. dreamweaver.getLiveDataMode() Availability Dreamweaver UltraDev 1. Description Determines whether the Live Data window is currently visible. Arguments None. Returns A Boolean value: if the Live Data window is visible; false otherwise. true dreamweaver.getLiveDataParameters () Availability...
  • Page 333: Dreamweaver.livedatatranslate()

    In the URL, these parameters would appear as shown in the following example: http://someURL?ID=22&Name=Samuel This function lets you obtain these live data settings through JavaScript. Arguments None. Returns An array that contains the URL parameters for the current document. The array contains an even number of parameter strings.
  • Page 334: Dreamweaver.setlivedataerror()

    Returns object. This object is the same as the value that the function httpReply MMHttp.getText() returns. If the user clicks the Stop icon, the return value’s is equal to 200 httpReply.statusCode (Status OK) and its is equal to the empty string. For more information on the httpReply.data object, see Chapter 3, “The HTTP API,”...
  • Page 335: Dreamweaver.setlivedataparameters()

    dreamweaver.setLiveDataParameters() Availability Dreamweaver MX. Description Sets the URL parameters that you reference in your document for use in Live Data mode. Live Data mode lets you view a web page in the design stage (as if it has been translated by the application server and returned).
  • Page 336: Server Behavior Functions

    Server behavior functions Server behavior functions let you manipulate the Server Behaviors panel, which you can display by selecting Window > Server Behaviors. Using these functions, you can find all the server behaviors on a page and programmatically apply a new behavior to the document or modify an existing behavior.
  • Page 337: Dreamweaver.serverbehaviorinspector.getserverbehaviors()

    dreamweaver.serverBehaviorInspector.getServerBehaviors() Availability Dreamweaver UltraDev 1. Description Gets a list of all the behaviors on the page. When Dreamweaver determines that the internal list of server behaviors might be out of date, it calls the function for each findServerBehaviors() currently installed behavior. Each function returns an array. Dreamweaver merges all the arrays into a single array and sorts it, based on the order that each behavior’s object selectedNode...
  • Page 338: Server Model Functions

    Server model functions In Macromedia Dreamweaver, each document has an associated document type. For dynamic document types, Dreamweaver also associates a server model (such as ASP-JS, ColdFusion, or PHP-MySQL). Server models are used to group functionality that is specific to a server technology. Different server behaviors, data sources, and so forth, appear based on the server model that is associated with the document.
  • Page 339: Dom.servermodel.getdelimiters()

    dom.serverModel.getDelimiters() Availability Dreamweaver MX. Description Lets JavaScript code get the script delimiter for each server model, so managing the server model code can be separated from managing the user-scripted code. Arguments None. Returns An array of objects where each object contains the following three properties: •...
  • Page 340: Dom.servermodel.getserverextension() (Deprecated)

    Returns A string, the value of which is the name of the folder. dom.serverModel.getServerExtension() (deprecated) Availability Dreamweaver UltraDev 4; deprecated in Dreamweaver MX. Description Returns the default file extension of files that use the current server model. (The default file extension is the first in the list.) If no user document is currently selected, the serverModel object is set to the server model of the currently selected site.
  • Page 341: Dom.servermodel.getserverinfo()

    Example The following code snippet from a participant file shows a translator tag: searchPatterns <searchPatterns whereToSearch="comment"> <searchPattern paramNames=",ssi_comment_includeUrl"> <![CDATA[/<!--\s*#include\s+(file|virtual)\s*=\s*"([^"]*)"\s*-->/i]]> </searchPattern> </searchPatterns> The search pattern contains a JavaScript regular expression that specifies two submatches (both of which are contained within parentheses). The first submatch is for the text string file .
  • Page 342: Dom.servermodel.getserverlanguage() (Deprecated)

    Returns A JavaScript object that contains a variety of information that is specific to the current server model. dom.serverModel.getServerLanguage() (deprecated) Availability UltraDev 1; deprecated in Dreamweaver MX. Description Determines the server model that is associated with the document and returns that value. The server language for a site is the value that comes from the Default Scripting Language setting on the App Server Info tab in the Site Definition dialog box.
  • Page 343: Dom.servermodel.getserversupportscharset()

    dom.serverModel.getServerSupportsCharset() Availability Dreamweaver MX. Description Determines whether the server model that is associated with the document supports the named character set. Note: In addition to letting you call this function from the JavaScript layer, Dreamweaver calls this function when the user changes the encoding in the page Properties dialog box. If the server model does not support the new character encoding, this function returns and Dreamweaver pops up false...
  • Page 344: Dom.servermodel.testappserver()

    dom.serverModel.testAppServer() Availability Dreamweaver MX. Description Tests whether a connection to the application server can be made. Arguments None. Returns A Boolean value that indicates whether the request to connect to the application server was successful. dreamweaver.getServerModels() Availability Dreamweaver MX. Description Gets the names for all the currently defined server models.
  • Page 345: Chapter 17: Design

    CHAPTER 17 Design The Design functions in Macromedia Dreamweaver MX 2004 perform operations related to designing the appearance of a document. These operations include functions that apply a specified cascading style sheet (CSS) style, split a selected frame vertically or horizontally, align selected layers or hotspots, play a selected plug-in item, create a layout cell, or manipulate table rows or columns.
  • Page 346: Dom.removecssstyle()

    • argument, which is optional, is the attribute with which the style should be classOrID applied (either ). If the argument is a value or an empty "class" "id" elementNode null string and no tag exactly surrounds the selection, the style is applied using tags.
  • Page 347: Dreamweaver.cssruletracker.editselectedrule()

    dreamweaver.cssRuleTracker.editSelectedRule() Availability Dreamweaver MX 2004. Description Lets the user edit the currently selected rule in the rule tracker. This function displays the selected rule in the CSS property grid, and if necessary, will show the property grid and its containing floater.
  • Page 348: Dreamweaver.cssstylepalette.attachstylesheet()

    Returns Nothing. Enabler “dreamweaver.cssStylePalette.canApplySelectedStyle()” on page 449. dreamweaver.cssStylePalette.attachStyleSheet() Availability Dreamweaver 4. Description Displays a dialog box that lets users attach a style sheet to the current active document or to one of its attached style sheets, depending on the selection in the CSS Styles panel. Arguments None.
  • Page 349: Dreamweaver.cssstylepalette.editselectedstyle()

    Arguments None. Returns Nothing. Enabler “dreamweaver.cssStylePalette.canDuplicateSelectedStyle()” on page 450. dreamweaver.cssStylePalette.editSelectedStyle() Availability Dreamweaver 3. Description Opens the Style Definition dialog box for the style that is currently selected in the CSS Styles panel. Arguments None. Returns Nothing. Enabler “dreamweaver.cssStyle.canEditSelectedStyle()” on page 450.
  • Page 350: Dreamweaver.cssstylepalette.getmediatype()

    dreamweaver.cssStylePalette.getMediaType() Availability Dreamweaver MX 2004. Description Gets target media type for rendering. The default media type is "screen". Arguments None. Returns A string value that specifies the target media type. Example var mediaType = dw.cssStylePalette.getMediaType(); dreamweaver.cssStylePalette.getSelectedStyle() Availability Dreamweaver 3; available in Dreamweaver MX. fullSelector Description Gets the name of the style that is currently selected in the CSS Styles panel.
  • Page 351: Dreamweaver.cssstylepalette.getselectedtarget() (Deprecated)

    dreamweaver.cssStylePalette.getSelectedTarget() (deprecated) Availability Dreamweaver 3; deprecated in Dreamweaver MX because there is no longer an Apply To Menu in the CSS Styles panel. Description This function gets the selected element in the Apply To pop-up menu at the top of the CSS Styles panel.
  • Page 352: Dreamweaver.cssstylepalette.newstyle()

    dreamweaver.cssStylePalette.newStyle() Availability Dreamweaver 3. Description Opens the New Style dialog box. Arguments None. Returns Nothing. dreamweaver.cssStylePalette.setMediaType() Availability Dreamweaver MX 2004. Description Sets the target media type for rendering. Refreshes the rendering of all open documents. Arguments mediaType • argument specifies the new target media type. mediaType Returns Nothing.
  • Page 353: Dom.isdocumentinframe()

    Returns An array of strings where each string is the name of a frame in the current frameset. Any unnamed frames are skipped. If none of the frames in the frameset is named, an empty array returns. Example For a document that contains four frames (two of which are named), a call to the function might return an array that contains the following strings: dom.getFrameNames() •...
  • Page 354: Dom.splitframe()

    dom.splitFrame() Availability Dreamweaver 3. Description Splits the selected frame vertically or horizontally. Arguments splitDirection • argument is a string that must specify one of the following directions: splitDirection , or "up" "down" "left" "right" Returns Nothing. Enabler “dom.canSplitFrame()” on page 440.
  • Page 355: Dom.arrange()

    dom.arrange() Availability Dreamweaver 3. Description Moves the selected hotspots in the specified direction. Arguments toBackOrFront • argument is the direction in which the hotspots must move, either front toBackOrFront or back. Returns Nothing. Enabler “dom.canArrange()” on page 432. dom.makeSizesEqual() Availability Dreamweaver 3.
  • Page 356: Dom.resizeselectionby()

    Arguments x, y • argument is the number of pixels that the selection must move horizontally. • argument is the number of pixels that the selection must move vertically. Returns Nothing. dom.resizeSelectionBy() Availability Dreamweaver 3. Description Resizes the currently selected layer or hotspot. Arguments left bottom...
  • Page 357: Layout Environment Functions

    Arguments tagName • argument must be , or tagName "layer" "ilayer" "div" "span" Returns Nothing. Layout environment functions Layout environment functions handle operations that are related to the settings for working on a document. They affect the source, position, and opacity of the tracing image; get and set the ruler origin and units;...
  • Page 358: Dom.gettracingimageopacity()

    dom.getTracingImageOpacity() Availability Dreamweaver 3. Description Gets the opacity setting for the document’s tracing image. Arguments None. Returns A value between 0 and 100, or nothing if no opacity is set. Enabler “dom.hasTracingImage()” on page 441. dom.loadTracingImage() Availability Dreamweaver 3. Description Opens the Select Image Source dialog box.
  • Page 359: Dom.playplugin()

    dom.playPlugin() Availability Dreamweaver 3. Description Plays the selected plug-in item. Arguments None. Returns Nothing. Enabler “dom.canPlayPlugin()” on page 438. dom.setRulerOrigin() Availability Dreamweaver 3. Description Sets the origin of the ruler. Arguments xCoordinate yCoordinate • argument is a value, expressed in pixels, on the horizontal axis. xCoordinate •...
  • Page 360: Dom.settracingimageposition()

    dom.setTracingImagePosition() Availability Dreamweaver 3. Description Moves the upper left corner of the tracing image to the specified coordinates. If the arguments are omitted, the Adjust Tracing Image Position dialog box appears. Arguments • argument is the number of pixels that specify the horizontal coordinate. •...
  • Page 361: Dom.snaptracingimagetoselection()

    dom.snapTracingImageToSelection() Availability Dreamweaver 3. Description Aligns the upper left corner of the tracing image with the upper left corner of the current selection. Arguments None. Returns Nothing. Enabler “dom.hasTracingImage()” on page 441. dom.stopAllPlugins() Availability Dreamweaver 3. Description Stops all plug-in content that is currently playing in the document. Arguments None.
  • Page 362: Dreamweaver.arrangefloatingpalettes()

    dreamweaver.arrangeFloatingPalettes() Availability Dreamweaver 3. Description Moves the visible floating panels to their default positions. Arguments None. Returns Nothing. dreamweaver.showGridSettingsDialog() Availability Dreamweaver 3. Description Opens the Grid Settings dialog box. Arguments None. Returns Nothing. Chapter 17: Design...
  • Page 363: Layout View Functions

    Layout view functions Layout view functions handle operations that change the layout elements within a document. They affect table, column, and cell settings, including position, properties, and appearance. dom.addSpacerToColumn() Availability Dreamweaver 4. Description Creates a 1-pixel-high transparent spacer image at the bottom of a specified column in the currently selected table.
  • Page 364: Dom.createlayouttable()

    dom.createLayoutTable() Availability Dreamweaver 4. Description Creates a layout table in the current document at the specified position and dimensions, either within an existing table or in the area below the existing content on the page. If the table is created in an existing layout table, it cannot overlap other layout cells or nested layout tables, but it can contain other layout cells or nested layout tables.
  • Page 365: Dom.doesgrouphavespacers()

    dom.doesGroupHaveSpacers() Availability Dreamweaver 4. Description Determines whether the currently selected table contains a row of spacer images that Dreamweaver generated. It fails if the current selection is not a table. Arguments None. Returns Returns if the table contains a row of spacer images; otherwise.
  • Page 366: Dom.getshowlayoutview()

    dom.getShowLayoutView() Availability Dreamweaver 4. Description Determines the view for the current document; either Layout or Standard view. Arguments None. Returns Returns if the current document is in Layout view; if the document is in true false Standard view. dom.isColumnAutostretch() Availability Dreamweaver 4.
  • Page 367: Dom.removeallspacers()

    dom.removeAllSpacers() Availability Dreamweaver 4. Description Removes all spacer images generated by Dreamweaver from the currently selected table. This function fails if the current selection is not a table or if the operation is not successful. Arguments None. Returns Nothing. dom.removeSpacerFromColumn() Availability Dreamweaver 4.
  • Page 368: Dom.setshowlayouttabletabs()

    Arguments colNum bAutostretch • argument is the column to be automatically sized or set to a fixed width. colNum • argument specifies whether to set the column to autostretch ( ) or to a bAutostretch true fixed width ( false Returns Nothing.
  • Page 369: Table Editing Functions

    Table editing functions Table functions add and remove table rows and columns, change column widths and row heights, convert measurements from pixels to percents and back, and perform other standard table-editing tasks. dom.convertWidthsToPercent() Availability Dreamweaver 3. Description This function converts all attributes in the current table from pixels to percentages.
  • Page 370: Dom.decreaserowspan()

    Returns Nothing. Enabler “dom.canDecreaseColspan()” on page 434. dom.decreaseRowspan() Availability Dreamweaver 3. Description This function decreases the row span by one. Arguments None. Returns Nothing. Enabler “dom.canDecreaseRowspan()” on page 434. dom.deleteTableColumn() Availability Dreamweaver 3. Description This function removes the selected table column or columns. Arguments None.
  • Page 371: Dom.dodeferredtableupdate()

    Arguments None. Returns Nothing. Enabler “dom.canDeleteTableRow()” on page 435 dom.doDeferredTableUpdate() Availability Dreamweaver 3. Description If the Faster Table Editing option is selected in the General preferences, this function forces the table layout to reflect recent changes without moving the selection outside the table. This function has no effect if the Faster Table Editing option is not selected.
  • Page 372: Dom.gettableextent()

    dom.getTableExtent() Availability Dreamweaver 3. Description This function gets the number of columns and rows in the selected table. Arguments None. Returns An array that contains two whole numbers. The first array item is the number of columns, and the second array item is the number of rows. If no table is selected, nothing returns. dom.increaseColspan() Availability Dreamweaver 3.
  • Page 373: Dom.inserttablecolumns()

    dom.insertTableColumns() Availability Dreamweaver 3. Description This function inserts the specified number of table columns into the current table. Arguments numberOfCols bBeforeSelection • argument is the number of columns to insert. numberOfCols • argument is a Boolean value: indicates that the columns should bBeforeSelection true be inserted before the column that contains the selection;...
  • Page 374: Dom.mergetablecells()

    dom.mergeTableCells() Availability Dreamweaver 3. Description This function merges the selected table cells. Arguments None. Returns Nothing. Enabler “dom.canMergeTableCells()” on page 438. dom.removeAllTableHeights() Availability Dreamweaver 3. Description This function removes all attributes from the selected table. HEIGHT Arguments None. Returns Nothing. dom.removeAllTableWidths() Availability Dreamweaver 3.
  • Page 375: Dom.removecolumnwidth()

    dom.removeColumnWidth() Availability Dreamweaver MX 2004. Description This function removes all attributes from a single, selected column. WIDTH Arguments None. Returns Nothing. dom.selectTable() Availability Dreamweaver 3. Description Selects an entire table. Arguments None. Returns Nothing. Enabler “dom.canSelectTable()” on page 439. dom.setShowTableWidths() Availability Dreamweaver MX 2004.
  • Page 376: Dom.settablecelltag()

    Returns Nothing. dom.setTableCellTag() Availability Dreamweaver 3. Description This function specifies the tag for the selected cell. Arguments tdOrTh • argument must be either tdOrTh "td" "th" Returns Nothing. dom.setTableColumns() Availability Dreamweaver 3. Description This function sets the number of columns in the selected table. Arguments numberOfCols •...
  • Page 377: Dom.showinserttablerowsorcolumnsdialog()

    dom.showInsertTableRowsOrColumnsDialog() Availability Dreamweaver 3. Description This function opens the Insert Rows or Columns dialog box. Arguments None. Returns Nothing. Enabler “dom.canInsertTableColumns()” on page 436 “dom.canInsertTableRows()” on page 437. dom.splitTableCell() Availability Dreamweaver 3. Description This function splits the current table cell into the specified number of rows or columns. If one or both of the arguments is omitted, the Split Cells dialog box appears.
  • Page 378 Chapter 17: Design...
  • Page 379: Chapter 18: Code

    Code functions Code Hints are menus that Macromedia Dreamweaver MX 2004 opens when you type certain character patterns in Code view. Code Hints provide a typing shortcut by offering a list of strings that potentially complete the string you are typing.
  • Page 380: Dreamweaver.codehints.addmenu()

    dreamweaver.codeHints.addMenu() Availability Dreamweaver MX. Description Dynamically defines a new tag in the CodeHints.xml file. If there is an existing menu tag menu that has the same pattern and document type, this function adds items to the existing menu. Arguments menuGroupId, pattern, labelArray, {valueArray}, {iconArray}, {doctypes}, {casesensitive} •...
  • Page 381: Dreamweaver.codehints.addfunction()

    Example If the user creates a record set called " ", the following code would create a menu for myRs myRS dw.codeHints.addMenu( "CodeHints_object_methods", // menu is enabled if object methods are enabled "myRS.", // pop up menu if user types "myRS." new Array("firstName", "lastName"), // items in drop-down menu for myRS new Array("firstName", "lastName"),...
  • Page 382: Dreamweaver.codehints.resetmenu()

    dreamweaver.codeHints.resetMenu() Availability Dreamweaver MX. Description Resets the specified menu tag or function tag to its state immediately after Dreamweaver reads the CodeHints.xml file. In other words, a call to this function erases the effect of previous calls to the functions. addMenu() addFunction() Arguments...
  • Page 383: Dreamweaver.reloadcodecoloring()

    dreamweaver.reloadCodeColoring() Description Reloads code coloring files from the Dreamweaver Configuration/Code Coloring folder. Arguments None. Returns Nothing. Example dreamweaver.reloadCodeColoring() Find/replace functions Find/replace functions handle find and replace operations. They cover basic functionality, such as finding the next instance of a search pattern, and complex replacement operations that require no user interaction.
  • Page 384: Dreamweaver.replace()

    dreamweaver.replace() Availability Dreamweaver 3. Description Verifies that the current selection matches the search criteria that was specified by dreamweaver.setUpFindReplace(), by dreamweaver.setUpComplexFindReplace(), or by the user in the Replace dialog box; the function then replaces the selection with the replacement text that is specified by the search request.
  • Page 385: Dreamweaver.setupcomplexfindreplace()

    Returns Nothing. Example The first line of the following example sets up a tag search and specifies that the scope of the search should be the current document. The second line performs the search operation. dreamweaver.setUpComplexFind('<dwquery><queryparams matchcase="false" ¬ ignorewhitespace="true" useregexp="false"/><find>¬ <qtag qname="a"><qattribute qname="href"...
  • Page 386: Dreamweaver.setupfind()

    dreamweaver.setUpFind() Availability Dreamweaver 3. Description Prepares for a text or HTML source search by defining the search parameters for a subsequent operation. dreamweaver.findNext() Arguments searchObject argument is an object for which the following properties can be defined: searchObject • is the text for which to search. searchString •...
  • Page 387: Dreamweaver.setupfindreplace()

    dreamweaver.setUpFindReplace() Availability Dreamweaver 3. Description Prepares for a text or HTML source search by defining the search parameters and the scope for a subsequent operation. dreamweaver.replace() dreamweaver.replaceAll() Arguments searchObject argument is an object for which the following properties can be defined: searchObject •...
  • Page 388: Dreamweaver.showfinddialog()

    dreamweaver.showFindDialog() Availability Dreamweaver 3. Description Opens the Find dialog box. Arguments None. Returns Nothing. Enabler “dreamweaver.canShowFindDialog()” on page 448. dreamweaver.showFindReplaceDialog() Availability Dreamweaver 3. Description Opens the Replace dialog box. Arguments None. Returns Nothing. Enabler “dreamweaver.canShowFindDialog()” on page 448. Chapter 18: Code...
  • Page 389: General Editing Functions

    General editing functions You handle general editing functions in the Document window. These functions insert text, HTML, and objects; apply, change, and remove font and character markup; modify tags and attributes; and more. dom.applyCharacterMarkup() Availability Dreamweaver 3. Description Applies the specified type of character markup to the selection. If the selection is an insertion point, it applies the specified character markup to any subsequently typed text.
  • Page 390: Dom.deleteselection()

    dom.deleteSelection() Availability Dreamweaver 3. Description Deletes the selection in the document. Arguments None. Returns Nothing. dom.editAttribute() Availability Dreamweaver 3. Description Displays the appropriate interface for editing the specified Document attribute. In most cases, this interface is a dialog box. This function is valid only for the active document. Arguments attribute •...
  • Page 391: Dom.getcharset()

    dom.getCharSet() Availability Dreamweaver 4. Description Returns the attribute in the meta tag of the document. charset Arguments None. Returns The encoding identity of the document. For example, for a Latin1 document, the function returns iso-8859-1 dom.getFontMarkup() Availability Dreamweaver 3. Description Gets the value of the specified attribute of the tag for the current selection.
  • Page 392: Dom.getlinkhref()

    dom.getLinkHref() Availability Dreamweaver 3. Description Gets the link that surrounds the current selection. This function is equivalent to looping through the parents and grandparents of the current node until a link is found and then calling the on the link. getAttribute('HREF') Arguments None.
  • Page 393: Dom.gettextalignment()

    dom.getTextAlignment() Availability Dreamweaver 3. Description Gets the alignment of the block that contains the selection. Arguments None. Returns A string that contains the value of the attribute for the tag that is associated with the block ALIGN or an empty string if the attribute is not set for the tag.
  • Page 394: Dom.indent()

    Returns A Boolean value that indicates whether the entire selection has the specified character markup. The function returns a value of if only part of the selection has the specified markup. false dom.indent() Availability Dreamweaver 3. Description Indents the selection using tags.
  • Page 395: Dom.insertobject()

    The result appears in the Document window, as shown in the following figure: dom.insertObject() Availability Dreamweaver 3. Description Inserts the specified object, prompting the user for parameters if necessary. Arguments objectName • argument is the name of an object in the Configuration/Objects folder. objectName Returns Nothing.
  • Page 396: Dom.newblock()

    Example The following code inserts the text: into the current document: &lt;b&gt;130&lt;/b&gt; var theDOM = dreamweaver.getDocumentDOM(); theDOM.insertText('<b>130</b>'); The results appear in the Document window, as shown in the following figure: dom.newBlock() Availability Dreamweaver 3. Description Creates a new block with the same tag and attributes as the block that contains the current selection or creates a new paragraph if the pointer is outside all blocks.
  • Page 397: Dom.outdent()

    dom.outdent() Availability Dreamweaver 3. Description Outdents the selection. Arguments None. Returns Nothing. dom.removeCharacterMarkup() Availability Dreamweaver 3. Description Removes the specified type of character markup from the selection. Arguments tagName • argument is the tag name that is associated with the character markup. It must be tagName one of the following strings: "b"...
  • Page 398: Dom.removelink()

    dom.removeLink() Availability Dreamweaver 3. Description Removes the hypertext link from the selection. Arguments None. Returns Nothing. dom.resizeSelection() Availability Dreamweaver 3. Description Resizes the selected object to the specified dimensions. Arguments newWidth newHeight • argument specifies the new width to which the function will set the newWidth selected object.
  • Page 399: Dom.setlinkhref()

    Returns Nothing. dom.setLinkHref() Availability Dreamweaver 3. Description Makes the selection a hypertext link or changes the URL value of the HREF tag that encloses the current selection. Arguments linkHREF • argument is the URL (document-relative path, root-relative path, or absolute linkHREF URL) comprising the link.
  • Page 400: Dom.setlistboxkind()

    dom.setListBoxKind() Availability Dreamweaver 3. Description Changes the kind of the selected menu. SELECT Arguments kind • argument must be either kind "menu" "list box" Returns Nothing. dom.showListPropertiesDialog() Availability Dreamweaver 3. Description Opens the List Properties dialog box. Arguments None. Returns Nothing.
  • Page 401: Dom.settextalignment()

    dom.setTextAlignment() Availability Dreamweaver 3. Description Sets the attribute of the block that contains the selection to the specified value. ALIGN Arguments alignValue • argument must be , or alignValue "left" "center" "right" Returns Nothing. dom.setTextFieldKind() Availability Dreamweaver 3. Description Sets the format of the selected text field. Arguments fieldType •...
  • Page 402: Dom.showfontcolordialog()

    dom.showFontColorDialog() Availability Dreamweaver 3. Description Opens the Color Picker dialog box. Arguments None. Returns Nothing. dreamweaver.deleteSelection() Availability Dreamweaver 3. Description Deletes the selection in the active document or the Site panel; on the Macintosh, it deletes the text box that has focus in a dialog box or floating panel. Arguments None.
  • Page 403: Dreamweaver.getfontlist()

    dreamweaver.getFontList() Availability Dreamweaver 3. Description Gets a list of all the font groups that appear in the text Property inspector and in the Style Definition dialog box. Arguments None. Returns An array of strings that represent each item in the font list. Example For the default installation of Dreamweaver, a call to the function...
  • Page 404: Dreamweaver.getkeystate()

    dreamweaver.getKeyState() Availability Dreamweaver 3. Description Determines whether the specified modifier key is depressed. Arguments • argument must be one of the following values: , or . In "Cmd" "Ctrl" "Alt" "Shift" Windows, refer to the Control key; on the Macintosh, refers to the "Cmd"...
  • Page 405: Dreamweaver.getsystemfontlist()

    dreamweaver.getSystemFontList() Availability Dreamweaver 4. Description Returns a list of fonts for the system. This function can get either all fonts or only TrueType fonts. These fonts are needed for the Flash Text object. Arguments fontTypes • argument is a string that contains either fontTypes "all"...
  • Page 406: Quick Tag Editor Functions

    Example The following example calls to invoke the Print dialog box for the user’s dw.PrintCode() document. If the function returns the value , the code displays an alert to inform the user false that it cannot execute the print request. var theDOM = dreamweaver.getDocumentDOM("document");...
  • Page 407: Dom.striptag()

    dom.stripTag() Availability Dreamweaver 3. Description Removes the tag from around the current selection, leaving any contents. If the selection has no tags or contains more than one tag, Dreamweaver reports an error. Arguments None. Returns Nothing. dom.wrapTag() Availability Dreamweaver 3. Description Wraps the specified tag around the current selection.
  • Page 408: Code View Functions

    Arguments {nearWhat} {mode} • The optional argument, if specified, must be either nearWhat "selection" "tag . If this argument is omitted, the default value is selector" "selection" • The optional argument, if specified, must be , or mode "default" "wrap" "insert"...
  • Page 409: Dom.getshownoscript()

    Arguments None. Returns Nothing. dom.getShowNoscript() Availability Dreamweaver MX. Description Gets the current state of the content option (from the View > Noscript Content menu noscript option). On by default, the tag identifies page script content that can be rendered, or noscript not (by choice), in the browser.
  • Page 410: Dom.isdesignviewupdated()

    dom.isDesignviewUpdated() Availability Dreamweaver 4. Description Determines whether the Design view and Text view content is synchronized for those Dreamweaver operations that require a valid document state. Arguments None. Returns A Boolean value: if the Design view (WYSIWYG) is synchronized with the text in the Text true view;...
  • Page 411: Dom.source.arrowdown()

    Returns Nothing. dom.source.arrowDown() Availability Dreamweaver 4. Description Moves the insertion point down the Code view document, line by line. If content is already selected, this function extends the selection line by line. Arguments {nTimes} {bShiftIsDown} • argument, which is optional, is the number of lines that the insertion point must nTimes move.
  • Page 412: Dom.source.arrowright()

    dom.source.arrowRight() Availability Dreamweaver 4. Description Moves the insertion point to the right in the current line of the Code view. If content is already selected, this function extends the selection to the right. Arguments {nTimes} {bShiftIsDown} • argument, which is optional, is the number of characters that the insertion point nTimes must move.
  • Page 413: Dom.source.balancebracestextview()

    dom.source.balanceBracesTextview() Availability Dreamweaver 4. Description This function is a Code view extension that enables parentheses balancing. You can call to extend a currently highlighted selection or insertion dom.source.balanceBracesTextview() point from the opening of the surrounding parenthetical statement to the end of the statement to balance the following characters: .
  • Page 414: Dom.source.endpage()

    Returns Nothing. dom.source.endPage() Availability Dreamweaver 4. Description Moves the insertion point to the end of the current page or to the end of the next page if the insertion point is already at the end of a page. If content is already selected, this function extends the selection page by page.
  • Page 415: Dom.source.getlinefromoffset()

    Returns A pair of integers that represent offsets from the beginning of the source document. The first integer is the opening of the selection; the second is the closing of the selection. If the two numbers are equal, the selection is an insertion point. If there is no selection in the source, both numbers are -1.
  • Page 416: Dom.source.indenttextview()

    Arguments offset, {searchDirection} • argument is a number that specifies the offset in the code for which the function offset will return any errors. • argument, which is optional, is a string that specifies " ", searchDirection empty " or " If specified, the function searches forward or back from the given forward"...
  • Page 417: Dom.source.insert()

    dom.source.insert() Availability Dreamweaver 4. Description Inserts the specified string into the source code at the specified offset from the beginning of the source file. If the offset is not greater than or equal to zero, the insertion fails and the function returns false Arguments...
  • Page 418: Dom.source.pagedown

    Arguments None. Returns Nothing. dom.source.pageDown() Availability Dreamweaver 4. Description Moves the insertion point down the Code view document, page by page. If content is already selected, this function extends the selection page by page. Arguments {nTimes} {bShiftIsDown} • argument, which is optional, is the number of pages that the insertion point must nTimes move.
  • Page 419: Dom.source.previousword()

    dom.source.previousWord() Availability Dreamweaver 4. Description Moves the insertion point to the beginning of the previous word (or words, if specified) in Code view. If content is already selected, this function extends the selection to the left. Arguments {nTimes} {bShiftIsDown} • argument, which is optional, is the number of words that the insertion point must nTimes move.
  • Page 420: Dom.source.scrollendfile()

    dom.source.scrollEndFile() Availability Dreamweaver 4. Description Scrolls the Code view to the bottom of the document file without moving the insertion point. Arguments None. Returns Nothing. dom.source.scrollLineDown() Availability Dreamweaver 4. Description Scrolls the Code view down line by line without moving the insertion point. Arguments nTimes •...
  • Page 421: Dom.source.scrollpagedown()

    dom.source.scrollPageDown() Availability Dreamweaver 4. Description Scrolls the Code view down page by page without moving the insertion point. Arguments nTimes • argument is the number of pages to scroll. If is omitted, the default is 1. nTimes nTimes Returns Nothing. dom.source.scrollPageUp() Availability Dreamweaver 4.
  • Page 422: Dom.source.selectparenttag()

    dom.source.selectParentTag() Availability Dreamweaver 4. Description This function is a Code view extension that enables tag balancing. You can call to extend a currently highlighted selection or insertion point dom.source.selectParentTag() from the surrounding open tag to the closing tag. Subsequent calls extend the selection to additional surrounding tags until there are no more enclosing tags.
  • Page 423: Dom.source.startofline()

    Returns Nothing. dom.source.startOfLine() Availability Dreamweaver 4. Description Places the insertion point at the beginning of the current line. If content is already selected, this function extends the selection to the beginning of the current line. Arguments bShiftIsDown • argument is a Boolean value that indicates whether content is being bShiftIsDown selected.
  • Page 424: Dom.source.wrapselection()

    dom.source.wrapSelection() Availability Dreamweaver 4. Description Inserts the text of before the current selection and the text of after the current startTag endTag selection. The function then selects the entire range between, and including, the inserted tags. If the current selection was an insertion point, then the function places the insertion point between don’t have to be tags;...
  • Page 425: Tag Editor And Tag Library Functions

    Tag editor and tag library functions You can use tag editors to insert new tags, edit existing tags, and access reference information about tags. The Tag Chooser lets users organize their tags so that they can easily select frequently used tags. The tag libraries that come with Dreamweaver store information about tags that are used in standards-based markup languages and most widely used tag-based scripting languages.
  • Page 426: Dreamweaver.popupedittagdialog()

    dreamweaver.popupEditTagDialog() Availability Dreamweaver MX. Description If a tag is selected, this function opens the tag editor for that tag, so you can edit the tag. Arguments None. Returns Nothing. Enabler “dreamweaver.canPopupEditTagDialog()” on page 445. dreamweaver.showTagChooser() Availability Dreamweaver MX. Description This function displays the Tag Chooser dialog box, brings it to the front, and sets it in focus. Arguments None.
  • Page 427: Dreamweaver.taglibrary.gettaglibrarydom()

    dreamweaver.tagLibrary.getTagLibraryDOM() Availability Dreamweaver MX. Description Given the URL of a file, this function returns the DOM for that file, so that its filename.vtm contents can be edited. This function should be called only when the Tag Library editor is active. Arguments fileURL •...
  • Page 428: Dreamweaver.taglibrary.importdtdorschema()

    dreamweaver.tagLibrary.importDTDOrSchema() Availability Dreamweaver MX. Description This function imports a DTD or schema file from a remote server into the tag library. Arguments fileURL, Prefix • argument is the path to DTD or schema file, in local URL format. fileURL • argument is the prefix string that should be added to all tags in this tag library.
  • Page 429 Example: The following example shows that using the function dw.tagLibrary.getImportedTagList() can get an array of tags from the library: libName // "fileURL" and "prefix" have been entered by the user. // tell the Tag Library to Import the DTD/Schema var libName = dw.tagLibrary.importDTDOrSchema(fileURL, prefix); // get the array of tags for this library // this is the TagInfo object var tagArray = dw.tagLibrary.getImportedTagList(libName);...
  • Page 430 Chapter 18: Code...
  • Page 431: Chapter 19: Enablers

    CHAPTER 19 Enablers Macromedia Dreamweaver MX 2004 Enabler functions determine whether another function can perform a specific operation in the current context. The function specifications describe the general circumstances under which each function returns a value. However, the descriptions true...
  • Page 432: Dom.canapplytemplate()

    dom.canApplyTemplate() Availability Dreamweaver 3. Description Checks whether Dreamweaver can perform an Apply To Page operation. This function is valid only for the active document. Arguments None. Returns A Boolean value that indicates whether the document is not a library item or a template, and that the selection is not within the tag.
  • Page 433: Dom.canclippaste()

    dom.canClipPaste() Availability Dreamweaver 3. Description Checks whether Dreamweaver can perform a Paste operation. Arguments None. Returns A Boolean value: if the Clipboard contains any content that can be pasted into true Dreamweaver; otherwise. false dom.canClipPasteText() Availability Dreamweaver 3. Description Checks whether Dreamweaver can perform a Paste as Text operation. Arguments None.
  • Page 434: Dom.canconverttablestolayers()

    dom.canConvertTablesToLayers() Availability Dreamweaver 3. Description Checks whether Dreamweaver can perform a Convert Tables to Layers operation. Arguments None. Returns A Boolean value: if all the content in the section of the document is contained within true BODY tables, and the document is not based on a template; otherwise.
  • Page 435: Dom.candeletetablecolumn()

    dom.canDeleteTableColumn() Availability Dreamweaver 3. Description Checks whether Dreamweaver can perform a Delete Column operation. Arguments None. Returns A Boolean value: if the insertion point is inside a cell or if a cell or column is selected; true otherwise. false dom.canDeleteTableRow() Availability Dreamweaver 3.
  • Page 436: Dom.canincreasecolspan()

    dom.canIncreaseColspan() Availability Dreamweaver 3. Description Checks whether Dreamweaver can perform an Increase Colspan operation. Arguments None. Returns A Boolean value: if there are any cells to the right of the current cell; otherwise. true false dom.canIncreaseRowspan() Availability Dreamweaver 3. Description Checks whether Dreamweaver can perform an Increase Rowspan operation.
  • Page 437: Dom.caninserttablerows()

    dom.canInsertTableRows() Availability Dreamweaver 3. Description Checks whether Dreamweaver can perform an Insert Row(s) operation. Arguments None. Returns A Boolean value: if the selection is inside a table; if the selection is an entire table or is true false not inside a table. dom.canMakeNewEditableRegion() Availability Dreamweaver 3.
  • Page 438: Dom.canmergetablecells()

    dom.canMergeTableCells() Availability Dreamweaver 3. Description Checks whether Dreamweaver can perform a Merge Cells operation. Arguments None. Returns A Boolean value: if the selection is an adjacent grouping of table cells; otherwise. true false dom.canPlayPlugin() Availability Dreamweaver 3. Description Checks whether Dreamweaver can perform a Play operation. This function is valid only for the active document.
  • Page 439: Dom.canremoveeditableregion()

    dom.canRemoveEditableRegion() Availability Dreamweaver 3. Description Checks whether Dreamweaver can perform an Unmark Editable Region operation. Arguments None. Returns A Boolean value: if the current document is a template; otherwise. true false dom.canSelectTable() Availability Dreamweaver 3. Description Checks whether Dreamweaver can perform a Select Table operation. Arguments None.
  • Page 440: Dom.canshowlistpropertiesdialog()

    dom.canShowListPropertiesDialog() Availability Dreamweaver 3. Description Checks whether Dreamweaver can show the List Properties dialog box. Arguments None. Returns A Boolean value: if the selection is within an tag; otherwise. true false dom.canSplitFrame() Availability Dreamweaver 3. Description Checks whether Dreamweaver can perform a Split Frame [Left | Right | Up | Down] operation. Arguments None.
  • Page 441: Dom.canstopplugin()

    dom.canStopPlugin() Availability Dreamweaver 3. Description Checks whether Dreamweaver can perform a Stop operation. Arguments None. Returns A Boolean value: if the selection is currently being played with a plug-in; otherwise. true false dom.canUndo() Availability Dreamweaver 3. Description Checks whether Dreamweaver can perform an Undo operation. Arguments None.
  • Page 442: Dreamweaver.assetpalette.canedit()

    dreamweaver.assetPalette.canEdit() Availability Dreamweaver 4. Description Enables menu items in the Assets panel for editing. Arguments None. Returns Returns a Boolean value: if the asset can be edited; otherwise. Returns a value true false false for colors and URLs in the Site list, and returns a value for a multiple selection of colors false and URLs in the Favorites list.
  • Page 443: Dreamweaver.canclipcut()

    dreamweaver.canClipCut() Availability Dreamweaver 3. Description Checks whether Dreamweaver can perform a Cut operation. Arguments None. Returns A Boolean value: if there is any selected content that can be cut to the Clipboard; true otherwise. false dreamweaver.canClipPaste() Availability Dreamweaver 3. Description Checks whether Dreamweaver can perform a Paste operation.
  • Page 444: Dreamweaver.canexportcss()

    dreamweaver.canExportCSS() Availability Dreamweaver 3. Description Checks whether Dreamweaver can perform an Export CSS Styles operation. Arguments None. Returns A Boolean value: if the document contains any class styles that are defined in the true HEAD section; otherwise. false dreamweaver.canExportTemplateDataAsXML() Availability Dreamweaver MX.
  • Page 445: Dreamweaver.canopeninframe()

    Returns A Boolean value: if a search pattern has already been established; otherwise. true false dreamweaver.canOpenInFrame() Availability Dreamweaver 3. Description Checks whether Dreamweaver can perform an Open in Frame operation. Arguments None. Returns A Boolean value: if the selection or insertion point is within a frame; otherwise.
  • Page 446: Dreamweaver.canredo()

    dreamweaver.canRedo() Availability Dreamweaver 3. Description Checks whether Dreamweaver can perform a Redo operation in the current context. Arguments None. Returns A Boolean value that indicates whether any operations can be undone. dreamweaver.canRevertDocument() Availability Dreamweaver 3. Description Checks whether Dreamweaver can perform a Revert (to the last-saved version) operation. Arguments documentObject •...
  • Page 447: Dreamweaver.cansavedocument()

    dreamweaver.canSaveDocument() Availability Dreamweaver 3. Description Checks whether Dreamweaver can perform a Save operation on the specified document. Arguments documentObject • argument is the root of a document’s DOM (the same value that the documentObject function returns). dreamweaver.getDocumentDOM() Returns A Boolean value that indicates whether the document has any unsaved changes. dreamweaver.canSaveDocumentAsTemplate() Availability Dreamweaver 3.
  • Page 448: Dreamweaver.cansaveframesetas()

    dreamweaver.canSaveFramesetAs() Availability Dreamweaver 3. Description Checks whether Dreamweaver can perform a Save Frameset As operation on the specified document. Arguments documentObject • argument is the root of a document’s DOM (the same value that the documentObject function returns). dreamweaver.getDocumentDOM() Returns A Boolean value that indicates whether the document is a frameset.
  • Page 449: Dreamweaver.canundo()

    dreamweaver.canUndo() Availability Dreamweaver 3. Description Checks whether Dreamweaver can perform an Undo operation in the current context. Arguments None. Returns A Boolean value that indicates whether any operations can be undone. dreamweaver.cssRuleTracker.canEditSelectedRule() Availability Dreamweaver MX 2004. Description Checks whether the Property Grid editor can be applied to the selected rule. Because the Property Grid can display rules in locked files, a return value of does not guarantee that the rule can true...
  • Page 450: Dreamweaver.cssstylepalette.candeleteselectedstyle()

    Returns A Boolean value: if the selected style has a class selector; otherwise. true false dreamweaver.cssStylePalette.canDeleteSelectedStyle() Availability Dreamweaver MX. Description Checks the current selection to determine whether the selected style can be deleted. Arguments None. Returns A Boolean value: if the selection can be deleted; otherwise.
  • Page 451: Dreamweaver.cssstylepalette.caneditstylesheet()

    dreamweaver.cssStylePalette.canEditStyleSheet() Availability Dreamweaver MX. Description Checks the current selection to see whether it contains style sheet elements that can be edited. Arguments None. Returns A Boolean value: if the selection is a style sheet node or a style definition within a style sheet true node and the style sheet is neither hidden nor this document;...
  • Page 452: Dreamweaver.resultspalette.canclear()

    dreamweaver.resultsPalette.canClear() Availability Dreamweaver MX. Description Checks whether you can clear the contents of the Results panel that is currently in focus. Arguments None. Returns A Boolean value: if the contents can clear; otherwise. true false dreamweaver.resultsPalette.canCopy() Availability Dreamweaver MX. Description Checks whether the current Results window can display a copied message in its contents.
  • Page 453: Dreamweaver.resultspalette.canpaste()

    dreamweaver.resultsPalette.canPaste() Availability Dreamweaver MX. Description Checks whether the current Results window can display a Paste message in its contents. Arguments None. Returns A Boolean value: if the contents can display; otherwise. true false dreamweaver.resultsPalette.canOpenInBrowser() Availability Dreamweaver MX. Description Checks whether the current report can display in a browser. Arguments None.
  • Page 454: Dreamweaver.resultspalette.cansave()

    dreamweaver.resultsPalette.canSave() Availability Dreamweaver MX. Description Checks whether the Save dialog box can open for the current panel. Currently, the Site Reports, Target Browser Check, Validation, and Link Checker panels support the Save dialog box. Arguments None. Returns A Boolean value: if the Save dialog box can appear;...
  • Page 455: Dreamweaver.snippetpalette.caninsert()

    dreamweaver.snippetpalette.canInsert() Availability Dreamweaver MX. Description Checks whether you can insert or apply the selected element and returns either a true false value so you can enable or disable menu items for inserting or applying. Arguments None. Returns A Boolean value: if you can insert or apply the selected element;...
  • Page 456: Site.canchangelink()

    site.canChangeLink() Availability Dreamweaver 3. Description Checks whether Dreamweaver can perform a Change Link operation. Arguments None. Returns A Boolean value: if an HTML or Flash file links to the selected file in the site map; true otherwise. false site.canCheckIn() Availability Dreamweaver 3.
  • Page 457: Site.cancloak()

    Arguments siteOrURL • argument must be the keyword, which indicates that the function siteOrURL site should act on the selection in the Site panel or the URL for a single file. Returns A Boolean value: if all the following conditions are true; otherwise: true false...
  • Page 458: Site.canfindlinksource()

    site.canFindLinkSource() Availability Dreamweaver 3. Description Checks whether Dreamweaver can perform a Find Link Source operation. Arguments None. Returns A Boolean value that indicates that the selected link in the site map is not the home page. site.canGet() Availability Dreamweaver 3. Description Determines whether Dreamweaver can perform a Get operation.
  • Page 459: Site.canmakeeditable()

    Returns One of the following values: • If the first argument is the keyword and the second argument is a URL, a Boolean value local that indicates whether the document belongs to a site • If the first argument is the keyword and the second argument is a URL, a Boolean remote value that indicates whether the document belongs to a site for which a remote site has been...
  • Page 460: Site.canopen()

    site.canOpen() Availability Dreamweaver 3. Description Checks whether Dreamweaver can open the files or folders that are currently selected in the Site panel. Arguments None. Returns A Boolean value: if any files or folders are selected in the Site panel; otherwise. true false site.canPut()
  • Page 461: Site.canrefresh()

    Returns A Boolean value: if the Use Cache To Speed Link Updates option is enabled for the true current site. site.canRefresh() Availability Dreamweaver 3. Description Checks whether Dreamweaver can perform a Refresh [Local | Remote] operation. Arguments localOrRemote • argument must be either the keyword localOrRemote local...
  • Page 462: Site.canselectallcheckedoutfiles()

    site.canSelectAllCheckedOutFiles() Availability Dreamweaver 4. Description Determines whether the current working site has the Check In/Check Out feature enabled. Arguments None. Returns A Boolean value: if the site allows Check In/Check Out; otherwise. true false site.canSelectNewer() Availability Dreamweaver 3. Description Determines whether Dreamweaver can perform a Select Newer [Remote | Local] operation. Arguments localOrRemote •...
  • Page 463: Site.cansynchronize()

    site.canSynchronize() Availability Dreamweaver 3. Description Determines whether Dreamweaver can perform a Synchronize operation. Arguments None. Returns A Boolean value that indicates whether a remote site has been defined. site.canUncloak() Availability Dreamweaver MX. Description Determines whether Dreamweaver can perform an uncloaking operation. Arguments siteOrURL •...
  • Page 464: Site.canviewasroot()

    site.canViewAsRoot() Availability Dreamweaver 3. Description Determines whether Dreamweaver can perform a View as Root operation. Arguments None. Returns A Boolean value: if the specified file is an HTML or Flash file; otherwise. true false Chapter 19: Enablers...
  • Page 465: Index

    INDEX assetPalette.edit() 295 assetPalette.getSelectedCategory() 295 addBehavior() 303 assetPalette.getSelectedItems() 295 addDebugContextData() 181 assetPalette.getSelectedView() 296 addItem() 173 assetPalette.insertOrApply() 296 addLinkToExistingFile() 221 assetPalette.locateInSite() 297 addLinkToNewFile() 221 assetPalette.newAsset() 297 addResultItem() 174 assetPalette.newFolder() 297 addSpacerToColumn() 363 assetPalette.recreateLibraryFromDocument() 298 align() 354 assetPalette.refreshSiteAssets() 298 APIs, types of assetPalette.removeFromFavorites() 298 database 77 assetPalette.renameNickname() 299...
  • Page 466 canCheckIn() 456 canRemoveLink() 461 canCheckOut() 456 canRevertDocument() 446 canClear() 452 canSave() 454 canClipCopy() 442 canSaveAll() 446 canClipCopyText() 432 canSaveDocument() 447 canClipCut() 443 canSaveDocumentAsTemplate() 447 canClipPaste() 433, 443 canSaveFrameset() 447 canClipPasteText() 433 canSaveFramesetAs() 448 canCloak() 457 canSelectAll() 448, 454 canConnect() 457 canSelectAllCheckedOutFiles() 462 canConvertLayersToTable() 433 canSelectNewer() 462...
  • Page 467 codeHints.addFunction() 381, 382 codeHints.addMenu() 380 Data Manager 329 codeHints.resetMenu() 382 data property of httpReply objects 43 codeHints.showCodeHints() 382 database access functions 91 ColdFusion Component Explorer 229, 233 database API 77 columns access functions 91 getting from statements 91 connection functions 78 getting from stored procedures 96 MMDB.deleteConnection() 78 Command menu functions 250...
  • Page 468 database connection dialog box API 105 dom.addSpacerToColumn() 363 definition files 109 dom.align() 354 include files, generated 108 dom.applyCharacterMarkup() 389 database connection functions 78 dom.applyCSSStyle() 345 database connection type definition files 109 dom.applyFontMarkup() 389 database connectivity API dom.applyTemplate() 317 applyConnection() 107 dom.arrange() 355 findConnection() 105 dom.arrowDown() 163...
  • Page 469 dom.convertLayersToTable() 249 dom.getShowAutoIndent() 183 dom.convertTablesToLayers() 250 dom.getShowFrameBorders() 183 dom.convertToXHTML() 252 dom.getShowGrid() 184 dom.convertWidthsToPercent() 369 dom.getShowHeadView() 184 dom.convertWidthsToPixels() 369 dom.getShowImageMaps() 185 dom.createLayoutCell() 363 dom.getShowInvalidHTML() 184 dom.createLayoutTable() 364 dom.getShowInvisibleElements() 185 dom.decreaseColspan() 369 dom.getShowLayerBorders() 185 dom.decreaseRowspan() 370 dom.getShowLayoutTableTabs() 365 dom.deleteKey() 165 dom.getShowLayoutView() 366 dom.deleteSelection() 390 dom.getShowLineNumbers() 186 dom.deleteTableColumn() 370...
  • Page 470 dom.makeCellWidthsConsistent() 366 dom.serverModel.getServerName() 342 dom.makeSizesEqual() 355 dom.serverModel.getServerSupportsCharset() 343 dom.markSelectionAsEditable() 320 dom.serverModel.getServerVersion() 343 dom.mergeTableCells() 374 dom.serverModel.testAppServer() 344 dom.moveSelectionBy() 355 dom.setAttributeWithErrorChecking() 398 dom.newBlock() 396 dom.setColumnAutostretch() 367 dom.newEditableRegion() 321 dom.setEditNoFramesContent() 188 dom.nextParagraph() 166 dom.setHideAllVisualAids() 189 dom.nextWord() 167 dom.setLayerTag() 356 dom.nodeToOffsets() 280 dom.setLinkHref() 399 dom.notifyFlashObjectChanged() 396 dom.setLinkTarget() 399 dom.offsetsToNode() 281...
  • Page 471 dom.showFontColorDialog() 402 doURLDecoding() 270 dom.showInfoMessagePopup() 269 doURLEncoding() 286 dom.showInsertTableRowsOrColumnsDialog() 377 dreamweaver.arrangeFloatingPalettes() 362 dom.showListPropertiesDialog() 400 dreamweaver.assetPalette.addToFavoritesFromDocume dom.showPagePropertiesDialog() 270 nt() 293 dom.snapTracingImageToSelection() 361 dreamweaver.assetPalette.addToFavoritesFromSiteAsset dom.source.arrowDown() 411 s() 294 dom.source.arrowLeft() 411 dreamweaver.assetPalette.addToFavoritesFromSiteWin dom.source.arrowRight() 412 dow() 294 dom.source.arrowUp() 412 dreamweaver.assetPalette.canEdit() 442 dom.source.balanceBracesTextView() 413 dreamweaver.assetPalette.canInsertOrApply() 442 dom.source.endOfDocument() 413 dreamweaver.assetPalette.copyToSite() 294 dom.source.endOfLine() 413...
  • Page 472 dreamweaver.canOpenInFrame() 445 dreamweaver.cssStylePallette.canEditStyleSheet() 451 dreamweaver.canPlayRecordedCommand() 445 dreamweaver.dbi.getDataSources() 328 dreamweaver.canPopupEditTagDialog() 445 dreamweaver.deleteSelection() 402 dreamweaver.canRedo() 446 dreamweaver.doURLDecoding() 270 dreamweaver.canRevertDocument() 446 dreamweaver.doURLEncoding() 286 dreamweaver.canSaveAll() 446 dreamweaver.editCommandList() 250 dreamweaver.canSaveDocument() 447 dreamweaver.editFontList() 402 dreamweaver.canSaveDocumentAsTemplate() 447 dreamweaver.editLockedRegions() 290 dreamweaver.canSaveFrameset() 447 dreamweaver.exportCSS() 257 dreamweaver.canSaveFramesetAs() 448 dreamweaver.exportEditableRegionsAsXML() 258 dreamweaver.canSelectAll() 448 dreamweaver.exportTemplateDataAsXML() 258 dreamweaver.canShowFindDialog() 448...
  • Page 473 dreamweaver.getRecentFileList() 260 dreamweaver.libraryPalette.recreateFromDocument() dreamweaver.getRedoText() 154 dreamweaver.getSecondaryBrowser() 145 dreamweaver.libraryPalette.renameSelectedItem() 301 dreamweaver.getServerModels() 344 dreamweaver.liveDataTranslate() 333 dreamweaver.getShowDialogsOnInsert() 149 dreamweaver.loadSitesFromPrefs() 220 dreamweaver.getShowStatusBar() 195 dreamweaver.mapKeyCodeToChar() 170 dreamweaver.getSiteRoot() 278 dreamweaver.minimizeRestoreAll() 213 dreamweaver.getSnapDistance() 212 dreamweaver.nativeToLatin1() 287 dreamweaver.getSystemFontList() 405 dreamweaver.newDocument() 261 dreamweaver.getTempFolderPath() 278 dreamweaver.newFromTemplate() 261 dreamweaver.getTokens() 286 dreamweaver.nodeExists() 283 dreamweaver.getTranslatorList() 291 dreamweaver.notifyMenuUpdated() 171 dreamweaver.getUndoText() 154...
  • Page 474 dreamweaver.resultsPalette.cut() 178 dreamweaver.showTagChooser() 151, 426 dreamweaver.resultsPalette.debugWindow.addDebugC dreamweaver.showTagLibraryEditor() 426 ontextData() 181 dreamweaver.showTargetBrowsersDialog() 276 dreamweaver.resultsPalette.openInBrowser() 179 dreamweaver.snippetPalette.editSnippet() 325 dreamweaver.resultsPalette.openInEditor() 179 dreamweaver.snippetPalette.getCurrentSnippetPath() dreamweaver.resultsPalette.paste() 178 dreamweaver.resultsPalette.save() 179 dreamweaver.snippetPalette.insert() 325 dreamweaver.resultsPalette.selectAll() 180 dreamweaver.snippetPalette.insertSnippet() 326 dreamweaver.revertDocument() 264 dreamweaver.snippetPalette.newFolder() 324 dreamweaver.runCommand() 251 dreamweaver.snippetPalette.newSnippet() 324 dreamweaver.saveAll() 264 dreamweaver.snippetPalette.remove() 326 dreamweaver.saveDocument() 264 dreamweaver.snippetPalette.rename() 326 dreamweaver.saveDocumentAs() 265...
  • Page 475 DWfile.setAttributes() 41 FilePathToLocalURL() 57 DWfile.write() 42 files snippets 323 files on disk copying 34 editAttribute() 390 creating (HTML files) 255 editColumns() 226 creating (non-HTML files) 42 editCommandList() 250 creating (XHTML files) 256 editFontList() 402 creating (XML files) 257 editLockedRegions() 290 reading 39 editSelectedRule() 347 removing 40...
  • Page 476 getAttributes() 35 getExternalTextEditor() 143 getAutoValidationCount() 409 getExtGroups() 330 getBehavior() 304 getExtParticipants() 330 getBehaviorAt() 308 getFile() 45 getBehaviorCount() 308 getFileCallback() 47 getBehaviorElement() 305 getFlashPath() 143 getBehaviorEvent() 306 getFloaterVisibility() 210 getBehaviorTag() 306 getFocus() 207, 212, 232 getBrowserList() 142 getFolderName() 339 getCharSet() 391 getFontList() 403 getCheckOutUser() 230 getFontMarkup() 391...
  • Page 477 getPreventLayerOverlaps() 183 getShowLineNumbers() 186 getPrimaryBrowser() 144 getShowNoscript 409 getPrimaryExtensionEditor() 144 getShowPageTitles() 200 getPrimaryKeys() 94 getShowRulers() 186 getPrimaryView() 212 getShowStatusBar() 195 getProcedures() 94 getShowSyntaxColoring() 186 getProperties() 111 getShowTableBorders() 187 getRdsPassword() 84 getShowTableWidths() 371 getRdsUserName() 84 getShowToolbar() 187 getRecentFileList() 260 getShowToolbarIconLabels() 202 getRedoText() 154 getShowToolTips() 200 getRemoteDsnList() 84...
  • Page 478 getView() 208 indent() 394 getViews() 99 indentTextView() 416 getWindowTitle() 208 InfoPrefs 60 global application functions 148 insert object functions 161 global document functions 267 insert() 325, 417 insertFlashElement 72 insertFlashElement() 161 insertHTML() 394 hasCharacterMarkup() 393 insertLibraryItem() 320 hasConnectionWithName() 86 insertObject() 395 hasTracingImage() 441 insertSnippet() 326 hideInfoMessagePopup() 268...
  • Page 479 loadTracingImage() 358 MMDB.showConnectionMgrDialog() 89 LocalURLToFilePath() 61 MMDB.showOdbcDialog() 89 locateInSite() 235 MMDB.showRdsUserDialog() 89 MMDB.showRestrictDialog() 90 MMDB.showResultset() 100 MMDB.showSPResultset() 101 makeCellWidthsConsistent() 366 MMDB.showSPResultsetNamedParams() 102 makeEditable() 236 MMDB.testConnection() 90 makeNewDreamweaverFile() 236 MMHttp.clearServerScriptsFolder() 44 makeNewFolder() 237 MMHttp.clearTemp() 45 makeSizesEqual() 355 MMHttp.getFile() 45 mapKeyCodeToChar() 170 MMHttp.getFileCallback() 47 markSelectionAsEditable() 320 MMHttp.getTextCallback() 48...
  • Page 480 newRule() 347 postTextCallback 49 newSite() 237 preview attribute 323 newSnippet() 324 previousParagraph() 168 newStyle() 352 previousWord() 168, 419 nextParagraph() 166 PrintCode() 405 nextWord() 167, 417 put() 238 nodeExists() 283 nodeToOffsets() 280 dreamweaver.nodeToOffsets() 284 quitApplication() 149 _notes folder 51 notifyFlashObjectChanged() 396 notifyMenuUpdated() 171 read() 39 reapplyBehaviors() 304...
  • Page 481 resizeSelection() 398 scrollPageDown() 421 resizeSelectionBy() 356 scrollPageUp() 421 Results window functions 172 scrollTopFile() 421 resultsPalette.canClear() 452 SCS 133 resultsPalette.canCopy() 452 SCS_AfterPut() 137, 138 resultsPalette.canCut() 452 SCS_BeforeGet() 136 resultsPalette.canOpenInBrowser() 453 SCS_BeforePut() 137 resultsPalette.canOpenInEditor() 453 SCS_canCheckin() 134 resultsPalette.canPaste() 453 SCS_canCheckout() 133 resultsPalette.canSave() 454 SCS_canConnect() 133 resultsPalette.canSelectAll() 454 SCS_canDelete() 135...
  • Page 482 selectChild() 406 setRulerUnits() 359 selectHomePage() 241 setSelectedBehavior() 311 selection functions 279 setSelectedNode() 282 selectNewer() 242 setSelectedSteps() 160 selectParent() 406 setSelection() 245, 282, 285 selectParentTag() 422 setShowDependents() 200 selectTable() 375 setShowFrameBorders() 189 server setShowGrid() 190 behaviors functions 336 setShowHeadView() 190 components functions 327 setShowHiddenFiles() 201 debugging 180 setShowImageMaps() 191...
  • Page 483 showColdFusionAdmin() 88 site.canSetLayout() 461 showConnectionMgrDialog() 89 site.canSynchronize() 463 showDynamicData() 150 site.canUncloak() 463 showFindDialog() 388 site.canUndoCheckOut() 463 showFindReplaceDialog() 388 site.canViewAsRoot() 464 showFontColorDialog() 402 site.changeLink() 222 showGridSettingsDialog() 362 site.changeLinkSitewide() 222 showInfoMessagePopup() 269 site.checkIn() 222 showInsertTableRowsOrColumnsDialog() 377 site.checkLinks() 223 showListPropertiesDialog() 400 site.checkOut() 223 showLiveDataDialog() 335 site.checkTargetBrowsers() 224 showOdbcDialog() 89...
  • Page 484 site.remoteIsValid() 239 SCS_Checkout() 127 site.removeLink() 240 SCS_Connect() 119 site.renameSelection() 240 SCS_Delete() 123 site.runValidation() 240 SCS_Disconnect() 119 site.saveAsImage() 241 SCS_Get() 122 site.selectAll() 241 SCS_GetAgentInfo() 118 site.selectHomePage() 241 SCS_GetCheckoutName() 126 site.selectNewer() 242 SCS_GetConnectionInfo() 124 site.setAsHomePage() 242 SCS_GetDesignNotes() 131 site.setCloakingEnabled() 242 SCS_GetErrorMessage() 130 site.setConnectionState() 243 SCS_GetErrorMessageLength() 129 site.setCurrentSite() 243...
  • Page 485 stored procedures 91 getting columns from 96 window functions 207 getting parameters for 98 wrapSelection() 424 showing results of 101, 102 wrapTag() 407 stripTag() 407 write() 42 SWFFile.createFile() 73 SWFFile.getNaturalSize() 74 SWFFile.getObjectType() 75 XHTML SWFFile.readFile() 75 cleaning up 252 synchronize() 245 converting to 252 synchronizeDocument() 424 creating 256...
  • Page 486 Index...

This manual is also suitable for:

Dreamweaver mx 2004

Table of Contents