Skip to content

Commit

Permalink
FLUID-4907: Created auxiliary schema starter grade.
Browse files Browse the repository at this point in the history
  • Loading branch information
cindyli committed Jul 12, 2013
1 parent 4deb930 commit ebd1697
Show file tree
Hide file tree
Showing 5 changed files with 138 additions and 109 deletions.
137 changes: 137 additions & 0 deletions src/webapp/components/uiOptions/js/AuxiliarySchema.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
/*
Copyright 2013 OCAD University
Licensed under the Educational Community License (ECL), Version 2.0 or the New
BSD license. You may not use this file except in compliance with one these
Licenses.
You may obtain a copy of the ECL 2.0 License and BSD License at
https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
*/

// Declare dependencies
/*global fluid_1_5:true*/

// JSLint options
/*jslint white: true, funcinvoke: true, undef: true, newcap: true, nomen: true, regexp: true, bitwise: true, browser: true, forin: true, maxerr: 100, indent: 4 */

var fluid_1_5 = fluid_1_5 || {};

(function (fluid) {

/*******************************************************************************
* Base auxiliary schema grade
*******************************************************************************/

fluid.defaults("fluid.uiOptions.auxSchema", {
gradeNames: ["fluid.littleComponent", "autoInit"],
auxiliarySchema: {}
});

/*******************************************************************************
* Starter auxiliary schema grade
*
* Contains the settings for 6 preferences: text size, line space, text font,
* table of contents, inputs larger and emphasize links
*******************************************************************************/

fluid.defaults("fluid.uiOptions.auxSchema.starter", {
gradeNames: ["fluid.uiOptions.auxSchema", "autoInit"],
auxiliarySchema: {
"namespace": "fluid.uiOptions.constructed", // The author of the auxiliary schema will provide this and will be the component to call to initialize the constructed UIO.
"templatePrefix": "../html", // The common path to settings panel templates. The template defined in "panels" element will take precedence over this definition.
"textSize": {
"type": "fluid.uiOptions.textSize"
},
"lineSpace": {
"type": "fluid.uiOptions.lineSpace"
},
"textFont": {
"type": "fluid.uiOptions.textFont",
"classes": {
"default": "",
"times": "fl-font-uio-times",
"comic": "fl-font-uio-comic-sans",
"arial": "fl-font-uio-arial",
"verdana": "fl-font-uio-verdana"
}
},
"contrast": {
"type": "fluid.uiOptions.contrast",
"classes": {
"default": "fl-theme-uio-default",
"bw": "fl-theme-uio-bw fl-theme-bw",
"wb": "fl-theme-uio-wb fl-theme-wb",
"by": "fl-theme-uio-by fl-theme-by",
"yb": "fl-theme-uio-yb fl-theme-yb"
}
},
"tableOfContents": {
"type": "fluid.uiOptions.tableOfContents"
},
"emphasizeLinks": {
"type": "fluid.uiOptions.emphasizeLinks"
},
"inputsLarger": {
"type": "fluid.uiOptions.inputsLarger"
},
"enactors": [{
"type": "fluid.uiOptions.enactors.textSize"
}, {
"type": "fluid.uiOptions.enactors.lineSpace",
"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",
"tocTemplate": "the-location-of-toc-template"
}, {
"type": "fluid.uiOptions.enactors.emphasizeLinks",
"cssClass": "fl-link-enhanced"
}, {
"type": "fluid.uiOptions.enactors.inputsLarger",
"cssClass": "fl-text-larger"
}],
"panels": [{
"type": "fluid.uiOptions.panels.textSize",
"container": ".flc-uiOptions-text-size", // the css selector in the template where the panel is rendered
"template": "templates/textSize" // optional
}, {
"type": "fluid.uiOptions.panels.lineSpace",
"container": ".flc-uiOptions-line-space", // the css selector in the template where the panel is rendered
"template": "templates/lineSpace" // optional
}, {
"type": "fluid.uiOptions.panels.textFont",
"container": ".flc-uiOptions-text-font", // the css selector in the template where the panel is rendered
"classnameMap": "@textFont.classes",
"template": "templates/textFont" // optional
}, {
"type": "fluid.uiOptions.panels.contrast",
"container": ".flc-uiOptions-contrast", // the css selector in the template where the panel is rendered
"classnameMap": "@contrast.classes",
"template": "templates/contrast" // optional
}, {
"type": "fluid.uiOptions.panels.layoutControls",
"container": ".flc-uiOptions-layout-controls", // the css selector in the template where the panel is rendered
"template": "templates/tableOfContents" // optional
}, {
"type": "fluid.uiOptions.panels.linksControls",
"container": ".flc-uiOptions-links-controls", // the css selector in the template where the panel is rendered
"template": "templates/linksControls" // optional
}]
}
});

})(fluid_1_5);
106 changes: 0 additions & 106 deletions src/webapp/components/uiOptions/schema/AuxiliarySchema.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/webapp/demos/uiOptions/html/uiOptions.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<script type="text/javascript" src="../../../framework/renderer/js/fluidRenderer.js"></script>
<script type="text/javascript" src="../../../framework/renderer/js/RendererUtilities.js"></script>

<script type="text/javascript" src="../../../components/uiOptions/schema/AuxiliarySchema.js"></script>
<script type="text/javascript" src="../../../components/uiOptions/js/AuxiliarySchema.js"></script>
<script type="text/javascript" src="../../../components/tabs/js/Tabs.js"></script>
<script type="text/javascript" src="../../../components/uiOptions/js/URLUtilities.js"></script>
<script type="text/javascript" src="../../../components/uiOptions/js/i18n.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
<script type="text/javascript" src="../../../../components/uiOptions/js/Panels.js"></script>
<script type="text/javascript" src="../../../../components/uiOptions/js/PrimaryBuilder.js"></script>

<script type="text/javascript" src="../../../../components/uiOptions/schema/AuxiliarySchema.js"></script>
<script type="text/javascript" src="../../../../components/uiOptions/js/AuxBuilder.js"></script>

<!-- These are the jqUnit test js files -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
<script type="text/javascript" src="../../../../components/tableOfContents/js/TableOfContents.js"></script>

<script type="text/javascript" src="../../../../components/uiOptions/js/PrimaryBuilder.js"></script>
<script type="text/javascript" src="../../../../components/uiOptions/schema/AuxiliarySchema.js"></script>
<script type="text/javascript" src="../../../../components/uiOptions/js/AuxBuilder.js"></script>
<script type="text/javascript" src="../../../../components/uiOptions/js/Builder.js"></script>

Expand Down

0 comments on commit ebd1697

Please sign in to comment.