// For server connections, the files will
// already be remote urls.
if (selFile.indexOf("://") == (-1))
{
var urlPrefix = "file:///";
var strTemp = selFile.substr(urlPrefix.length);
if (selFile.indexOf(urlPrefix) == -1)
bHavePreviewTarget = false;
else if (strTemp.indexOf("/") == -1)
bHavePreviewTarget = false;
else if (!DWfile.exists(selFile))
bHavePreviewTarget = false;
else if (DWfile.getAttributes(selFile).indexOf("D") != -1)
bHavePreviewTarget = false;
}
else
{
bHavePreviewTarget = true;
}
}
}
}
}
else if (dw.getFocus() == 'document' ||
dw.getFocus() == 'textView' || dw.getFocus("true") == 'html' )
{
var dom = dw.getDocumentDOM('document');
if (dom != null)
{
var parseMode = dom.getParseMode();
if (parseMode == 'html' || parseMode == 'xml')
bHavePreviewTarget = true;
}
}
return bHavePreviewTarget;
}
The
havePreviewTarget()
default return value. The function performs two basic tests calling the
to determine what part of the application currently has focus. The first test checks whether the
site panel has focus (
if (dw.getFocus(true) == 'site')
focus, the second test checks to see if a document (
(
dw.getFocus() == 'textView'
has focus. If neither test is true, the function returns the value
If the site panel has focus, the function checks whether the view setting is Remote view. If it is, the
function sets
bHavePreviewTarget
(
site.getRemoteSelection().length > 0
(
site.canBrowseDocument()
None, the function gets a list of the selected files (
the form of
file:///
function sets the value
), or the Code inspector (
to
true
). If the view setting is not Remote view, and if the view is not
URLs.
bHavePreviewTarget
). If the site panel does not have
dw.getFocus() == 'document'
dw.getFocus("true") == 'html'
false
if there are remote files
) and the files can be opened in a browser
var selFiles = site.getSelection();
to
as the
false
function
dw.getFocus()
), Text view
.
A dynamic menu
)
) in
167
Need help?
Do you have a question about the DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER and is the answer not in the manual?