aboutsummaryrefslogtreecommitdiff
path: root/js/mediators
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-02-09 00:05:25 -0800
committerJose Antonio Marquez2012-02-09 00:05:25 -0800
commit04d375a02e44d1c11054ace16cd243ada8e6bd23 (patch)
tree7f283d2cf4b2b259a21fe5994d41e2db44f652e5 /js/mediators
parent61ec99658932c5393272d90141b4f753a09b4888 (diff)
downloadninja-04d375a02e44d1c11054ace16cd243ada8e6bd23.tar.gz
Fixing URI for templates, need UI to use correct data
Diffstat (limited to 'js/mediators')
-rw-r--r--js/mediators/io-mediator.js37
1 files changed, 34 insertions, 3 deletions
diff --git a/js/mediators/io-mediator.js b/js/mediators/io-mediator.js
index fbabd780..b6d0e598 100644
--- a/js/mediators/io-mediator.js
+++ b/js/mediators/io-mediator.js
@@ -7,21 +7,52 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
7//////////////////////////////////////////////////////////////////////// 7////////////////////////////////////////////////////////////////////////
8// 8//
9var Montage = require("montage/core/core").Montage, 9var Montage = require("montage/core/core").Montage,
10 Component = require("montage/ui/component").Component,
10 FileIo = require("js/io/system/fileio").FileIo, 11 FileIo = require("js/io/system/fileio").FileIo,
11 ProjectIo = require("js/io/system/projectio").ProjectIo; 12 ProjectIo = require("js/io/system/projectio").ProjectIo;
12//////////////////////////////////////////////////////////////////////// 13////////////////////////////////////////////////////////////////////////
13// 14//
14exports.IoMediator = Montage.create(require("montage/ui/component").Component, { 15exports.IoMediator = Montage.create(Component, {
16 ////////////////////////////////////////////////////////////////////
17 //
18 deserializedFromTemplate: {
19 enumerable: false,
20 value: function () {
21 }
22 },
23 ////////////////////////////////////////////////////////////////////
24 //
25 fio: {
26 enumerable: false,
27 value: FileIo
28 },
15 //////////////////////////////////////////////////////////////////// 29 ////////////////////////////////////////////////////////////////////
16 // 30 //
17 fileNew: { 31 fileNew: {
18 enumerable: false, 32 enumerable: false,
19 value: function (file, template, callback) { 33 value: function (file, template, callback) {
20 // 34 //
35 var xhr = new XMLHttpRequest();
36 xhr.open("GET", template, false);
37 xhr.send();
38 if (xhr.readyState === 4) {
39 //
40 console.log(this.fio.newFile({uri: file, contents: xhr.response}));
41 } else {
42 //Error
43 }
44
45
46
47
48
49
21 50
22 51 //callback('win');
23 var returnObj = null; //like {"uri": "/gfdg/gdf/dfg.js", "success": true,...} 52 /*
53var returnObj = null; //like {"uri": "/gfdg/gdf/dfg.js", "success": true,...}
24 callback(returnObj); 54 callback(returnObj);
55*/
25 } 56 }
26 }, 57 },
27 //////////////////////////////////////////////////////////////////// 58 ////////////////////////////////////////////////////////////////////