...
Note: All further examples will only use the "UIO + Page Enhancer" version: fluid.uiOptionsPlusPageEnhancer()
. The pattern holds.
Section |
---|
Column |
---|
Code Block |
---|
|
/**
* Define a grade for the schema for your settings
*/
fluid.defaults("my.extra.settingsSchema", {
schema: {...}
});
/**
* Define a grade for extra panels
* and their default settings
*/
fluid.defaults("my.extra.panels", {
defaultSiteSettings: {
foofer: 7,
doodle: true
},
components: {
foofer: {
funcName: "my.integration.fooferPanel",
options: {
// if necessary:
template: "myFooferPanel.html"
// why can't panels load their own templates?
}
// any other configuration as necessary
},
doodle: {
funcName: "my.integration.doodlePanel",
options: {
template: "myDoodlePanel.html"
// if necessary
}
// any other configuration as necessary
}
}
});
/**
* Define a grade for extra enactors
*/
fluid.defaults("my.extra.enactors", {
components: {
foofer: {
funcName: "my.integration.fooferEnactor",
// any other configuration as necessary
},
doodle: {
funcName: "my.integration.doodleEnactor",
// any other configuration as necessary
}
}
});
/**
* Add the enactors, panels and schema
*/
fluid.uiOptionsPlusPageEnhancer(container, {
gradeNames: ["fluid.uiEnhancer.starterEnactors",
"fluid.uiOptions.starterSettingsPanels",
"fluid.uiOptions.starterSettingsSchema",
"my.extra.enactors",
"my.extra.panels",
"my.extra.settingsSchema"],
pathToTemplates: "my/sites/lib/infusion/templates/",
pathToTocTemplate: "my/sites/",
siteThemeClassName: "foofer-doodle-theme"
});
|
|
|
Alternatively, the extra grades could be added using demands:
Section |
---|
Column |
---|
Code Block |
---|
|
fluid.demands("fluid.uiOptions", ["my.integrations"], {
gradeNames: ["my.extra.enactors", "my.extra.panels", "my.extra.settingsSchema"],
});
fluid.uiOptionsPlusPageEnhancer(container, {
gradeNames: ["fluid.uiEnhancer.starterEnactors",
"fluid.uiOptions.starterSettingsPanels",
"fluid.uiOptions.starterSettingsSchema"],
pathToTemplates: "my/sites/lib/infusion/templates/",
pathToTocTemplate: "my/sites/",
siteThemeClassName: "foofer-doodle-theme"
});
|
|
|
Use Case: 3rd Parties Wanting A Subset Of The Starter Set
...
The last two of these methods will be shown here, excluding the colour-and-contrast setting and the layout setting.
Section |
---|
Column |
---|
| h3: Empty Subcomponents Code Block |
---|
|
fluid.uiOptionsPlusPageEnhancer(container, {
gradeNames: ["fluid.uiOptions.starterSettingsPanels",
"fluid.uiEnhancer.starterEnactors",
"fluid.uiOptions.starterSettingsSchema"],
// add the 'emptySubcomponent' stuff here
pathToTemplates: "my/sites/lib/infusion/templates/",
pathToTocTemplate: "my/sites/",
siteThemeClassName: "foofer-doodle-theme"
});
|
|
Column |
---|
| h3: Individual Grades Code Block |
---|
|
fluid.uiOptionsPlusPageEnhancer(container, {
gradeNames: [
// Specify each of the four desired panels directly
"fluid.uiOptions.textSizer",
"fluid.uiOptions.lineSpacer",
"fluid.uiOptions.textFont",
"fluid.uiOptions.linksControls",
// Specify each of the four desired enactors directly
"fluid.uiEnhancer.textSizer",
"fluid.uiEnhancer.lineSpacer",
"fluid.uiEnhancer.textFont",
"fluid.uiEnhancer.linksControls",
// Use the full schema
"fluid.uiOptions.starterSettingsSchema"
],
pathToTemplates: "my/sites/lib/infusion/templates/",
pathToTocTemplate: "my/sites/",
siteThemeClassName: "foofer-doodle-theme"
});
|
|
|
Use Case: 4th Parties (users of customized UIOs)