MACROMEDIA DREAMWEAVER MX 2004-EXTENDING DREAMWEAVER Manual page 168

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

Advertisement

For each item in the selected list, the function tests for the presence of the character string
"
". If it is not found, the code performs a series of tests on the list item. If the item is not in
://
the form of a
file:///
value to
. If the remainder of the string following the
false
slash (/) (
if (strTemp.indexOf("/") == -1)
not exist (
else if (!DWfile.exists(selFile))
checks to see if the specified file is a folder (
(DWfile.getAttributes(selFile).indexOf("D") != -1)
function returns the value
bHavePreviewTarget
If a document, Text view, or the Code inspector have focus (
'document' || dw.getFocus() == 'textView' || dw.getFocus("true") == 'html' )
the function gets the DOM and checks to see if the document is an HTML or an XML
document. If so, the function sets
the value stored in
receiveArguments()
Dreamweaver calls the receiveArguments() function to let the command process
any arguments that pass from the menu item. For the Preview in Browsers menu,
the receiveArguments() function invokes the browser that the user selects.
The receiveArguments() function looks like the following example:
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();
}
// match up the path with the name of the corresponding browser
// that appears in the menu
browserList = dw.getBrowserList();
while (i < browserList.length)
{
if (browserList[i+1] == theBrowser)
theBrowser = browserList[i];
i+=2;
}
}
else
theBrowser = whichBrowser;
168
Chapter 8: Menus and Menu Commands
URL (
if (selFile.indexOf(urlPrefix) == -1)
Otherwise, if the target is a file, the function sets
false.
to the value
.
true
bHavePreviewTarget
bHavePreviewTarget
file:///
), it sets the return value to
), it sets the return value to
else if
). If
else if (dw.getFocus() ==
to
true
.
), it sets the return
prefix does not contain a
. If the file does
false
. Last, it
false
is a folder, the
selfile
. Finally, the function returns
),

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