diff --git a/adia/__init__.py b/adia/__init__.py index b418ec2..3f33f20 100644 --- a/adia/__init__.py +++ b/adia/__init__.py @@ -11,7 +11,7 @@ from .renderer import Renderer -__version__ = '4.0.0' +__version__ = '4.0.1' __all__ = [ 'Diagram', 'SequenceDiagram', diff --git a/documentation/javascriptapi.rst b/documentation/javascriptapi.rst index 1cf8ecb..af8d37b 100644 --- a/documentation/javascriptapi.rst +++ b/documentation/javascriptapi.rst @@ -134,19 +134,19 @@ as the below: /* ADia configuration */ window.aDia.delay = 10 - window.aDia.addHook('init', (aDia) => { + window.aDia.oninit = (aDia) => { versionArea.innerText = `ADia version: ${aDia.__version__}` - }); + }; - window.aDia.input = () => sourceArea.value - window.aDia.addHook('result', () => { + window.aDia.input = () => sourceArea.value + window.aDia.onresult = () => { errorArea.value = ''; targetArea.value = ''; - }); + }; - window.aDia.addHook('success', (aDia, dia) => targetArea.value = dia) - window.aDia.addHook('error', (aDia, err) => errorArea.value = msg) - window.aDia.addHook('status', (aDia, state) => statusArea.innerText = state) + window.aDia.onsuccess = (aDia, dia) => targetArea.value = dia + window.aDia.onerror = (aDia, err) => errorArea.value = msg + window.aDia.onstatus = (aDia, state) => statusArea.innerText = state const go = aDia.go.bind(aDia); @@ -157,7 +157,6 @@ as the below: - The ``ADia`` class will listen for changes of source element and inform you by provided callbacks.