Show Sounds Panel API

Show Sounds Panel Overview

Allows users to choose whether they want the screen to flash when a sound is played. This component uses Yes/No Panel as a base grade so it has the same component structure as Yes/No Panel in aspect of the model, options, selectors and dependencies.

 

On This Page
Still need help?

Join the infusion-users mailing list and ask your questions there.


Adding a Show Sounds Panel to a Component/Grade

Option 1: Typically the Show Sound Panel is integrated into the first discovery tool by supplying it as a type option in an Auxiliary Schema:

"showSounds": {
    "type": "gpii.firstDiscovery.showSounds",
    "panel": {
        "type": "gpii.firstDiscovery.panel.showSounds",
        "container": ".gpiic-fd-prefsEditor-panel-showSounds",
        "template": "%prefix/yesNo.html",
        "message": "%prefix/showSounds.json"
    }
}
Working in conjunction with the Auxiliary Schema, the type and its default value of the show sounds preference are defined in the Primary Schema:

 

fluid.defaults("gpii.firstDiscovery.schemas.showSounds", {
    gradeNames: ["autoInit", "fluid.prefs.schemas"],
    schema: {
        "gpii.firstDiscovery.showSounds": {
            "type": "boolean",
            "default": true
        }
    }
});

 

Option 2: Adding as a stand alone component:

var myPanel = gpii.firstDiscovery.panel.showSounds(container, options);

 

Grades

The base grades used by the Show Sounds Panel: