forked from blockchain/unused-My-Wallet
-
Notifications
You must be signed in to change notification settings - Fork 2
/
blockchain-com-mobile.js
45 lines (37 loc) · 1.13 KB
/
blockchain-com-mobile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
isExtension = true;
APP_NAME = 'javascript_blockchain_com_mobile';
$(document).ready(function() {
var body = $(document.body);
var data_root = body.data('root');
if (data_root)
root = data_root;
var data_resource = body.data('resource');
if (data_resource)
resource = data_resource;
//Chrome should automatically grant notification permissions
MyWallet.setHTML5Notifications(true);
$('#create-account').click(function() {
Mobile.loadTemplate('create-account')
});
});
var Mobile = new function() {
this.loadTemplate = function(name, success, error) {
$.ajax({
type: "GET",
url: '/template',
data : {format : 'plain', name : name, mobile : true},
success: function(html) {
try {
$('body').html(html);
if (success) success();
} catch (e) {
console.log(e);
if (error) error();
}
},
error : function(data) {
if (error) error();
}
});
}
}