User Guide

Extending Dreamweaver

Summary of content (394 pages)

To use this sample, save it to the Drea

  • PAGE 58

    The following figure shows an advanced Recordset dialog box that uses a database tree control and a variable grid control: Adding a database tree control The database tree control has the following attributes: Attribute name Description name Name of the database tree control control.style Width and height, in pixels type Type of control connection Name of the database connection that is defined in the Connection Manager; if empty, the control is empty.

  • PAGE 59

    To add a database tree control to a dialog box, you can use the following sample code with appropriate substitutions for quoted variables: You can change the connection attribute to retrieve selected data and display it in the tree. You can use the DBTreeControl attribute as a JavaScript wrapper object for the new tag.

  • PAGE 60

    Adding tree controls Tree controls display data in a hierarchical format and let users expand and collapse nodes in the tree. The MM:TREECONTROL tag lets you create tree controls for any type of information; unlike the database tree control that is described in “Adding a database tree control” on page 58, no association with a database is required.

  • PAGE 61

    Creating a tree control The MM:TREECONTROL tag creates a tree control and can use one or more tags to add structure, as described in the following list: • • is an empty, optional tag that defines a column in the tree control. MM:TREENODE is an optional tag that defines a node in the tree. It is a nonempty tag that can contain only other MM:TREENODE tags. MM:TREECOLUMN MM:TREECONTROL tags have the following attributes: Attribute name Description name Name of the tree control size Optional.

  • PAGE 62

    The MM:TREENODE attributes are described in the following table: Attribute name Description name Name of the node value Contains the content for the given node. For more than one column, this is a pipe-delimited string. To specify an empty column, place a single space character before the pipe (|). state Specifies that the node is expanded or collapsed with the strings "expanded" or "collapsed".

  • PAGE 63

    //add the new node to the top of the selected node’s children selNode.innerHTML = '' + selNode.innerHTML; Deleting nodes To delete the currently innerHTML or outerHTML properties. selected node from the document structure, use the The following example deletes the entire selected node and any children: var tree = document.myTreeControl; var selNode = tree.selectedNodes[0]; selNode.

  • PAGE 64

    A simple Flash dialog box example In this example, you use Dreamweaver to create a new command that displays a SWF file called myFlash.swf when the user clicks the command in the Commands menu. For specific information about creating commands before trying this example, see the information about commands in Extending Dreamweaver. Note: This example assumes you already have a SWF file called myFlash.swf in the Configuration/ Commands folder of your Dreamweaver application installation folder.

  • PAGE 65

    Save the file again. Next, exit and restart Dreamweaver. Select the Command > My Flash Movie menu option, and your Flash content appears in a Dreamweaver dialog box, as shown in the following figure: This example shows a simple implementation of Dreamweaver’s Flash content support. After you are familiar with building objects and commands as well as more sophisticated forms, you can integrate Flash content into your Dreamweaver extensions for a more dynamic user experience.

  • PAGE 66

    Chapter 3: User Interfaces for Extensions

  • PAGE 67

    CHAPTER 4 The Dreamweaver Document Object Model In Macromedia Dreamweaver MX 2004, the Document Object Model (DOM) is a critically important structure for extension builders. It lets you access and manipulate elements within a user’s document and within the extension file. A DOM defines the composition of documents that are created using a markup language. By representing tags and as objects and properties, the DOM lets programming languages access and manipulate documents and their components.

  • PAGE 68

    Which document DOM? It is important to distinguish between the DOM of the user’s document and the DOM of the extension. The information in this chapter applies to both types of Dreamweaver documents, but the way that you reference each DOM is different. If you are familiar with JavaScript in browsers, you can reference objects in the active document by writing document. (for example, document.forms[0]), the same way that you reference objects in extension files.

  • PAGE 69

    Object document Properties Methods Events forms • (an array of form getElementsBy TagName() hasChildNodes() onLoad objects) images • (an array of image objects) layers • (an array of LAYER, ILAYER, and absolutely positioned DIV and SPAN objects) child objects by name • nodeType • parentNode • childNodes • documentElement • body • URL • parentWindow • all tags/elements nodeType • parentNode • childNodes • tagName • attributes by name innerHTML outerHTML form getAttribute() setAttribute() removeAttri

  • PAGE 70

    Object Properties checkbox radio In addition to the properties that In addition to the methods onClick are available for all tags: that are available for all tags: checked form • Methods Events blur() focus() password text file hidden image (field) textarea In addition to the properties that In addition to the methods onBlur onFocus are available for all tags: that are available for all tags: form • select In addition to the properties that In addition to the methods are available for all tags: t

  • PAGE 71

    Properties and methods of the document object The following table details the properties and methods of the document object that are taken from DOM Level 1 and used in Dreamweaver. A bullet (•) marks read-only properties. Property or method Return value nodeType • Node.DOCUMENT_NODE parentNode • null parentWindow • The JavaScript object that corresponds to the document’s parent window. (This property is not included in DOM Level 1; however, Microsoft Internet Explorer 4.0 supports it.

  • PAGE 72

    Properties and methods of HTML tag objects Every HTML tag is represented by a JavaScript object. Tags are organized in a tree hierarchy, where tag x is a parent of tag y, if y falls completely within x’s opening and closing tags (x content y content more x content.). For this reason, your code should be well-formed. The following table lists the properties and methods of tag objects in Dreamweaver, along with their return values or explanations. A bullet (•) marks read-only properties.

  • PAGE 73

    Property or method Return value getElementsByTagName(tagName) A NodeList that can be used to step through child tags of type tagName (for example, IMG, DIV, and so on). If the tag argument is LAYER, the function returns all LAYER and ILAYER tags and all absolutely positioned DIV and SPAN tags. If the tag argument is INPUT, the function returns all form elements. (If a name attribute is specified for one or more tagName objects, it must begin with a letter, which the HTML 4.

  • PAGE 74

    Properties and methods of comment objects A JavaScript object represents each HTML comment. The following table details the properties and methods of comment objects that are taken from DOM Level 1 and are used in Dreamweaver. A bullet (•) marks read-only properties. Property or method Return value nodeType • Node.

  • PAGE 75

    The dreamweaver object has a property called systemScript that lets you query the language of the user’s operating system. Use this property if you need to include special cases in your extension code for localized operating systems, as shown in the following example: if (dreamweaver,systemScript && (dreamweaver.systemScript.

  • PAGE 76

    Chapter 4: The Dreamweaver Document Object Model

  • PAGE 77

    CHAPTER 5 Customizing Code View Macromedia Dreamweaver MX 2004 uses two devices in Code view that help you enter code quickly and make your code readable and accurate. These two devices are Code Hints and Code Coloring. In addition, Dreamweaver validates your code for the target browsers that you specify and allows you to change default HTML formatting. You can customize Code Hints and Code Coloring by modifying the XML files that implement them.

  • PAGE 78

    The CodeHints.xml file The CodeHints.xml file contains the following entities: • A list of all the menu groups • • Dreamweaver displays the list of menu groups when you select the Code Hints category from the Preferences dialog box. You can open the Preferences dialog box by selecting Edit > Preferences. Dreamweaver MX provides the following menu groups or types of Code Hints menus: Tag Names, Attribute Names, Attribute Values, Function Arguments, Object Methods and Variables, and HTML Entities.

  • PAGE 79

    Code Hints tags The CodeHints.xml file contains the following tags, which define Code Hints menus. You can use these tags to define additional Code Hints menus. Description The codehints tag is the root of the CodeHints.xml file. Attributes None. Contents One or more menugroup tags. Container None. Example Description Each menugroup tag corresponds to a type of menu.

  • PAGE 80

    Description The description tag contains text that Dreamweaver displays when you select the menu group from the Preferences dialog box. The description text displays below the list of menu groups. The description text might optionally contain a single a tag where the href attribute must be a JavaScript URL that Dreamweaver executes if the user clicks the link. Use the XML CDATA construct to enclose any special or illegal characters in the string so that Dreamweaver treats them as text.

  • PAGE 81

    • The casesensitive attribute specifies whether the pattern is case-sensitive. The possible values for the casesensitive attribute are true, false, or a subset of the comma-separated list that you specify for the doctypes attribute. The list of document types lets you specify that the pattern is case-sensitive for some document types but not for others. The value defaults to false if you omit this attribute.

  • PAGE 82

    Container The menu tag. Example Description This tag replaces the menu tag for specifying function arguments and object methods for a Code Hints pop-up menu. When you type a function or method name in Code View, Dreamweaver opens a menu of function prototypes, displaying the current argument in bold.

  • PAGE 83

    Container The menugroup tag. Example // function example // object method example Code coloring Dreamweaver lets you customize or extend the code coloring schemes that you see in Code view so that you can add new keywords to a scheme or add code coloring schemes for new document types.

  • PAGE 84

    The following excerpt from the Colors.

  • PAGE 85

    Notice that the syntaxColor and tagColor tags in the Colors.xml file assign color and style values to an id string value. The id value is then used in the codeColoring.xml file to assign a style to a scheme tag. For example, the defaultTag tag in the codeColoring.xml excerpt has an id of "CodeColor_HTMLComment". In the Colors.xml file, the id value of "CodeColor_HTMLComment" is assigned a text= value of "#999999", which is gray.

  • PAGE 86

    Description Optional. Text values that delimit the end of the text block for this scheme. The blockEnd and blockStart tags must be paired and the combination must be unique. Values are not evaluated as case-sensitive. The blockEnd value can be one character. Multiple instances of this tag are allowed. For more information on blockEnd strings, see “Wildcard characters” on page 100. Attributes None. Example ]> Description Optional.

  • PAGE 87

    Description A list of characters that represent brackets. Attributes name, id • • A string that assigns a name to the list of brackets. Required. An identifier string that maps color and style to this syntax item. name="bracket_name" id="id_string" Example Description Contains a text string that represents the delimiter of the start of a character.

  • PAGE 88

    Description A text string that delimits the start of a comment block. You must specify the commentStart and commentEnd tags in pairs. Multiple commentStart…/commentEnd pairs are allowed. Attributes None. Example Description A text string that delimits the end of a comment block. You must specify the commentStart and commentEnd tags in pairs. Multiple commentStart…/commentEnd pairs are allowed. Attributes None.

  • PAGE 89

    Example Description An empty tag that indicates CSS rules and holds code coloring attributes. Attributes name, id • • A string that assigns a name to the CSS property. Required. An identifier string that maps color and style to this syntax item.

  • PAGE 90

    Description Optional. This tag applies only to tag-based syntax (that is, where ignoreTags="No"). If this tag is present, then all tag attributes are colored according to the style assigned to this tag. If this tag is omitted, then attributes are colored the same as the tag. Attributes name • A string that assigns a name to the default attribute.

  • PAGE 91

    Description A text string that delimits the start of a comment that continues until the end of the current line. Multiple endOfLineComment…/endOfLineComment tags are allowed. Attributes None. Example Description An empty tag that indicates that HTML special characters should be recognized and hold coloring attributes. Attributes name, id • • A string that assigns a name to the entity. Required.

  • PAGE 92

    Description A list of characters, each of which Dreamweaver can recognize as the first character in an identifier. Attributes name, id • • A string that assigns a name to the list of identifier characters. Required. An identifier string that maps color and style to this syntax item.

  • PAGE 93

    Attributes None. Example No Description Specifies whether markup tags should be ignored. Values are Yes and No; the default is Yes. Set to No when syntax is for tag markup language that is delimited by < and >. Set to Yes when syntax is for a programming language. Attributes None. Example No Description Specifies whether the text that is matched by this scheme is locked from being edited in the Code view.

  • PAGE 94

    Description List of keywords for type specified in category attribute. Multiple keywords tags are allowed. Attributes name, id • • A string that assigns a name to the list of keywords. Required. An identifier string that maps color and style to this syntax item.

  • PAGE 95

    Description Specifies a list of searchPattern tags. Attributes name, id, delimiter, escape • • • • A string that assigns a name to the list of search pattern strings. id="id_string" Required. An identifier string that maps color and style to this syntax item. delimiter The character or string that starts and ends a regular expression. escape The character or string that signals special character processing, known as the “escape” character or string.

  • PAGE 96

    Description A string of characters that define a regular search pattern using supported wildcard characters. Multiple searchPattern tags are allowed. Attributes None. Container The regexp tag. Example Description These tags contain a text string that represents the delimiter of the start of a string. You must specify the stringStart and stringEnd tags in pairs. Multiple stringStart … stringEnd pairs are allowed.

  • PAGE 97

    Description Contains a text string that represents the delimiter of a string escape character. Multiple stringEsc tags are allowed. Attributes None. Example Description This tag groups one or more tags to which you can assign a unique color and style. Attributes id, name, taglibrary, tags • • • • Required. An identifier string that maps color and style to this syntax item.

  • PAGE 98

    Sample code

    header

    Here's some editable text

     

    Example customText This value tells Dreamweaver to use custom colors to color the block delimiters.

  • PAGE 99

    innerTag This value is identical to the outerTag value, except that the tag coloring is taken from the scheme inside the delimiters. This is currently used for the html tag. nameTag This value specifies that the blockStart string is the opening of a tag and blockEnd string is the closing of a tag, and these delimiters are to be colored based on the tag settings of the scheme. This type of scheme displays tags that can be embedded inside other tags, such as the cfoutput tag.

  • PAGE 100

    Field CSS cssProperty X cssSelector X cssValue X character Tags Script X X function keyword X identifier X number X operator X X brackets X X keywords X X To make the process of defining schemes more flexible, Dreamweaver lets you specify wildcard and escape characters. Wildcard characters The following is a list of wildcard characters that Dreamweaver supports, along with the strings to specify them and descriptions of their usage.

  • PAGE 101

    Wildcard Escape Description string Optional whitespace \s* This matches zero or more white space or newline characters. For example, When this line is present, Dreamweaver does not create a menu item for the file, and you must call dw.runCommand() to execute the command.

  • PAGE 137

    Returns Dreamweaver expects an array that contains an even number of elements. The first element is a string that contains the label for the topmost button. The second element is a string of JavaScript code that defines the behavior of the topmost button when it is clicked. The remaining elements define additional buttons in the same way.

  • PAGE 138

    windowDimensions() Description Sets specific dimensions for the Parameters dialog box. If this function is not defined, the window dimensions are computed automatically. Note: Do not define this function unless you want an Options dialog box that is larger than 640 x 480 pixels. Arguments platform • The value of the platform argument is either "macintosh" or "windows", depending on the user’s platform. Returns Dreamweaver expects a string of the form "widthInPixels,heightInPixels".

  • PAGE 139

    Creating the UI The UI is a form that contains two radio buttons that let the user select uppercase or lowercase. The following example shows the HTML code to create the form: Make Uppercase or Lowercase Inspecting translated attributes When server markup specifies a single attribute and the attribute is represented in a Property inspector, Dreamweaver displays the server markup in the Property inspector, as shown in the following figure: The markup appears whether or not a translator is associated with it. The translator runs whenever the user edits the server markup that appears in the Property inspector.

  • PAGE 345

    Locking translated tags or blocks of code In most cases, you want a translator to change markup so that Dreamweaver can display it, but you want to save the original markup, not the changes. For such cases, Dreamweaver provides special XML tags in which to wrap translated content and to refer to the original code. When you use these XML tags, the contents of the original attributes are duplicated in Code view. If the file is saved, the original, untranslated markup is written to the file.

  • PAGE 346

    [about us] [help] A simple block/tag translator example To help understand translation, look at a translator that is written entirely in JavaScript, which does not rely on a C library for any functionality. The following translator example would be more efficient if it was written in C, but the JavaScript version is simpler, which makes it perfect for demonstrating how translators work.

  • PAGE 347

    var replCode = replaceKentTag(); function var outStr = ""; translation // in the document. // Calls the replaceKentTag() // to get the code that will replace KENT. // The string to be returned after //If the document does not contain any content, terminate the translation. if ( inStr.

  • PAGE 348

    replCode = replCode + imgTag; replCode = replCode + end; return replCode; } /****************************************************************** * The getImage() function determines which image to display * * based on the day of the week, the time of day and the * * user's platform. The day and time are figured based on UTC * * time (Greenwich Mean Time) minus 8 hours, which gives * * Pacific Standard Time (PST). No allowance is made for Daylight * * Savings Time in this routine.

  • PAGE 349

    //Or else it's after 6pm but before the stroke of midnight }else if (SFhour >= 18){ //If it's Saturday if (day == 6){ imageRef = "images/kent_dancing.jpg"; //If it's not Saturday, check the user's platform }else if (platform == "MacPPC"){ imageRef = "images/kent_hardAtWorkOnMac.jpg"; }else{ imageRef = "images/kent_hardAtWorkOnWin.jpg"; } }else{ imageRef = "images/kent_sleeping.jpg"; } //If it's after midnight and before 10am, or anytime on Sunday }else{ imageRef = "images/kent_sleeping.

  • PAGE 350

    The canInspectSelection() function for the untranslated HAPPY Property inspector is simple. Because the selection type is exact, it can return a value of true without further analysis.

  • PAGE 351

    After you parse the orig attribute to populate the fields in the Property inspector for the translated tag, the next step is probably to set the value of the orig attribute if the user changes the value in any of the fields. You might find restrictions against making changes in a locked region. You can avoid this problem by changing the original markup and retranslating. The Property inspector for translated server-side includes (the ssi_translated.

  • PAGE 352

    Finding bugs in your translator If the translateMarkup() function contains certain types of errors, the translator loads properly, but it fails without an error message when you invoke it. Although failing silently prevents Dreamweaver from becoming unstable, it can hinder development, especially when you need to find one small syntax error in multiple lines of code.

  • PAGE 353

    CHAPTER 21 C-Level Extensibility The C-level extensibility mechanism lets you implement Macromedia Dreamweaver MX 2004 extensibility files using a combination of JavaScript and custom C code. You define functions using C, bundle them in a dynamic linked library (DLL) or a shared library, save the library in the Configuration/JSExtensions folder within the Dreamweaver application folder, and then call the functions from JavaScript using the Dreamweaver JavaScript interpreter.

  • PAGE 354

    readContentsOfFile(JSContext *cx, JSObject *obj, unsigned int ¬ argc, jsval *argv, jsval *rval) { char *fileName, *fileContents; JSBool success; unsigned int length; /* Make sure caller passed in exactly one argument. If not, * then tell the interpreter to abort script execution.

  • PAGE 355

    Note: The library can be implemented in either C or C++, but the file that contains the MM_Init() function and the MM_STATE macro must be implemented in C. The C++ compiler garbles function names, which makes it impossible for Dreamweaver to find the MM_Init() function.

  • PAGE 356

    The C-level API The C-level extensibility API consists of the following functions: typedef JSBool (*JSNative)(JSContext *cx, JSObject *obj, unsigned int argc, jsval *argv, jsval *rval) Description This function signature describes C-level implementations of JavaScript functions in the following situations: • The cx pointer is a pointer to an opaque JSContext structure, which must be passed to some of the functions in the JavaScript API. This variable holds the interpreter’s execution context.

  • PAGE 357

    char *JS_ValueToString() Description This function extracts a function argument from a jsval structure, converts it to a string, if possible, and passes the converted value back to the caller. Note: Do not modify the returned buffer pointer or you might corrupt the data structures of the JavaScript interpreter. To change the string, you must copy the characters into another buffer and create a new JavaScript string.

  • PAGE 358

    JSBool JS_ValueToDouble() Description This function extracts a function argument from a jsval structure, converts it to a double (if possible), and passes the converted value back to the caller. Arguments JSContext *cx, jsval v, double *dp • The cx argument is the opaque JSContext pointer that passed to the JavaScript function. • The v argument is the jsval structure from which the double is to be extracted. • The dp argument is a pointer to an 8-byte double.

  • PAGE 359

    Returns A Boolean value: JS_TRUE indicates success; JS_FALSE indicates failure. JSBool JS_StringToValue() Description This function stores a string return value in a jsval structure. It allocates a new JavaScript string object. Arguments JSContext *cx, char *bytes, size_t sz, jsval *vp • The cx argument is the opaque JSContext pointer that passes to the JavaScript function. • The bytes argument is the string to be stored in the jsval structure.

  • PAGE 360

    JSVal JS_BooleanToValue() Description This function stores a Boolean return value in a jsval structure. Arguments JSBool bv • The bv argument is a Boolean value: JS_TRUE indicates success; JS_FALSE indicates failure. Returns A JSVal structure that contains the Boolean value that passes to the function as an argument. JSVal JS_IntegerToValue() Description This function converts a long integer value to JSVal structure.

  • PAGE 361

    Arguments JSObject *obj • Typically, this argument is passed in and converted using the JS_ValueToObject() function. Returns A pointer to a null-terminated string. The caller should not free this string when it finishes. JSObject *JS_NewArrayObject() Description This function creates a new object that contains an array of JSVals. Arguments JSContext *cx, unsigned int length, jsval *v • The cx argument is the opaque JSContext pointer that passes to the JavaScript function.

  • PAGE 362

    JSBool JS_GetElement() Description This function reads a single element of an array object. Arguments JSContext *cx, JSObject *obj, unsigned int index, jsval *v • The cx argument is the opaque JSContext pointer that passes to the JavaScript function. • The obj argument is a pointer to an array object. • The index argument is an integer index into the array. The first element is index 0, and the • last element is index (length - 1).

  • PAGE 363

    JSBool JS_ExecuteScript() Description This function compiles and executes a JavaScript string. If the script generates a return value, it returns in *rval. Arguments JSContext *cx, JSObject *obj, char *script, unsigned int sz, jsval *rval • The cx argument is the opaque JSContext pointer that passes to the JavaScript function. • The obj argument is a pointer to the object in whose context the script executes. While the • • • script is running, the this keyword is equal to this object.

  • PAGE 364

    File Access and Multiuser Configuration API Macromedia recommends that you always use the File Access and Multiuser Configuration API to access the file system through C-level extensions. For files other than configuration files, the functions access the specified file or folder. Dreamweaver supports multiple-user configurations for the Windows XP, Windows 2000, and Mac OS X operating systems. Typically, you install Dreamweaver in a restricted folder such as C:/Program Folders in Windows.

  • PAGE 365

    C-level extensions, or shared libraries, must use the File Access and Multiuser Configuration API to read and write to the Dreamweaver Configuration folder. Using the File Access and Multiuser Configuration API lets Dreamweaver read and write to the user Configuration folder and ensures that the file operations do not fail due to insufficient access privileges.

  • PAGE 366

    Arguments char *fileURL, char *constraints • The char • *fileUrl argument is a pointer to a string that names the folder for which you want a list of the contents. The string must have the format of a file:// URL. The function accepts valid wildcard characters of asterisks (*) and question marks (?) in the file:// URL string. Use asterisks (*) to represent one or more unspecified characters, and question marks (?) to represent a single unspecified character.

  • PAGE 367

    int MM_OpenConfigFile() Availability Dreamweaver MX. Description This function opens the file and returns an operating system file handle. You can use the operating system file handle in calls to system file functions. You must close the file handle with a call to the system _close function. If the file is a configuration file, it finds the file in either the user Configuration folder or the Dreamweaver Configuration folder.

  • PAGE 368

    JSBool MM_GetConfigFileAttributes() Availability Dreamweaver MX. Description This function finds the file and returns the attributes of the file. You can set any of the arguments except fileURL to null if you do not need the value. Arguments char *fileURL, unsigned long *attrs, unsigned long *filesize, unsigned long *modtime, unsigned long *createtime • The char • • • • *fileURL argument is a pointer to a string that names the file for which you want the attributes.

  • PAGE 369

    JSBool MM_SetConfigFileAttributes() Availability Dreamweaver MX. Description This function sets the attributes that you specify for the file, if they are different from the current attributes. If the specified file URL is in the Dreamweaver Configuration folder, this function first copies the file to the user Configuration folder before it sets the attributes. If the attributes are the same as the current file attributes, the file is not copied.

  • PAGE 370

    Arguments char *fileURL • The char *fileURL argument is a pointer to a file:// URL string that names the configuration folder that you want to create. Returns A Boolean value: JS_TRUE indicates success; JS_FALSE indicates failure. Example char *dwConfig = "file:///c|/Program Files\Macromedia\Dreamweaver \Configuration\Extensions.txt"; MM_CreateConfigFolder(dwConfig); JSBool MM_RemoveConfigFolder() Availability Dreamweaver MX. Description This function removes the folder and its files and subfolders.

  • PAGE 371

    Arguments char *fileURL • The char *fileURL argument is a pointer to a string that names the configuration folder to remove, which is provided as a file:// URL. Returns A Boolean value: JS_TRUE indicates success; JS_FALSE indicates failure. Example char dwConfig = "file:///c:|Program Files\Macromedia\Dreamweaver \Configuration\Objects\insertbar.

  • PAGE 372

    To call the computeSum() function from the Insert Horizontal Rule object: 1 Create a folder called JSExtensions in the Configuration folder within the Dreamweaver application folder. 2 Copy Sample.dll (Windows) or Sample (Macintosh) to the JSExtensions folder. 3 In a text editor, open the HR.htm file in the Configuration/Objects/Common folder. 4 Add the line alert(Sample.

  • PAGE 373

    Find information about supporting files and reference resources that can aid in developing Macromedia Dreamweaver MX 2004 extensions. Appendix A: The Shared Folder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

  • PAGE 374

  • PAGE 375

    APPENDIX A The Shared Folder The Shared folder is the central repository for utility functions, classes, and images that are commonly used by all extensions. Any extension can reference the files in the Shared folder’s subfolders, and you can add custom common utilities to the ones already provided by Macromedia Dreamweaver MX 2004. The multiple user Configuration folders installed for users on Windows XP, Windows 2000, and Macintosh OS X also contain a Shared folder for individual customizations.

  • PAGE 376

    The Common folder The Common folder has shared scripts and classes for use in third-party extensions. CodeBehindMgr.js Contains functions for creating a code-behind document. A code-behind document lets you create distinct pages that separate the code for user interface (UI) logic from the code for a UI design. The methods of JSCodeBehindMgr defined in this file can create new code-behind documents and manage the link to design documents, ColumnValueNodeClass.

  • PAGE 377

    ListControlClass.js Contains functions that manage a