canAcceptCommand()
Adobe Dreamweaver next calls the canAcceptCommand() function for each menuitem tag that references a command file with the file attribute. If the canAcceptCommand() function returns the value false, the menu item is dimmed. If the canAcceptCommand() function returns the value true, Adobe Dreamweaver enables the item on the menu. If the function returns true or is not defined, Adobe Dreamweaver calls the isCommandChecked() function to determine whether to display a check mark next to the menu item. If the isCommandChecked() function is not defined, no check mark appears.
function canAcceptCommand(){ var PIB = dw.getBrowserList(); if (arguments[0] == 'primary' || arguments[0] == 'secondary') return havePreviewTarget(); return havePreviewTarget() && (PIB.length > 0);}The canAcceptCommand() function in the PIB_Dynamic.js file again retrieves the browser list that was created in Preferences. Then it checks whether the first argument (arguments[0]) is primary or secondary. If so, it returns the value returned by the havePreviewTarget() function. If not, it tests the call to the havePreviewTarget() function and tests whether any browsers have been specified (PIB.length > 0). If both tests are true, the function returns the value true. If either or both of the tests are false, the function returns the value false.