Mercurial Hosting > freedit
diff src/site.js @ 21:33731231093a
fix bbcode editing
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 17 Jul 2022 08:24:52 -0600 |
parents | 3ea49246d6a7 |
children | 4fdc4ec0050b |
line wrap: on
line diff
--- a/src/site.js Wed Jul 13 22:00:00 2022 -0600 +++ b/src/site.js Sun Jul 17 08:24:52 2022 -0600 @@ -31,26 +31,3 @@ err += '\nstack = ' + error.stack; ajax( '/error_log.js', 'err='+encodeURIComponent(err) ); }; - -function editorEnter() { - let s = getSelection(); - let r = s.getRangeAt(0); - r.deleteContents(); - let t = document.createTextNode('\n'); - r.insertNode(t); - let isFucked = getSelection().getRangeAt(0).collapsed; - //console.log(isFucked); - r.collapse(); - if(isFucked) { - s.removeAllRanges(); - s.addRange(r); - } -} - -function editorKey() { - //console.log(event); - if( event.code === 'Enter' ) { - editorEnter(); - return false; - } -}