Assets panel functions

 < Day Day Up > 

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).

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 or site map to the Favorites list. This function handles only images, movies, scripts, Shockwave files, Flash files, and URLs (in the case of the site map). 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

See "dreamweaver.assetPalette.canEdit()" on page 1067.

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".

NOTE

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

See "dreamweaver.assetPalette.canInsertOrApply()" on page 1068.

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.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.

Arguments

None.

Returns

Nothing.

dreamweaver.libraryPalette.getSelectedItem() (deprecated)

Availability

Dreamweaver 3; deprecated in 4 in favor of dreamweaver.assetPalette.getSelectedItems().

Description

This function gets the path of the selected library item.

Arguments

None.

Returns

A string that contains the path of the library item, which is expressed as a file:// URL.

dreamweaver.libraryPalette.newFromDocument() (deprecated)

Availability

Dreamweaver 3; deprecated in Dreamweaver 4 in favor of using dreamweaver.assetPalette.setSelectedCategory(), and then calling dreamweaver.assetPalette.newAsset().

Description

This function creates a new library item based on the selection in the current document.

Arguments

 bReplaceCurrent 

  • The bReplaceCurrent argument is a Boolean value that indicates whether to replace the selection with an instance of the newly created library item.

Returns

Nothing.

dreamweaver.libraryPalette.recreateFromDocument() (deprecated)

Availability

Dreamweaver 3; deprecated in Dreamweaver 4 in favor of dreamweaver.assetPalette.recreateLibraryFrom Document().

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.

Returns

Nothing.

dreamweaver.libraryPalette.renameSelectedItem() (deprecated)

Availability

Dreamweaver 3; deprecated in Dreamweaver 4 in favor of using dreamweaver.assetPalette.setSelectedCategory() with "library" as the argument value, and then calling dreamweaver.assetPalette.renameNickname().

Description

This function turns the name of the selected library item into a text field, so the user can rename the selection.

Arguments

None.

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.

dreamweaver.templatePalette.deleteSelected Template() (deprecated)

Availability

Dreamweaver 3; deprecated in Dreamweaver 4 in favor of using dreamweaver.assetPalette.setSelectedCategory() with "templates" as the argument value, and then calling dreamweaver.assetPalette.removeFromFavorites().

Description

This function deletes the selected template from the Templates folder.

Arguments

None.

Returns

Nothing.

dreamweaver.templatePalette.getSelected Template() (deprecated)

Availability

Dreamweaver 3; deprecated in 4 in favor of dreamweaver.assetPalette.getSelectedItems().

Description

This function gets the path of the selected template.

Arguments

None.

Returns

A string that contains the path of the template, which is expressed as a file:// URL.

dreamweaver.templatePalette.renameSelected Template() (deprecated)

Availability

Dreamweaver 3; deprecated in Dreamweaver 4 in favor of using dreamweaver.assetPalette.setSelectedCategory() with "templates" as the argument value, and 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.

Arguments

None.

Returns

Nothing.

     < 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