Skip to content

Commit

Permalink
showing the new request to the side panel automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
chensivan committed Feb 20, 2016
1 parent 0fe12a9 commit fa49b88
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
20 changes: 19 additions & 1 deletion lib/requests/uploadRecording.js
Original file line number Diff line number Diff line change
@@ -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');

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -100,4 +118,4 @@ function remove(path) {
}
});
});
}
}
5 changes: 1 addition & 4 deletions lib/response/responseView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion lib/response/views/main.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@



<div ng-controller='MainController'>
<div id="theList" ng-controller='MainController'>
<div class="panel panel2" ng-click="titleClick(title)">{{title}}</div>

<div class="panel panel2" ng-show="resList" ng-repeat="obj in myArr" id="{{obj.id}}" ng-click="myClick(obj)">
Expand Down

0 comments on commit fa49b88

Please sign in to comment.