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, Adobe Shockwave and Adobe Flash content, URLs, colors, and scripts).
dreamweaver.assetPalette.addToFavoritesFrom Document()
Availability
Dreamweaver 4.
Description
Adds the element that is selected in the Document window to the Favorites list. This function handles only images, Shockwave files, Flash files, text font colors, and URLs.
Arguments
None.
Returns
Nothing.
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.
Returns
Nothing.
dreamweaver.assetPalette.addToFavoritesFromSiteWindow()
Availability
Dreamweaver 4.
Description
Adds the elements that are selected in the Site panel to the Favorites list. This function handles only images, movies, scripts, Shockwave files, and FLA files. If other folders or files are selected, they are ignored.
Arguments
None.
Returns
Nothing.
dreamweaver.assetPalette.copyToSite()
Availability
Dreamweaver 4.
Description
Copies selected elements to another site and puts them in that site’s Favorites list. If the elements are files (other than colors or URLs), the actual file is copied into that site.
Arguments
targetSite
The targetSite argument is the name of the target site, which the site.getSites() call returns.
Returns
Nothing.
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.
Returns
Nothing.
Enabler
dreamweaver.assetPalette.getSelectedCategory()
Availability
Dreamweaver 4.
Description
Returns the currently selected category.
Arguments
None.
Returns
The currently selected category, which can be one of the following: "templates", "library", "images", "movies", "shockwave", "flash", "scripts", "colors", or "urls".
dreamweaver.assetPalette.getSelectedItems()
Availability
Dreamweaver 4.
Description
Returns an array of the selected items in the Assets panel, either in the Site or Favorites list.
Arguments
None.
Returns
An array of the following three strings for each selected item:
The name string, which is the name/filename or nickname that appears in the Assets panel.
The value string, which is the full path, full URL, or color value, depending on the selected item.
The type string, which is either "folder" or one of the following categories: "templates", "library", "images", "movies", "shockwave", "flash", "scripts", "colors", or "urls".
If nothing is selected in the Assets panel, this function returns an array that contains one empty string.
Example
If URLs is the category, and a folder MyFolderName and a URL MyFavoriteURL are both selected in the Favorites list, the function returns the following list:
items[0] = "MyFolderName" items[1] = "//path/FolderName" items[2] = "folder" items[3] = "MyFavoriteURL" items[4] = "http://www.MyFavoriteURL.com" items[5] = "urls"
dreamweaver.assetPalette.getSelectedView()
Availability
Dreamweaver 4.
Description
Indicates which list is currently shown in the Assets panel.
Arguments
None.
Returns
Returns a string that has a value of either "site" or "favorites".
dreamweaver.assetPalette.insertOrApply()
Availability
Dreamweaver 4.
Description
Inserts selected elements or applies the element to the current selection. It applies templates, colors, and URLs to the selection; it also inserts URLs and other elements at the insertion point. If a document isn’t open, the function is not available.
Arguments
None.
Returns
Nothing.
Enabler
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.
Arguments
None.
Returns
Nothing.
dreamweaver.assetPalette.newAsset()
Availability
Dreamweaver 4.
Description
Creates a new element for the current category in the Favorites list. For library and templates, this is a new blank library or template file that the user can name immediately. 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 images, Shockwave files, Flash files, or scripts.
Arguments
None.
Returns
Nothing.
dreamweaver.assetPalette.newFolder()
Availability
Dreamweaver 4.
Description
Creates a new folder in the current category with the default name (untitled) and puts a text box around the default name. It is available only in the Favorites list.
Arguments
None.
Returns
Nothing.
dreamweaver.assetPalette.recreateLibraryFrom Document()
Availability
Dreamweaver 4.
Description
Replaces the deprecated libraryPalette function, recreateLibraryFromDocument(). It 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.
Returns
Nothing.
dreamweaver.assetPalette.refreshSiteAssets()
Availability
Dreamweaver 4.
Description
Scans the site, switches to the Site list, and populates the list.
Arguments
None.
Returns
Nothing.
dreamweaver.assetPalette.removeFromFavorites()
Availability
Dreamweaver 4.
Description
Removes the selected elements from the Favorites list. This function does not delete the actual file on disk, except in the case of a library or template where the user is prompted before the file is deleted. It works only in the Favorites list or if the category is Library or Templates.
Arguments
None.
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.
Returns
Nothing.
dreamweaver.assetPalette.setSelectedCategory()
Availability
Dreamweaver 4.
Description
Switches to show a different category.
Arguments
categoryType
The categoryType argument can be one of the following categories: "templates", "library", "images", "movies", "shockwave", "flash", "scripts", "colors", or "urls".
Returns
Nothing.
dreamweaver.assetPalette.setSelectedView()
Availability
Dreamweaver 4.
Description
Switches the display to show either the Site list or the Favorites list.
Arguments
viewType
The viewType argument is a string that can be "site" or "favorites".
Returns
Nothing.
dreamweaver.referencePalette.getFontSize()
Availability
Dreamweaver 4.
Description
Returns the current font size of the Reference panel display region.
Arguments
None.
Returns
The relative font size as small, medium, or large.
dreamweaver.referencePalette.setFontSize()
Availability
Dreamweaver 4.
Description
Changes the font size that appears in the Reference panel.
Arguments
fontSize
The fontSize argument is one of the following relative sizes: small, medium, or large.
Returns
Nothing.