on master help sign in
*
commitf91f45e1bb016b35c83be01071ed2505fec246e7 authorDevine Lu Linvega <aliceffekt@gmail.com> dateWed 24 Jul 2019, 11:32 (7 years ago) parent26680f2
1 file changed+5−8
scripts/hallway.js+5−8
scripts/hallway.js+5−8
@@ -92,9 +92,7 @@ function Hallway (sites) {
9292
9393 this.findMention = function (found) {
9494 const mention = Object.keys(feeds).filter(user => found.indexOf(feeds[user].path) > -1)
95− return mention.length === 1
96− ? ` <span class='user'>@${mention[0]}</span>`
97− : ` <span class='user'>${found}</span>`
95+ return mention.length === 1 ? ` <span class='user'>@${mention[0]}</span>` : ` <span class='user'>${found}</span>`
9896 }
9997
10098 this.templateEntry = function (entry) {
@@ -161,9 +159,8 @@ function Hallway (sites) {
161159
162160 function timeAgo (dateParam) {
163161 const date = typeof dateParam === 'object' ? dateParam : new Date(dateParam)
164− const DAY_IN_MS = 86400000 // 24 * 60 * 60 * 1000
165162 const today = new Date()
166− const yesterday = new Date(today - DAY_IN_MS)
163+ const yesterday = new Date(today - 86400000)
167164 const seconds = Math.round((today - date) / 1000)
168165 const minutes = Math.round(seconds / 60)
169166 const isToday = today.toDateString() === date.toDateString()
@@ -185,10 +182,10 @@ function Hallway (sites) {
185182
186183 return `${Math.floor(minutes / 1440)} days ago`
187184 }
185+}
188186
189− function escapeHtml (unsafe) {
190− return unsafe.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#039;')
191− }
187+function escapeHtml (unsafe) {
188+ return unsafe.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#039;')
192189}
193190
194191function filter (name) {