MACROMEDIA DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER Spezifikationen Seite 150

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 504
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 149
150 Insert Bar Objects
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 141) for the button’s appearance.
5. Restart Dreamweaver or reload extensions.
The new object appears on the Insert bar in the specified location.
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 Chapter 8, “Menus and Menu
Commands,” on page 181.
If you plan to distribute the extension to other Dreamweaver users, see “Working with the
Extension Manager” on page 109 to learn more about packaging extensions.
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
NOTE
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,
see the Dreamweaver API
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.
Seitenansicht 149
1 2 ... 145 146 147 148 149 150 151 152 153 154 155 ... 503 504

Kommentare zu diesen Handbüchern

Keine Kommentare