Merge pull request #3243 from cmgustavo/updates/dependencies-01
Updates bower dependencies. Fix AngularJS for iOS 9.0.1
This commit is contained in:
commit
de81e57042
6 changed files with 35 additions and 163 deletions
|
|
@ -58,7 +58,7 @@ module.exports = function(grunt) {
|
||||||
'bower_components/angular-foundation/mm-foundation-tpls.js',
|
'bower_components/angular-foundation/mm-foundation-tpls.js',
|
||||||
'bower_components/angular-moment/angular-moment.js',
|
'bower_components/angular-moment/angular-moment.js',
|
||||||
'bower_components/ng-lodash/build/ng-lodash.js',
|
'bower_components/ng-lodash/build/ng-lodash.js',
|
||||||
'bower_components/angular-qrcode/qrcode.js',
|
'bower_components/angular-qrcode/angular-qrcode.js',
|
||||||
'bower_components/angular-gettext/dist/angular-gettext.js',
|
'bower_components/angular-gettext/dist/angular-gettext.js',
|
||||||
'bower_components/angular-touch/angular-touch.js',
|
'bower_components/angular-touch/angular-touch.js',
|
||||||
'bower_components/angular-bitcore-wallet-client/angular-bitcore-wallet-client.js',
|
'bower_components/angular-bitcore-wallet-client/angular-bitcore-wallet-client.js',
|
||||||
|
|
|
||||||
31
bower.json
31
bower.json
|
|
@ -7,23 +7,20 @@
|
||||||
"bitcore"
|
"bitcore"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"angular": "~1.3.13",
|
"angular": "1.4.6",
|
||||||
"angular-foundation": "*",
|
|
||||||
"angular-qrcode": "~5.1.0",
|
|
||||||
"angular-gettext": "~2.0.5",
|
|
||||||
"animate.css": "3.4.0",
|
|
||||||
"foundation": "zurb/bower-foundation#~5.5.1",
|
|
||||||
"foundation-icon-fonts": "*",
|
|
||||||
"ng-lodash": "~0.2.0",
|
|
||||||
"angular-moment": "0.10.1",
|
|
||||||
"moment": "2.10.3",
|
|
||||||
"angular-bitcore-wallet-client": "0.4.4",
|
"angular-bitcore-wallet-client": "0.4.4",
|
||||||
"angular-ui-router": "~0.2.13",
|
"angular-foundation": "0.7.0",
|
||||||
"qrcode-decoder-js": "*",
|
"angular-gettext": "2.1.0",
|
||||||
"fastclick": "*",
|
"angular-moment": "0.10.1",
|
||||||
"angular-ui-switch": "~0.1.0"
|
"angular-qrcode": "monospaced/angular-qrcode#~6.0.3",
|
||||||
},
|
"angular-ui-router": "0.2.15",
|
||||||
"resolutions": {
|
"angular-ui-switch": "0.1.1",
|
||||||
"qrcode-generator": "0.0.1"
|
"animate.css": "3.4.0",
|
||||||
|
"fastclick": "1.0.6",
|
||||||
|
"foundation": "5.5.2",
|
||||||
|
"foundation-icon-fonts": "*",
|
||||||
|
"moment": "2.10.3",
|
||||||
|
"ng-lodash": "0.2.3",
|
||||||
|
"qrcode-decoder-js": "*"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -63,18 +63,9 @@
|
||||||
|
|
||||||
<div class="input">
|
<div class="input">
|
||||||
<input id="secret" type="text" placeholder="{{'Paste invitation here'|translate}}" name="secret" ng-model="secret" wallet-secret required>
|
<input id="secret" type="text" placeholder="{{'Paste invitation here'|translate}}" name="secret" ng-model="secret" wallet-secret required>
|
||||||
<div ng-hide="showScanner || disableScanner">
|
<div class="qr-scanner-input">
|
||||||
<a class="postfix text-right" ng-click="join.openScanner()"><i class="icon-scan size-18"> </i></a>
|
<qr-scanner on-scan="join.onQrCodeScanned(data)"></qr-scanner>
|
||||||
</div>
|
</div>
|
||||||
<div ng-show="showScanner">
|
|
||||||
<a class="postfix button warning" ng-click="cancelScanner()"><i class="fi-x"> </i></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="scanner"
|
|
||||||
class="row"
|
|
||||||
ng-if="showScanner"
|
|
||||||
ng-include="'views/includes/scanner.html'">
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a class="button outline light-gray tiny expand" ng-click="join.hideAdv=!join.hideAdv">
|
<a class="button outline light-gray tiny expand" ng-click="join.hideAdv=!join.hideAdv">
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,12 @@
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.qr-scanner-input {
|
||||||
|
position: absolute;
|
||||||
|
top: 5px;
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
h1, h2, h3, h4, h5, h6 {
|
h1, h2, h3, h4, h5, h6 {
|
||||||
color: #2C3E50;
|
color: #2C3E50;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,139 +9,12 @@ angular.module('copayApp.controllers').controller('joinController',
|
||||||
return isChromeApp;
|
return isChromeApp;
|
||||||
};
|
};
|
||||||
|
|
||||||
//TODO : make one function - this was copied from topbar.js
|
this.onQrCodeScanned = function(data) {
|
||||||
var cordovaOpenScanner = function() {
|
$scope.secret = data;
|
||||||
window.ignoreMobilePause = true;
|
$scope.joinForm.secret.$setViewValue(data);
|
||||||
window.plugins.spinnerDialog.show(null, 'Preparing camera...', true);
|
$scope.joinForm.secret.$render();
|
||||||
$timeout(function() {
|
|
||||||
cordova.plugins.barcodeScanner.scan(
|
|
||||||
function onSuccess(result) {
|
|
||||||
$timeout(function() {
|
|
||||||
window.plugins.spinnerDialog.hide();
|
|
||||||
window.ignoreMobilePause = false;
|
|
||||||
}, 100);
|
|
||||||
if (result.cancelled) return;
|
|
||||||
|
|
||||||
$timeout(function() {
|
|
||||||
var data = result.text;
|
|
||||||
$scope.secret = data;
|
|
||||||
$scope.joinForm.secret.$setViewValue(data);
|
|
||||||
$scope.joinForm.secret.$render();
|
|
||||||
}, 1000);
|
|
||||||
},
|
|
||||||
function onError(error) {
|
|
||||||
$timeout(function() {
|
|
||||||
window.ignoreMobilePause = false;
|
|
||||||
window.plugins.spinnerDialog.hide();
|
|
||||||
}, 100);
|
|
||||||
alert('Scanning error');
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}, 100);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var modalOpenScanner = function() {
|
|
||||||
var _scope = $scope;
|
|
||||||
var ModalInstanceCtrl = function($scope, $rootScope, $modalInstance) {
|
|
||||||
// QR code Scanner
|
|
||||||
var video;
|
|
||||||
var canvas;
|
|
||||||
var $video;
|
|
||||||
var context;
|
|
||||||
var localMediaStream;
|
|
||||||
|
|
||||||
var _scan = function(evt) {
|
|
||||||
|
|
||||||
if (localMediaStream) {
|
|
||||||
context.drawImage(video, 0, 0, 300, 225);
|
|
||||||
try {
|
|
||||||
qrcode.decode();
|
|
||||||
} catch (e) {
|
|
||||||
//qrcodeError(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$timeout(_scan, 500);
|
|
||||||
};
|
|
||||||
|
|
||||||
var _scanStop = function() {
|
|
||||||
if (localMediaStream && localMediaStream.stop) localMediaStream.stop();
|
|
||||||
localMediaStream = null;
|
|
||||||
video.src = '';
|
|
||||||
};
|
|
||||||
|
|
||||||
qrcode.callback = function(data) {
|
|
||||||
_scanStop();
|
|
||||||
$modalInstance.close(data);
|
|
||||||
};
|
|
||||||
|
|
||||||
var _successCallback = function(stream) {
|
|
||||||
video.src = (window.URL && window.URL.createObjectURL(stream)) || stream;
|
|
||||||
localMediaStream = stream;
|
|
||||||
video.play();
|
|
||||||
$timeout(_scan, 1000);
|
|
||||||
};
|
|
||||||
|
|
||||||
var _videoError = function(err) {
|
|
||||||
$scope.cancel();
|
|
||||||
};
|
|
||||||
|
|
||||||
var setScanner = function() {
|
|
||||||
|
|
||||||
navigator.getUserMedia = navigator.getUserMedia ||
|
|
||||||
navigator.webkitGetUserMedia || navigator.mozGetUserMedia ||
|
|
||||||
navigator.msGetUserMedia;
|
|
||||||
window.URL = window.URL || window.webkitURL ||
|
|
||||||
window.mozURL || window.msURL;
|
|
||||||
};
|
|
||||||
|
|
||||||
$scope.init = function() {
|
|
||||||
setScanner();
|
|
||||||
$timeout(function() {
|
|
||||||
canvas = document.getElementById('qr-canvas');
|
|
||||||
context = canvas.getContext('2d');
|
|
||||||
|
|
||||||
video = document.getElementById('qrcode-scanner-video');
|
|
||||||
$video = angular.element(video);
|
|
||||||
canvas.width = 300;
|
|
||||||
canvas.height = 225;
|
|
||||||
context.clearRect(0, 0, 300, 225);
|
|
||||||
|
|
||||||
navigator.getUserMedia({
|
|
||||||
video: true
|
|
||||||
}, _successCallback, _videoError);
|
|
||||||
}, 500);
|
|
||||||
};
|
|
||||||
|
|
||||||
$scope.cancel = function() {
|
|
||||||
_scanStop();
|
|
||||||
$modalInstance.dismiss('cancel');
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
var modalInstance = $modal.open({
|
|
||||||
templateUrl: 'views/modals/scanner.html',
|
|
||||||
windowClass: 'full',
|
|
||||||
controller: ModalInstanceCtrl,
|
|
||||||
backdrop: 'static',
|
|
||||||
keyboard: false
|
|
||||||
});
|
|
||||||
modalInstance.result.then(function(data) {
|
|
||||||
$scope.secret = data;
|
|
||||||
$scope.joinForm.secret.$setViewValue(data);
|
|
||||||
$scope.joinForm.secret.$render();
|
|
||||||
});
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
this.openScanner = function() {
|
|
||||||
if (isCordova) {
|
|
||||||
cordovaOpenScanner();
|
|
||||||
} else {
|
|
||||||
modalOpenScanner();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
this.join = function(form) {
|
this.join = function(form) {
|
||||||
if (form && form.$invalid) {
|
if (form && form.$invalid) {
|
||||||
self.error = gettext('Please enter the required fields');
|
self.error = gettext('Please enter the required fields');
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.directives')
|
angular.module('copayApp.directives')
|
||||||
.directive('qrScanner', ['$rootScope', '$timeout', '$modal', 'isCordova',
|
.directive('qrScanner', ['$rootScope', '$timeout', '$modal', 'isCordova', 'gettextCatalog',
|
||||||
function($rootScope, $timeout, $modal, isCordova) {
|
function($rootScope, $timeout, $modal, isCordova, gettextCatalog) {
|
||||||
|
|
||||||
var controller = function($scope) {
|
var controller = function($scope) {
|
||||||
|
|
||||||
$scope.cordovaOpenScanner = function() {
|
$scope.cordovaOpenScanner = function() {
|
||||||
window.ignoreMobilePause = true;
|
window.ignoreMobilePause = true;
|
||||||
window.plugins.spinnerDialog.show(null, 'Preparing camera...', true);
|
window.plugins.spinnerDialog.show(null, gettextCatalog.getString('Preparing camera...'), true);
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
cordova.plugins.barcodeScanner.scan(
|
cordova.plugins.barcodeScanner.scan(
|
||||||
function onSuccess(result) {
|
function onSuccess(result) {
|
||||||
|
|
@ -61,7 +61,12 @@ angular.module('copayApp.directives')
|
||||||
};
|
};
|
||||||
|
|
||||||
var _scanStop = function() {
|
var _scanStop = function() {
|
||||||
if (localMediaStream && localMediaStream.stop) localMediaStream.stop();
|
if (localMediaStream && localMediaStream.active) {
|
||||||
|
var localMediaStreamTrack = localMediaStream.getTracks();
|
||||||
|
for (var i = 0; i < localMediaStreamTrack.length; i++) {
|
||||||
|
localMediaStreamTrack[i].stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
localMediaStream = null;
|
localMediaStream = null;
|
||||||
video.src = '';
|
video.src = '';
|
||||||
};
|
};
|
||||||
|
|
@ -156,4 +161,4 @@ angular.module('copayApp.directives')
|
||||||
template: '<a id="camera-icon" class="p10" ng-click="openScanner()"><i class="icon-scan size-21"></i></a>'
|
template: '<a id="camera-icon" class="p10" ng-click="openScanner()"><i class="icon-scan size-21"></i></a>'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue