From b3807b435f3ed01f159fb0f6c53956962b964d13 Mon Sep 17 00:00:00 2001 From: jules Date: Mon, 16 Dec 2013 16:44:31 -0500 Subject: ui reorg, remove all frames, handle alpha w/ bgcolor --- js/util.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'js') diff --git a/js/util.js b/js/util.js index dcc978f..dde3427 100644 --- a/js/util.js +++ b/js/util.js @@ -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