MACROMEDIA DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER Manual page 169

Extending dreamweaver
Hide thumbs Also See for DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER:
Table of Contents

Advertisement

// Only launch the browser if we have a valid browser selected
if (theBrowser != "file:///" && typeof(theBrowser) != "undefined" &&
theBrowser.length > 0)
{
if (dw.getFocus(true) == 'site')
{
// Only get the first item of the selection because
// browseDocument() can't take an array.
//dw.browseDocument(site.getSelection()[0],theBrowser);
site.browseDocument(theBrowser);
}
else
dw.browseDocument(dw.getDocumentPath('document'),theBrowser);
}
else
{
// otherwise, if the user hit the F12 or Ctrl+F12 keys,
// ask if they want to specify a primary or secondary browser now.
if (whichBrowser == 'primary')
{
result = window.confirm(MSG_NoPrimaryBrowserDefined);
}
else if (whichBrowser == 'secondary')
{
result = window.confirm(MSG_NoSecondaryBrowserDefined);
}
// If they clicked OK, show the prefs dialog with the browser panel
if (result)
dw.showPreferencesDialog('browsers');
}
}
}
The function first sets the variable
. Along with setting other default values, the function also sets
arguments[0]
value of
.
false
After initializing variables, the
havePreviewTarget()
see if the user selected the primary or secondary browser. If so, the function sets the variable
to the path of the executable file that starts the browser (
theBrowser
or
dw.getSecondaryBrowser()
browsers returned by
dw.getBrowsersList()
path to the primary or secondary browser, the function sets the variable
matching value in
browserList
executable file that starts the browser. If
function sets the variable
Next, the
receiveArguments()
not begin with a path, that it is not
these conditions are true, and if the Site panel has focus, the
the
site.browseDocument()
the Site panel. If the Site panel does not have focus, the
function
dw.browseDocument()
of the variable
theBrowser
the document.
whichBrowser
receiveArguments()
and tests the result. If the result of the test is true, the function checks to
). The function then performs a loop that examines the list of
. This value contains the name of the browser and the path to the
havePreviewTarget()
to the value of the variable
theBrowser
function tests the variable
"undefined"
function to invoke the selected browser with the files selected in
and passes it the path of the current document and the value
, which specifies the name of the browser with which to open
to the value that Dreamweaver passes,
function calls the user-defined function
. If the path to a browser in the list matches the
returns the value
whichBrowser
theBrowser
, and that it has a length greater than zero. If all
receiveArguments()
receiveArguments()
to a default
return
dw.getPrimaryBrowser()
to the
theBrowser
, the
false
.
to make sure that it does
function calls
function calls the
A dynamic menu
169

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Dreamweaver mx 2004

Table of Contents