-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
46 lines (44 loc) · 1.12 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<script>
var map =
{
'DRAFT': 1 << 1,
'SENT': 1 << 2,
'RECEIVED': 1 << 3,
'IN_REPORTING': 1 << 4,
'DEFINITIVE_SIGNED': 1 << 5,
'CANCELLED': 1 << 6,
'REJECTED': 1 << 7,
'IN_ERROR': 1 << 8,
'FIRST_SIGNATURE_DONE': 1 << 9,
'RESERVED_FOR_SIGNATURE': 1 << 10,
'ORDER_COMPLETED': 1 << 11,
'SUPPLEMENTARY_READER_REQUEST': 1 << 12,
'SUPPLEMENTARY_REQUEST': 1 << 13,
'SUPPLEMENTARY_RESPONSE_PENDING': 1 << 14,
'READY_FOR_COMPLETION': 1 << 15,
'CORRECTION_IN_PROGRESS': 1 << 16,
'CORRECTION_DONE': 1 << 17,
'EDITABLE_DRAFT': 1 << 18
}
function decode(value){
var status = parseInt(value) ;
var result = "";
for (var key in map) {
result += (status & map[key] ? key + "</br>": "");
}
document.getElementById('decode').innerHTML = status.toString(2) ;
document.getElementById('result').innerHTML = result ;
}
</script>
</head>
<body>
<h1>Decode order status</h1>
Order Status :
<input type="text" id="orderStatus" onchange="decode(this.value)""/>
<p id="decode"></p>
<p id="result"></p>
</body>
</html>