function canAcceptCommand()
{
var PIB = dw.getBrowserList();
if (arguments[0] == 'primary' || arguments[0] == 'secondary')
return havePreviewTarget();
return havePreviewTarget() && (PIB.length > 0);
}
The
canAcceptCommand()
list that was created in Preferences. Then it checks whether the first argument
(
) is primary or secondary. If so, it returns the value returned by the
arguments[0]
havePreviewTarget()
function and tests whether any browsers have been specified (
are true, the function returns the value
function returns the value
havePreviewTarget()
The
havePreviewTarget()
if Dreamweaver has a valid target to display in the browser. A valid target is a document or a
selected group of files in the site panel. The
following example:
function havePreviewTarget()
{
var bHavePreviewTarget = false;
if (dw.getFocus(true) == 'site')
{
if (site.getFocus() == 'remote')
{
bHavePreviewTarget = site.getRemoteSelection().length > 0 &&
}
else if (site.getFocus() != 'none')
{
var selFiles = site.getSelection();
if (selFiles.length > 0)
{
var i;
bHavePreviewTarget = true;
for (i = 0; i < selFiles.length; i++)
{
204
Menus and Menu Commands
function in the PIB_Dynamic.js file again retrieves the browser
function. If not, it tests the call to the
. If either or both of the tests are false, the
true
.
false
function is a user-defined function that returns the value
havePreviewTarget()
site.canBrowseDocument();
havePreviewTarget()
). If both tests
PIB.length > 0
function looks like the
true
Need help?
Do you have a question about the DREAMWEAVER 8-EXTENDING DREAMWEAVER and is the answer not in the manual?
Questions and answers