mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update RapydScript
This commit is contained in:
parent
461a358d7a
commit
0d5341a31b
Binary file not shown.
@ -60,7 +60,13 @@ def E(tag, *args, **kwargs):
|
|||||||
|
|
||||||
for attr in kwargs:
|
for attr in kwargs:
|
||||||
vattr = str.replace(str.rstrip(attr, '_'), '_', '-')
|
vattr = str.replace(str.rstrip(attr, '_'), '_', '-')
|
||||||
ans.setAttribute(vattr, kwargs[attr])
|
val = kwargs[attr]
|
||||||
|
if callable(val):
|
||||||
|
if str.startswith(attr, 'on'):
|
||||||
|
attr = attr[2:]
|
||||||
|
ans.addEventListener(attr, val)
|
||||||
|
else:
|
||||||
|
ans.setAttribute(vattr, val)
|
||||||
|
|
||||||
for arg in args:
|
for arg in args:
|
||||||
if type(arg) == 'string':
|
if type(arg) == 'string':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user