Insert object functions handle operations related to the objects on the Insert bar or listed on the Insert menu.
dreamweaver.objectPalette.getMenuDefault()
Availability
Dreamweaver MX 2004.
Description
Retrieves the ID string of the default item for the associated menu.
Arguments
menuId
The menuId argument is the string that defines the menu in the insertbar.xml file.
Returns
A string value defining the ID of the default item.
Example
The following example assigns the current default object for the Media menu to the defID variable:
var defId = dw.objectPalette.getMenuDefault("DW_Media");
dreamweaver.objectPalette.setMenuDefault()
Availability
Dreamweaver MX 2004.
Description
Sets the default object for a pop-up menu. The default object’s icon represents the specified pop-up menu on the Insert bar. The user can click on the default object to insert it, or click on the arrow beside the default object to open the pop-up menu and see the other objects in that menu. Dreamweaver sets the new menu default the next time the user opens Dreamweaver or uses the Reload Extensions command.
Arguments
menuId, defaultId
The menuId argument is the string that defines the menu in the insertbar.xml file.
The defaultId argument is the string that defines the new default object in the insertbar.xml field.
Returns
A Boolean value: true if the new default is successfully set; false otherwise.
Example
The following example sets the Flash object as the default object for the Media menu:
dw.objectPalette.setMenuDefault("DW_Media", "DW_Flash");
dreamweaver.reloadObjects()
Availability
Dreamweaver MX 2004.
Description
Reloads all the objects on the Insert bar. This function is the equivalent of Control+left-clicking the mouse on the Categories menu on the Insert bar and selecting the Reload Extensions menu option.
Arguments
None.
Returns
A Boolean value: true if the objects were successfully loaded; false otherwise.
dom.convertActiveContent()
Availability
Dreamweaver CS3.
Description
Converts all the active content in the given document.
Arguments
forceUpdate
The forceUpdate argument is a Boolean value that indicates whether to override the user’s preference settings (true, = override). This argument is optional.
Returns
A Boolean value: true if all active content was converted successfully. Returns false if some active content that needed to be converted was not converted, such as object tags in a locked region of a template instance.
Example
if( !dom.convertActiveContent(true) ) { alert(dw.loadString("ActiveContent/notAllConverted")); }
dom.convertNextActiveContent()
Availability
Dreamweaver CS3.
Description
Specifies that the next object tag that is inserted (for the remainder of the current edit—one undoable action) has a script built for it. This function allows you to use a third-party extension to generate the appropriate script for the specific active content.
Arguments
None.
Returns
Nothing.
Example
dom.convertNextActiveContent(); dom.insertHTML("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\ "http://download.Macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\"100\" height=\"22\"><param name=\"movie\" value=\"button1.swf\" /><param name=\ "quality\" value=\"high\" /><embed src=\"button1.swf\" quality=\"high\" pluginspage=\ "http://www.Macromedia.com/go/getflashplayer\" type=\"application/ x-shockwave-flash\"width=\"100\" height=\"22\"></embed></object>\");