aboutsummaryrefslogtreecommitdiff
path: root/js/io/system/projectio.js
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-02-15 20:37:48 -0800
committerJose Antonio Marquez2012-02-15 20:37:48 -0800
commit89b5e793ea88ef235b54b6e1d1c379698d3e612b (patch)
tree4d29118f35df77ca6b423119a4ff61694a442cbf /js/io/system/projectio.js
parent9d2c2a80483415d7560b00cda5519153db23e241 (diff)
parentd366c0bd1af6471511217ed574083e15059519b5 (diff)
downloadninja-89b5e793ea88ef235b54b6e1d1c379698d3e612b.tar.gz
Merge branch 'refs/heads/NinjaInternal' into Color
Diffstat (limited to 'js/io/system/projectio.js')
-rwxr-xr-x[-rw-r--r--]js/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..8e3230d7 100644..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 ////////////////////////////////////////////////////////////////////