-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathwa-rfid.html
More file actions
51 lines (40 loc) · 994 Bytes
/
wa-rfid.html
File metadata and controls
51 lines (40 loc) · 994 Bytes
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
46
47
48
49
50
51
<html>
<head>
<script type="text/javascript" src="../webduino-js/src/module/RFID.js"></script>
</head>
<body>
<script>
(function() {
var proto = Object.create(HTMLElement.prototype, {
isReading: {
get: function() {
return !!(this.rfid && this.rfid.isReading);
}
}
});
proto.init_ = function(board) {
var RFID = webduino.module.RFID;
this.rfid = new RFID(board);
};
proto.read = function(enterHandler, leaveHandler) {
this.rfid.read(enterHandler, leaveHandler);
};
proto.stopRead = function() {
this.rfid.stopRead();
};
proto.on = function(evtType, handler) {
this.rfid.on(evtType, handler);
};
proto.off = function(evtType, handler) {
this.rfid.off(evtType, handler);
};
proto.detachedCallback = function() {
this.rfid.destroy();
};
document.registerElement('wa-rfid', {
prototype: proto
});
})();
</script>
</body>
</html>