From fa49b88454e91e3141f139e3298f8febb051bdd8 Mon Sep 17 00:00:00 2001 From: chensivan Date: Sat, 20 Feb 2016 17:07:48 -0500 Subject: [PATCH] showing the new request to the side panel automatically --- lib/requests/uploadRecording.js | 20 +++++++++++++++++++- lib/response/responseView.js | 5 +---- lib/response/views/main.view.html | 2 +- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/lib/requests/uploadRecording.js b/lib/requests/uploadRecording.js index 22605c0..4477aad 100644 --- a/lib/requests/uploadRecording.js +++ b/lib/requests/uploadRecording.js @@ -1,7 +1,10 @@ var mkdirp = require('./mkdirp'); var fse = require('fs-extra'); +var angular = require('angular'); var fs = require('fs'); var path = require('path'); + + var STORAGE_DIRECTORY = path.join(__dirname, 'recordings'); var FormData = require('form-data'); @@ -43,6 +46,21 @@ module.exports = function (uid, editorRecorder, voiceRecorder, workspaceSnapshot cwd: cwd }; + var app = angular.element(document.getElementById("theList")).scope(); + + app.$apply(function(){ + app.myArr.push({ + id: uid, + request: transcript, + status: "Status: Unsolved!", + }); + }); + + console.log(app.myArr); + + + + var filename = 'recording.json', fullFilename = path.join(folder, filename); @@ -100,4 +118,4 @@ function remove(path) { } }); }); -} \ No newline at end of file +} diff --git a/lib/response/responseView.js b/lib/response/responseView.js index ee040ed..0acf657 100644 --- a/lib/response/responseView.js +++ b/lib/response/responseView.js @@ -19,15 +19,12 @@ function VizView(isEnabled) { this.app = angular.module('app', []); - // console.log("1"); - // require('../services/server_query')(this.app); require('./controllers/main.controller')(this.app); require('./controllers/response.controller')(this.app); require('./services/question_manager')(this.app); - // require('./controllers/suggested_examples.controller')(this.app); - // console.log("2"); readFile(path.join(__dirname, 'views', 'main.view.html'), 'utf8').then(_.bind(function(contents) { + this.mainView.html(contents); angular.element(this.mainView).ready(_.bind(function() { diff --git a/lib/response/views/main.view.html b/lib/response/views/main.view.html index 3f6bb93..e96ce15 100644 --- a/lib/response/views/main.view.html +++ b/lib/response/views/main.view.html @@ -31,7 +31,7 @@ -
+
{{title}}