diff options
author | Brion Vibber <brion@status.net> | 2010-08-12 12:47:07 -0700 |
---|---|---|
committer | Brion Vibber <brion@status.net> | 2010-08-12 12:47:07 -0700 |
commit | 34995df879457f03ad6f78e617294dc2dd040b7d (patch) | |
tree | 9c201cb9b1a272b34e0cc6bd05636a4ff08f0b88 /js | |
parent | f14f252a1633c9297f33a98ef7f4ccf6db0efaef (diff) |
TinyMCE: counter support (may not be 100% exact match to server-side count, but there's already discrepencies due to URL shortening)
Fix for bad char conversions also, caused short text to not be saved in some cases.
Diffstat (limited to 'js')
-rw-r--r-- | js/util.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/js/util.js b/js/util.js index 6a67da4bc..ad8a44c82 100644 --- a/js/util.js +++ b/js/util.js @@ -110,7 +110,7 @@ var SN = { // StatusNet return; } - var remaining = MaxLength - form.find('#'+SN.C.S.NoticeDataText).val().length; + var remaining = MaxLength - SN.U.CharacterCount(form); var counter = form.find('#'+SN.C.S.NoticeTextCount); if (remaining.toString() != counter.text()) { @@ -134,6 +134,10 @@ var SN = { // StatusNet } }, + CharacterCount: function(form) { + return form.find('#'+SN.C.S.NoticeDataText).val().length; + }, + ClearCounterBlackout: function(form) { // Allow keyup events to poke the counter again SN.C.I.CounterBlackout = false; |