Created
November 8, 2017 00:01
-
-
Save dukegreene/ffe7902906ebe614fc32a981bd98cafb to your computer and use it in GitHub Desktop.
Tee Minus Two Eighty - Version One
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Quick fix to bring back a precise char counter. | |
Copy into browser console to enable for new tweets. | |
(Reply tweets not supported yet...maybe next version?) | |
Works in current Chrome browser on 11/07/2017. | |
*/ | |
$('#tweet-box-global').on('keyup', function(event) { | |
var $box = $('#tweet-box-global div'); | |
event.preventDefault(); | |
var remainLength = 280 - $box.text().length; | |
var charCountDisplay = ` | |
<div id="chars-left" style="color: red"> | |
${remainLength} | |
</div> | |
` | |
$("#chars-left").remove(); | |
$box.parent().parent().append(charCountDisplay); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment