diff options
37 files changed, 456 insertions, 432 deletions
diff --git a/css/ninja.css b/css/ninja.css index 6a804e99..cd7a35ab 100755 --- a/css/ninja.css +++ b/css/ninja.css | |||
@@ -204,14 +204,6 @@ body { position: absolute; margin: 0px; width: 100%; height: 100%; background-co | |||
204 | 204 | ||
205 | .layoutCanvas { position: absolute; margin: 0px; border: none; padding: 0px; top: 0px; left: 0px; z-index: 4; } | 205 | .layoutCanvas { position: absolute; margin: 0px; border: none; padding: 0px; top: 0px; left: 0px; z-index: 4; } |
206 | 206 | ||
207 | #codeViewContainer { position: absolute; top: 0px; left: 0px; margin: 0px; padding: 0px; background: black; width: 100%; height: 100%; display: none; } | ||
208 | |||
209 | #mainContent #codeMirror_1 { height: 100%; } | ||
210 | |||
211 | #mainContent .CodeMirror { width: 100%; height: 100%; background: white; } | ||
212 | |||
213 | #mainContent .CodeMirror-scroll { height: 100%; overflow: auto; } | ||
214 | |||
215 | .montage-editor-frame { position: absolute; z-index: 7; top: 0; left: 0; display: none; -webkit-user-select: initial; } | 207 | .montage-editor-frame { position: absolute; z-index: 7; top: 0; left: 0; display: none; -webkit-user-select: initial; } |
216 | 208 | ||
217 | .montage-editor { padding: 0px; word-wrap: normal; } | 209 | .montage-editor { padding: 0px; word-wrap: normal; } |
diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.js b/js/components/layout/bread-crumb.reel/bread-crumb.js index e396bdbf..c1b021a3 100755 --- a/js/components/layout/bread-crumb.reel/bread-crumb.js +++ b/js/components/layout/bread-crumb.reel/bread-crumb.js | |||
@@ -23,7 +23,7 @@ exports.Breadcrumb = Montage.create(Component, { | |||
23 | value: function(){ | 23 | value: function(){ |
24 | if(!this.application.ninja.documentController.activeDocument) { | 24 | if(!this.application.ninja.documentController.activeDocument) { |
25 | this.disabled = true; | 25 | this.disabled = true; |
26 | this.application.ninja.currentSelectedContainer = this.application.ninja.currentDocument.documentRoot; | 26 | this.application.ninja.currentSelectedContainer = (this.application.ninja.currentDocument ? this.application.ninja.currentDocument.documentRoot : null); |
27 | } | 27 | } |
28 | } | 28 | } |
29 | }, | 29 | }, |
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index 6d11bd0e..c6bf4c6b 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js | |||
@@ -427,10 +427,6 @@ var DocumentController = exports.DocumentController = Montage.create(Component, | |||
427 | 427 | ||
428 | closeDocument: { | 428 | closeDocument: { |
429 | value: function(id) { | 429 | value: function(id) { |
430 | if(this.activeDocument.needsSave === true){ | ||
431 | //if file dirty then alert user to save | ||
432 | } | ||
433 | |||
434 | var doc = this._findDocumentByUUID(id); | 430 | var doc = this._findDocumentByUUID(id); |
435 | 431 | ||
436 | var closeDocumentIndex = this._findIndexByUUID(id); | 432 | var closeDocumentIndex = this._findIndexByUUID(id); |
diff --git a/js/controllers/styles-controller.js b/js/controllers/styles-controller.js index ec4314f9..2ff3e235 100755 --- a/js/controllers/styles-controller.js +++ b/js/controllers/styles-controller.js | |||
@@ -795,7 +795,9 @@ var stylesController = exports.StylesController = Montage.create(Component, { | |||
795 | ///// method to apply/test the new value | 795 | ///// method to apply/test the new value |
796 | dec.setProperty(property, value, priority); | 796 | dec.setProperty(property, value, priority); |
797 | 797 | ||
798 | this.styleSheetModified(rule.parentStyleSheet); | 798 | if(rule.parentStyleSheet) { |
799 | this.styleSheetModified(rule.parentStyleSheet); | ||
800 | } | ||
799 | 801 | ||
800 | ///// Return browser value for value we just set | 802 | ///// Return browser value for value we just set |
801 | return dec.getPropertyValue(property); | 803 | return dec.getPropertyValue(property); |
@@ -1102,7 +1104,7 @@ var stylesController = exports.StylesController = Montage.create(Component, { | |||
1102 | ///// The dominant rule might not have the style property defined - why? | 1104 | ///// The dominant rule might not have the style property defined - why? |
1103 | ///// If no rules have the property defined, we can use the | 1105 | ///// If no rules have the property defined, we can use the |
1104 | ///// most-specific single-target rule as the dominant rule (for setting styles) | 1106 | ///// most-specific single-target rule as the dominant rule (for setting styles) |
1105 | return element.ownerDocument.defaultView.getComputedStyle(element).getPropertyValue(property); | 1107 | return (element.ownerDocument.defaultView ? element.ownerDocument.defaultView.getComputedStyle(element).getPropertyValue(property) : null); |
1106 | } | 1108 | } |
1107 | 1109 | ||
1108 | return value; | 1110 | return value; |
diff --git a/js/document/templates/montage-html/package.json b/js/document/templates/montage-html/package.json index c8bc02fb..d1e839dc 100755 --- a/js/document/templates/montage-html/package.json +++ b/js/document/templates/montage-html/package.json | |||
@@ -3,6 +3,7 @@ | |||
3 | "lib": "" | 3 | "lib": "" |
4 | }, | 4 | }, |
5 | "mappings": { | 5 | "mappings": { |
6 | "montage": "../../../../node_modules/montage/" | 6 | "montage": "../../../../node_modules/montage/", |
7 | "montage-google": "../../../../node_modules/montage-google/" | ||
7 | } | 8 | } |
8 | } \ No newline at end of file | 9 | } \ No newline at end of file |
diff --git a/js/helper-classes/3D/snap-manager.js b/js/helper-classes/3D/snap-manager.js index f4bfc12b..6766ac7f 100755 --- a/js/helper-classes/3D/snap-manager.js +++ b/js/helper-classes/3D/snap-manager.js | |||
@@ -1957,6 +1957,8 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { | |||
1957 | var localPt = hitRec.getLocalPoint(); | 1957 | var localPt = hitRec.getLocalPoint(); |
1958 | var planeMat = hitRec.getPlaneMatrix(); | 1958 | var planeMat = hitRec.getPlaneMatrix(); |
1959 | var stageWorldPt; | 1959 | var stageWorldPt; |
1960 | |||
1961 | /* | ||
1960 | if(inGlobalMode) | 1962 | if(inGlobalMode) |
1961 | { | 1963 | { |
1962 | stageWorldPt = MathUtils.transformPoint(localPt,planeMat); | 1964 | stageWorldPt = MathUtils.transformPoint(localPt,planeMat); |
@@ -1965,6 +1967,8 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { | |||
1965 | { | 1967 | { |
1966 | stageWorldPt = viewUtils.postViewToStageWorld( MathUtils.transformPoint(localPt,planeMat), elt ); | 1968 | stageWorldPt = viewUtils.postViewToStageWorld( MathUtils.transformPoint(localPt,planeMat), elt ); |
1967 | } | 1969 | } |
1970 | */ | ||
1971 | stageWorldPt = viewUtils.postViewToStageWorld( MathUtils.transformPoint(localPt,planeMat), elt ); | ||
1968 | 1972 | ||
1969 | /* | 1973 | /* |
1970 | // get a working plane parallel to the current working plane through the stage world point | 1974 | // get a working plane parallel to the current working plane through the stage world point |
diff --git a/js/helper-classes/3D/view-utils.js b/js/helper-classes/3D/view-utils.js index 40a19b90..919f7c50 100755 --- a/js/helper-classes/3D/view-utils.js +++ b/js/helper-classes/3D/view-utils.js | |||
@@ -124,35 +124,81 @@ exports.ViewUtils = Montage.create(Component, { | |||
124 | } | 124 | } |
125 | }, | 125 | }, |
126 | 126 | ||
127 | getNormalToUnprojectedElementPlane: { | 127 | /* |
128 | value: function( elt ) { | 128 | * This method will return a normal to a plane containing the Z axis and either the |
129 | var mat = this.getMatrixFromElement(elt); | 129 | * x or y axis of the element. |
130 | */ | ||
131 | getNormalToUnprojectedElementPlane: | ||
132 | { | ||
133 | value: function( elt, axis, localMode ) | ||
134 | { | ||
135 | var objMat = this.getMatrixFromElement(elt); | ||
136 | var objMatInv = glmat4.inverse( objMat, [] ); | ||
130 | 137 | ||
131 | var xVec = [mat[0], mat[1], mat[2], mat[3]]; | 138 | var xVec = [1,0,0]; |
132 | var yVec = [mat[4], mat[5], mat[6], mat[7]]; | 139 | var yVec = [0,1,0]; |
140 | var zVec = [0,0,1]; | ||
133 | 141 | ||
134 | var stage = this.application.ninja.currentDocument.documentRoot; | 142 | var stage = this.application.ninja.currentDocument.documentRoot; |
135 | var stageMat = this.getMatrixFromElement(stage); | 143 | var stageMat = this.getMatrixFromElement(stage); |
136 | var stagePlane = [stageMat[8], stageMat[9], stageMat[10], stageMat[11]]; | ||
137 | 144 | ||
145 | var mat = glmat4.multiply( stageMat, objMat, [] ); | ||
146 | |||
147 | var viewDir; | ||
148 | if (localMode) | ||
149 | { | ||
150 | var matInv = glmat4.inverse( mat, [] ); | ||
151 | viewDir = MathUtils.transformVector( [0,0,1], matInv ); | ||
152 | } | ||
153 | else | ||
154 | { | ||
155 | var stageInv = glmat4.inverse( stageMat, [] ); | ||
156 | viewDir = MathUtils.transformVector( [0,0,1], stageInv ); | ||
157 | } | ||
158 | |||
159 | /* | ||
138 | if (elt === stage) | 160 | if (elt === stage) |
139 | { | 161 | { |