Global application functions act on the entire application. They handle tasks such as quitting and accessing Preferences.

dreamweaver.beep()

Availability

Dreamweaver MX.

Description

Creates a system beep.

Arguments

None.

Returns

Nothing.

Example

The following example calls dw.beep() to call the user’s attention to a message that the alert() function displays:

 beep(){ 
    if(confirm(“Is your order complete?”) 
    { 
        dreamweaver.beep(); 
        alert(“Click OK to submit your order”); 
    } 
}

dreamweaver.getShowDialogsOnInsert()

Availability

Dreamweaver 3.

Description

Checks whether the Show Dialog When Inserting Objects option is turned on in the General category of Preferences.

Arguments

None.

Returns

A Boolean value that indicates whether the option is on.

dreamweaver.quitApplication()

Availability

Dreamweaver 3.

Description

Quits Dreamweaver after the script that calls this function finishes executing.

Arguments

None.

Returns

Nothing.

dreamweaver.showAboutBox()

Availability

Dreamweaver 3.

Description

Opens the About dialog box.

Arguments

None.

Returns

Nothing.

dreamweaver.showDynamicDataDialog()

Availability

Dreamweaver UltraDev 1.

Description

Displays the Dynamic Data or the Dynamic Text dialog box, and waits for the user to dismiss the dialog box. If the user clicks OK, the showDynamicDataDialog() function returns a string to insert into the user’s document. (This string returns from the Data Sources API function, generateDynamicDataRef(), and passes to the Data Format API function, formatDynamicDataRef(); the return value from formatDynamicDataRef() is the one that the showDynamicDataDialog() function returns.)

Arguments

source, {title}

  • The source argument is a string that contains source code, which represents the dynamic data object. It is the same string that a previous call to this function returned. The function uses the contents of the source argument to initialize all the dialog box controls, so they appear exactly as when the user clicked OK to create this string.

    Dreamweaver passes this string to the inspectDynamicDataRef() function to determine if the string matches any of the nodes in the tree. If the string matches a node, that node is selected when the dialog box appears. You can also pass an empty string, which does not initialize the dialog box. For example, a dialog box is not initialized when used to create a new item.

  • The title argument, which is optional, is a string that contains the text to display in the title bar of the dialog box. If this argument is not supplied, Dreamweaver displays Dynamic Data in the title bar.

Returns

A string that represents the dynamic data object, if the user clicks OK.

dreamweaver.showPasteSpecialDialog()

Availability

Dreamweaver 8.

Description

This function displays the Paste Special dialog box. If the user clicks OK, the showPasteSpecialDialog() function performs the paste.

Arguments

None.

Returns

Nothing.

Example

 dw.showPasteSpecialDialog();

dreamweaver.showPreferencesDialog()

Availability

Dreamweaver 3. Added the strCategory argument in Dreamweaver 8. Updated in CS4.

Description

This function opens the Preferences dialog box.

Arguments

{strCategory}

  • The strCategoryargument, which is optional, must be one of the following strings to open the correlating category of the Preferences dialog box: general, accessibility, "html colors" (for the Code Coloring category), "html format" (for the Code Format category), "code hints", "html rewriting" (for the Code Rewriting category), copyPaste , "css styles", "file compare", "external editors" (for the File Types/Editors category), fonts, highlighting, "invisible elements", layers,"new document", floaters (for the Panels category), browsers, (for the Preview in Browser category), "site ftp" (for the Site category), "status bar", and validator. If Dreamweaver does not recognize the argument as a valid pane name, the dialog box opens to the last active pane. Dreamweaver does the same, if the argument is omitted.

Returns

Nothing.

Example

The following example opens the Preferences dialog box and selects the Code Coloring category:

 dw.showPreferencesDialog(“html colors”);

dreamweaver.showTagChooser()

Availability

Dreamweaver MX.

Description

Toggles the visibility of the Tag Chooser dialog box for users to insert tags into the Code view. The function shows the Tag Chooser dialog box on top of all other Dreamweaver windows. If the dialog box is not visible, the function opens it, brings it to the front, and sets focus to it. If the Tag Chooser is visible, the function hides the dialog box.

Arguments

None.

Returns

Nothing.

dw.registerIdleHandler()

Availability

Dreamweaver CS3.

Description

This function registers a JavaScript function to be called on a periodic basis during idle processing time.

Arguments

id, idleFunction, interval

  • The id argument is a unique string used to identify the idle task to register. To ensure uniqueness, prefix the ID with a unique identifier. For example you might want a beep every 5 seconds, but you wouldn't want to call the task "beep", because someone else might also have created a task of the same name. A better name would be something like "acme_beep_task", thus providing both context and uniqueness.

  • The idleFunction argument is the JavaScript function to be called during idle processing time.

  • The interval argument is the number of seconds between calls of idleFunction, subject to idle-time availability.

Returns

A Boolean value indicating whether the idle task was successfully registered.

Example

The following example causes the system to beep once every 5 seconds:

 dw.registerIdleHandler("acme_beep_task", function() { dw.beep();}, 5);

dw.revokeIdleHandler()

Availability

Dreamweaver CS3.

Description

This function removes an idle task previously spawned by the registerIdleHandler()function. The intention is to provide a way to remove a previously registered idle task. If an idle task is expected to remain active until the application is terminated, it is unnecessary to call this function. In this case, the idle task is removed automatically before termination.

Arguments

id

  • The id is a unique string used to identify the registered idle task to remove. This is the same ID that was initially used to register the task.

Returns

A Boolean value indicating whether the idle task was successfully removed.

Example

The following example removes the idle task known as "dw_beep_task" from the idle task queue:

 dw.revokeIdleHandler("acme_beep_task");

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