aboutsummaryrefslogtreecommitdiff
path: root/js/document
diff options
context:
space:
mode:
Diffstat (limited to 'js/document')
-rwxr-xr-xjs/document/controllers/document.js36
-rwxr-xr-xjs/document/document-html.js136
-rwxr-xr-xjs/document/document-text.js38
-rwxr-xr-xjs/document/helpers/url-parser.js118
-rwxr-xr-xjs/document/helpers/webgl-helper.js318
-rwxr-xr-xjs/document/mediators/io.js18
-rwxr-xr-xjs/document/mediators/template.js486
-rwxr-xr-xjs/document/models/base.js448
-rwxr-xr-xjs/document/models/html.js46
-rwxr-xr-xjs/document/models/text.js62
-rw-r--r--js/document/templates/app/main.js10
-rwxr-xr-xjs/document/templates/banner/index.html118
-rwxr-xr-xjs/document/templates/html/index.html66
-rwxr-xr-xjs/document/templates/preview/banner.html92
-rwxr-xr-xjs/document/views/base.js72
-rwxr-xr-xjs/document/views/code.js18
-rwxr-xr-xjs/document/views/design.js638
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//
33var Montage = require("montage/core/core").Montage, 33var Montage = require("montage/core/core").Montage,
34 Component = require("montage/ui/component").Component; 34 Component = require("montage/ui/component").Component;
35//////////////////////////////////////////////////////////////////////// 35////////////////////////////////////////////////////////////////////////
36// 36//
37exports.DocumentController = Montage.create(Component, { 37exports.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//
33var Montage = require("montage/core/core").Montage, 33var 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//
39exports.HtmlDocument = Montage.create(Component, { 39exports.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}); 116 this._observer.observe(this.model.views.design.document.head, {childList: true});
117 }.bind(this), template, {viewCallback: this.handleViewReady, context: this}); 117 }.bind(this), template, {viewCallback: this.handleViewReady, context: this});
118