|
JavaScript API functions
The following JavaScript API functions are functions that are new, have changed, or were omitted from the Extending Dreamweaver MX manual.
dreamweaver.getTempFolderPath()
Note: The following documentation updates the prior description of this function in Dreamweaver MX errata.
Availability
Dreamweaver MX
Description
Gets the full path to a temporary folder where you can store temporary or transient files.
On the multiple-user operating systems of Windows XP, Windows 2000, Windows NT, and Mac OS X, this function looks in the user's Configuration folder. Otherwise, it looks in the Dreamweaver MX Configuration folder. This function looks for a Temp folder inside the Configuration folder. If a folder does not exist, the function creates it.
Note: Shared files that are not transient should be stored in the Configuration/Shared folder.
Arguments
None.
Returns
The full path to the folder, expressed as a file:// URL.
Example
The following line of code returns the full path for the specified file. Note that it does not return a / at the end of the path, although other Dreamweaver MX functions do (for example, dreamweaver.getSiteRoot() ).
var myTempfile = dw.getTempFolderPath() + "/myTempFile.txt";
dreamweaver.newDocument()
Errata
The dreamweaver.newDocument() function was omitted from the Extending Dreamweaver MX manual. It belongs with the "File manipulation functions" section of the JavaScript API documentation.
Availability
Dreamweaver MX
Description
Connects the new-document dialog box to its menu item.
Arguments
{bopenWithCurSiteAndShowDialog}
bopenWithCurSiteAndShowDialog is an optional argument that has a value of true or false . Use true for the "New from Template . . ." menu item.
Returns
Nothing.
dreamweaver.saveDocumentAsTemplate()
Errata
The optional fileName argument was omitted from the documentation of the dreamweaver.saveDocumentAsTemplate() function. This function is described in the "File manipulation functions" section of the JavaScript API documentation.
Availability
Dreamweaver 3
Description
Opens the Save As Template dialog box.
Arguments
documentObject {,fileName}
documentObject is the object at the root of a document's DOM tree, which is the value that dreamweaver.getDocumentDOM() ) returns.
fileName is the name of the file to open, expressed as an absolute URL.
Returns
Nothing.
Enabler
dreamweaver.canSaveDcoumentAsTemplate()
dreamweaver.snippetPalette.insertSnippet()
Errata
This description of the function adds an example.
Availability
Dreamweaver MX
Description
Inserts indicated snippet to current selection.
Arguments
Snippet path relative to snippet folder.
Returns
A Boolean value.
Enabler
dw.snippetpalette.canInsert()
Example
dw.snippetPalette.insertSnippet('Text\\Different_Link_Color.csn');
site.getAppURLPrefixForSite()
Errata
The getAppURLPrefixForSite() function was omitted from the Extending Dreamweaver MX manual. It belongs in the "Site functions" section of the JavaScript API documentation.
Availability
Dreamweaver MX
Description
This function gets the value of the URL prefix of the currently selected site.
Arguments
None.
Returns
A String containing the URL prefix of the site that is currently selected.
Example
sitePrefix = getAppURLPrefixForSite();
|