Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Renamed FaxUi to FDom for clarity.

  • Loading branch information...
commit 7e8c4fa620259b36e87c38275937c4e5c70be3f1 1 parent ee4fb6b
jordan authored
Showing with 129 additions and 91 deletions.
  1. +3 −3 README.md
  2. +2 −2 coreModules/FBaseStyle/FBaseStyle.js
  3. +2 −2 coreModules/FBaseStyle/package.json
  4. +3 −3 coreModules/FBoxes/FBoxes.js
  5. +2 −2 coreModules/FBoxes/package.json
  6. +4 −4 coreModules/FButton/FButton.js
  7. +2 −2 coreModules/FButton/package.json
  8. +36 −37 coreModules/{FaxUi/FaxUi.js → FDom/FDom.js}
  9. +3 −3 coreModules/{FaxUi → FDom}/FaxUiStylers.js
  10. +3 −3 coreModules/{FaxUi → FDom}/package.json
  11. +4 −4 coreModules/FTextInput/FTextInput.js
  12. +2 −2 coreModules/FTextInput/package.json
  13. +2 −2 coreModules/FTheme/FTheme.js
  14. +2 −2 coreModules/FTheme/package.json
  15. +4 −4 coreModules/FToggleSwitch/FToggleSwitch.js
  16. +2 −2 coreModules/FToggleSwitch/package.json
  17. 0  coreModules/Fax/FaxAttributes.js
  18. +35 −0 coreModules/Fax/FaxDomHelpers.js
  19. +1 −1  coreModules/Fax/FaxEvent.js
  20. +1 −1  coreModules/Fax/package.json
  21. +1 −1  projectManager/stockResources/mainModulePackageTemplate.json
  22. +2 −2 projectManager/stockResources/mainModuleTemplate.js
  23. +9 −7 projectManager/stockResources/moduleTemlate.js
  24. +4 −2 projectManager/stockResources/projectConfigTemplate.js
