Skip to content

Commit

Permalink
FIxed for full postcode search
Browse files Browse the repository at this point in the history
When putting in a full postcode in JE, the distance of the restaurant
was being added to the end of the address string which was causing the
food.gov.uk lookup to fail.
  • Loading branch information
dutts committed Mar 15, 2015
1 parent dfeb73e commit d58abf3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions addon/data/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,19 @@ $(excludeNoDataCheckbox).change(function() {
});
excludeNoDataLabel.appendChild(excludeNoDataCheckbox);

config.appendChild(excludeNoDataLabel);
//config.appendChild(excludeNoDataLabel);

$("div.restaurants").prepend(config);

restaurantEntries.each(function () {
var _this = $(this);
var name = $("h2.name a:first", this).text().trim();
var address = $("p.address:first", this).text().trim();
var address = $("p.address:first", this)
.clone()
.children()
.remove()
.end()
.text().trim();

var url = "http://api.ratings.food.gov.uk/Establishments?name=" + encodeURIComponent(name) + "&address=" + encodeURIComponent(address);

Expand Down
Binary file modified addon/nomorvom.xpi
Binary file not shown.
2 changes: 1 addition & 1 deletion addon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"description": "Never eat from a dodgy takeaway again. Display food.gov.uk food hygiene scores in your Just Eat search results.",
"author": "Richard Dutton",
"license": "MPL 2.0",
"version": "0.9"
"version": "0.10"
}

0 comments on commit d58abf3

Please sign in to comment.