spec/dummy/tmp/cache/assets/CEE/250/sprockets%2F96688f33f2f8aa261bf6701c1d6d7575 in medivo-0.0.1 vs spec/dummy/tmp/cache/assets/CEE/250/sprockets%2F96688f33f2f8aa261bf6701c1d6d7575 in medivo-0.0.2

- old
+ new

@@ -1,25 +1,52 @@ -o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1318515873.1462021[`: @value{I" +o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1318541826.3233469: @value{I" class:EFI"BundledAsset; FI"id; -F"%22be3bcd87c19355fb91e7ef0e63e4b2I"logical_path; +F"%1a33e87935cbcca67082718ec6890b4dI"logical_path; FI"medivo/models.js; FI" pathname; FI"c/Users/danielsudol/projects/medivo/medivo_resource/app/assets/javascripts/medivo/models.coffee; FI"content_type; FI"application/javascript; FI" mtime; -FI"2011-10-13T16:23:54+02:00; +FI"2011-10-13T21:16:04+02:00; FI" body; -FI"(function() { +FI" (function() { + String.prototype.capitalize = function() { + return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase(); + }; + String.prototype.titleize = function() { + var parts, res; + res = []; + parts = this.split(" "); + $.each(parts, function(index, part) { + return res.push(part.capitalize()); + }); + return res.join(" "); + }; + Handlebars.registerHelper("rounded", function(number) { + if (number !== void 0) { + return parseFloat(number).toFixed(2); + } + }); + Handlebars.registerHelper("titleize", function(string) { + if (string !== void 0) { + return string.titleize(); + } + }); + Handlebars.registerHelper("address_without_comma", function(lab) { + if (this.address !== void 0) { + return this.address.replace(/(\s*,\s*$)/g, "").titleize(); + } + }); window.Lab = (function() { function Lab(data) { this.data = data; } Lab.prototype.marker = null; - Lab.prototype.map_tooltip_template = Handlebars.compile("{{name}}\n{{address}}\n{{city}},{{state}} "); + Lab.prototype.map_tooltip_template = Handlebars.compile("{{titleize name}}\n{{address_without_comma address}}\n{{titleize city}},{{state}} "); Lab.prototype.clearMarker = function() { if (this.marker) { this.marker.setMap(null); return this.marker = null; } @@ -43,18 +70,22 @@ return new google.maps.MarkerImage("/assets/medivo/lab.png"); }; return Lab; })(); window.LabList = (function() { - function LabList(data) { + function LabList(lab_info) { + this.labs = []; + this.setLabs(lab_info); + } + LabList.prototype.setLabs = function(lab_info) { var labs; - this.data = data; + this.clearMarkers(); labs = this.labs = []; - $.each(this.data, function(index, lab_data) { + return $.each(lab_info, function(index, lab_data) { return labs.push(new Lab(lab_data)); }); - } + }; LabList.prototype.clearMarkers = function() { return $.each(this.labs, function(index, lab) { return lab.clearMarker(); }); }; @@ -67,9 +98,9 @@ FI"dependency_paths; F[{I" path; FI"c/Users/danielsudol/projects/medivo/medivo_resource/app/assets/javascripts/medivo/models.coffee; FI" mtime; -FIu: Time `_: @_zoneI" CEST; +FIu: Time @@: @_zoneI" CEST; T: offseti I"hexdigest; -F"%9ab86a68c7584a4258da5257b5b3f2a7I" _version; -F"%4cb2ee12166a4b69b8fba75205972b7a +F"%40bbdc6d6c93b253ab70fac561a465feI" _version; +F"%36821fa1f19faa0dcebe2dd0b27ced36 \ No newline at end of file