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.js7
-rwxr-xr-x[-rw-r--r--]js/io/document/document-controller.js321
-rwxr-xr-x[-rw-r--r--]js/io/document/html-document.js53
-rwxr-xr-x[-rw-r--r--]js/io/document/text-document.js66
-rw-r--r--js/io/system/chromeapi.js269
-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)521
-rwxr-xr-x[-rw-r--r--]js/io/system/fileio.js220
-rw-r--r--js/io/system/filesystem.js723
-rw-r--r--js/io/system/ninjalibrary.js330
-rw-r--r--js/io/system/ninjalibrary.json6
-rwxr-xr-x[-rw-r--r--]js/io/system/projectio.js70
-rw-r--r--js/io/templates/descriptor.json73
-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.js111
-rwxr-xr-xjs/io/ui/cloudpopup.reel/config.rb9
-rw-r--r--js/io/ui/cloudpopup.reel/css/cloudpopup.css98
-rwxr-xr-xjs/io/ui/cloudpopup.reel/css/cloudpopup.scss102
-rwxr-xr-x[-rw-r--r--]js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.css (renamed from js/io/workflow/newFileDialog/new-file-location.reel/new-file-location.css)28
-rwxr-xr-xjs/io/ui/new-file-dialog/new-file-location.reel/new-file-location.html94
-rwxr-xr-xjs/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js56
-rwxr-xr-xjs/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.css160
-rwxr-xr-x[-rw-r--r--]js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.html (renamed from js/io/workflow/newFileDialog/new-file-options-navigator.reel/new-file-options-navigator.html)21
-rw-r--r--js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js416
-rwxr-xr-xjs/io/ui/new-file-dialog/new-file-workflow-controller.js139
-rwxr-xr-xjs/io/ui/new-file-dialog/new-file-workflow-model.js49
-rw-r--r--js/io/ui/save-as-dialog.reel/save-as-dialog.css100
-rw-r--r--js/io/ui/save-as-dialog.reel/save-as-dialog.html57
-rw-r--r--js/io/ui/save-as-dialog.reel/save-as-dialog.js215
-rw-r--r--js/io/workflow/new-project-manager.js136
-rw-r--r--js/io/workflow/newFileDialog/new-file-location.reel/new-file-location.html41
-rw-r--r--js/io/workflow/newFileDialog/new-file-location.reel/new-file-location.js28
-rw-r--r--js/io/workflow/newFileDialog/new-file-options-navigator.reel/new-file-options-navigator.css95
-rw-r--r--js/io/workflow/newFileDialog/new-file-options-navigator.reel/new-file-options-navigator.js160
-rw-r--r--js/io/workflow/newFileDialog/new-file-workflow-controller.js59
-rw-r--r--js/io/workflow/newFileDialog/new-file-workflow-model.js121
-rw-r--r--js/io/workflow/newProjectNavigator.js75
-rw-r--r--js/io/workflow/newProjectNavigator.reel/newProjectNavigator.css32
-rw-r--r--js/io/workflow/newProjectNavigator.reel/newProjectNavigator.html32
47 files changed, 3362 insertions, 1819 deletions
diff --git a/js/io/document/base-document.js b/js/io/document/base-document.js
index 44f54f78..918b51ad 100644..100755
--- a/js/io/document/base-document.js
+++ b/js/io/document/base-document.js
@@ -82,7 +82,12 @@ var BaseDocument = exports.BaseDocument = Montage.create(Montage, {
82 value: function() { 82 value: function() {
83 // Have the XHR here? 83 // Have the XHR here?
84 } 84 }
85 } 85 },
86 86
87 save:{
88 value:function(){
89 //base function - to be overridden
90 }
91 }
87 92
88}); \ No newline at end of file 93}); \ No newline at end of file
diff --git a/js/io/document/document-controller.js b/js/io/document/document-controller.js
index 99177de0..e36181bf 100644..100755
--- a/js/io/document/document-controller.js
+++ b/js/io/document/document-controller.js
@@ -12,37 +12,31 @@ 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,
20 18 HTMLDocument = require("js/io/document/html-document").HTMLDocument,
21var HTMLDocument = require("js/io/document/html-document").HTMLDocument; 19 TextDocument = require("js/io/document/text-document").TextDocument;
22var TextDocument = require("js/io/document/text-document").TextDocument;
23 20
24var DocumentController = exports.DocumentController = Montage.create(Component, { 21var DocumentController = exports.DocumentController = Montage.create(Component, {
25 hasTemplate: { value: false }, 22 hasTemplate: {
23 value: false
24 },
25
26 _documents: {
27 value: []
28 },
26 29
27 _documents: { value: [] },
28 _documentsHash: { value: {} },
29 _activeDocument: { value: null }, 30 _activeDocument: { value: null },
30 _iframeCounter: { value: 1, enumerable: false }, 31 _iframeCounter: { value: 1, enumerable: false },
31 _iframeHolder: { value: null, enumerable: false }, 32 _iframeHolder: { value: null, enumerable: false },
32 _textHolder: { value: null, enumerable: false }, 33 _textHolder: { value: null, enumerable: false },
33 _codeMirrorCounter: {value: 1, enumerable: false}, 34 _codeMirrorCounter: {value: 1, enumerable: false},
34 35
35 _codeEditor: { 36 tmpSourceForTesting: {
36 value: { 37 value: "function CodeMirror(place, givenOptions) {" +
37 "editor": { 38 "// Determine effective options based on given values and defaults." +
38 value: null, 39 "var options = {}, defaults = CodeMirror.defaults; }"
39 enumerable: false
40 },
41 "hline": {
42 value: null,
43 enumerable: false
44 }
45 }
46 }, 40 },
47 41
48 activeDocument: { 42 activeDocument: {
@@ -50,33 +44,28 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
50 return this._activeDocument; 44 return this._activeDocument;
51 }, 45 },
52 set: function(doc) { 46 set: function(doc) {
53 if(this._activeDocument) { 47 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 48
62 if(this._documents.indexOf(doc) === -1) { 49 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 50
67 this._activeDocument = doc; 51 this._activeDocument = doc;
68 this._activeDocument.isActive = true; 52 this._activeDocument.isActive = true;
69 53
70 if(this.activeDocument.documentType === "htm" || this.activeDocument.documentType === "html") { 54 if(!!this._activeDocument.editor){
71 // TODO selection should use the document own selectionModel 55 this._activeDocument.editor.focus();
72 //selectionManagerModule.selectionManager._selectedItems = this._activeDocument.selectionModel;
73 } 56 }
57
74 } 58 }
75 }, 59 },
76 60
77 deserializedFromTemplate: { 61 deserializedFromTemplate: {
78 value: function() { 62 value: function() {
79 this.eventManager.addEventListener("appLoaded", this, false); 63 this.eventManager.addEventListener("appLoaded", this, false);
64 this.eventManager.addEventListener("executeFileOpen", this, false);
65 this.eventManager.addEventListener("executeNewFile", this, false);
66 this.eventManager.addEventListener("executeSave", this, false);
67
68 this.eventManager.addEventListener("recordStyleChanged", this, false);
80 } 69 }
81 }, 70 },
82 71
@@ -86,84 +75,184 @@ var DocumentController = exports.DocumentController = Montage.create(Component,
86 } 75 }
87 }, 76 },
88 77
78 handleExecuteFileOpen: {
79 value: function(event) {
80 var pickerSettings = event._event.settings || {};
81 pickerSettings.callback = this.openFileWithURI;
82 pickerSettings.callbackScope = this;
83 this.application.ninja.filePickerController.showFilePicker(pickerSettings);