Sha256: ea1daeefc7ab6934884708569efc29b8917fc8b9ee348d53281982b3696beb61
Contents?: true
Size: 741 Bytes
Versions: 49
Compression:
Stored size: 741 Bytes
Contents
########## js and handlebars helpers ############## window.isNumber = (n)-> !isNaN(parseFloat(n)) && isFinite(n) String.prototype.capitalize = -> this.charAt(0).toUpperCase() + this.substring(1).toLowerCase() String.prototype.titleize = -> res = [] parts = this.split(" ") $.each(parts, (index, part)-> res.push(part.capitalize()) ) res.join(" ") Handlebars.registerHelper("rounded", (number)-> if isNumber(number) parseFloat(number).toFixed(2) ) Handlebars.registerHelper("titleize", (string)-> if (string != undefined) string.titleize() ) Handlebars.registerHelper("address_without_comma", (lab)-> return unless this.data and this.data.address this.data.address.replace(/(\s*,\s*$)/g, "").titleize() )
Version data entries
49 entries across 49 versions & 1 rubygems