summaryrefslogtreecommitdiff
path: root/js/util.js
diff options
context:
space:
mode:
authorjules <jules@okfoc.us>2013-12-16 16:44:31 -0500
committerjules <jules@okfoc.us>2013-12-16 16:44:31 -0500
commitb3807b435f3ed01f159fb0f6c53956962b964d13 (patch)
tree13b4bcb8117a91a04602c5103d71323c35394711 /js/util.js
parent647e85694a9ab1ef8ef9f0ad321710c064cf74fd (diff)
ui reorg, remove all frames, handle alpha w/ bgcolor
Diffstat (limited to 'js/util.js')
-rw-r--r--js/util.js3
1 files changed, 3 insertions, 0 deletions
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<a?a:n<b?n:b }