Window functions handle operations that are related to the document window and the floating panels. The window functions show and hide floating panels, determine which part of the Document window has focus, and set the active document. For operations that are related specifically to the Site panel, see Site functions.

Note:

Some of the functions in this section operate only on Windows. The description of a function indicates whether this is the case.

dom.getFocus()

Availability

Dreamweaver 3.

Description

This function determines the part of the document that is currently in focus.

Arguments

None.

Returns

One of the following strings:

  • The "head" string if the HEAD area is active

  • The "body" string if the BODY or NOFRAMES area is active

  • The "frameset" string if a frameset or any of its frames is selected

  • The "none" string if the focus is not in the document (for example, if it’s in the Property inspector or another floating panel)

dom.getView()

Availability

Dreamweaver 4, updated in CS4.

Description

This function determines which view is visible.

Arguments

None.

Returns

design, code, split, or "split code" depending on the visible view.

dom.getWindowTitle()

Availability

Dreamweaver 3.

Description

This function gets the title of the window that contains the document.

Arguments

None.

Returns

A string that contains the text that appears between the TITLE tags in the document, or nothing, if the document is not in an open window.

dom.setView()

Availability

Dreamweaver 4; updated in CS4.

Description

This function shows or hides the Design or Code view to produce a design-only, code-only, or split view.

Arguments

viewString

  • The viewString argument is the view to produce; it must be one of the following values: design, code, split, or "split code".

Returns

Nothing.

dreamweaver.bringAttentionToFloater()

Availability

Dreamweaver MX.

Description

Brings the specified panel or inspector to the front, and draws attention to the panel or inspector by making it flash, which is a slightly different functionality than dw.toggleFloater().

Arguments

floaterName

  • The floaterName argument is the name of the window, panel, or inspector.

Returns

Nothing.

Example

The following example opens and flashes the Assets panel:

 dw.bringAttentionToFloater("library");

dreamweaver.cascade()

Availability

Dreamweaver MX (Windows only), Dreamweaver 8 (added Macintosh support).

Description

Cascades the document windows, starting in the upper-left corner and positioning each window below and slightly offset from the previous one.

Arguments

None.

Returns

Nothing.

Example

The following example cascades the open documents:

 dw.cascade()

dreamweaver.getActiveWindow()

Availability

Dreamweaver 3.

Description

This function gets the document in the active window.

Arguments

None.

Returns

The document object that corresponds to the document in the active window; or, if the document is in a frame, the document object that corresponds to the frameset.

dreamweaver.getDocumentList()

Availability

Dreamweaver 3.

Description

This function gets a list of all the open documents.

Arguments

None.

Returns

An array of document objects, each corresponding to an open Document window. If a document window contains a frameset, the document object refers to the frameset, not the contents of the frames.

dreamweaver.getFloatersVisible()

Availability

Description

Determines if any panel, docked or floating, is visible. The result does not include the following:

  • The visibility state of the Insert bar

  • The closed panels

Note:

The result does not include the Insert bar, but includes the Insert panel.

Arguments

None.

Returns

A Boolean value: true if any panel is visible; false otherwise.

dreamweaver.getFloaterVisibility()

Availability

Dreamweaver 3, and updated in CS4.

Description

This function checks whether the specified panel or inspector is visible.

Arguments

floaterName

  • The floaterName argument is the name of a floating panel. If floaterName does not match one of the built-in panel names, Dreamweaver searches in the Configuration/Floaters folder for a file called floaterName.htm, where floaterName is the name of a floating panel.

    The floaterName values for built-in Dreamweaver panels are the strings to the right of the panel names in the following list:

    Assets = "assets"

    Behaviors = "behaviors"

    Bindings = "data bindings"

    Code inspector = "html"

    Components = "server components"

    CSS Styles = "css styles"

    Databases = "databases"

    Frames = "frames"

    History = "history"

    Insert bar = "objects"

    Layers = "layers"

    Library = "library"

    Link Checker Results = "linkchecker"

    Properties = "properties"

    Reference = "reference"

    Report Results = "reports"

    Search Results = "search"

    Selection inspector = "selection inspector"

    Server Behaviors = "server behaviors"

    Site = "site"

    Site Files = "site files"

    Snippets = "snippets"

    Browser Compatibility Check = "bcc"

    Validation Results = "validation"

Returns

A Boolean value: true if the floating panel is visible and in the front; false otherwise or if Dreamweaver cannot find a floating panel named floaterName.

dreamweaver.getFocus()

Availability

Dreamweaver 4.

Description

This function determines what part of the application is currently in focus.

Arguments

bAllowFloaters

  • The bAllowFloaters argument is a Boolean value: true if you want the function to return the name of the floating panel, if a floating panel has focus; false otherwise.

Returns

One of the following strings:

  • The "document" string if the document window is in focus

  • The "site" string if the Site panel is in focus

  • The "textView" string if the Text view is in focus

  • The "html" string if the Code inspector is in focus

  • The floaterName string, if bAllowFloaters is true and a floating panel has focus, where floaterName is "objects", "properties", "launcher", "library", "css styles", "html styles", "behaviors", "timelines", "layers", "frames", "templates", or "history"

  • (Macintosh) The "none" string if neither the Site panel nor any document windows are open

