Skip to content

Commit

Permalink
remove audio
Browse files Browse the repository at this point in the history
  • Loading branch information
chensivan committed Mar 2, 2017
1 parent 72d1010 commit f8ad71c
Show file tree
Hide file tree
Showing 16 changed files with 115 additions and 7,415 deletions.
1 change: 1 addition & 0 deletions index.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
@import "styles/recording-bar";
@import "styles/tooltip";
@import "styles/request-background-color";
// @import "styles/less/bootstrap";
4 changes: 3 additions & 1 deletion lib/codeon.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ var user_preferences = require('./utils/user_preferences');
var editorID;
var pfs = require('./utils/promised_fs');
var path = require('path');

require('electron').ipcRenderer.setMaxListeners(20);
global.jQuery = require('jquery');
require('bootstrap');

module.exports= {

Expand Down
6 changes: 3 additions & 3 deletions lib/requests/controllers/recording_prompt.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ module.exports = function(app, _parent) {
// triggers text request box
$scope.textRecording = function() {
//hide h2, hide start recording button
$scope.TEXTMODE = true
// $scope.TEXTMODE = true
$scope.textRequestDescription = ""
};

Expand All @@ -67,7 +67,7 @@ module.exports = function(app, _parent) {
//re-configure
$scope.requestTitle = "";
$scope.textRequestDescription = ""
$scope.TEXTMODE = false;
// $scope.TEXTMODE = false;
$scope.COUNTDOWN = false;
_parent.closePrompt();
}
Expand All @@ -76,7 +76,7 @@ module.exports = function(app, _parent) {
$scope.cancelPrompt = function() {
$scope.requestTitle = "";
$scope.textRequestDescription = ""
$scope.TEXTMODE = false
// $scope.TEXTMODE = false
$scope.COUNTDOWN = false;
var scope = angular.element(document.querySelector('#makeRequest')).scope();
$timeout(function(){
Expand Down
13 changes: 11 additions & 2 deletions lib/requests/requestView.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,19 @@ function RequestView() {
scope.reqSideBarButton = false;
});
}, 0, false);

// start recording with enter key
// $('textarea', this.getPromptPanelElement()).select().focus().on('keydown.checkEnter', _.bind(function(event) {
// if (event.keyCode === 13 && event.shiftKey === false) {
// $('#startRecording', this.getPromptPanelElement()).click();
// } else if (event.keyCode === 27) {
// $('#cancelRecording', this.getPromptPanelElement()).click();
// }
// }, this));

// send request with enter key
$('textarea', this.getPromptPanelElement()).select().focus().on('keydown.checkEnter', _.bind(function(event) {
if (event.keyCode === 13 && event.shiftKey === false) {
$('#startRecording', this.getPromptPanelElement()).click();
$('#requestTextSubmittion', this.getPromptPanelElement()).click();
} else if (event.keyCode === 27) {
$('#cancelRecording', this.getPromptPanelElement()).click();
}
Expand Down
4 changes: 4 additions & 0 deletions lib/requests/views/metafile.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<html>
<head>
<meta http-equiv="Content-Security-Policy" content="default-src * 'unsafe-inline' 'unsafe-eval'; img-src data:; font-src 'self' data:; 'child-src' 'self' blob:">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/qtip2/2.1.1/jquery.qtip.min.css" />
<script src="http://cdn.jsdelivr.net/qtip2/2.2.0/jquery.qtip.min.js"></script>
</head>
</html>
14 changes: 7 additions & 7 deletions lib/requests/views/recording_prompt.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
<form ng-submit='startRecording()' ng-hide='COUNTDOWN'>
<h2>Briefly name your request. (e.g. javascript event handler syntax)</h2>
<textarea ng-model='requestTitle' id="request-title" class="form-control native-key-bindings" rows="1" tabIndex=-1 placeholder="(e.g. javascript event handler syntax)">{{requestTitle}}</textarea>
<h2 ng-hide='TEXTMODE'>
<h2 ng-show='TEXTMODE'>
You have two options to describe your request:<br><br>
1. Pressing "Text" button below allows you to write your request. <br><br>
2. Pressing "Start Recording" button below will start recording your voice and text written in the editor.
</h2>
<h2 ng-hide='TEXTMODE' style="color:red;">Please keep your request within 1 minute.</h2>
<h2 ng-show='TEXTMODE' style="color:red;">Please keep your request within 1 minute.</h2>
<br/>
<h2 ng-show='TEXTMODE' >Describe your request in the text box below. Click 'Submit' button once you are done! (up to 50 words)</h2>
<h2>Describe your request in the text box below. Click 'Submit' button once you are done! (up to 50 words)</h2>

<textarea ng-show='TEXTMODE' ng-model='textRequestDescription' id="request-text" class="form-control native-key-bindings" rows="5" tabIndex=-1 placeholder="(e.g. type your request here ... )">{{requestText}}</textarea>
<textarea ng-model='textRequestDescription' id="request-text" class="form-control native-key-bindings" rows="5" tabIndex=-1 placeholder="(e.g. type your request here ... )">{{requestText}}</textarea>

<div ng-hide="COUNTDOWN" class="prompt_buttons">
<select ng-model="requestTags" ng-options="tag for tag in tags" multiple></select>
<button id='textRecording' ng-hide='TEXTMODE' type='button' class='btn btn-default icon settings h3_size' ng-click='textRecording()'>Text</button>
<button id='startRecording' ng-hide='TEXTMODE' type='button' class='btn btn-default icon icon-primitive-dot settings h3_size' ng-click='startRecording()'>Start Recording</button>
<button id='requestTextSubmittion' ng-show='TEXTMODE' type='button' class='btn btn-default icon settings h3_size' ng-click='textRequestSubmittion()'>Submit</button>
<button id='textRecording' ng-show='TEXTMODE' type='button' class='btn btn-default icon settings h3_size' ng-click='textRecording()'>Text</button>
<button id='startRecording' ng-show='TEXTMODE' type='button' class='btn btn-default icon icon-primitive-dot settings h3_size' ng-click='startRecording()'>Start Recording</button>
<button id='requestTextSubmittion' type='button' class='btn btn-default icon settings h3_size' ng-click='textRequestSubmittion()'>Submit</button>
<button id='cancelRecording' type='button' class='btn btn-default icon settings h3_size' ng-click='cancelPrompt()'>Cancel</button>
</div>
</form>
Expand Down
29 changes: 26 additions & 3 deletions lib/response/controllers/helper_response.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var Quill = require('quill')
// var mediumEditor = require("medium-editor")
var trix = require('angular-trix')
var trixx = require('trix')

require('qtip')
module.exports = function(app) {

app.filter('showButtonOnce', function() {
Expand Down Expand Up @@ -38,6 +38,29 @@ module.exports = function(app) {

});


app.directive('qtip', function() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
element.qtip({
content: attrs.qtip,
style: {
classes: 'myRequestTooltipClass'
},
hide: {
event: (scope.closeButton == true ? "false" : "click mouseleave"),
delay: 0,
fixed: (($(this).hover || attrs.fixed) ? true : false), //prevent the tooltip from hiding when set to true
leave: false
}

});
},

};
});

app.controller("HelperResponse", ['$scope', '$rootScope', 'QuestionManager', 'Slider', 'RequestReplayer', function($scope, $rootScope, QuestionManager, Slider, RequestReplayer) {
$scope.hasReplay = false;
$scope.show = false;
Expand All @@ -46,9 +69,9 @@ module.exports = function(app) {

var quill = new Quill('#editor-container', {
modules: {toolbar: false},
theme: 'bubble'
theme: 'bubble',
readOnly: true
});

var answerLength = $scope.selectedObj.status.responses.length
var lastAnswerArray = $scope.selectedObj.status.responses[answerLength-1].answers
var needToInsertText;
Expand Down
61 changes: 31 additions & 30 deletions lib/response/controllers/response_panel.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ module.exports = function(app) {
var parent = atom.views.getView(atom.workspace).querySelector('.vertical');
parent.appendChild(element.el);

// watch selection to trigger 'help' button
// watch the gutter color to see the request
atom.workspace.observeTextEditors(function(edi) {
edi.observeSelections(function(sel) {

Expand All @@ -80,35 +80,36 @@ module.exports = function(app) {
var rowDiff = sel.getBufferRange().end.row - sel.getBufferRange().start.row;
var colDiff = sel.getBufferRange().end.column - sel.getBufferRange().start.column;
var isWholeLine = ((rowDiff == 1) && (colDiff == 0));

//check marker
_.each(atom.workspace.getActiveTextEditor().getMarkers(), function(m) {
var markerRowDiff = m.getBufferRange().start.row - m.getBufferRange().end.row;
var markerColDiff = m.getBufferRange().end.column - m.getBufferRange().start.column;
var isMarkerOnSelection = (row == m.getBufferRange().start.row)
//show up alert
if ((markerRowDiff == 0) && (markerColDiff == 0) && (isWholeLine) && (isMarkerOnSelection)) {
var question_id = m.getProperties().question_id;
var request = {};
//find the request that has this id
_.every($rootScope.requests, function(existRequest) {
if (existRequest.question_id == question_id) {
request = existRequest;
return false;
}
return true;
});

debugger;
var sco = angular.element(document.getElementById('theList')).scope();

sco.$apply(function() {
sco.clickRequest(request);

});
}

})
debugger
//check if the whole line was selected
if(atom.workspace.getActiveTextEditor().getMarkers().length>0){
_.each(atom.workspace.getActiveTextEditor().getMarkers(), function(m) {
var markerRowDiff = m.getBufferRange().start.row - m.getBufferRange().end.row;
var markerColDiff = m.getBufferRange().end.column - m.getBufferRange().start.column;
var isMarkerOnSelection = (row == m.getBufferRange().start.row)
//show up alert
if ((markerRowDiff == 0) && (markerColDiff == 0) && (isWholeLine) && (isMarkerOnSelection)) {
var question_id = m.getProperties().question_id;
var request = {};
//find the request that has this id
_.every($rootScope.requests, function(existRequest) {
if (existRequest.question_id == question_id) {
request = existRequest;
return false;
}
return true;
});

var sco = angular.element(document.getElementById('theList')).scope();
sco.$apply(function() {
sco.clickRequest(request);

});
}

})

}

});
})
Expand Down
4 changes: 2 additions & 2 deletions lib/response/views/response_panel.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ <h3 ng-show='request.request_description'>Q: {{request.request_description}}</h3
<div style="background-color: #fafafa;" ng-show="selectedObj && responseContent" ng-controller='RequestController' class="request-content">
<div style="margin-left: 10px; margin-right: 10px; ">
<div class="annotation_bubble_upper">
<h3 style="font-size: 18px;">{{selectedObj.title | limitTo:35}}{{selectedObj.title.length > 30 ? '...' : ''}} </h3>
<h3 class='selectable' style="font-size: 18px;-webkit-user-select: all; ">{{selectedObj.title }}</h3>
<div>
<span class="label label-default" ng-repeat="tag in selectedObj.tags">{{tag}}</span>
</div>
<h3 ng-show='selectedObj.request_description'>Q: {{selectedObj.request_description}}</h3>
<h3 style="line-height: 18px;" ng-show='selectedObj.request_description'>Q: {{selectedObj.request_description}}</h3>
File:{{selectedObj.changelog[1].title}}

<div ng-hide='selectedObj.request_description' class="request-buttons">
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"less": "latest",
"marked": "latest",
"node-diff3": "latest",
"qtip": "0.0.4",
"recordrtc": "5.4.0",
"request": "latest",
"semver": "latest",
Expand Down
Loading

0 comments on commit f8ad71c

Please sign in to comment.