twitter 140 char highlighting

return 140 char highlighting to twitter

Verze ze dne 08. 11. 2017. Zobrazit nejnovější verzi.

// ==UserScript==
// @name         twitter 140 char highlighting
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  return 140 char highlighting to twitter
// @author       ashleyjames.xyz
// @match        https://twitter.com
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    var textdiv = document.getElementById('tweet-box-home-timeline');
    textdiv.onkeyup = function(){
        var str = textdiv.innerHTML;
        if (str.length > 140){
            textdiv.style.backgroundColor = "#faa";
        }
        else if (str.length < 140){
            textdiv.style.backgroundColor = "#fff";
        }
    };
})();