Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

3rd parties will have to define their own grades.

Adding panels to the set of included panels (no schema)

Section
Column
width50%

UIO

Code Block
javascript
javascript
/**
 * 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?
            }
        },
        doodle: {
            funcName: "my.integration.doodlePanel",
            options: {
                template: "myDoodlePanel.html"
                // if necessary
            }
        }
    }
});
fluid.uiOptions(container, {
    gradeNames: ["fluid.uiOptions.defaultPanels", "my.extra.panels"],
    pathToTemplates: "my/sites/lib/infusion/templates/",
    pathToTocTemplate: "my/sites/",
    // TocTemplate filename would be in a separate option
    siteThemeClassName: "foofer-doodle-theme"
});

Alternatively, the extra grade could be added using demands:

Code Block
javascript
javascript
fluid.demands("fluid.uiOptions", ["my.integrations"], {
    gradeNames: ["my.extra.panels"],
});
fluid.uiOptions(container, {
    gradeNames: ["fluid.uiOptions.defaultPanels"],
    pathToTemplates: "my/sites/lib/infusion/templates/",
    pathToTocTemplate: "my/sites/",
    // TocTemplate filename would be in a separate option
    siteThemeClassName: "foofer-doodle-theme"
});
Column

Page Enhancer

Code Block
javascript
javascript
/**
 * Define a grade for extra enactors
 * and their default settings
 */
// Define a
grade for the extra 
fluid.defaults("my.extra.settings", {
    defaultSiteSettings: {
        foofer: 7,
        doodle: true
    },
    components: {
        foofer: {
            funcName: "my.integration.fooferEnactor",
            options: {
                // if necessary
            }
        },
        doodle: {
            funcName: "my.integration.doodleEnactor",
            options: {
                // if necessary
            }
        }
    }
});
fluid.pageEnhancer({
    gradeNames: ["fluid.uiOptions.defaultSettings", "my.extra.settings"],
    pathToTocTemplate: "my/sites/",
    // TocTemplate filename would be in a separate option
    siteThemeClassName: "foofer-doodle-theme"
});

Alternatively, the extra grade could be added using demands:

Code Block
javascript
javascript
fluid.demands("fluid.pageEnhancer", ["my.integrations"], {
    gradeNames: ["my.extra.settings"],
});
fluid.pageEnhancer({
    gradeNames: ["fluid.uiOptions.defaultSettings"],
    pathToTocTemplate: "my/sites/",
    // TocTemplate filename would be in a separate option
    siteThemeClassName: "foofer-doodle-theme"
});

Adding panels to the set of included panels (with schema)

Section
Column
width50%

UIO

Code Block
javascript
javascript

// The grade definition would be the same as above

fluid.uiOptions(container, {
    // XXX: Would custom schema include 'default' panels?
    schema: "my/sites/mySchema.json"
    pathToTemplates: "my/sites/lib/infusion/templates/",
    pathToTocTemplate: "my/sites/",
    // TocTemplate filename would be in a separate option
    siteThemeClassName: "foofer-doodle-theme"
});
Column

Page Enhancer

Code Block
javascript
javascript

// The grade definition would be the same as above

fluid.pageEnhancer({
    // XXX: Would custom schema include 'default' panels?
    schema: "my/sites/mySchema.json"
    pathToTocTemplate: "my/sites/",
    // TocTemplate filename would be in a separate option
    siteThemeClassName: "foofer-doodle-theme"
});

...