dreamweaver.getPrimaryView()

Availability

Dreamweaver 4.

Description

This function determines which view is visible as the primary view in the front.

Arguments

None.

Returns

The "design" or "code" strings, depending on which view is visible or on the top in a Split view.

dreamweaver.getSnapDistance()

Availability

Dreamweaver 4.

Description

This function returns the snapping distance in pixels.

Arguments

None.

Returns

An integer that represents the snapping distance in pixels. The default is 10 pixels; 0 indicates that the Snap feature is off.

dreamweaver.minimizeRestoreAll()

Availability

Dreamweaver 4.

Description

This function minimizes (reduces to an icon) or restores all windows in Dreamweaver.

Arguments

bMinimize

  • The bMinimize argument is a Boolean value: true if windows should be minimized; false if the minimized windows should be restored.

Returns

Nothing.

dreamweaver.setActiveWindow()

Availability

Dreamweaver 3.

Description

This function activates the window that contains the specified document.

Arguments

documentObject, {bActivateFrame}

  • The documentObject argument is the object at the root of a document’s DOM tree (the value that the dreamweaver.getDocumentDOM() function returns).

  • The bActivateFrame argument is optional, and is applicable only if documentObject is inside a frameset. The bActivateFrame argument is a Boolean value: true activates the frame that contains the document as well as the window that contains the frameset; false otherwise.

Returns

Nothing.

dreamweaver.setFloaterVisibility()

Availability

Dreamweaver 3, and updated in CS4.

Description

This function specifies whether to make a particular floating panel or inspector visible.

Arguments

floaterName, bIsVisible

  • The floaterName argument is the name of a floating panel. If floaterName does not match one of the built-in panel names, Dreamweaver searches in the Configuration/Floaters folder for a file called floaterName.htm. If Dreamweaver cannot find a floating panel named floaterName, this function has no effect.

    The floaterName values for built-in Dreamweaver panels are the strings to the right of the panel names in the following list:

    Assets = "assets"

    Behaviors = "behaviors"

    Bindings = "data sources"

    Code inspector = "html"

    Components = "server components"

    CSS Styles = "css styles"

    Databases = "databases"

    Frames = "frames"

    History = "history"

    HTML Styles = "html styles"

    Insert bar = "objects"

    Layers = "layers"

    Library = "library"

    Link Checker Results = "linkchecker"

    Properties = "properties"

    Reference = "reference"

    Report Results = "reports"

    Search Results = "search"

    Server Behaviors = "server behaviors"

    Site = "site"

    Site Files = "site files"

    Snippets = "snippets"

    Tag inspector = "tag inspector"

    Browser Compatibility Check= "bcc"

    Templates = "templates"

    Validation Results = "validation"

  • The bIsVisible argument is a Boolean value that indicates whether to make the floating panel visible.

Returns

Nothing.

dreamweaver.setPrimaryView()

Availability

Dreamweaver 4.

Description

This function displays the specified view at the top of the document window.

Arguments

viewString

  • The viewString argument is the view to display at the top of the document window; it can be one of the following values: "design" or "code".

Returns

Nothing.

dreamweaver.setSnapDistance()

Availability

Dreamweaver 4.

Description

This function sets the snapping distance in pixels.

Arguments

snapDistance

  • The snapDistance argument is an integer that represents the snapping distance in pixels. The default is 10 pixels. Specify 0 to turn off the Snap feature.

Returns

Nothing.

dreamweaver.showProperties()

Availability

Dreamweaver 3.

Description

This function makes the Property inspector visible and gives it focus.

Arguments

None.

Returns

Nothing.

dreamweaver.tileHorizontally()

Availability

Dreamweaver MX (Windows only), Dreamweaver 8 (added Macintosh support).

Description

Tiles the document windows horizontally, positioning each window next to another one without overlapping the documents. This process is similar to splitting the workspace vertically.

Arguments

None.

Returns

Nothing.

Example

The following example tiles the open documents horizontally:

 dw.tileHorizontally()

dreamweaver.tileVertically()

Availability

Dreamweaver MX (Windows only), Dreamweaver 8 (added Macintosh support).

Description

Tiles the document window vertically, positioning one document window behind the other without overlapping documents. This is similar to splitting the workspace horizontally.

Arguments

None.

Returns

Nothing.

Example

The following example tiles the open documents vertically:

 dw.tileVertically()

dreamweaver.toggleFloater()

Availability

Dreamweaver 3.

Description

This function shows, hides, or brings to the front the specified panel or inspector.

Note:

This function is meaningful only in the menus.xml file. To show, bring forward, or hide a floating panel, use dw.setFloaterVisibility().

Arguments

floaterName

  • The floaterName argument is the name of the window. If the floating panel name is reference, the visible/invisible state of the Reference panel is updated by the user’s selection in Code view. All other panels track the selection all the time, but the Reference panel tracks the selection in Code view only when the user starts tracking.

Returns

Nothing.

dreamweaver.updateReference()

Availability

Dreamweaver 4.

Description

This function updates the Reference floating panel. If the Reference floating panel is not visible, dw.updateReference() makes it visible and then updates it.

Arguments

None.

Returns

Nothing.

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy