diff options
author | Valerio Virgillito | 2012-03-13 11:15:34 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-03-13 11:15:34 -0700 |
commit | f6b958360d82854bdaf51848e7fd715d1f633179 (patch) | |
tree | 80f6c08bb730089bdd3f26310df8d2363f9ba863 /js/lib/NJUtils.js | |
parent | c24f58c10231c30d3a8a4c9fb9a4f395dd746180 (diff) | |
parent | 4d7b86f55c504ee4e8c2460cf6b60cb9a2cf18f0 (diff) | |
download | ninja-f6b958360d82854bdaf51848e7fd715d1f633179.tar.gz |
Merge pull request #105 from joseeight/FileIO-Build-Candidate
File I/O adding webGL/canvas data functionality
Diffstat (limited to 'js/lib/NJUtils.js')
-rwxr-xr-x | js/lib/NJUtils.js | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/js/lib/NJUtils.js b/js/lib/NJUtils.js index e16715a4..4f1082f9 100755 --- a/js/lib/NJUtils.js +++ b/js/lib/NJUtils.js | |||
@@ -116,7 +116,39 @@ exports.NJUtils = Object.create(Object.prototype, { | |||
116 | ///// TODO: Selection and model should be based on the element type | 116 | ///// TODO: Selection and model should be based on the element type |
117 | makeModelFromElement: { | 117 | makeModelFromElement: { |
118 | value: function(el) { | 118 | value: function(el) { |
119 | this.makeElementModel(el, "Div", "block", false); | 119 | var selection = "div", |
120 | controller = "block", | ||
121 | isShape = false; | ||
122 | switch(el.nodeName.toLowerCase()) | ||
123 | { | ||
124 | case "div": | ||
125 | break; | ||
126 | case "img": | ||
127 | selection = "image"; | ||
128 | controller = "image"; | ||
129 | break; | ||
130 | case "video": | ||
131 | selection = "video"; | ||
132 | controller = "video"; | ||
133 | break; | ||
134 | case "canvas": | ||
135 | isShape = el.getAttribute("data-RDGE-id"); | ||
136 | if(isShape) | ||
137 | { | ||
138 | // TODO - Need more info about the shape | ||
139 | selection = "canvas"; | ||
140 | controller = "shape"; | ||
141 | } | ||
142 | else | ||
143 | { | ||
144 | selection = "canvas"; | ||
145 | controller = "canvas"; | ||
146 | } | ||
147 | break; | ||
148 | case "shape": | ||
149 | break; | ||
150 | } | ||
151 | this.makeElementModel(el, selection, controller, isShape); | ||
120 | } | 152 | } |
121 | }, | 153 | }, |
122 | 154 | ||