aboutsummaryrefslogtreecommitdiff
path: root/js/document/html-document.js
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-04-04 17:24:27 -0700
committerNivesh Rajbhandari2012-04-04 17:24:27 -0700
commit01cf259da7aaa7d70789d9a7c32111d88b477463 (patch)
tree0bff3395ac681e5f685d2267f7dbc03a8e32bc4a /js/document/html-document.js
parent331ea08655245e3532e48bf160d5f68a04d8723f (diff)
parent13368ca6ebbc13adeafccd898dfffd7ce37cb28a (diff)
downloadninja-01cf259da7aaa7d70789d9a7c32111d88b477463.tar.gz
Merge branch 'refs/heads/ToolFixes' into WebGLMaterials
Conflicts: js/document/templates/montage-html/default_html.css js/mediators/element-mediator.js js/panels/properties.reel/properties.js js/tools/BrushTool.js js/tools/LineTool.js js/tools/PenTool.js js/tools/SelectionTool.js js/tools/ShapeTool.js js/tools/TranslateObject3DTool.js Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js/document/html-document.js')
-rwxr-xr-xjs/document/html-document.js33
1 files changed, 11 insertions, 22 deletions
diff --git a/js/document/html-document.js b/js/document/html-document.js
index 8f9d2870..6324d5ed 100755
--- a/js/document/html-document.js
+++ b/js/document/html-document.js
@@ -212,7 +212,7 @@ exports.HTMLDocument = Montage.create(TextDocument, {
212 { 212 {
213 /* 213 /*
214 // Use this code to test the runtime version of WebGL 214 // Use this code to test the runtime version of WebGL
215 var cdm = new CanvasDataManager(); 215 var cdm = new NinjaCvsRt.CanvasDataManager();
216 cdm.loadGLData(elt, value, null ); 216 cdm.loadGLData(elt, value, null );
217 */ 217 */
218 218
@@ -276,13 +276,6 @@ exports.HTMLDocument = Montage.create(TextDocument, {
276 var world = new GLWorld( canvas, useWebGL ); 276 var world = new GLWorld( canvas, useWebGL );
277 world.importJSON( jObj ); 277 world.importJSON( jObj );
278 } 278 }
279 else
280 {
281 var index = importStr.indexOf( "webGL: " );
282 var useWebGL = (index >= 0);
283 var world = new GLWorld( canvas, useWebGL );
284 world.import( importStr );
285 }
286 279
287 this.buildShapeModel( canvas.elementModel, world ); 280 this.buildShapeModel( canvas.elementModel, world );
288 } 281 }
@@ -307,19 +300,15 @@ exports.HTMLDocument = Montage.create(TextDocument, {
307 { 300 {
308 shapeModel.GLGeomObj = root; 301 shapeModel.GLGeomObj = root;
309 shapeModel.strokeSize = root._strokeWidth; 302 shapeModel.strokeSize = root._strokeWidth;
310 shapeModel.stroke = root._strokeColor.slice(); 303 shapeModel.stroke = root._strokeColor;
311 shapeModel.strokeMaterial = root._strikeMaterial ? root._strokeMaterial.dup() : null;
312 shapeModel.strokeStyle = "solid"; 304 shapeModel.strokeStyle = "solid";
313 //shapeModel.strokeStyleIndex 305 //shapeModel.strokeStyleIndex
314 //shapeModel.border
315 //shapeModel.background
316 switch (root.geomType()) 306 switch (root.geomType())
317 { 307 {
318 case root.GEOM_TYPE_RECTANGLE: 308 case root.GEOM_TYPE_RECTANGLE:
319 elementModel.selection = "Rectangle"; 309 elementModel.selection = "Rectangle";
320 elementModel.pi = "RectanglePi"; 310 elementModel.pi = "RectanglePi";
321 shapeModel.fill = root._fillColor.slice(); 311 shapeModel.fill = root._fillColor;
322 shapeModel.fillMaterial = root._fillMaterial ? root._fillMaterial.dup() : null;
323 shapeModel.tlRadius = root._tlRadius; 312 shapeModel.tlRadius = root._tlRadius;
324 shapeModel.trRadius = root._trRadius; 313 shapeModel.trRadius = root._trRadius;
325 shapeModel.blRadius = root._blRadius; 314 shapeModel.blRadius = root._blRadius;
@@ -329,8 +318,7 @@ exports.HTMLDocument = Montage.create(TextDocument, {
329 case root.GEOM_TYPE_CIRCLE: 318 case root.GEOM_TYPE_CIRCLE:
330 elementModel.selection = "Oval"; 319 elementModel.selection = "Oval";
331 elementModel.pi = "OvalPi"; 320 elementModel.pi = "OvalPi";
332 shapeModel.fill = root._fillColor.slice(); 321 shapeModel.fill = root._fillColor;
333 shapeModel.fillMaterial = root._fillMaterial ? root._fillMaterial.dup() : null;
334 shapeModel.innerRadius = root._innerRadius; 322 shapeModel.innerRadius = root._innerRadius;
335 break; 323 break;
336 324
@@ -340,6 +328,12 @@ exports.HTMLDocument = Montage.create(TextDocument, {
340 shapeModel.slope = root._slope; 328 shapeModel.slope = root._slope;
341 break; 329 break;
342 330
331 case root.GEOM_TYPE_BRUSH_STROKE:
332 elementModel.selection = "BrushStroke";
333 elementModel.pi = "BrushStrokePi";
334 break;
335
336
343 default: 337 default:
344 console.log( "geometry type not supported for file I/O, " + root.geomType()); 338 console.log( "geometry type not supported for file I/O, " + root.geomType());
345 break; 339 break;
@@ -426,7 +420,6 @@ exports.HTMLDocument = Montage.create(TextDocument, {
426 if (elt.elementModel && elt.elementModel.shapeModel && elt.elementModel.shapeModel.GLWorld) 420 if (elt.elementModel && elt.elementModel.shapeModel && elt.elementModel.shapeModel.GLWorld)
427 { 421 {
428 var data = elt.elementModel.shapeModel.GLWorld.exportJSON(); 422 var data = elt.elementModel.shapeModel.GLWorld.exportJSON();
429 //var data = elt.elementModel.shapeModel.GLWorld.export();
430 dataArray.push( data ); 423 dataArray.push( data );
431 } 424 }
432 425
@@ -871,11 +864,7 @@ exports.HTMLDocument = Montage.create(TextDocument, {
871 //TODO: Add logic to handle save before preview 864 //TODO: Add logic to handle save before preview
872 this.application.ninja.documentController.handleExecuteSaveAll(null); 865 this.application.ninja.documentController.handleExecuteSaveAll(null);
873 //Temp check for webGL Hack 866 //Temp check for webGL Hack
874 if (this.application.ninja.documentController.activeDocument.glData.length && this.application.ninja.documentController.activeDocument.glData.length > 1) {//TODO: Should be 0, temp hack fix 867 window.open(this.application.ninja.coreIoApi.rootUrl + this.application.ninja.documentController._activeDocument.uri.split(this.application.ninja.coreIoApi.cloudData.root)[1]);
875 setTimeout(function () {window.open(this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController._activeDocument.uri.split(this.application.ninja.coreIoApi.cloudData.root)[1]);}.bind(this), 3500);
876 } else {
877 window.open(this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController._activeDocument.uri.split(this.application.ninja.coreIoApi.cloudData.root)[1]);
878 }
879 //chrome.tabs.create({url: this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController._activeDocument.uri.split(this.application.ninja.coreIoApi.cloudData.root)[1]}); 868 //chrome.tabs.create({url: this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController._activeDocument.uri.split(this.application.ninja.coreIoApi.cloudData.root)[1]});
880 } 869 }
881 }, 870 },