copay/js/init.js

32 lines
775 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() {
2014-11-25 10:09:36 -08:00
var startAngular = function () {
angular.bootstrap(document, ['copayApp']);
};
if (window.cordova !== undefined) {
document.addEventListener('deviceready', function() {
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);
document.addEventListener('pause', function() {
window.location = '#!';
});
2014-11-25 10:09:36 -08:00
} else {
startAngular();
}
2014-03-14 13:38:27 -07:00
});