diff --git a/src/webapp/components/uiOptions/js/Builder.js b/src/webapp/components/uiOptions/js/Builder.js index 6f7cee9965..fa49552881 100644 --- a/src/webapp/components/uiOptions/js/Builder.js +++ b/src/webapp/components/uiOptions/js/Builder.js @@ -33,7 +33,84 @@ var fluid_1_5 = fluid_1_5 || {}; fluid.defaults("fluid.uiOptions.builder.assembler", { gradeNames: ["autoInit", "fluid.eventedComponent", "{fluid.uiOptions.builder}.buildPrimary"], - auxSchema: "{fluid.uiOptions.builder}.options.expandedAuxSchema" + auxSchema: "{fluid.uiOptions.builder}.options.expandedAuxSchema", + defaultName: "fluid.uiOptions.create", + invokers: { + attachUIOptions: { + funcName: "fluid.uiOptions.builder.assembler.attach", + args: ["{that}.options.auxSchema.panels", "fluid.uiOptions.builder.assembler.uiOptions"] + }, + attachEnhancer: { + funcName: "fluid.uiOptions.builder.assembler.attach", + args: ["{that}.options.auxSchema.enactors", "fluid.uiOptions.builder.assembler.enhancer"] + } + }, + listeners: { + onCreate: { + listener: "fluid.defaults", + args: [{ + expander: { + func: "fluid.uiOptions.builder.assembler.provideName", + args: ["{that}.options.auxSchema.name", "{that}.options.defaultName"] + } + }, { + gradeNames: ["autoInit", "fluid.viewComponent", "{that}.attachUIOptions", "{that}.attachEnhancer"] + }] + } + } + }); + + fluid.defaults("fluid.uiOptions.builder.assembler.enhancer", { + gradeNames: ["autoInit", "fluid.viewComponent"], + components: { + store: { + type: "fluid.globalSettingsStore" + }, + enhancer: { + type: "fluid.pageEnhancer", + options: { + components: "{that}.options.auxSchema.enactors" + } + } + } }); + fluid.defaults("fluid.uiOptions.builder.assembler.uiOptions", { + gradeNames: ["autoInit", "fluid.viewComponent"], + components: { + store: { + type: "fluid.globalSettingsStore" + }, + uiOptions: { + type: "fluid.uiOptions.fatPanel", + container: "{that}.container", + options: { + prefix: "{that}.options.auxSchema.templatePrefix", + components: { + templateLoader: { + options: { + templates: "{that}.options.auxSchema.templates" + } + }, + uiOptions: { + options: { + components: "{that}.options.auxSchema.panels" + } + } + } + } + } + } + }); + + fluid.uiOptions.builder.assembler.attach = function (components, gradeName) { + if (!$.isEmptyObject(components)) { + return gradeName; + } + }; + + fluid.uiOptions.builder.assembler.provideName = function (suppliedName, defaultName) { + return suppliedName || defaultName; + }; + })(jQuery, fluid_1_5); diff --git a/src/webapp/tests/component-tests/uiOptions/js/BuilderTests.js b/src/webapp/tests/component-tests/uiOptions/js/BuilderTests.js index a7b8a983c7..04ff276d39 100644 --- a/src/webapp/tests/component-tests/uiOptions/js/BuilderTests.js +++ b/src/webapp/tests/component-tests/uiOptions/js/BuilderTests.js @@ -43,26 +43,11 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt } }, "enactors": [{ - "type": "fluid.uiOptions.enactors.lineSpacing", - "fontSizeMap": { - "xx-small": "9px", - "x-small": "11px", - "small": "13px", - "medium": "15px", - "large": "18px", - "x-large": "23px", - "xx-large": "30px" - } - }, { "type": "fluid.uiOptions.enactors.textFont", "classes": "@textFont.classes" }, { "type": "fluid.uiOptions.enactors.contrast", "classes": "@contrast.classes" - }, { - "type": "fluid.uiOptions.enactors.tableOfContents", - "template": "the-location-of-toc-template", - "random": "@random.path" }] }; @@ -88,17 +73,6 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt } }, "enactors": [{ - "type": "fluid.uiOptions.enactors.lineSpacing", - "fontSizeMap": { - "xx-small": "9px", - "x-small": "11px", - "small": "13px", - "medium": "15px", - "large": "18px", - "x-large": "23px", - "xx-large": "30px" - } - }, { "type": "fluid.uiOptions.enactors.textFont", "classes": { "default": "", @@ -116,9 +90,6 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt "by": "fl-theme-uio-by fl-theme-by", "yb": "fl-theme-uio-yb fl-theme-yb" } - }, { - "type": "fluid.uiOptions.enactors.tableOfContents", - "template": "the-location-of-toc-template" }] };