Open Kryptonit3-zz opened 10 years ago
I'd love to see this also for sure, but probably as an extension. Both of these things would be super simple, but so far the majority of implementations I've seen are in blogging engines and stuff, so max characters built in might not make sense since it'd be used so little overall. If you need help implementing this tho, let me know :) @famthegeek might be able to help too make this a script you can include.
Attention: I have implemented this feature in an additional code,
refer to my wiki I made
I will upload a video of it in action soon!
Video uploaded. Refer to wiki link in previous post :)
Apparently this has an issue with anything but plain text when reaching limit (aka text and markdown code) - if someone wants to modify the code please do to fix the problem.
jQuery has a .text method right? Could you simply get the html with exportFile(name, 'html') and get the text of it with jQuery?
you got me on the right path, i needed the text, not the HTML, so I will be changing this
var editorContent = editor.getElement('editor').body.innerHTML;
to this
var editorBody = editor.getElement('editor').body;
var editorContent = (editorBody.innerText || editorBody.textContent);
the || is for IE compatibility.
Wiki has been updated - https://github.com/OscarGodson/EpicEditor/wiki/Limiting-character-input-when-using-an-existing-textarea---using-jQuery
Thanks!
Would love to see a option for max character limit and a character counter