summaryrefslogtreecommitdiff
path: root/StoneIsland/platforms/ios/www/js/vendor/util.js
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/platforms/ios/www/js/vendor/util.js')
-rw-r--r--StoneIsland/platforms/ios/www/js/vendor/util.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/StoneIsland/platforms/ios/www/js/vendor/util.js b/StoneIsland/platforms/ios/www/js/vendor/util.js
index 8a58a84c..23f55d4c 100644
--- a/StoneIsland/platforms/ios/www/js/vendor/util.js
+++ b/StoneIsland/platforms/ios/www/js/vendor/util.js
@@ -24,6 +24,17 @@ function rgba_string (rgb,a) { return "rgba(" + rgb.map(Math.round).join(",") +
function hex_string (rgb) { return "#" + rgb.map(Math.round).map(function(n){ var s = n.toString(16); return s.length == 1 ? "0"+s : s }).join("") }
function parse_rgba_string (s) { return s.match(/(\d+)/g).slice(0,3) }
+function title_case (str) {
+ return str.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});
+}
+function pluralize (n,s,ss) { return n + " " + s + ( n == 1 ? "" : (ss || "s") ) }
+function as_cash(n){
+ var cents = ((n*100) % 100);
+ if (cents < 10) { cents = "0" + (cents|0) }
+ else { cents = cents|0 }
+ return "$" + (n|0) + "." + cents
+}
+
var E = Math.E
var PI = Math.PI
var PHI = (1+Math.sqrt(5))/2
@@ -41,6 +52,7 @@ function rand(n){ return (Math.random()*n) }
function randint(n){ return rand(n)|0 }
function randrange(a,b){ return a + rand(b-a) }
function choice(a){ return a[randint(a.length)] }
+function noop(){}
function range(m,n,s){
var a = []