Mininova Description Length Counter

By JoeSimmons Last update Jan 18, 2009 — Installed 131 times.

There are 2 previous versions of this script.

// ==UserScript==
// @name           Mininova Description Length Counter
// @namespace      http://userscripts.org/users/23652
// @description    Adds a box to show how many characters you've typed
// @include        http://www.mininova.org/upload
// @copyright      JoeSimmons
// ==/UserScript==

var box, counter;

if(/Upload rules:/.test(document.body.textContent)) {
box = document.getElementById("form-description");
box.addEventListener("keyup", update, false);
window.addEventListener("load", update, false);

counter = document.createElement("div");
counter.textContent = box.value.length + " characters";
counter.setAttribute("style", "position:fixed; bottom:2px; left:"+(innerWidth/2)+"px; border:1px solid #000; color:#000; background-color:#fff; font:13px arial; padding:6px;");
document.body.appendChild(counter);
}

function update() {
counter.textContent = box.value.length + " characters";
}