Skip to content

Commit

Permalink
linkify maponics & geonameid links
Browse files Browse the repository at this point in the history
Auditors: rahul
  • Loading branch information
David Blackman committed Jan 28, 2014
1 parent a2e3a18 commit 2c5ca1c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion server/src/main/resources/static/geocoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,15 @@ function success(data, bulkInputs) {
statusArea.empty();
debugInfo.empty();


function linkifySlugs(str, group1, group2) {
var id = group1 + ':' + group2;
return '<a href="/static/geocoder.html#slug=' + id + '">' + id + '</a>';
}

_(data.debugLines).each(function(l) {
debugInfo.append(l);
l = l.replace(/(geonameid|maponics):(\d+)/g, linkifySlugs);
debugInfo.append($('<span>' + l + '</span>'));
debugInfo.append($('<br>'));
})

Expand Down

0 comments on commit 2c5ca1c

Please sign in to comment.