From 6e96cf96eed6704c26e28c01dd3ece0eee54b1fd Mon Sep 17 00:00:00 2001 From: okfprojz Date: Fri, 25 Sep 2015 12:33:03 -0400 Subject: rm unnecessary assets --- public/assets/js/vendor/util.js | 194 ---------------------------------------- public/index.html | 3 - 2 files changed, 197 deletions(-) diff --git a/public/assets/js/vendor/util.js b/public/assets/js/vendor/util.js index 34ef45f..9063a35 100644 --- a/public/assets/js/vendor/util.js +++ b/public/assets/js/vendor/util.js @@ -1,197 +1,3 @@ -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") } - $.fn.sanitize = function(s) { return trim(sanitize($(this).val())) } - $.fn.stripHTML = function(s) { return trim(stripHTML($(this).val())) } - $.fn.sanitizeName = function(s) { return trim(sanitizeName($(this).val())) } - $.fn.htmlSafe = function(s) { return $(this).html(sanitize(s)) } - $.fn.toDollars = function(i) { return $(this).html((i/100).toFixed(2)) } -} - -function trim (s){ return s.replace(/^\s+/,"").replace(/\s+$/,"") } -function sanitize (s){ return (s || "").replace(new RegExp("[<>&]", 'g'), "") } -function sanitizeName (s){ return (s || "").replace(new RegExp("[^-_a-zA-Z0-9]", 'g'), "") } -function stripHTML (s){ return (s || "").replace(/<[^>]+>/g, "") } -function sanitizeHTML (s){ return (s || "").replace(/&/g, "&").replace(//g, ">") } -function capitalize (s){ return s.split(" ").map(capitalizeWord).join(" ") } -function capitalizeWord (s){ return s.charAt(0).toUpperCase() + s.slice(1) } -function slugify (s){ return (s || "").toLowerCase().replace(/\s/g,"-").replace(/[^-_a-zA-Z0-9]/g, '-').replace(/-+/g,"-") } -function rgb_string (rgb) { return "rgb(" + rgb.map(Math.round).join(",") + ")" } -function rgba_string (rgb,a) { return "rgba(" + rgb.map(Math.round).join(",") + "," + a + ")" } -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) } - -var E = Math.E -var PI = Math.PI -var PHI = (1+Math.sqrt(5))/2 -var TWO_PI = PI*2 -var HALF_PI = PI/2 -var LN10 = Math.LN10 -function clamp(n,a,b){ return n= a) + 0 - // ^^ bool -> int -} - -function julestep (a,b,n) { - return clamp(norm(n,a,b), 0.0, 1.0); -} - -// hermite curve apparently -function smoothstep(min,max,n){ - var t = clamp((n - min) / (max - min), 0.0, 1.0); - return t * t * (3.0 - 2.0 * t) -} - -function shuffle(a){ - var r, swap - for (var i = a.length; i > 0; i--){ - r = randint(i) - swap = a[i-1] - a[i-1] = a[r] - a[r] = swap - } - return a -} -function reverse(a){ - var reversed = [] - for (var i = 0, _len = a.length-1; i <= _len; i++){ - reversed[i] = a[_len-i] - } - return reversed -} -function deinterlace(a){ - var odd = [], even = [] - for (var i = 0, _len = a.length; i < _len; i++) { - if (i % 2) even.push(a[i]) - else odd.push(a[i]) - } - return [even, odd] -} -function weave(a){ - var aa = deinterlace(a) - var b = [] - aa[0].forEach(function(el){ b.push(el) }) - reverse(aa[1]).forEach(function(el){ b.push(el) }) - return b -} -function range(m,n,s){ - var a = [] - s = s || 1 - for (var i = m; i <= n; i += s) { - a.push(i) - } - return a -} - -var guid_syllables = "iz az ez or iv ex baz el lo lum ot un no".split(" ") -var guid_n = 0 -function guid(n){ - var len = guid_syllables.length - return ((++guid_n*(len-1)*(~~log(guid_n))).toString(len)).split("").map(function(s){ - return guid_syllables[parseInt(s, len) % len--] - }).join("") -} - -function defaults (dest, src) { - dest = dest || {} - for (var i in src) { - dest[i] = typeof dest[i] == 'undefined' ? src[i] : dest[i] - } - return dest -} - -// Change straight quotes to curly and double hyphens to em-dashes. -function smarten(a) { - a = a.replace(/(^|[-\u2014\s(\["])'/g, "$1\u2018"); // opening singles - a = a.replace(/'/g, "\u2019"); // closing singles & apostrophes - a = a.replace(/(^|[-\u2014/\[(\u2018\s])"/g, "$1\u201c"); // opening doubles - a = a.replace(/"/g, "\u201d"); // closing doubles - a = a.replace(/--/g, "\u2014"); // em-dashes - return a -}; - - -function pairs(h){ - var a = [] - for (var i in h) { - if(h.hasOwnProperty(i)) { - a.push([i, h[i]]) - } - } - return a -} -function invert_hash (h) { - var k = {} - for (var i in h) { if (h.hasOwnProperty(i)) k[h[i]] = i } - return k -} -function filenameFromUrl (url) { - var partz = url.split( "/" ) - return partz[partz.length-1].split(".")[0] -} - -function bitcount(v) { - v = v - ((v >>> 1) & 0x55555555); - v = (v & 0x33333333) + ((v >>> 2) & 0x33333333); - return ((v + (v >>> 4) & 0xF0F0F0F) * 0x1010101) >>> 24; -} - // Function.bind polyfill if (!Function.prototype.bind) { Function.prototype.bind = function(oThis) { diff --git a/public/index.html b/public/index.html index febb353..2e0bf79 100644 --- a/public/index.html +++ b/public/index.html @@ -58,9 +58,6 @@ - - - -- cgit v1.2.3-70-g09d2