Adobe 38040334 - Dreamweaver CS3 User Manual page 161

Extending dreamweaver
Hide thumbs Also See for 38040334 - Dreamweaver CS3:
Table of Contents

Advertisement

The
havePreviewTarget()
function performs two basic tests calling the
currently has input focus. The first test checks whether the Site panel has focus (
). If the Site panel does not have focus, the second test checks to see if a document (
'site')
), Text view (
'document'
dw.getFocus() == 'textView'
) has focus. If neither test is true, the function returns the value
'html'
If the Site panel has focus, the function checks whether the view setting is Remote view. If it is, the function sets
to
bHavePreviewTarget
can be opened in a browser (
is not None, the function gets a list of the selected files (
URLs.
file:///
For each item in the selected list, the function tests for the presence of the character string "
the code performs a series of tests on the list item. If the item is not in the form of a
(selFile.indexOf(urlPrefix) == -1)
the
prefix does not contain a slash (/) (
file:///
. If the file does not exist (
false
checks to see if the specified file is a folder (
). If
is a folder, the function returns the value
1)
selfile
to the value
bHavePreviewTarget
If a document, Text view, or the Code inspector has input focus (
dw.getFocus() == 'textView' || dw.getFocus("true") == 'html' )
checks to see if the document is an HTML or an XML document. If so, the function sets
. Finally, the function returns the value stored in
true
receiveArguments()
Dreamweaver calls the
receiveArguments()
the menu item. For the Preview in Browsers menu, the
user selects. The
receiveArguments()
function receiveArguments()
{
var whichBrowser = arguments[0];
var theBrowser = null;
var i=0;
var browserList = null;
var result = false;
if (havePreviewTarget())
{
// Code to check if we were called from a shortcut key
if (whichBrowser == 'primary' || whichBrowser == 'secondary')
{
// get the path of the selected browser
if (whichBrowser == 'primary')
{
theBrowser = dw.getPrimaryBrowser();
}
else if (whichBrowser == 'secondary')
{
theBrowser = dw.getSecondaryBrowser();
function sets the value
bHavePreviewTarget
dw.getFocus()
if there are remote files (
true
site.canBrowseDocument()
), it sets the return value to
if (strTemp.indexOf("/") == -1)
else if (!DWfile.exists(selFile))
else if (DWfile.getAttributes(selFile).indexOf("D") != -
.
true
function to let the command process any arguments that pass from
function looks like the following example:
to
false
function to determine what part of the application
), or the Code inspector (
.
false
site.getRemoteSelection().length > 0
). If the view setting is not Remote view, and if the view
var selFiles = site.getSelection();
. If the remainder of the string following
false
), it sets the return value to
Otherwise, if the target is a file, the function sets
false.
else if (dw.getFocus() == 'document' ||
), the function gets the DOM and
.
bHavePreviewTarget
function invokes the browser that the
receiveArguments()
DREAMWEAVER CS3
Extending Dreamweaver
as the default return value. The
if (dw.getFocus(true) ==
dw.getFocus() ==
dw.getFocus("true") ==
) and the files
) in the form of
". If it is not found,
://
URL (
if
file:///
), it sets the return value to
false
bHavePreviewTarget
155
. Last, it
to

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dreamweaver cs3

Table of Contents