From 04d375a02e44d1c11054ace16cd243ada8e6bd23 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Thu, 9 Feb 2012 00:05:25 -0800 Subject: Fixing URI for templates, need UI to use correct data --- js/mediators/io-mediator.js | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) (limited to 'js/mediators') 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 //////////////////////////////////////////////////////////////////////// // var Montage = require("montage/core/core").Montage, + Component = require("montage/ui/component").Component, FileIo = require("js/io/system/fileio").FileIo, ProjectIo = require("js/io/system/projectio").ProjectIo; //////////////////////////////////////////////////////////////////////// // -exports.IoMediator = Montage.create(require("montage/ui/component").Component, { +exports.IoMediator = Montage.create(Component, { + //////////////////////////////////////////////////////////////////// + // + deserializedFromTemplate: { + enumerable: false, + value: function () { + } + }, + //////////////////////////////////////////////////////////////////// + // + fio: { + enumerable: false, + value: FileIo + }, //////////////////////////////////////////////////////////////////// // fileNew: { enumerable: false, value: function (file, template, callback) { // + var xhr = new XMLHttpRequest(); + xhr.open("GET", template, false); + xhr.send(); + if (xhr.readyState === 4) { + // + console.log(this.fio.newFile({uri: file, contents: xhr.response})); + } else { + //Error + } + + + + + + - - var returnObj = null; //like {"uri": "/gfdg/gdf/dfg.js", "success": true,...} + //callback('win'); + /* +var returnObj = null; //like {"uri": "/gfdg/gdf/dfg.js", "success": true,...} callback(returnObj); +*/ } }, //////////////////////////////////////////////////////////////////// -- cgit v1.2.3