forked from GNUsocial/gnu-social
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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user