CB-12985 : setup eslint and removed jshint

This commit is contained in:
Audrey So
2017-06-09 14:51:30 -07:00
parent 55d419a36e
commit 80342b0ddd
13 changed files with 287 additions and 299 deletions
+10 -10
View File
@@ -21,7 +21,7 @@
var HIGHEST_POSSIBLE_Z_INDEX = 2147483647;
function takePicture(success, error, opts) {
function takePicture (success, error, opts) {
if (opts && opts[2] === 1) {
capture(success, error, opts);
} else {
@@ -32,9 +32,9 @@ function takePicture(success, error, opts) {
input.type = 'file';
input.name = 'files[]';
input.onchange = function(inputEvent) {
input.onchange = function (inputEvent) {
var reader = new FileReader();
reader.onload = function(readerEvent) {
reader.onload = function (readerEvent) {
input.parentNode.removeChild(input);
var imageData = readerEvent.target.result;
@@ -49,13 +49,13 @@ function takePicture(success, error, opts) {
}
}
function capture(success, errorCallback, opts) {
function capture (success, errorCallback, opts) {
var localMediaStream;
var targetWidth = opts[3];
var targetHeight = opts[4];
targetWidth = targetWidth == -1?320:targetWidth;
targetHeight = targetHeight == -1?240:targetHeight;
targetWidth = targetWidth == -1 ? 320 : targetWidth;
targetHeight = targetHeight == -1 ? 240 : targetHeight;
var video = document.createElement('video');
var button = document.createElement('button');
@@ -70,7 +70,7 @@ function capture(success, errorCallback, opts) {
video.height = targetHeight;
button.innerHTML = 'Capture!';
button.onclick = function() {
button.onclick = function () {
// create a canvas and capture a frame from video stream
var canvas = document.createElement('canvas');
canvas.width = targetWidth;
@@ -100,7 +100,7 @@ function capture(success, errorCallback, opts) {
navigator.mozGetUserMedia ||
navigator.msGetUserMedia;
var successCallback = function(stream) {
var successCallback = function (stream) {
localMediaStream = stream;
video.src = window.URL.createObjectURL(localMediaStream);
video.play();
@@ -117,7 +117,7 @@ function capture(success, errorCallback, opts) {
module.exports = {
takePicture: takePicture,
cleanup: function(){}
cleanup: function () {}
};
require("cordova/exec/proxy").add("Camera",module.exports);
require('cordova/exec/proxy').add('Camera', module.exports);