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.
This commit is contained in:
Brion Vibber
2010-08-12 12:47:07 -07:00
parent f14f252a16
commit 34995df879
2 changed files with 29 additions and 22 deletions

View File

@@ -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;