diff options
author | Kris Kowal | 2012-07-06 11:52:06 -0700 |
---|---|---|
committer | Kris Kowal | 2012-07-06 15:01:48 -0700 |
commit | 648ee61ae84216d0236e0dbc211addc13b2cfa3a (patch) | |
tree | 8f0f55557bd0c47a84e49c1977c950645d284607 /js/document | |
parent | aedd14b18695d031f695d27dfbd94df5614495bb (diff) | |
download | ninja-648ee61ae84216d0236e0dbc211addc13b2cfa3a.tar.gz |
Expand tabs
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 | 486 | ||||
-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 | 118 | ||||
-rwxr-xr-x | js/document/templates/html/index.html | 66 | ||||
-rwxr-xr-x | js/document/templates/preview/banner.html | 92 | ||||
-rwxr-xr-x | js/document/views/base.js | 72 | ||||
-rwxr-xr-x | js/document/views/code.js | 18 | ||||
-rwxr-xr-x | js/document/views/design.js | 638 |
17 files changed, 1360 insertions, 1360 deletions
diff --git a/js/document/controllers/document.js b/js/document/controllers/document.js index 1b1e1b85..8033c2e9 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..a7a0f03a 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 | //Adding observer to know when template is ready |
115 | this._observer = new WebKitMutationObserver(this.handleTemplateReady.bind(this)); | 115 | this._observer = new WebKitMutationObserver(this.handleTemplateReady.bind(this)); |
116 | this._observer.observe(this.model.views.design.document.head, {childList: true}); |