copay/js/init.js

36 lines
826 B
JavaScript
Raw Normal View History

2014-03-14 13:38:27 -07:00
'use strict';
2014-04-30 08:25:33 -07:00
2014-03-14 13:38:27 -07:00
angular.element(document).ready(function() {
var startAngular = function() {
2014-11-25 10:09:36 -08:00
angular.bootstrap(document, ['copayApp']);
};
/* Cordova specific Init */
2014-11-25 10:09:36 -08:00
if (window.cordova !== undefined) {
2014-11-25 10:09:36 -08:00
document.addEventListener('deviceready', function() {
document.addEventListener('pause', function() {
window.location = '#!';
});
setTimeout(function() {
navigator.splashscreen.hide();
}, 2000);
function handleBitcoinURI(url) {
if (!url) return;
window.location = '#!/uri-payment/' + url;
}
window.plugins.webintent.getUri(handleBitcoinURI);
window.plugins.webintent.onNewIntent(handleBitcoinURI);
window.handleOpenURL = handleBitcoinURI;
2014-11-25 10:09:36 -08:00
startAngular();
}, false);
2014-11-25 10:09:36 -08:00
} else {
startAngular();
}
2014-03-14 13:38:27 -07:00
});