summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/vendor/util.js
diff options
context:
space:
mode:
Diffstat (limited to 'StoneIsland/www/js/vendor/util.js')
-rw-r--r--StoneIsland/www/js/vendor/util.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/StoneIsland/www/js/vendor/util.js b/StoneIsland/www/js/vendor/util.js
index 0e48ce5a..fede4761 100644
--- a/StoneIsland/www/js/vendor/util.js
+++ b/StoneIsland/www/js/vendor/util.js
@@ -24,6 +24,10 @@ 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();});
+}
+
var E = Math.E
var PI = Math.PI
var PHI = (1+Math.sqrt(5))/2