beautypg.com

Dw.revokeidlehandler(), Bridge communication functions – Adobe Dreamweaver API Reference CS5 User Manual

Page 124

background image

119

DREAMWEAVER API REFERENCE

Application

Last updated 8/27/2013

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");

Bridge communication functions

The bridge communication functions allow communication between Dreamweaver and the Bridge application. One
feature of this communication is to allow the user to browse files in Bridge easily from Dreamweaver.