aboutsummaryrefslogtreecommitdiff
path: root/js/io/system/projectio.js
diff options
context:
space:
mode:
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 ////////////////////////////////////////////////////////////////////