aboutsummaryrefslogtreecommitdiff
path: root/js/stage/stage-view.reel
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-01-27 12:05:17 -0800
committerJose Antonio Marquez2012-01-27 12:05:17 -0800
commit3a754133dbc138390503341fd2e9beba3e43aa4b (patch)
treecdeae7d7dd9a30d7b4fab5afb7efad68d4ec7508 /js/stage/stage-view.reel
parentb89a7ee8b956c96a1dcee995ea840feddc5d4b27 (diff)
downloadninja-3a754133dbc138390503341fd2e9beba3e43aa4b.tar.gz
Merged old FileIO
Diffstat (limited to 'js/stage/stage-view.reel')
-rwxr-xr-xjs/stage/stage-view.reel/stage-view.css36
-rwxr-xr-xjs/stage/stage-view.reel/stage-view.html31
-rwxr-xr-xjs/stage/stage-view.reel/stage-view.js77
3 files changed, 144 insertions, 0 deletions
diff --git a/js/stage/stage-view.reel/stage-view.css b/js/stage/stage-view.reel/stage-view.css
new file mode 100755
index 00000000..f15f74a0
--- /dev/null
+++ b/js/stage/stage-view.reel/stage-view.css
@@ -0,0 +1,36 @@
1/* <copyright>
2 This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3 No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
4 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5 </copyright> */
6
7.codeViewContainer {
8 position: absolute;
9 top: 0px;
10 left: 0px;
11 margin: 0px;
12 padding: 0px;
13 background: black;
14 width: 100%;
15 height: 100%;
16 /*display: none;*/
17}
18
19/* OLD CSS for reference
20#mainContent #codeMirror_1 {
21 height:100%;
22}
23*/
24
25.CodeMirror {
26 width: 100%;
27 height: 100%;
28 background: white;
29}
30
31.CodeMirror .CodeMirror-scroll {
32 height: 100%;
33 overflow: scroll;
34 overflow-x: auto;
35 overflow-y: auto;
36}
diff --git a/js/stage/stage-view.reel/stage-view.html b/js/stage/stage-view.reel/stage-view.html
new file mode 100755
index 00000000..ee8fa315
--- /dev/null
+++ b/js/stage/stage-view.reel/stage-view.html
@@ -0,0 +1,31 @@
1<!DOCTYPE html>
2<!-- <copyright>
3 This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
4 No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
5 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
6 </copyright> -->
7<html>
8<head>
9 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10 <link rel="stylesheet" type="text/css" href="stage-view.css">
11
12 <script type="text/montage-serialization">
13 {
14 "owner": {
15 "module": "js/stage/stage-view.reel",
16 "name": "StageView",
17 "properties": {
18 "element": {"#": "codeViewContainer"}
19 }
20 }
21 }
22 </script>
23
24</head>
25<body>
26
27
28 <section id="codeViewContainer" class="codeViewContainer"></section>
29
30</body>
31</html>
diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js
new file mode 100755
index 00000000..63fe88ba
--- /dev/null
+++ b/js/stage/stage-view.reel/stage-view.js
@@ -0,0 +1,77 @@
1/* <copyright>
2This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
4(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5</copyright> */
6
7/**
8@requires montage/core/core
9@requires montage/ui/component
10*/
11var Montage = require("montage/core/core").Montage,
12 Component = require("montage/ui/component").Component;
13
14exports.StageView = Montage.create(Component, {
15 _documents: {
16 value : []
17 },
18
19 docs: {
20 get: function() {
21 return this._documents;
22 },
23 set: function(value) {
24 //console.log(value);
25 }
26 },
27
28 templateDidLoad: {
29 value: function() {
30 this.eventManager.addEventListener("appLoaded", this, false);
31 //console.log(this.application.ninja.documentController._documents);
32 }
33 },
34
35 handleAppLoaded: {
36 value: function() {
37
38 // Don't bind for now
39 /*
40 Object.defineBinding(this, "docs", {
41 boundObject: this.application.ninja.documentController,
42 boundObjectPropertyPath: "_documents"
43 });
44 */
45
46 }
47 },
48
49 // Temporary function to create a Codemirror text view
50 createTextView: {
51 value: function(doc) {
52// DocumentManager._hideCurrentDocument();
53
54 this.application.ninja.currentDocument.container.parentNode.style["display"] = "none";
55
56// stageManagerModule.stageManager._scrollFlag = false; // TODO HACK to prevent type error on Hide/Show Iframe
57// DocumentManager.activeDocument = doc;
58
59 this.element.appendChild(doc.textArea);
60
61
62 var codeM = CodeMirror.fromTextArea(doc.textArea, {
63 lineNumbers: true,
64 mode: "javascript"
65// onCursorActivity: function() {
66// DocumentManager._codeEditor.editor.setLineClass(DocumentManager._codeEditor.hline, null);
67// DocumentManager._codeEditor.hline = DocumentManager._codeEditor.editor.setLineClass(DocumentManager._codeEditor.editor.getCursor().line, "activeline");
68// }
69 });
70
71// DocumentManager._codeEditor.hline = DocumentManager._codeEditor.editor.setLineClass(0, "activeline");
72
73 this.application.ninja.stage.hideCanvas(true);
74
75 }
76 }
77}); \ No newline at end of file