Skip to content

Commit

Permalink
FLUID-4907: functional builder. TODO: Updated aux builder expansion.
Browse files Browse the repository at this point in the history
  • Loading branch information
yzen committed Jul 5, 2013
1 parent fa98c40 commit 7e612aa
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 30 deletions.
79 changes: 78 additions & 1 deletion src/webapp/components/uiOptions/js/Builder.js
Expand Up @@ -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);
29 changes: 0 additions & 29 deletions src/webapp/tests/component-tests/uiOptions/js/BuilderTests.js
Expand Up @@ -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"
}]
};

Expand All @@ -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": "",
Expand All @@ -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"
}]
};

Expand Down

0 comments on commit 7e612aa

Please sign in to comment.