X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=editor_tests.coffee;h=57772448840fe614bcb2028d5e24744d62cbd70d;hb=8709cb94761099e91b480781b64323b169130d3a;hp=4b995bb355bab6e6321c417e08dec37fef26687f;hpb=be45d613a601143205ac93a5359d2340983efdf5;p=peach-html5-editor.git diff --git a/editor_tests.coffee b/editor_tests.coffee index 4b995bb..5777244 100644 --- a/editor_tests.coffee +++ b/editor_tests.coffee @@ -1,9 +1,13 @@ in_el = document.getElementById 'in' out_el = document.getElementById 'out' button = document.getElementById 'button' -button.onclick = -> - editor = wheic.wysiwyg in_el - out_el.value = wheic.dom_to_html editor.dom +editor = null +button.onclick = in_el.onchange = in_el.onkeyup = -> + if editor? + editor.load_html in_el + else + editor = wheic.wysiwyg in_el + editor.iframe.contentDocument.body.innerHTML = out_el.value = wheic.dom_to_html editor.dom return false button.value="Cleanup" button.removeAttribute 'disabled'