diff options
Diffstat (limited to 'js/stage/stage-view.reel/stage-view.js')
-rwxr-xr-x | js/stage/stage-view.reel/stage-view.js | 77 |
1 files changed, 77 insertions, 0 deletions
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> | ||
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 | /** | ||
8 | @requires montage/core/core | ||
9 | @requires montage/ui/component | ||
10 | */ | ||
11 | var Montage = require("montage/core/core").Montage, | ||
12 | Component = require("montage/ui/component").Component; | ||
13 | |||
14 | exports.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 | ||