-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add more info to map popups * format popup with options and css, limit title length * map popup formatting * add # link to wiki popups * update inline map unit tests with new classes * update test to remove tags from wiki to fix error * add created_at and doc_image_url to nearbyPeople search * fix test error from new tags * fix test errors * fix lint errors * adjust test for returns wikis updated * Fixing Travis system testing * Removing unwanted screenshot logging Co-authored-by: Natalie <[email protected]>
- Loading branch information
Showing
17 changed files
with
205 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// Function by caiotarifa: https://gist.github.com/caiotarifa/30ae974f2293c761f3139dd194abd9e5 | ||
// | ||
// using this function instead of distance_of_time_in_words in Ruby for the map popups calculation in leaflet_helper.js | ||
|
||
var TimeAgo = (function() { | ||
var self = {}; | ||
|
||
// Public Methods | ||
self.locales = { | ||
prefix: '', | ||
sufix: 'ago', | ||
|
||
seconds: '1 minute', | ||
minute: '1 minute', | ||
minutes: '%d minutes', | ||
hour: '1 hour', | ||
hours: '%d hours', | ||
day: '1 day', | ||
days: '%d days', | ||
month: '1 month', | ||
months: '%d months', | ||
year: '1 year', | ||
years: '%d years' | ||
}; | ||
|
||
self.inWords = function(timeAgo) { | ||
|
||
var seconds = Math.floor((new Date() - new Date(timeAgo)) / 1000), | ||
separator = this.locales.separator || ' ', | ||
words = this.locales.prefix + separator, | ||
interval = 0, | ||
intervals = { | ||
year: seconds / 31536000, | ||
month: seconds / 2592000, | ||
day: seconds / 86400, | ||
hour: seconds / 3600, | ||
minute: seconds / 60 | ||
}; | ||
|
||
var distance = this.locales.seconds; | ||
|
||
for (var key in intervals) { | ||
if (intervals.hasOwnProperty(key)) { | ||
interval = Math.floor(intervals[key]); | ||
|
||
if (interval > 1) { | ||
distance = this.locales[key + 's']; | ||
break; | ||
} else if (interval === 1) { | ||
distance = this.locales[key]; | ||
break; | ||
} | ||
} | ||
} | ||
|
||
distance = distance.replace(/%d/i, interval); | ||
words += distance + separator + this.locales.sufix; | ||
|
||
return words.trim(); | ||
}; | ||
|
||
return self; | ||
}()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.