Forums
This topic is locked
customizing insertbar.xml
28 Feb 2007 19:32:08 mum sy posted:
I found this thread www.dmxzone.net/forum/topic.asp?topic_id=34010 but it does not answer my question.I'm trying to add a button for superscript to the Text tab of the insertbar.
I have read the customizing pdf,
www.adobe.com/support/dreamweaver/custom/customizing_dwmx/
made an 18x18 gif with same name as the .htm file.
I made the .htm file by copying one from the Text folder, and changing relevant sections.
<pre id=code><font face=courier size=2 id=code><!-- MENU-LOCATION=NONE -->
<html>
<head>
<!-- Copyright 2001, 2002, 2003 Macromedia, Inc. All rights reserved. -->
<title><MMString:LoadString id="insertbar/textSup" /></title>
<script language="javascript">
//--------------- 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('<SUP>','</SUP>');
}else{
dom.source.wrapSelection('<sup>','</sup>');
}
}else if (dw.getFocus() == 'document'){
// Normally, when we apply character (or font) markup, DW considers several
// factors including whether or not the user has expressed a general preference
// to use CSS over HTML. In that is the case, then DW will try to use CSS
// where possible and sensible. In this case, however, we don't want CSS
// used, regardless of the general preference that the user has stated.
// Therefore, we temporarily force that preference to be "use HTML over CSS"
// so this markup is implemented in HTML, not CSS.
var oldPrefUseCSS = dw.setPrefUseCSS(false);
dom.applyCharacterMarkup("sup"
dw.setPrefUseCSS(oldPrefUseCSS);
}
// Just return -- don't do anything else.
return;
}
</script>
</head>
<body>
</body>
</html> </font id=code></pre id=code>
I copied. added and altered a line in the insertbar.xml file:
<separator />
<button id="DW_Text_Strong" image="Text\Strong.gif" MMString:name="insertbar/textStrong" file="Text\Strong.htm" />
<button id="DW_Text_Em" image="Text\Em.gif" MMString:name="insertbar/textEm" file="Text\Em.htm" />
<button id="DW_Text_Sup" image="Text\Sup.gif" MMString:name="insertbar/textSup" file="Text\Sup.htm" />
<separator />
When I made a simple htm file with just the tags <sup> and </sup> in it, the button showed up on the Text tab and it worked. However I would like the tags to wrap.
The insertbar file does not seem to update. I get no error message. I tested by simply moving the line for the "em" tag. I reloaded the extensions; no difference to the Text options.
I think my Sup.htm file is correct. I changed nothing but replacing the appropriate text.
Am I missing something? How can I get changes to insertbar.xml to take effect?
Thanks for your help.
Dreamweaver mx 2004
Replies
Replied 04 Mar 2007 16:23:26
04 Mar 2007 16:23:26 mum sy replied:
I found my own answer and here it is in case it would help anyone else -- this information is not found in the DW help file but in the Extending Dreamweaver help.
If you are using XP and have more than one user, Dreamweaver also creates a Configuration folder in the user's Application Data folder. The insertbar.xml file is not copied there; you must do this yourself.
On my computer in my documents and settings folder:
AppData/Macromedia/Dreamweaver MX 2004/Configuration/Objects
The Sup.htm and sup.gif image go in the Program's Configuration/Objects/Text folder; not in the user's profile --
but the changes in insertbar.xml must be made and the file copied to the User's Objects folder.
Note that you must copy the insertbar.xml file to that file, THEN open it and make changes on the copied file. It doesn't work to open the program's insertbar.xml and then use "save as" to the user's folder.
If you are using XP and have more than one user, Dreamweaver also creates a Configuration folder in the user's Application Data folder. The insertbar.xml file is not copied there; you must do this yourself.
On my computer in my documents and settings folder:
AppData/Macromedia/Dreamweaver MX 2004/Configuration/Objects
The Sup.htm and sup.gif image go in the Program's Configuration/Objects/Text folder; not in the user's profile --
but the changes in insertbar.xml must be made and the file copied to the User's Objects folder.
Note that you must copy the insertbar.xml file to that file, THEN open it and make changes on the copied file. It doesn't work to open the program's insertbar.xml and then use "save as" to the user's folder.