aboutsummaryrefslogtreecommitdiff
path: root/js/io/system/projectio.js
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-02-01 23:31:36 -0800
committerJose Antonio Marquez2012-02-01 23:31:36 -0800
commit33e655cbbb0816340c5a2e5d5cc0a6b0c7d9f53c (patch)
tree0bc03653f9739ff09d1e14ddf061a147b9dc383d /js/io/system/projectio.js
parentb354ea65f7c53ce05aff6a204853e666f084950f (diff)
downloadninja-33e655cbbb0816340c5a2e5d5cc0a6b0c7d9f53c.tar.gz
File IO clean up and setting up
Cleaned up file IO templates and removed app-caching from Ninja since it would be needed. Setting up io-mediator to hook up to controller. Still need to address naming conventions and clean up more in the io directory.
Diffstat (limited to 'js/io/system/projectio.js')
-rwxr-xr-xjs/io/system/projectio.js70
1 files changed, 45 insertions, 25 deletions
diff --git a/js/io/system/projectio.js b/js/io/system/projectio.js
index 822fd385..ad4cf151 100755
--- a/js/io/system/projectio.js
+++ b/js/io/system/projectio.js
@@ -4,56 +4,76 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
4(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. 4(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5</copyright> */ 5</copyright> */
6 6
7var FileIo = require("js/io/system/fileio").FileIo;
8//////////////////////////////////////////////////////////////////////// 7////////////////////////////////////////////////////////////////////////
9//Exporting as Project I/O 8//
10exports.ProjectIo = (require("montage/core/core").Montage).create(Object.prototype, { 9var Montage = require("montage/core/core").Montage,
10 FileIo = require("js/io/system/fileio").FileIo;
11////////////////////////////////////////////////////////////////////////
12//
13exports.ProjectIo = = Montage.create(Object.prototype, {
11 //////////////////////////////////////////////////////////////////// 14 ////////////////////////////////////////////////////////////////////
12 // 15 //
13 create: { 16 newProject: {
14 enumerable: false, 17 enumerable: false,
15 value: function () { 18 value: function () {
19 //Checking for API to be available
20 if (!this.application.ninja.coreIoApi.cloudAvailable()) {
21 //API not available, no IO action taken
22 return null;
23 }
24 //
16 } 25 }
17 }, 26 },
18 //////////////////////////////////////////////////////////////////// 27 ////////////////////////////////////////////////////////////////////
19 // 28 //
20 open: { 29 readProject: {
21 enumerable: false, 30 enumerable: false,
22 value: function(e) { 31 value: function(e) {
23 //TODO: Add functionality 32 //Checking for API to be available
24 console.log('ProjectIO: open'); 33 if (!this.application.ninja.coreIoApi.cloudAvailable()) {
34 //API not available, no IO action taken
35 return null;
36 }
37 //
25 } 38 }
26 }, 39 },
27 //////////////////////////////////////////////////////////////////// 40 ////////////////////////////////////////////////////////////////////
28 // 41 //
29 save: { 42 saveProject: {
30 enumerable: false, 43 enumerable: false,
31 value: function(type, id, components) { 44 value: function() {
32 // 45 //Checking for API to be available
33 var rObj; 46 if (!this.application.ninja.coreIoApi.cloudAvailable()) {
47 //API not available, no IO action taken
48 return null;
49 }
34 // 50 //
35 switch (type) { 51 }
36 case 'montageapp': 52 },
37 // 53 ////////////////////////////////////////////////////////////////////
38 var css = FileIo.save('css', id); 54 //
39 var html = FileIo.save('html', id, components); 55 copyProject: {
40 // 56 enumerable: false,
41 rObj = {html: html, css: css}; 57 value: function(e) {
42 break; 58 //Checking for API to be available
43 default: 59 if (!this.application.ninja.coreIoApi.cloudAvailable()) {
44 break; 60 //API not available, no IO action taken
61 return null;
45 } 62 }
46 // 63 //
47 return rObj;
48 } 64 }
49 }, 65 },
50 //////////////////////////////////////////////////////////////////// 66 ////////////////////////////////////////////////////////////////////
51 // 67 //
52 saveAs: { 68 infoProject: {
53 enumerable: false, 69 enumerable: false,
54 value: function(e) { 70 value: function(e) {
55 //TODO: Add functionality 71 //Checking for API to be available
56 console.log('ProjectIO: saveAs'); 72 if (!this.application.ninja.coreIoApi.cloudAvailable()) {
73 //API not available, no IO action taken
74 return null;
75 }
76 //
57 } 77 }
58 } 78 }
59 //////////////////////////////////////////////////////////////////// 79 ////////////////////////////////////////////////////////////////////