X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=editor_tests.coffee;h=06dfd4046a1496f19aa0dd595fd1733542a5eac3;hb=a85e7976ce04ccbceb207ffe60ffbd212eb5a789;hp=4b995bb355bab6e6321c417e08dec37fef26687f;hpb=c8370edb3147dad5c8921f6dd4509a3c94658e0c;p=peach-html5-editor.git diff --git a/editor_tests.coffee b/editor_tests.coffee index 4b995bb..06dfd40 100644 --- a/editor_tests.coffee +++ b/editor_tests.coffee @@ -1,9 +1,15 @@ 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 = -> + #button.value="Reload" + if editor? + editor.load_html in_el.value + else + # first run + button.parentNode.removeChild button + editor = wheic.wysiwyg in_el return false -button.value="Cleanup" +button.value="Load" button.removeAttribute 'disabled' +button.click()