on master help sign in
*
fda69d5Devine Lu Linvega
scripts/hallway.js+8−8
@@ -27,14 +27,14 @@ function Hallway (sites) {
27
27
28 // Entries
28 // Entries
29
29
30− function compare( a, b ) {
30+ function compare (a, b) {
31− if ( a.date < b.date ){
31+ if (a.date < b.date) {
32− return -1;
32+ return -1
33 }
33 }
34− if ( a.date > b.date ){
34+ if (a.date > b.date) {
35− return 1;
35+ return 1
36 }
36 }
37− return 0;
37+ return 0
38 }
38 }
39
39
40 this.sortEntries = function () {
40 this.sortEntries = function () {
@@ -46,7 +46,7 @@ function Hallway (sites) {
46 a.push(entry)
46 a.push(entry)
47 }
47 }
48 }
48 }
49− return a.sort( compare );
49+ return a.sort(compare)
50 }
50 }
51
51
52 this.templateEntry = function (entry) {
52 this.templateEntry = function (entry) {
@@ -103,7 +103,7 @@ function Hallway (sites) {
103 const entries = []
103 const entries = []
104 for (const id in lines) {
104 for (const id in lines) {
105 const line = lines[id].trim()
105 const line = lines[id].trim()
106− if(line === ''){ continue }
106+ if (line === '') { continue }
107 const date = line.substr(0, 25).trim()
107 const date = line.substr(0, 25).trim()
108 const body = line.substr(26).trim()
108 const body = line.substr(26).trim()
109 entries.push({ date, body, author })
109 entries.push({ date, body, author })