aboutsummaryrefslogtreecommitdiff
path: root/js/document
diff options
context:
space:
mode:
authorhwc4872012-04-19 13:01:43 -0700
committerhwc4872012-04-19 13:01:43 -0700
commite6a20fe64574763483dc602bd759278ccf5e5e68 (patch)
tree69defe7200206f0257fe90697136fadef59d521e /js/document
parentae7eb87564632ce7c676bd728b8ff2710ff0bb83 (diff)
parent9284c19f076dec3b47ece7dc7bcd22d74e4246c3 (diff)
downloadninja-e6a20fe64574763483dc602bd759278ccf5e5e68.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into Textures
Conflicts: js/lib/drawing/world.js js/lib/geom/geom-obj.js js/lib/rdge/materials/cloud-material.js js/lib/rdge/materials/deform-material.js js/lib/rdge/materials/flat-material.js js/lib/rdge/materials/material.js js/lib/rdge/materials/pulse-material.js js/lib/rdge/materials/relief-tunnel-material.js js/lib/rdge/materials/square-tunnel-material.js js/lib/rdge/materials/star-material.js js/lib/rdge/materials/taper-material.js js/lib/rdge/materials/tunnel-material.js js/lib/rdge/materials/twist-material.js js/lib/rdge/materials/twist-vert-material.js js/lib/rdge/materials/uber-material.js js/lib/rdge/materials/water-material.js js/lib/rdge/materials/z-invert-material.js
Diffstat (limited to 'js/document')
-rwxr-xr-xjs/document/html-document.js30
-rwxr-xr-xjs/document/templates/montage-html/default_html.css9
-rwxr-xr-xjs/document/templates/montage-html/index.html2
-rwxr-xr-xjs/document/text-document.js4
4 files changed, 16 insertions, 29 deletions
diff --git a/js/document/html-document.js b/js/document/html-document.js
index 8f9d2870..2531465d 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,13 @@ 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();
311 shapeModel.strokeMaterial = root._strikeMaterial ? root._strokeMaterial.dup() : null;
312 shapeModel.strokeStyle = "solid"; 303 shapeModel.strokeStyle = "solid";
313 //shapeModel.strokeStyleIndex 304 //shapeModel.strokeStyleIndex
314 //shapeModel.border
315 //shapeModel.background
316 switch (root.geomType()) 305 switch (root.geomType())
317 { 306 {
318 case root.GEOM_TYPE_RECTANGLE: 307 case root.GEOM_TYPE_RECTANGLE:
319 elementModel.selection = "Rectangle"; 308 elementModel.selection = "Rectangle";
320 elementModel.pi = "RectanglePi"; 309 elementModel.pi = "RectanglePi";
321 shapeModel.fill = root._fillColor.slice();
322 shapeModel.fillMaterial = root._fillMaterial ? root._fillMaterial.dup() : null;
323 shapeModel.tlRadius = root._tlRadius; 310 shapeModel.tlRadius = root._tlRadius;
324 shapeModel.trRadius = root._trRadius; 311 shapeModel.trRadius = root._trRadius;
325 shapeModel.blRadius = root._blRadius; 312 shapeModel.blRadius = root._blRadius;
@@ -329,8 +316,6 @@ exports.HTMLDocument = Montage.create(TextDocument, {
329 case root.GEOM_TYPE_CIRCLE: 316 case root.GEOM_TYPE_CIRCLE:
330 elementModel.selection = "Oval"; 317 elementModel.selection = "Oval";
331 elementModel.pi = "OvalPi"; 318 elementModel.pi = "OvalPi";
332 shapeModel.fill = root._fillColor.slice();
333 shapeModel.fillMaterial = root._fillMaterial ? root._fillMaterial.dup() : null;
334 shapeModel.innerRadius = root._innerRadius; 319 shapeModel.innerRadius = root._innerRadius;
335 break; 320 break;
336 321
@@ -340,6 +325,12 @@ exports.HTMLDocument = Montage.create(TextDocument, {
340 shapeModel.slope = root._slope; 325 shapeModel.slope = root._slope;
341 break; 326 break;
342 327
328 case root.GEOM_TYPE_BRUSH_STROKE:
329 elementModel.selection = "BrushStroke";
330 elementModel.pi = "BrushStrokePi";
331 break;
332
333
343 default: 334 default:
344 console.log( "geometry type not supported for file I/O, " + root.geomType()); 335 console.log( "geometry type not supported for file I/O, " + root.geomType());
345 break; 336 break;
@@ -426,7 +417,6 @@ exports.HTMLDocument = Montage.create(TextDocument, {
426 if (elt.elementModel && elt.elementModel.shapeModel && elt.elementModel.shapeModel.GLWorld) 417 if (elt.elementModel && elt.elementModel.shapeModel && elt.elementModel.shapeModel.GLWorld)
427 { 418 {
428 var data = elt.elementModel.shapeModel.GLWorld.exportJSON(); 419 var data = elt.elementModel.shapeModel.GLWorld.exportJSON();
429 //var data = elt.elementModel.shapeModel.GLWorld.export();
430 dataArray.push( data ); 420 dataArray.push( data );
431 } 421 }
432 422
@@ -871,11 +861,7 @@ exports.HTMLDocument = Montage.create(TextDocument, {
871 //TODO: Add logic to handle save before preview 861 //TODO: Add logic to handle save before preview
872 this.application.ninja.documentController.handleExecuteSaveAll(null); 862 this.application.ninja.documentController.handleExecuteSaveAll(null);
873 //Temp check for webGL Hack 863 //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 864 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]}); 865 //chrome.tabs.create({url: this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController._activeDocument.uri.split(this.application.ninja.coreIoApi.cloudData.root)[1]});
880 } 866 }
881 }, 867 },
diff --git a/js/document/templates/montage-html/default_html.css b/js/document/templates/montage-html/default_html.css
index 68300edf..04b21c6f 100755
--- a/js/document/templates/montage-html/default_html.css
+++ b/js/document/templates/montage-html/default_html.css
@@ -65,11 +65,10 @@ body
65 display: none; 65 display: none;
66} 66}
67 67
68.global3DSettings { 68.active-element-outline {
69 -webkit-transform-style: preserve-3d; 69 outline: #adff2f solid 2px;
70 -webkit-transform: perspective(1400) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
71} 70}
72 71
73.elem-red-outline { 72.nj-preset-transition {
74 outline: red solid thin; 73 -webkit-transition: all 450ms linear !important;
75} \ No newline at end of file 74} \ No newline at end of file
diff --git a/js/document/templates/montage-html/index.html b/js/document/templates/montage-html/index.html
index edfab2b0..b3f68030 100755
--- a/js/document/templates/montage-html/index.html
+++ b/js/document/templates/montage-html/index.html
@@ -40,7 +40,7 @@
40 40
41 <ninja-div id="Viewport" class="stageDimension"> 41 <ninja-div id="Viewport" class="stageDimension">
42 42
43 <ninja-div id="UserContent" class="stageView stageDimension global3DSettings"></ninja-div> 43 <ninja-div id="UserContent" class="stageView stageDimension"></ninja-div>
44 44
45 </ninja-div> 45 </ninja-div>
46 46
diff --git a/js/document/text-document.js b/js/document/text-document.js
index 88464d87..2574b67c 100755
--- a/js/document/text-document.js
+++ b/js/document/text-document.js
@@ -163,7 +163,9 @@ var TextDocument = exports.TextDocument = Montage.create(Component, {
163 163
164 needsSave: { 164 needsSave: {
165 get: function() { return this._needsSave; }, 165 get: function() { return this._needsSave; },
166 set: function(value) { this._needsSave = value } 166 set: function(value) {
167 this._needsSave = value;
168 }
167 }, 169 },
168 170
169 callback: { 171 callback: {