diff options
| author | jules <jules@okfoc.us> | 2013-12-16 16:44:31 -0500 |
|---|---|---|
| committer | jules <jules@okfoc.us> | 2013-12-16 16:44:31 -0500 |
| commit | b3807b435f3ed01f159fb0f6c53956962b964d13 (patch) | |
| tree | 13b4bcb8117a91a04602c5103d71323c35394711 /js/util.js | |
| parent | 647e85694a9ab1ef8ef9f0ad321710c064cf74fd (diff) | |
ui reorg, remove all frames, handle alpha w/ bgcolor
Diffstat (limited to 'js/util.js')
| -rw-r--r-- | js/util.js | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1,10 +1,13 @@ if (window.$) { $.fn.int = function(){ return parseInt($(this).val(),10) } $.fn.float = function(){ return parseFloat($(this).val()) } + $.fn.string = function(){ return trim($(this).val()) } $.fn.enable = function() { return $(this).attr("disabled",null) } $.fn.disable = function() { return $(this).attr("disabled","disabled") } } +function trim(s){ return s.replace(/^\s+/,"").replace(/\s+$/,"") } + var E = Math.E var PI = Math.PI function clamp(n,a,b){ return n<a?a:n<b?n:b } |
