Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
CountCharacters
CountCharacters
0
Comments
@fysicsluvr: I can look into that.
Thank you both for your comments.
Maybe I'm just being a nitpick, but I'd really like to retain the original submit button.
I'm on Windows Vista, FireFox 2.0.0.12.
To eliminate the hiding and showing of the button, please comment out the following lines in the functions.js file:
if (q > maxvalue) { CharCount.style.fontWeight = 'bold'; CharCount.style.color = '#ff0000'; //button[0].type = 'hidden'; } else { CharCount.style.fontWeight = 'normal'; CharCount.style.color = '#000000'; //button[0].type = 'visible'; }
There really isn't any need to do this since Vanilla traps the error. I will fix this.
The delete and backspace keys actually adjust the count correctly.
However, there is a discrepancy between what Vanilla says is the number of characters over the limit and what my count is. For example, my count says 400 characters over the limit while Vanilla says 518 characters. Maybe it has to do with end-of-line characters. I'll look into this.
Edit: It does appear that Vanilla adds 2 characters per line (perhaps it's adding or counting a CR and LF for each line). That's what is the difference in counts.
Would it be possible to move the counter up to the right of the whisper field? It would take up less screen real-estate and quite often, the bottom of the comment section won't be completely visible when you type in a new comment. You'll have to scroll down to see the counter and indeed the submit button.
I should have noted that if you want to do this, change the following function in the default.php file from a p tag to a div tag with an added style:
function CommentForm_AddCount(&$CommentForm) { global $Context; echo '<div id="charsleft" style="float:right;clear:both;"><input disabled type="text" value=" Characters left -->" size="18"/><input type="text" name="charcount" id="char_count" size="8" /><input type="hidden" id="maxlength" name="maxlength" value="'.$Context->Configuration["MAX_COMMENT_LENGTH"].'" /> '; echo '</div>'; }
Is there an easy way to get it to work with the editor, or at least to not display if there is an editor in operation (since some users may use the GUI editor and some may not).
-- Jason
The file you attempted to upload (CountCharacters101-20090207.zip) was of type "application/octet-stream", but the file extension "zip" did not match the accepted extensions for this type of file: rar, tar.gz
Can anyone help me get past this error?
The correct setting for the submit button type when active is (unsurprisingly) "submit".
file: functions.js
row: 45
WRONG:
button[0].type = 'visible';
RIGHT:
button[0].type = 'submit';
Cheers! And keep up the good work.
I tried running the udpate for 'CountCharacters' and it said that an updated version of 'CountCharacters 1.0.1' is available. But I am unable to download it even after multiple attempts.
Thanks
Gerry