Configuration folders and extensions

 < Day Day Up > 

The folders and files that are stored in the Dreamweaver Configuration folder contain the extensions that come with Dreamweaver. When you write an extension, you must save the files in the proper folder for Dreamweaver to recognize them. For example, if you create a Property inspector extension, you save the files in the Configuration/Inspectors folder. If you download and install an extension from the Macromedia Exchange website (www.macromedia.com/exchange), the Extension Manager automatically saves the extension files to the proper folders.

You can use the files in the Dreamweaver Configuration folder as examples, but these files are generally more complex than the average extension that is available on the Macromedia Exchange website. For more information on the contents of each subfolder within the Configuration folder, see the Configuration_ReadMe.htm file.

The Configuration/Shared folder does not correspond to a specific extension type. It is the central repository for utility functions, classes, and images that are used by more than one extension. The files in the Configuration/Shared/Common folder are designed to be useful to a broad range of extensions. These files are useful as examples of JavaScript techniques and as utilities. Look here first for the functions that perform specific tasks, such as creating a valid Document Object Model (DOM) reference to an object, testing whether the current selection is inside a particular tag, escaping special characters in strings, and more. If you create common files, you should create a separate subfolder in the Configuration/Shared/Common folder, which is shown in the following figure, and store them there.

Configuration/Shared/Common/Scripts folder structure

For more information about the Shared folder, see Appendix, "The Shared Folder," on page 483.

Multiuser Configuration folders

For the multiuser operating systems of Windows XP, Windows 2000, and Macintosh OS X, Dreamweaver creates a separate Configuration folder for each user in addition to the Dreamweaver Configuration folder. Any time Dreamweaver or a JavaScript extension writes to the Configuration folder, Dreamweaver automatically writes to the user Configuration folder instead. This practice lets each Dreamweaver user customize configuration settings without disturbing the configuration settings of other users. For more information, see "Customizing Dreamweaver in a multiuser environment" on page 27 and "File Access and Multiuser Configuration API" in the Dreamweaver API Reference.

Running scripts at startup or shutdown

If you place a command file in the Configuration/Startup folder, the command runs as Dreamweaver starts up. Startup commands load before the menus.xml file, before the files in the ThirdPartyTags folder, and before any other commands, objects, behaviors, inspectors, floating panels, or translators. You can use startup commands to modify the menus.xml file or other extension files. You can also show warnings, prompt the user for information, or call the dreamweaver.runCommand() function. However, from within the Startup folder, you cannot call a command that expects a valid Document Object Model (DOM). For information about the Dreamweaver DOM, see Chapter 5, "The Dreamweaver Document Object Model," on page 127.

Similarly, if you place a command file in the Configuration/Shutdown folder, the command runs as Dreamweaver shuts down. From the shutdown commands, you can call dreamweaver.runCommand() function, show warnings, or prompt the user for information, but you cannot stop the shutdown process.

For more information about commands, see Chapter 7, "Commands," on page 167. For more information about the dreamweaver.runCommand() function, see the Dreamweaver API Reference.

Reloading extensions

If you make a change to an extension while you are working in Dreamweaver, you can reload the extensions so that Dreamweaver recognizes the change.

To reload extensions

1.

Control-click (Windows) or Option-click (Macintosh) the Categories menu in the Insert bar's title bar.

2.

Select Reload Extensions.

NOTE

Remember that in a multiuser operating system you should edit copies of configuration files in your user Configuration folder rather than editing master configuration files. For more information, see "Configuration folders and extensions" on page 102.


     < Day Day Up > 


    Developing Extensions for Macromedia Dreamweaver 8
    Developing Extensions for Macromedia Dreamweaver 8
    ISBN: 0321395409
    EAN: 2147483647
    Year: 2005
    Pages: 282

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net