//--------------- API FUNCTIONS---------------
function isDOMRequired() {
// Return false, indicating that this object is available in Code view.
return false;
}
function objectTag() {
// Manually wrap tags around selection.
var dom = dw.getDocumentDOM();
if (dw.getFocus() == 'textView' || dw.getFocus(true) == 'html'){
var upCaseTag = (dw.getPreferenceString("Source Format", "Tags Upper Case", "") ==
'TRUE');
// Manually wrap tags around selection.
if (upCaseTag){
dom.source.wrapSelection('<FONT COLOR="#0000FF">','</FONT>');
}else{
dom.source.wrapSelection('<font color="#0000FF">','</font>');
}
}else if (dw.getFocus() == 'document'){
dom.applyFontMarkup("color", "#0000FF");
}
// Just return -- don't do anything else.
return;
}
</script>
</head>
<body>
</body>
</html>
Save the file as AddBlue.htm in the Editorial folder.
3
Now you can create an image for the Blue Text Object.
To create the image:
Create a GIF file that is 18 x 18 pixels, which will look like the following figure:
1
Save the image as AddBlue.gif in the Editorial folder.
2
Next, you edit the insertbar.xml file. This file defines the objects on the Insert bar and their locations. Notice the
various
tags and their attributes within the
menubutton
menu in the HTML category. Within the
To edit insertbar.xml:
Find the following line of code near the beginning of the file:
1
<insertbar xmlns:MMString="http://www.Macromedia.com/schemes/data/string/">
tags; these
category
tags, each
menubutton
button
Extending Dreamweaver
tags define each pop-up
menubutton
tag defines an item in the pop-up menu.
DREAMWEAVER CS3
114