Skip to content

Commit

Permalink
small patch in functions.js
Browse files Browse the repository at this point in the history
  • Loading branch information
atruskie committed Mar 14, 2013
1 parent 4858e26 commit 8a5e6cc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
8 changes: 7 additions & 1 deletion app/assets/javascripts/angular/controllers/experiments.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,16 @@
$scope.stepResults.startTime = Date.now();
};

$scope.startTimer = function() {
$scope.endTimer = function() {
$scope.stepResults.endTime = Date.now();
};

$scope.showInstructions = true;
$scope.start = function() {
$scope.showInstructions = false;
$scope.startTimer();
};

$scope.SPECTROGRAM_WIDTH = 1080;
var PPS = 45;
$scope.flashes = [];
Expand Down
6 changes: 3 additions & 3 deletions app/assets/templates/rapid_scanning_experiment.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@

<div class="experimentContainer">

<div id="instructions" >
<div id="instructions" ng-show="showInstructions" >
<div>
<img src="/experiment_assets/Instructions.jpg">
</div>
<button>I understand the instructions</button>
<button ng-click="start()">I understand the instructions</button>
</div>

<div>
<div ng-show="!showInstructions">
<div ng-show="bigScope.step == $index">

<div>
Expand Down
4 changes: 2 additions & 2 deletions lib/assets/javascripts/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,15 +267,15 @@ if (!Array.prototype.filter)
});
return parts.length ? parts.join('&') : '';
};
function encodeUriQuery(val, pctEncodeSpaces) {
this.encodeUriQuery = function encodeUriQuery(val, pctEncodeSpaces) {
val = val || "";
return encodeURIComponent(val).
replace(/%40/gi, '@').
replace(/%3A/gi, ':').
replace(/%24/g, '$').
replace(/%2C/gi, ',').
replace((pctEncodeSpaces ? null : /%20/g), '+');
}
};

this.isUndefined = function isUndefined(value) {
return typeof value == 'undefined';
Expand Down

0 comments on commit 8a5e6cc

Please sign in to comment.