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-12-07 07:40:59 -08:00
|
|
|
var startAngular = function() {
|
2014-11-25 10:09:36 -08:00
|
|
|
angular.bootstrap(document, ['copayApp']);
|
|
|
|
};
|
2014-12-07 07:40:59 -08:00
|
|
|
/* Cordova specific Init */
|
2014-11-25 10:09:36 -08:00
|
|
|
if (window.cordova !== undefined) {
|
2014-12-07 07:40:59 -08:00
|
|
|
|
2014-11-25 10:09:36 -08:00
|
|
|
document.addEventListener('deviceready', function() {
|
2014-12-07 07:40:59 -08:00
|
|
|
|
|
|
|
document.addEventListener('pause', function() {
|
|
|
|
window.location = '#!';
|
|
|
|
});
|
|
|
|
|
|
|
|
setTimeout(function() {
|
|
|
|
navigator.splashscreen.hide();
|
|
|
|
}, 2000);
|
2014-11-26 07:36:51 -08:00
|
|
|
|
|
|
|
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();
|
2014-11-26 07:36:51 -08:00
|
|
|
}, false);
|
2014-11-25 10:09:36 -08:00
|
|
|
} else {
|
|
|
|
startAngular();
|
|
|
|
}
|
|
|
|
|
2014-03-14 13:38:27 -07:00
|
|
|
});
|