// ==UserScript==
// @name Userscripts.org "Add Script" Number Only Input
// @namespace http://userscripts.org/users/23652
// @description Paste a script link into the "Add Script" field, and it will get turned into that script's ID
// @include http://userscripts.org/groups/*/scripts
// @copyright JoeSimmons
// @version 1.0.0
// @license Creative Commons Attribution-Noncommercial 3.0 United States License
// ==/UserScript==
function filter(e) {
if(e.value!='') e.value = e.value.replace(/[^\d]*/g, '');
}
var add = document.evaluate("//input[@type='text' and @name='script_id']",document,null,9,null).singleNodeValue;
if(add) {
add.addEventListener('change', function(e){filter(e.currentTarget);}, false);
add.addEventListener('blur', function(e){filter(e.currentTarget);}, false);
add.addEventListener('focus', function(e){filter(e.currentTarget);}, false);
}