Example
The following example assigns properties to the toolbar buttons:
function toolbarControls()
{
var toolBarBtnArray = new Array();
dom = dw.getDocumentDOM();
var plusButton = new ToolbarControlRec();
var aServerModelName = null;
if (dom && dom.serverModel)
{
aServerModelName = dom.serverModel.getDisplayName();
}
else
{
//look in the site for potential server model
aServerModelName = site.getServerDisplayNameForSite();
}
if (aServerModelName.length)
{
if(aServerModelName == "ColdFusion")
{
plusButton.image= PLUS_BUTTON_UP;
plusButton.pressedImage= PLUS_BUTTON_DOWN;
plusButton.disabledImage= PLUS_BUTTON_UP;
plusButton.toolStyle= "left";
plusButton.toolTipText= MM.MSG_WebServicesAddToolTipText;
plusButton.enabled= "dwscripts.IS_WIN";
plusButton.command= "invokeWebService()";
}
else
{
plusButton.image= PLUSDROPBUTTONUP;
plusButton.pressedImage= PLUSDROPBUTTONDOWN;
plusButton.disabledImage= PLUSDROPBUTTONUP;
plusButton.toolStyle= "left";
plusButton.toolTipText= MM.MSG_WebServicesAddToolTipText;
plusButton.enabled= "dwscripts.IS_WIN";
plusButton.menuId = "DWWebServicesChoosersContext";
}
toolBarBtnArray.push(plusButton);
var minusButton = new ToolbarControlRec();
minusButton.image= MINUSBUTTONUP;
minusButton.pressedImage= MINUSBUTTONDOWN;
minusButton.disabledImage= MINUSBUTTONDISABLED;
minusButton.toolStyle= "left";
minusButton.toolTipText= MM.MSG_WebServicesDeleteToolTipText;
Components panel API functions
421
Need help?
Do you have a question about the DREAMWEAVER 8-EXTENDING DREAMWEAVER and is the answer not in the manual?