aboutsummaryrefslogtreecommitdiff
path: root/js/io
diff options
context:
space:
mode:
Diffstat (limited to 'js/io')
-rwxr-xr-x[-rw-r--r--]js/io/document/base-document.js0
-rwxr-xr-x[-rw-r--r--]js/io/document/document-controller.js166
-rwxr-xr-x[-rw-r--r--]js/io/document/html-document.js0
-rwxr-xr-x[-rw-r--r--]js/io/document/text-document.js15
-rw-r--r--js/io/system/config.xml6
-rwxr-xr-x[-rw-r--r--]js/io/system/coreioapi.js (renamed from js/io/system/shellapi.js)405
-rwxr-xr-x[-rw-r--r--]js/io/system/fileio.js175
-rwxr-xr-x[-rw-r--r--]js/io/system/filesystem.js78
-rwxr-xr-x[-rw-r--r--]js/io/system/projectio.js0
-rwxr-xr-xjs/io/templates/files/_bin/template.css0
-rwxr-xr-xjs/io/templates/files/_bin/template.html0
-rwxr-xr-xjs/io/templates/files/_bin/template.js0
-rwxr-xr-xjs/io/templates/files/_bin/template.json0
-rwxr-xr-xjs/io/templates/files/_bin/template.php0
-rwxr-xr-xjs/io/templates/files/_bin/template.pl0
-rwxr-xr-xjs/io/templates/files/_bin/template.py0
-rwxr-xr-xjs/io/templates/files/_bin/template.rb0
-rwxr-xr-xjs/io/templates/files/_bin/template.xml0
-rwxr-xr-xjs/io/templates/files/_bin/xml.txt0
-rwxr-xr-xjs/io/templates/files/css.txt2
-rwxr-xr-xjs/io/templates/files/html.txt19
-rwxr-xr-xjs/io/templates/files/js.txt1
-rwxr-xr-xjs/io/templates/files/json.txt0
-rwxr-xr-xjs/io/templates/files/php.txt3
-rwxr-xr-xjs/io/templates/files/pl.txt1
-rwxr-xr-xjs/io/templates/files/py.txt1
-rwxr-xr-xjs/io/templates/files/rb.txt1
-rwxr-xr-xjs/io/ui/cloudpopup.reel/cloudpopup.html54
-rwxr-xr-xjs/io/ui/cloudpopup.reel/cloudpopup.js98
-rwxr-xr-xjs/io/ui/cloudpopup.reel/config.rb9
-rw-r--r--js/io/ui/cloudpopup.reel/css/cloudpopup.css120
-rwxr-xr-xjs/io/ui/cloudpopup.reel/css/cloudpopup.scss125
-rwxr-xr-x[-rw-r--r--]js/io/workflow/new-project-manager.js0
-rwxr-xr-x[-rw-r--r--]js/io/workflow/newFileDialog/new-file-location.reel/new-file-location.css23
-rwxr-xr-x[-rw-r--r--]js/io/workflow/newFileDialog/new-file-location.reel/new-file-location.html61
-rwxr-xr-x[-rw-r--r--]js/io/workflow/newFileDialog/new-file-location.reel/new-file-location.js30
-rwxr-xr-x[-rw-r--r--]js/io/workflow/newFileDialog/new-file-options-navigator.reel/new-file-options-navigator.css107
-rwxr-xr-x[-rw-r--r--]js/io/workflow/newFileDialog/new-file-options-navigator.reel/new-file-options-navigator.html45
-rwxr-xr-x[-rw-r--r--]js/io/workflow/newFileDialog/new-file-options-navigator.reel/new-file-options-navigator.js375
-rwxr-xr-x[-rw-r--r--]js/io/workflow/newFileDialog/new-file-workflow-controller.js75
-rwxr-xr-x[-rw-r--r--]js/io/workflow/newFileDialog/new-file-workflow-model.js39
-rwxr-xr-x[-rw-r--r--]js/io/workflow/newProjectNavigator.js0
-rwxr-xr-x[-rw-r--r--]js/io/workflow/newProjectNavigator.reel/newProjectNavigator.css0
-rwxr-xr-x[-rw-r--r--]js/io/workflow/newProjectNavigator.reel/newProjectNavigator.html0
-rwxr-xr-xjs/io/workflow/save-as-dialog.reel/save-as-dialog.css60
-rwxr-xr-xjs/io/workflow/save-as-dialog.reel/save-as-dialog.html84
-rwxr-xr-xjs/io/workflow/save-as-dialog.reel/save-as-dialog.js126
47 files changed, 1963 insertions, 341 deletions
diff --git a/js/io/document/base-document.js b/js/io/document/base-document.js
index 44f54f78..44f54f78 100644..100755
--- a/js/io/document/base-document.js
+++ b/js/io/document/base-document.js
diff --git a/js/io/document/document-controller.js b/js/io/document/document-controller.js
index 99177de0..6f363bc7 100644..100755
--- a/js/io/document/document-controller.js
+++ b/js/io/document/document-controller.js
@@ -12,26 +12,35 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
12@requires js/document/text-document 12@requires js/document/text-document
13*/ 13*/
14 14
15// TODO : Fix deps from Montage V4 Archi
16
17var Montage = require("montage/core/core").Montage, 15var Montage = require("montage/core/core").Montage,
18 Component = require("montage/ui/component").Component, 16 Component = require("montage/ui/component").Component,
19 Uuid = require("montage/core/uuid").Uuid; 17 Uuid = require("montage/core/uuid").Uuid,
18 fileSystem = require("js/io/system/filesystem").FileSystem;
20 19
21var HTMLDocument = require("js/io/document/html-document").HTMLDocument; 20var HTMLDocument = require("js/io/document/html-document").HTMLDocument;
22var TextDocument = require("js/io/document/text-document").TextDocument; 21var TextDocument = require("js/io/document/text-document").TextDocument;
23 22
24var DocumentController = exports.DocumentController = Montage.create(Component, { 23var DocumentController = exports.DocumentController = Montage.create(Component, {
25 hasTemplate: { value: false }, 24 hasTemplate: {
25 value: false
26 },
27
28 _documents: {
29 value: []
30 },
26 31
27 _documents: { value: [] },
28 _documentsHash: { value: {} },
29 _activeDocument: { value: null }, 32 _activeDocument: { value: null },
30 _iframeCounter: { value: 1, enumerable: false }, 33 _iframeCounter: { value: 1, enumerable: false },
31 _iframeHolder: { value: null, enumerable: false }, 34 _iframeHolder: { value: null, enumerable: false },
32 _textHolder: { value: null, enumerable: false }, 35 _textHolder: { value: null, enumerable: false },
33 _codeMirrorCounter: {value: 1, enumerable: false}, 36 _codeMirrorCounter: {value: 1, enumerable: false},
34 37
38 tmpSourceForTesting: {
39 value: "function CodeMirror(place, givenOptions) {" +
40 "// Determine effective options based on given values and defaults." +
41 "var options = {}, defaults = CodeMirror.defaults; }"
42 },
43
35 _codeEditor: { 44 _codeEditor: {
36 value: { 45 value: {
37 "editor": { 46 "editor": {
@@ -50,33 +59,21 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
50 return this._activeDocument; 59 return this._activeDocument;
51 }, 60 },
52 set: function(doc) { 61 set: function(doc) {
53 if(this._activeDocument) { 62 if(this._activeDocument) this._activeDocument.isActive = false;
54 if(this.activeDocument.documentType === "htm" || this.activeDocument.documentType === "html") {
55 // TODO selection should use the document own selectionModel
56 //this._activeDocument.selectionModel = selectionManagerModule.selectionManager._selectedItems;
57 }
58
59 this._activeDocument.isActive = false;
60 }
61 63
62 if(this._documents.indexOf(doc) === -1) { 64 if(this._documents.indexOf(doc) === -1) this._documents.push(doc);
63 //this._documentsHash[doc.uuid] = this._documents.push(doc) - 1;
64 this._documents.push(doc);
65 }
66 65
67 this._activeDocument = doc; 66 this._activeDocument = doc;
68 this._activeDocument.isActive = true; 67 this._activeDocument.isActive = true;
69 68
70 if(this.activeDocument.documentType === "htm" || this.activeDocument.documentType === "html") {
71 // TODO selection should use the document own selectionModel
72 //selectionManagerModule.selectionManager._selectedItems = this._activeDocument.selectionModel;
73 }
74 } 69 }
75 }, 70 },
76 71
77 deserializedFromTemplate: { 72 deserializedFromTemplate: {
78 value: function() { 73 value: function() {
79 this.eventManager.addEventListener("appLoaded", this, false); 74 this.eventManager.addEventListener("appLoaded", this, false);
75
76 this.eventManager.addEventListener("executeFileOpen", this, false);
80 } 77 }
81 }, 78 },
82 79
@@ -86,28 +83,126 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
86 } 83 }
87 }, 84 },
88 85
86 handleExecuteFileOpen: {
87 value: function(event) {
88 var pickerSettings = event._event.settings || {};
89 pickerSettings.callback = this.openFileWithURI;
90 pickerSettings.callbackScope = this;
91 this.application.ninja.filePickerController.showFilePicker(pickerSettings);
92
93 //this.openDocument({"type": "js", "source": this.tmpSourceForTesting});
94 }
95 },
96
97 openFileWithURI: {
98 value: function(uriArrayObj) {
99 var uri = "", fileContent = "", response=null;
100 if(!!uriArrayObj && !!uriArrayObj.uri && (uriArrayObj.uri.length > 0)){
101 uri = uriArrayObj.uri[0];
102 }
103 console.log("URI is: ", uri);
104
105 // Get file from Jose Code with a callback to here
106 if(!!uri){
107 response = fileSystem.shellApiHandler.openFile({"uri":uri});
108 if((response.success === true) && ((response.status === 200) || (response.status === 304))){
109 fileContent = response.content;
110 }
111
112 console.log("$$$ "+uri+"\n content = \n\n\n"+ fileContent+"\n\n\n");
113 this.openDocument({"type": "js", "name": "tmp.js", "source": fileContent});
114 }
115
116 }