A Simple Insert Object Example - Adobe 38040334 - Dreamweaver CS3 User Manual

Extending dreamweaver
Hide thumbs Also See for 38040334 - Dreamweaver CS3:
Table of Contents

Advertisement

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" on page 108
• "Adding the JavaScript functions" on page 108
• "Creating the image" on page 110
• "Editing the insertbar.xml file" on page 110
• "Adding a dialog box" on page 111
• "Building an Insert bar pop-up menu" on page 113
Creating the HTML file
The title of the object is specified between the opening and closing
language is JavaScript.
To create the HTML file:
Create a new blank file.
1
Add the following code:
2
<html>
<head>
<title>Strikethrough</title>
<script language="javascript">
</script>
</head>
<body>
</body>
</html>
Save the file as Strikethrough.htm in the Configuration/Objects/Text folder.
3
Adding the JavaScript functions
In this example, the JavaScript functions define the behavior and insert code for the Strikethrough object. You must
place all the API functions in the head section of the file. The existing object files, such as
Configuration/Objects/Text/Em.htm, follow a similar pattern of functions and comments.
The first function the object definition file uses is i
be synchronized to the existing Code view before execution continues. However, because the Superscript object
might be used with many other objects in the Code view, it does not require a forced synchronization.
tags. You also specify that the scripting
title
, which tells whether the Design view needs to
sDOMRequired()
DREAMWEAVER CS3
108
Extending Dreamweaver

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dreamweaver cs3

Table of Contents