View
6 README.md
@@ -144,7 +144,7 @@ projectModules: {
TestProject: { },
- FaxUi: { },
+ FDom: { },
Fax: { },
@@ -176,12 +176,12 @@ We'll make a button wrapped inside of a containing div. The button will stretch
```javascript
// Just set up our environment a bit.
var F = require('Fax'),
- FaxUi = require('FaxUi'),
+ FDom = require('FDom'),
Demo = {};
// Allow use of Divs/Spans/etc tail constructor
-F.using(FaxUi);
+F.using(FDom);
Demo.StretchyButton = {
// Initialize state for this component.
View
4 coreModules/FBaseStyle/FBaseStyle.js
@@ -1,6 +1,6 @@
var F = require('Fax'),
- FaxUi = require('FaxUi'),
- stylers = FaxUi.stylers;
+ FDom = require('FDom'),
+ stylers = FDom.stylers;
var FBaseStyle = {};
View
4 coreModules/FBaseStyle/package.json
@@ -2,11 +2,11 @@
"name" : "FBaseStyle",
"description" : "Declarative Components - box layouts etc.",
"url" : "http://none.org",
- "keywords" : ["fax", "Fax", "FaxUi", "ui", "rendering", "browser"],
+ "keywords" : ["fax", "Fax", "FDom", "ui", "rendering", "browser"],
"author" : "Jordo <jordofx@gmail.com>",
"contributors" : [],
"version" : "0.0.1",
"main" : "./FBaseStyle",
- "dependencies" : {"Fax": "0.0.1", "FaxUi": "0.0.1", "FTheme": "0.0.1"},
+ "dependencies" : {"Fax": "0.0.1", "FDom": "0.0.1", "FTheme": "0.0.1"},
"engines" : { "node": ">=0.4.0" }
}
View
6 coreModules/FBoxes/FBoxes.js
@@ -1,7 +1,7 @@
-var F = require('Fax'), FaxUi = require('FaxUi'), stylers = FaxUi.stylers,
+var F = require('Fax'), FDom = require('FDom'), stylers = FDom.stylers,
T = require('FTheme'),
- Th = FaxUi.Th, Td = FaxUi.Td, Tr = FaxUi.Tr, Div = FaxUi.Div,
- Table = FaxUi.Table, FBoxes = {};
+ Th = FDom.Th, Td = FDom.Td, Tr = FDom.Tr, Div = FDom.Div,
+ Table = FDom.Table, FBoxes = {};
(FBoxes.FBox = {}).structure = function() {
View
4 coreModules/FBoxes/package.json
@@ -2,11 +2,11 @@
"name" : "FBoxes",
"description" : "Declarative Components - box layouts etc.",
"url" : "http://none.org",
- "keywords" : ["fax", "Fax", "FaxUi", "ui", "rendering", "browser"],
+ "keywords" : ["fax", "Fax", "FDom", "ui", "rendering", "browser"],
"author" : "Jordo <jordofx@gmail.com>",
"contributors" : [],
"version" : "0.0.1",
"main" : "./FBoxes",
- "dependencies" : {"Fax": "0.0.1", "FaxUi": "0.0.1", "FTheme": "0.0.1"},
+ "dependencies" : {"Fax": "0.0.1", "FDom": "0.0.1", "FTheme": "0.0.1"},
"engines" : { "node": ">=0.4.0" }
}
View
8 coreModules/FButton/FButton.js
@@ -1,10 +1,10 @@
var F = require('Fax'),
- FaxUi = require('FaxUi'),
- stylers = FaxUi.stylers,
+ FDom = require('FDom'),
+ stylers = FDom.stylers,
T = require('FTheme'),
FButtonModule = {};
-F.using(FaxUi);
+F.using(FDom);
var Types = FButtonModule.Types = F.keyMirror({
FButtonConfirm: 1,
@@ -14,7 +14,7 @@ var Types = FButtonModule.Types = F.keyMirror({
FButtonModule.FButton = {
structure: function() {
var P = this.props, type = P.type || Types.FButtonOkay;
- return (P.anchorWithHref ? FaxUi.A : FaxUi.Button)(F.merge(P, {
+ return (P.anchorWithHref ? FDom.A : FDom.Button)(F.merge(P, {
classSet: {
FButton: true,
FButtonConfirm: type === Types.FButtonConfirm,
View
4 coreModules/FButton/package.json
@@ -2,11 +2,11 @@
"name" : "FButton",
"description" : "Declarative Components",
"url" : "http://none.org",
- "keywords" : ["fax", "Fax", "FaxUi", "ui", "rendering", "browser"],
+ "keywords" : ["fax", "Fax", "FDom", "ui", "rendering", "browser"],
"author" : "Jordo <jordofx@gmail.com>",
"contributors" : [],
"version" : "0.0.1",
"main" : "./FButton",
- "dependencies" : {"Fax": "0.0.1", "FaxUi": "0.0.1", "FTheme": "0.0.1"},
+ "dependencies" : {"Fax": "0.0.1", "FDom": "0.0.1", "FTheme": "0.0.1"},
"engines" : { "node": ">=0.4.0" }
}
View
73 coreModules/FaxUi/FaxUi.js → coreModules/FDom/FDom.js
@@ -28,13 +28,13 @@
*/
/**
- * FaxUi/FaxUi.js - core dom module for the FaxJs ui system. Low level building
+ * FDom/FDom.js - core dom module for the FaxJs ui system. Low level building
* blocks for javascript applications.
*/
var F = require('Fax'),
FComp = F.FaxComponentization,
FaxUiStylers = require('./FaxUiStylers'),
- FaxUi = {};
+ FDom = {};
@@ -42,44 +42,44 @@ var F = require('Fax'),
* Native dom "tag" components. Properties that you inject into these projection
* constructors correspond to actual dom properties, not abstract ones.
*/
-FaxUi.Div = FComp.makeDomContainerComponent('div');
-FaxUi.TextArea = FComp.makeDomContainerComponent('textarea');
-FaxUi.Label = FComp.makeDomContainerComponent('label');
-FaxUi.Ul = FComp.makeDomContainerComponent('ul');
-FaxUi.Dl = FComp.makeDomContainerComponent('dl');
-FaxUi.Dt = FComp.makeDomContainerComponent('dt');
-FaxUi.Dd = FComp.makeDomContainerComponent('Dd');
-FaxUi.P = FComp.makeDomContainerComponent('p');
-FaxUi.Pre = FComp.makeDomContainerComponent('pre');
-FaxUi.Hr = FComp.makeDomContainerComponent('hr');
-FaxUi.Br = FComp.makeDomContainerComponent('br');
-FaxUi.Img = FComp.makeDomContainerComponent('img');
-FaxUi.A = FComp.makeDomContainerComponent('a');
-FaxUi.Li = FComp.makeDomContainerComponent('li');
-FaxUi.I = FComp.makeDomContainerComponent('i');
-FaxUi.H1 = FComp.makeDomContainerComponent('h1');
-FaxUi.H2 = FComp.makeDomContainerComponent('h2');
-FaxUi.H3 = FComp.makeDomContainerComponent('h3');
-FaxUi.H4 = FComp.makeDomContainerComponent('h4');
-FaxUi.H5 = FComp.makeDomContainerComponent('h5');
-FaxUi.H6 = FComp.makeDomContainerComponent('h6');
-FaxUi.Span = FComp.makeDomContainerComponent('span');
-FaxUi.Input = FComp.makeDomContainerComponent('input');
-FaxUi.Button = FComp.makeDomContainerComponent('button');
-FaxUi.Table = FComp.makeDomContainerComponent('table');
-FaxUi.Tr = FComp.makeDomContainerComponent('tr');
-FaxUi.Th = FComp.makeDomContainerComponent('th');
-FaxUi.Td = FComp.makeDomContainerComponent('td');
-FaxUi.IFrame = FComp.makeDomContainerComponent('iframe');
+FDom.Div = FComp.makeDomContainerComponent('div');
+FDom.TextArea = FComp.makeDomContainerComponent('textarea');
+FDom.Label = FComp.makeDomContainerComponent('label');
+FDom.Ul = FComp.makeDomContainerComponent('ul');
+FDom.Dl = FComp.makeDomContainerComponent('dl');
+FDom.Dt = FComp.makeDomContainerComponent('dt');
+FDom.Dd = FComp.makeDomContainerComponent('Dd');
+FDom.P = FComp.makeDomContainerComponent('p');
+FDom.Pre = FComp.makeDomContainerComponent('pre');
+FDom.Hr = FComp.makeDomContainerComponent('hr');
+FDom.Br = FComp.makeDomContainerComponent('br');
+FDom.Img = FComp.makeDomContainerComponent('img');
+FDom.A = FComp.makeDomContainerComponent('a');
+FDom.Li = FComp.makeDomContainerComponent('li');
+FDom.I = FComp.makeDomContainerComponent('i');
+FDom.H1 = FComp.makeDomContainerComponent('h1');
+FDom.H2 = FComp.makeDomContainerComponent('h2');
+FDom.H3 = FComp.makeDomContainerComponent('h3');
+FDom.H4 = FComp.makeDomContainerComponent('h4');
+FDom.H5 = FComp.makeDomContainerComponent('h5');
+FDom.H6 = FComp.makeDomContainerComponent('h6');
+FDom.Span = FComp.makeDomContainerComponent('span');
+FDom.Input = FComp.makeDomContainerComponent('input');
+FDom.Button = FComp.makeDomContainerComponent('button');
+FDom.Table = FComp.makeDomContainerComponent('table');
+FDom.Tr = FComp.makeDomContainerComponent('tr');
+FDom.Th = FComp.makeDomContainerComponent('th');
+FDom.Td = FComp.makeDomContainerComponent('td');
+FDom.IFrame = FComp.makeDomContainerComponent('iframe');
/*
- * FaxUi.Ordered: A container of several same-typed subcomponents each element
+ * FDom.Ordered: A container of several same-typed subcomponents each element
* in the properties passed in must all accept the same properties (in other
* words implement the same interface.
*/
var OrderedConstructor = FComp.MakeComponentClass({},[FComp.OrderedComponentMixin]);
-FaxUi.Ordered = function(propsParam) {
+FDom.Ordered = function(propsParam) {
var props = propsParam || this;
return {
props: props,
@@ -89,13 +89,13 @@ FaxUi.Ordered = function(propsParam) {
/*
- * FaxUi.MultiDynamic: A container of several same-typed subcomponents each
+ * FDom.MultiDynamic: A container of several same-typed subcomponents each
* element in the properties passed in must all accept the same properties (in
* other words implement the same interface.
*/
var MultiDynamicConstructor =
FComp.MakeComponentClass({},[FComp.MultiDynamicComponentMixin]);
-FaxUi.MultiDynamic = function(propsParam) {
+FDom.MultiDynamic = function(propsParam) {
var props = propsParam || this;
return {
props: props,
@@ -104,6 +104,5 @@ FaxUi.MultiDynamic = function(propsParam) {
};
-module.exports = FComp.ComponentizeAll(FaxUi);
+module.exports = FComp.ComponentizeAll(FDom);
module.exports.stylers = FaxUiStylers;
-
View
6 coreModules/FaxUi/FaxUiStylers.js → coreModules/FDom/FaxUiStylers.js
@@ -191,7 +191,7 @@ var stylers = module.exports = {
/**
* Packs cross browser values into a single 'value'. Use like:
- * style = {borderRadius: FaxUi.stylers.roundValue(2)}
+ * style = {borderRadius: FDom.stylers.roundValue(2)}
*/
roundValue: function(radiusParam) {
var radiusPx = (radiusParam || 0) + 'px';
@@ -237,7 +237,7 @@ var stylers = module.exports = {
* and mixins won't allow two keys of 'background', so we sneak in an extra
* key/value pair in the value itself. This won't work for udpating values
* after they've been rendered. Use like: style = {background:
- * FaxUi.backgroundColorValue(...)}.
+ * FDom.stylers.backgroundColorValue(...)}.
* #todoie: Ie 8- do not support rgba. A better fallback is to use a filtered
* gradient with the same start and end color.
*/
@@ -251,7 +251,7 @@ var stylers = module.exports = {
/**
* Gradient from bottom to top. Injects cross browser *keys* and values.
- * #todoie (filter) Use like: style = {boxShadow: FaxUi.boxShadowValue(...)}
+ * #todoie (filter) Use like: style = {boxShadow: FDom.stylers.boxShadowValue(...)}
* Good article on box-shadow, and how to simulate in IE8-.
* http://dev.opera.com/articles/view/cross-browser-box-shadows/
*/
View
6 coreModules/FaxUi/package.json → coreModules/FDom/package.json
@@ -1,12 +1,12 @@
{
- "name" : "FaxUi",
+ "name" : "FDom",
"description" : "Declarative Base Components",
"url" : "http://none.org",
- "keywords" : ["fax", "Fax", "FaxUi", "ui", "rendering", "browser"],
+ "keywords" : ["fax", "Fax", "FDom", "ui", "rendering", "browser"],
"author" : "Jordo <jordofx@gmail.com>",
"contributors" : [],
"version" : "0.0.1",
- "main" : "./FaxUi",
+ "main" : "./FDom",
"dependencies" : {"Fax": "0.0.1"},
"engines" : { "node": ">=0.4.0" }
}
View
8 coreModules/FTextInput/FTextInput.js
@@ -3,11 +3,11 @@
* appropriate interfaces for them.
*/
var F = require('Fax'),
- FaxUi = require('FaxUi'),
- stylers = FaxUi.stylers,
+ FDom = require('FDom'),
+ stylers = FDom.stylers,
FTheme = require('FTheme'),
- Input = FaxUi.Input,
- Div = FaxUi.Div,
+ Input = FDom.Input,
+ Div = FDom.Div,
FTextInput = {};
var Consts = {
View
4 coreModules/FTextInput/package.json
@@ -2,12 +2,12 @@
"name" : "FTextInput",
"description" : "Declarative Components, text input with placeholder",
"url" : "http://none.org",
- "keywords" : ["fax", "Fax", "FaxUi", "ui", "rendering", "browser"],
+ "keywords" : ["fax", "Fax", "FDom", "ui", "rendering", "browser"],
"author" : "Jordo <jordofx@gmail.com>",
"contributors" : [],
"version" : "0.0.1",
"main" : "./FTextInput",
- "dependencies" : {"Fax": "0.0.1", "FaxUi": "0.0.1", "FTheme": "0.0.1"},
+ "dependencies" : {"Fax": "0.0.1", "FDom": "0.0.1", "FTheme": "0.0.1"},
"engines" : { "node": ">=0.4.0" }
}
View
4 coreModules/FTheme/FTheme.js
@@ -18,8 +18,8 @@
*/
var F = require('Fax'),
- FaxUi = require('FaxUi'),
- S = FaxUi.stylers;
+ FDom = require('FDom'),
+ S = FDom.stylers;
var STANDARD_LINE_HEIGHT = 14;
var WHITE = { r:255, g:255, b:255 };
View
4 coreModules/FTheme/package.json
@@ -2,11 +2,11 @@
"name" : "FTheme",
"description" : "Declarative Components - Theme file",
"url" : "http://none.org",
- "keywords" : ["fax", "Fax", "FaxUi", "ui", "rendering", "browser"],
+ "keywords" : ["fax", "Fax", "FDom", "ui", "rendering", "browser"],
"author" : "Jordo <jordofx@gmail.com>",
"contributors" : [],
"version" : "0.0.1",
"main" : "./FTheme",
- "dependencies" : {"Fax": "0.0.1", "FaxUi": "0.0.1"},
+ "dependencies" : {"Fax": "0.0.1", "FDom": "0.0.1"},
"engines" : { "node": ">=0.4.0" }
}
View
8 coreModules/FToggleSwitch/FToggleSwitch.js
@@ -1,8 +1,8 @@
var F = require('Fax'),
- FaxUi = require('FaxUi'),
- stylers = FaxUi.stylers,
+ FDom = require('FDom'),
+ stylers = FDom.stylers,
FTheme = require('FTheme'), T = FTheme,
- Div = FaxUi.Div,
+ Div = FDom.Div,
FToggleSwitch = {};
/**
@@ -57,7 +57,7 @@ FToggleSwitch.FToggleSwitch = {
var perceivedValue = this._externallyOwned(this.props) ? this.props.value :
this.state.internalValue;
- return FaxUi.Button({
+ return FDom.Button({
classSet: { relZero: true, FSwitch: true },
onClick: this.onElementClick.bind(this),
View
4 coreModules/FToggleSwitch/package.json
@@ -2,11 +2,11 @@
"name" : "FToggleSwitch",
"description" : "Declarative Components",
"url" : "http://none.org",
- "keywords" : ["fax", "Fax", "FaxUi", "ui", "rendering", "browser"],
+ "keywords" : ["fax", "Fax", "FDom", "ui", "rendering", "browser"],
"author" : "Jordo <jordofx@gmail.com>",
"contributors" : [],
"version" : "0.0.1",
"main" : "./FToggleSwitch",
- "dependencies" : {"Fax": "0.0.1", "FaxUi": "0.0.1", "FTheme": "0.0.1"},
+ "dependencies" : {"Fax": "0.0.1", "FDom": "0.0.1", "FTheme": "0.0.1"},
"engines" : { "node": ">=0.4.0" }
}
View
0  coreModules/Fax/FaxAttributes.js
No changes.
View
35 coreModules/Fax/FaxDomHelpers.js
@@ -0,0 +1,35 @@
+/**
+ * FaxJs tends to not touch the dom very much. Therefore, there won't be much
+ * code in this module. That's generally a good thing.
+ */
+
+var ERROR_MESSAGES = {
+ COULD_NOT_CREATE_SINGLE_DOM: "Could not create single dom node"
+};
+
+
+/**
+ * Does not work correctly with tables etc.
+ */
+var singleDomNodeFromMarkup = function (newMarkup) {
+ var elemIdx, div = document.createElement('div');
+ div.innerHTML = newMarkup;
+ var elements = div.childNodes;
+ for (elemIdx = elements.length - 1; elemIdx >= 0; elemIdx--){
+ return elements[elemIdx];
+ }
+ throw ERROR_MESSAGES.COULD_NOT_CREATE_SINGLE_DOM;
+};
+
+/**
+ * Does not work correctly with tables etc.
+ *
+ */
+var appendMarkup = exports.appendMarkup = function(elem, newMarkup) {
+ var elemIdx, div = document.createElement('div');
+ div.innerHTML = newMarkup;
+ var elements = div.childNodes;
+ for (elemIdx = elements.length - 1; elemIdx >= 0; elemIdx--) {
+ elem.appendChild(elements[elemIdx]);
+ }
+};
View
2  coreModules/Fax/FaxEvent.js
@@ -28,7 +28,7 @@
*/
/**
- * Fax/FaxEvent.js - FaxUi event system module.
+ * Fax/FaxEvent.js - Fax event system module.
*/
var FEnv = require('./FEnv');
View
2  coreModules/Fax/package.json
@@ -2,7 +2,7 @@
"name" : "Fax",
"description" : "Declarative Components",
"url" : "http://none.org",
- "keywords" : ["fax", "Fax", "FaxUi", "ui", "rendering", "browser"],
+ "keywords" : ["fax", "Fax", "FDom", "ui", "rendering", "browser"],
"author" : "Jordo <jordofx@gmail.com>",
"contributors" : [],
"version" : "0.0.1",
View
2  projectManager/stockResources/mainModulePackageTemplate.json
@@ -7,7 +7,7 @@
"contributors" : [],
"version" : "0.0.1",
"main" : "./MainModuleName",
- "dependencies" : {"Fax": "0.0.1", "FaxUi": "0.0.1", "FTheme": "0.0.1", "TextInput": "0.0.1", "FButton": "0.0.1", "FToggleSwitch": "0.0.1" },
+ "dependencies" : {"Fax": "0.0.1", "FDom": "0.0.1", "FTheme": "0.0.1", "TextInput": "0.0.1", "FButton": "0.0.1", "FToggleSwitch": "0.0.1" },
"engines" : { "node": ">=0.4.0" }
}
View
4 projectManager/stockResources/mainModuleTemplate.js
@@ -1,8 +1,8 @@
-var F = require('Fax'), FaxUi = require('FaxUi'), MainModuleName = {};
+var F = require('Fax'), FDom = require('FDom'), MainModuleName = {};
/* 'using(x)' allows "tail constructors" to be used for every component defined
* inside module 'x'. Tail constructors look like: { content: 'hi' }.Div() */
-F.using(MainModuleName, FaxUi);
+F.using(MainModuleName, FDom);
/* The project was created with an index.html that instantiates
* MainModuleName.MainComponent. 'structure()' is the main method of any ui
View
16 projectManager/stockResources/moduleTemlate.js
@@ -2,10 +2,12 @@
* ModuleName:
*/
var F = require('Fax'),
- FaxUi = require('FaxUi'),
+ FDom = require('FDom'),
+ Div = FDom.Div,
+ Span = FDom.Span,
ModuleName = {};
-F.using(ModuleName, FaxUi);
+F.using(ModuleName, FDom);
/**
@@ -13,12 +15,12 @@ F.using(ModuleName, FaxUi);
*/
ModuleName.SomeComponent = {
project : function() {
- return {
- classSet: { someComponentOuterDiv: true},
- containedSpan: {
+ return Div({
+ classSet: { someComponentOuterDiv: true },
+ containedSpan: Span({
content: 'A component!'
- }.Span()
- }.Div();
+ })
+ });
}
};
View
6 projectManager/stockResources/projectConfigTemplate.js
@@ -6,7 +6,7 @@
* 2. Make sure there is a package.json file (if needed) to model depencies,
* and set the main file.
*
- * To add a UI module (FaxUi component etc.)
+ * To add a UI module (Fax component etc.)
* 1. Place in projectDir/lib
* 2. Make sure there is a package.json (if needed) (as in non-ui modules).
* 3. Any module that depends on your new module, needs to declare so in
@@ -49,10 +49,12 @@ exports.projectConfig = {
projectModules: {
main: { },
+
+ FTheme: { },
FBaseStyle: { },
- FaxUi: { },
+ FDom: { },
Fax: { },
Please sign in to comment.
Something went wrong with that request. Please try again.