forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
backpack.js
33 lines (29 loc) · 887 Bytes
/
backpack.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
/**
* Push badges to backpack.
*/
function addtobackpack(event, args) {
OpenBadges.issue([args.assertion], function(errors, successes) { });
}
/**
* Check if website is externally accessible from the backpack.
*/
function check_site_access() {
var add = Y.one('#check_connection');
var callback = {
method: "GET",
on: {
success: function(id, o, args) {
var data = Y.JSON.parse(o.responseText);
if (data.code == 'http-unreachable') {
add.setHTML(data.response);
add.removeClass('hide');
}
},
failure: function(o) { }
}
};
Y.use('io-base', function(Y) {
Y.io('ajax.php', callback);
});
return false;
}