2014-03-14 17:38:27 -03:00
|
|
|
'use strict';
|
2014-04-30 12:25:33 -03:00
|
|
|
|
2014-03-14 17:38:27 -03:00
|
|
|
angular.element(document).ready(function() {
|
2015-01-03 13:59:18 -03:00
|
|
|
|
|
|
|
|
// this is now in HTML tab, witch is compatible with Windows Phone
|
|
|
|
|
// var startAngular = function() {
|
|
|
|
|
// angular.bootstrap(document, ['copayApp']);
|
|
|
|
|
// };
|
2014-12-07 12:40:59 -03:00
|
|
|
/* Cordova specific Init */
|
2014-11-25 15:09:36 -03:00
|
|
|
if (window.cordova !== undefined) {
|
2014-12-07 12:40:59 -03:00
|
|
|
|
2014-11-25 15:09:36 -03:00
|
|
|
document.addEventListener('deviceready', function() {
|
2014-12-07 12:40:59 -03:00
|
|
|
|
|
|
|
|
document.addEventListener('pause', function() {
|
2014-12-12 19:17:50 -03:00
|
|
|
if (!window.ignoreMobilePause) {
|
2015-01-22 17:14:31 -03:00
|
|
|
window.location = '#!/signout';
|
2014-12-12 15:07:48 -03:00
|
|
|
}
|
2015-01-07 11:32:44 -03:00
|
|
|
}, false);
|
2015-01-29 16:03:14 -02:00
|
|
|
|
|
|
|
|
document.addEventListener('resume', function() {
|
|
|
|
|
setTimeout(function() {
|
|
|
|
|
window.ignoreMobilePause = false;
|
|
|
|
|
}, 100);
|
|
|
|
|
}, false);
|
2015-01-07 11:32:44 -03:00
|
|
|
|
|
|
|
|
document.addEventListener('backbutton', function() {
|
|
|
|
|
window.location = '#!/homeWallet';
|
|
|
|
|
}, false);
|
|
|
|
|
|
|
|
|
|
document.addEventListener("menubutton", function() {
|
|
|
|
|
window.location = '#!/more';
|
|
|
|
|
}, false);
|
2014-12-07 12:40:59 -03:00
|
|
|
|
|
|
|
|
setTimeout(function() {
|
|
|
|
|
navigator.splashscreen.hide();
|
|
|
|
|
}, 2000);
|
2014-11-26 12:36:51 -03: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;
|
|
|
|
|
|
2015-01-03 13:59:18 -03:00
|
|
|
// startAngular();
|
2014-11-26 12:36:51 -03:00
|
|
|
}, false);
|
2014-11-25 15:09:36 -03:00
|
|
|
} else {
|
2015-01-03 13:59:18 -03:00
|
|
|
// startAngular();
|
2014-11-25 15:09:36 -03:00
|
|
|
}
|
|
|
|
|
|
2014-03-14 17:38:27 -03:00
|
|
|
});
|