1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 from pyjamas import DOM
16
20
21 PROTECTED = 1
22 READ_WRITE = 2
23 READ_ONLY = 3
24 DISABLED = 4
25
26
27
28
30 types = []
31 dt = event.dataTransfer
32 try:
33 dt_types = dt.types
34 if isinstance(dt_types, basestring):
35 return dt_types.split(',')
36 ct = 0
37 try:
38 type_i = dt_types.item(ct)
39 while type_i:
40 types.append(type_i)
41 ct += 1
42 type_i = dt_types.item(ct)
43 except:
44 try:
45 type_i = dt_types[ct]
46 while type_i:
47 types.append(type_i)
48 ct += 1
49 type_i = dt_types[ct]
50 except:
51 for item in ['Text', 'URL', 'File','HTML', 'Image', 'String']:
52 try:
53 if len(dt.getData(item)):
54 types.append(item)
55 except:
56 pass
57 except:
58 for item in ['Text', 'URL', 'File','HTML', 'Image']:
59 try:
60 if len(dt.getData(item)):
61 types.append(item)
62 except:
63 pass
64 return types
65