diff options
author | hwc487 | 2012-07-09 16:08:02 -0700 |
---|---|---|
committer | hwc487 | 2012-07-09 16:08:02 -0700 |
commit | 5085d0f67df89a21715308956004164597a6ba79 (patch) | |
tree | 2c896163143a66331205a39b0a3b1b45d51bf12a /js/document | |
parent | 51f1691f792dbda9b740ded8aa0457c9406db156 (diff) | |
parent | 84b3327bd92faafab7954b5eb64c7abe24a3fe13 (diff) | |
download | ninja-5085d0f67df89a21715308956004164597a6ba79.tar.gz |
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into GridFixes
Conflicts:
js/helper-classes/3D/StageLine.js
Diffstat (limited to 'js/document')
-rwxr-xr-x | js/document/controllers/document.js | 36 | ||||
-rwxr-xr-x | js/document/document-html.js | 136 | ||||
-rwxr-xr-x | js/document/document-text.js | 38 | ||||
-rwxr-xr-x | js/document/helpers/url-parser.js | 118 | ||||
-rwxr-xr-x | js/document/helpers/webgl-helper.js | 318 | ||||
-rwxr-xr-x | js/document/mediators/io.js | 18 | ||||
-rwxr-xr-x | js/document/mediators/template.js | 620 | ||||
-rwxr-xr-x | js/document/models/base.js | 448 | ||||
-rwxr-xr-x | js/document/models/html.js | 46 | ||||
-rwxr-xr-x | js/document/models/text.js | 62 | ||||
-rw-r--r-- | js/document/templates/app/main.js | 10 | ||||
-rwxr-xr-x | js/document/templates/banner/index.html | 136 | ||||
-rwxr-xr-x | js/document/templates/html/index.html | 80 | ||||
-rwxr-xr-x | js/document/templates/preview/banner.html | 100 | ||||
-rwxr-xr-x | js/document/views/base.js | 75 | ||||
-rwxr-xr-x | js/document/views/code.js | 18 | ||||
-rwxr-xr-x | js/document/views/design.js | 659 |
17 files changed, 1471 insertions, 1447 deletions
diff --git a/js/document/controllers/document.js b/js/document/controllers/document.js index 1b1e1b85..d897934a 100755 --- a/js/document/controllers/document.js +++ b/js/document/controllers/document.js | |||
@@ -30,40 +30,40 @@ POSSIBILITY OF SUCH DAMAGE. | |||
30 | 30 | ||
31 | //////////////////////////////////////////////////////////////////////// | 31 | //////////////////////////////////////////////////////////////////////// |
32 | // | 32 | // |
33 | var Montage = require("montage/core/core").Montage, | 33 | var Montage = require("montage/core/core").Montage, |
34 | Component = require("montage/ui/component").Component; | 34 | Component = require("montage/ui/component").Component; |
35 | //////////////////////////////////////////////////////////////////////// | 35 | //////////////////////////////////////////////////////////////////////// |
36 | // | 36 | // |
37 | exports.DocumentController = Montage.create(Component, { | 37 | exports.DocumentController = Montage.create(Component, { |
38 | //////////////////////////////////////////////////////////////////// | 38 | //////////////////////////////////////////////////////////////////// |
39 | // | 39 | // |
40 | hasTemplate: { | 40 | hasTemplate: { |
41 | enumerable: false, | 41 | enumerable: false, |
42 | value: false | 42 | value: false |
43 | }, | 43 | }, |
44 | //////////////////////////////////////////////////////////////////// | 44 | //////////////////////////////////////////////////////////////////// |
45 | // | 45 | // |
46 | save: { | 46 | save: { |
47 | value: function () { | 47 | value: function () { |
48 | // | 48 | // |
49 | } | 49 | } |
50 | }, | 50 | }, |
51 | //////////////////////////////////////////////////////////////////// | 51 | //////////////////////////////////////////////////////////////////// |
52 | // | 52 | // |
53 | saveAs: { | 53 | saveAs: { |
54 | value: function () { | 54 | value: function () { |
55 | // | 55 | // |
56 | } | 56 | } |
57 | }, | 57 | }, |
58 | //////////////////////////////////////////////////////////////////// | 58 | //////////////////////////////////////////////////////////////////// |
59 | // | 59 | // |
60 | close: { | 60 | close: { |
61 | value: function () { | 61 | value: function () { |
62 | // | 62 | // |
63 | } | 63 | } |
64 | } | 64 | } |
65 | //////////////////////////////////////////////////////////////////// | 65 | //////////////////////////////////////////////////////////////////// |
66 | //////////////////////////////////////////////////////////////////// | 66 | //////////////////////////////////////////////////////////////////// |
67 | }); | 67 | }); |
68 | //////////////////////////////////////////////////////////////////////// | 68 | //////////////////////////////////////////////////////////////////////// |
69 | //////////////////////////////////////////////////////////////////////// | 69 | //////////////////////////////////////////////////////////////////////// |
diff --git a/js/document/document-html.js b/js/document/document-html.js index 566e5078..1ebdd28a 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js | |||
@@ -30,40 +30,40 @@ POSSIBILITY OF SUCH DAMAGE. | |||
30 | 30 | ||
31 | //////////////////////////////////////////////////////////////////////// | 31 | //////////////////////////////////////////////////////////////////////// |
32 | // | 32 | // |
33 | var Montage = require("montage/core/core").Montage, | 33 | var Montage = require("montage/core/core").Montage, |
34 | Component = require("montage/ui/component").Component, | 34 | Component = require("montage/ui/component").Component, |
35 | HtmlDocumentModel = require("js/document/models/html").HtmlDocumentModel, | 35 | HtmlDocumentModel = require("js/document/models/html").HtmlDocumentModel, |
36 | DesignDocumentView = require("js/document/views/design").DesignDocumentView; | 36 | DesignDocumentView = require("js/document/views/design").DesignDocumentView; |
37 | //////////////////////////////////////////////////////////////////////// | 37 | //////////////////////////////////////////////////////////////////////// |
38 | // | 38 | // |
39 | exports.HtmlDocument = Montage.create(Component, { | 39 | exports.HtmlDocument = Montage.create(Component, { |
40 | //////////////////////////////////////////////////////////////////// | 40 | //////////////////////////////////////////////////////////////////// |
41 | // | 41 | // |
42 | hasTemplate: { | 42 | hasTemplate: { |
43 | value: false | 43 | value: false |
44 | }, | 44 | }, |
45 | //////////////////////////////////////////////////////////////////// | 45 | //////////////////////////////////////////////////////////////////// |
46 | // | 46 | // |
47 | model: { | 47 | model: { |
48 | value: null | 48 | value: null |
49 | }, | 49 | }, |
50 | //////////////////////////////////////////////////////////////////// | 50 | //////////////////////////////////////////////////////////////////// |
51 | // | 51 | // |
52 | loaded: { | 52 | loaded: { |
53 | value: {callback: null, context: null} | 53 | value: {callback: null, context: null} |
54 | }, | 54 | }, |
55 | //////////////////////////////////////////////////////////////////// | 55 | //////////////////////////////////////////////////////////////////// |
56 | // | 56 | // |
57 | _observer: { | 57 | _observer: { |
58 | value: null | 58 | value: null |
59 | }, | 59 | }, |
60 | //////////////////////////////////////////////////////////////////// | 60 | //////////////////////////////////////////////////////////////////// |
61 | // | 61 | // |
62 | exclusionList: { | 62 | exclusionList: { |
63 | value: ["HTML", "BODY", "NINJA-CONTENT", "NINJA-VIEWPORT"] | 63 | value: ["HTML", "BODY", "NINJA-CONTENT", "NINJA-VIEWPORT"] |
64 | }, | 64 | }, |
65 | //////////////////////////////////////////////////////////////////// | 65 | //////////////////////////////////////////////////////////////////// |
66 | // | 66 | // |
67 | inExclusion: { | 67 | inExclusion: { |
68 | value: function(element) { | 68 | value: function(element) { |
69 | if(this.exclusionList.indexOf(element.nodeName) === -1) { | 69 | if(this.exclusionList.indexOf(element.nodeName) === -1) { |
@@ -72,62 +72,62 @@ exports.HtmlDocument = Montage.create(Component, { | |||
72 | return 1; | 72 | return 1; |
73 | } | 73 | } |
74 | }, | 74 | }, |
75 | //////////////////////////////////////////////////////////////////// | 75 | //////////////////////////////////////////////////////////////////// |
76 | // | 76 | // |
77 | init: { | 77 | init: { |
78 | value:function(file, context, callback, view, template) { | 78 | value:function(file, context, callback, view, template) { |
79 | //Storing callback data for loaded dispatch | 79 | //Storing callback data for loaded dispatch |
80 | this.loaded.callback = callback; | 80 | this.loaded.callback = callback; |
81 | this.loaded.context = context; | 81 | this.loaded.context = context; |
82 | //Creating instance of HTML Document Model | 82 | //Creating instance of HTML Document Model |
83 | this.model = Montage.create(HtmlDocumentModel,{ | 83 | this.model = Montage.create(HtmlDocumentModel,{ |
84 | file: {value: file}, | 84 | file: {value: file}, |
85 | fileTemplate: {value: template}, | 85 | fileTemplate: {value: template}, |
86 | parentContainer: {value: document.getElementById("iframeContainer")}, //Saving reference to parent container of all views (should be changed to buckets approach | 86 | parentContainer: {value: document.getElementById("iframeContainer")}, //Saving reference to parent container of all views (should be changed to buckets approach |
87 | views: {value: {'design': DesignDocumentView.create(), 'code': null}} //TODO: Add code view logic | 87 | views: {value: {'design': DesignDocumentView.create(), 'code': null}} //TODO: Add code view logic |
88 | }); | 88 | }); |
89 | //Calling the any init routines in the model | 89 | //Calling the any init routines in the model |
90 | this.model.init(); | 90 | this.model.init(); |
91 | //Initiliazing views and hiding | 91 | //Initiliazing views and hiding |
92 | if (this.model.views.design.initialize(this.model.parentContainer)) { | 92 | if (this.model.views.design.initialize(this.model.parentContainer)) { |
93 | //Hiding iFrame, just initiliazing | 93 | //Hiding iFrame, just initiliazing |
94 | this.model.views.design.hide(); | 94 | this.model.views.design.hide(); |
95 | //Setting the iFrame property for reference in helper class | 95 | //Setting the iFrame property for reference in helper class |
96 | this.model.webGlHelper.iframe = this.model.views.design.iframe; | 96 | this.model.webGlHelper.iframe = this.model.views.design.iframe; |
97 | } else { | 97 | } else { |
98 | //ERROR: Design View not initialized | 98 | //ERROR: Design View not initialized |
99 | } | 99 | } |
100 | // | 100 | // |
101 | if (view === 'design') { | 101 | if (view === 'design') { |
102 | //TODO: Remove reference and use as part of model | 102 | //TODO: Remove reference and use as part of model |
103 | this.currentView = 'design'; | 103 | this.currentView = 'design'; |
104 | //Setting current view object to design | 104 | //Setting current view object to design |
105 | this.model.currentView = this.model.views.design; | 105 | this.model.currentView = this.model.views.design; |
106 | //Showing design iFrame | 106 | //Showing design iFrame |
107 | this.model.views.design.show(); | 107 | this.model.views.design.show(); |
108 | this.model.views.design.iframe.style.opacity = 0; | 108 | this.model.views.design.iframe.style.opacity = 0; |
109 | this.model.views.design.content = this.model.file.content; | 109 | this.model.views.design.content = this.model.file.content; |
110 | //TODO: Improve reference (probably through binding values) | 110 | //TODO: Improve reference (probably through binding values) |
111 | this.model.views.design._webGlHelper = this.model.webGlHelper; | 111 | this.model.views.design._webGlHelper = this.model.webGlHelper; |
112 | //Rendering design view, using observers to know when template is ready | 112 | //Rendering design view, using observers to know when template is ready |
113 | this.model.views.design.render(function () { | 113 | this.model.views.design.render(function () { |
114 | //Adding observer to know when template is ready | 114 |