basic URI handling

This commit is contained in:
Manuel Araoz 2014-06-30 18:41:17 -03:00
commit a7d484c944
4 changed files with 14 additions and 2 deletions

View file

@ -926,6 +926,7 @@ on supported browsers please check <a href="http://www.webrtc.org/">http://www.w
<script src="js/services/notifications.js"></script>
<script src="js/services/backupService.js"></script>
<script src="js/services/isMobile.js"></script>
<script src="js/services/uriHandler.js"></script>
<script src="js/controllers/header.js"></script>
<script src="js/controllers/footer.js"></script>

View file

@ -64,7 +64,6 @@ angular
})
.run(function($rootScope, $location) {
$rootScope.$on('$routeChangeStart', function(event, next, current) {
if (!util.supports.data) {
$location.path('unsupported');
} else {

View file

@ -2,7 +2,7 @@
var bitcore = require('bitcore');
angular.module('copayApp.services')
.factory('controllerUtils', function($rootScope, $sce, $location, notification, $timeout, Socket, video) {
.factory('controllerUtils', function($rootScope, $sce, $location, notification, $timeout, Socket, video, uriHandler) {
var root = {};
root.getVideoMutedStatus = function(copayer) {
@ -64,6 +64,7 @@ angular.module('copayApp.services')
};
root.setupRootVariables = function() {
uriHandler.register();
$rootScope.unitName = config.unitName;
$rootScope.txAlertCount = 0;
$rootScope.insightError = 0;

11
js/services/uriHandler.js Normal file
View file

@ -0,0 +1,11 @@
'use strict';
var UriHandler = function() {};
UriHandler.prototype.register = function() {
navigator.registerProtocolHandler('bitcoin',
'uri=%s',
'Copay');
};
angular.module('copayApp.services').value('uriHandler', new UriHandler());