A Simple Insert Object Example - MACROMEDIA DREAMWEAVER 8-EXTENDING DREAMWEAVER Manual

Extending dreamweaver
Table of Contents

Advertisement

4.
Edit the insertbar.xml file to identify the location of these new files and set attributes (see
"The Insert bar definition file" on page
5.
Restart Dreamweaver or reload extensions.
The new object appears on the Insert bar in the specified location.
Although you can store Object files in separate folders, it's important that each
filename be unique. The dom.insertObject() function, for example, looks for files
anywhere within the Objects folder without regard to subfolders (for more
information about the dom.insertObject() function,
Reference). If a file called Button.htm exists in the Forms folder and another object
file called Button.htm is in the MyObjects folder, Dreamweaver cannot distinguish
between them. If two separate instances of Button.htm exist, dom.insertObject()
displays two objects called Button, and the user might not recognize any difference.
Adding objects to the Insert menu
To add or control the position of an object on the Insert menu (or any other menu), modify
the menus.xml file. This file controls the entire menu structure for Dreamweaver. For more
information about modifying the menus.xml file, see
Commands," on page
If you plan to distribute the extension to other Dreamweaver users, see
Extension Manager" on page 109

A simple insert object example

This example adds an object to the Insert bar so users can add a line through (strike through)
selected text by clicking a button. This object is useful if a user needs to make editorial
comments in a document.
Because this example performs text manipulation, you may want to explore some of the
objects from the Text pop-up menu in the HTML category on the Insert bar as models. For
example, look at the Bold, Emphasis, and Heading object files to see similar functionality,
where Dreamweaver wraps a tag around selected text.
You will perform the following steps to create the strike-through insert object:
Creating the HTML file
Adding the JavaScript functions
Creating the image
Editing the insertbar.xml file
Adding a dialog box
Building an Insert bar pop-up menu
150
Insert Bar Objects
181.
to learn more about packaging extensions.
141) for the button's appearance.
see the
Chapter 8, "Menus and Menu
Dreamweaver API
"Working with the

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DREAMWEAVER 8-EXTENDING DREAMWEAVER and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Dreamweaver 8

Table of Contents