copay/js/init.js

54 lines
1.4 KiB
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() {
2015-01-03 08:59:18 -08:00
// this is now in HTML tab, witch is compatible with Windows Phone
// var startAngular = function() {
// 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() {
2014-12-12 14:17:50 -08:00
if (!window.ignoreMobilePause) {
window.location = '#!/signout';
2014-12-12 10:07:48 -08:00
}
}, false);
document.addEventListener('resume', function() {
setTimeout(function() {
window.ignoreMobilePause = false;
}, 100);
}, false);
document.addEventListener('backbutton', function() {
window.location = '#!/homeWallet';
}, false);
document.addEventListener("menubutton", function() {
window.location = '#!/more';
}, false);
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;
2015-01-03 08:59:18 -08:00
// startAngular();
}, false);
2014-11-25 10:09:36 -08:00
} else {
2015-01-03 08:59:18 -08:00
// startAngular();
2014-11-25 10:09:36 -08:00
}
2014-03-14 13:38:27 -07:00
});