| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 4ba8b0c commit fe23eac
46 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1 +1 @@ | |||
| 1 | - iojs-v1.2.0 | ||
| 1 | + 4.2.1 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -75,28 +75,27 @@ JS.Modules.CreateComment = (function() { | |||
| 75 | 75 | ||
| 76 | 76 | var _buildComment = function(data) { | |
| 77 | 77 | var comment = ''; | |
| 78 | - | ||
| 79 | 78 | comment+= | |
| 80 | - '<li id="comment-' + data.comment.id + '" class="list-item is-added js-editComment" data-id="' + data.comment.id + '">' + | ||
| 79 | + '<li id="comment-' + data.doc._id + '" class="list-item is-added js-editComment" data-id="' + data.doc._id + '">' + | ||
| 81 | 80 | '<div class="bucket">' + | |
| 82 | 81 | '<div class="bucket-media">' + | |
| 83 | - '<img class="thumb" src="' + data.comment.avatar_url + '" width="50">' + | ||
| 82 | + '<img class="thumb" src="' + data.doc.comments[0].user.avatar_url + '" width="50">' + | ||
| 84 | 83 | '</div>' + | |
| 85 | 84 | '<div class="bucket-content">' + | |
| 86 | 85 | '<div class="split mbm tfh">' + | |
| 87 | 86 | '<div class="split-item">' + | |
| 88 | 87 | '<div class="split-cell">' + | |
| 89 | - '<span class="mrs twb">' + data.comment.name + '</span>' + | ||
| 88 | + '<span class="mrs twb">' + data.doc.comments[0].user.name + '</span>' + | ||
| 90 | 89 | '<time class="tcs tsi">Today</time>' + | |
| 91 | 90 | '</div>' + | |
| 92 | 91 | '<div class="split-cell">' + | |
| 93 | 92 | '<button class="link js-editComment-editBtn">Edit</button>' + | |
| 94 | 93 | '</div>' + | |
| 95 | 94 | '</div>' + | |
| 96 | 95 | '</div>' + | |
| 97 | - '<p class="mbf js-editComment-comment">' + data.comment.body + '</p>' + | ||
| 96 | + '<p class="mbf js-editComment-comment">' + data.doc.comments[0].body + '</p>' + | ||
| 98 | 97 | '<form class="form js-editComment-form is-hidden" action="">' + | |
| 99 | - '<textarea class="form-input form-textarea js-autosize js-editComment-textarea">' + data.comment.body + '</textarea>' + | ||
| 98 | + '<textarea class="form-input form-textarea js-autosize js-editComment-textarea">' + data.doc.comments[0].body + '</textarea>' + | ||
| 100 | 99 | '<div class="split split--center">' + | |
| 101 | 100 | '<div class="split-item">' + | |
| 102 | 101 | '<div class="split-cell">' + | |
@@ -149,7 +148,7 @@ JS.Modules.CreateComment = (function() { | |||
| 149 | 148 | _firstComment = true; | |
| 150 | 149 | comment = _buildComment(data); | |
| 151 | 150 | } else { | |
| 152 | - if (data.comment.isSpam) { | ||
| 151 | + if (data.doc.comments[0].flagged) { | ||
| 153 | 152 | comment = _buildModerationComment(data); | |
| 154 | 153 | } else { | |
| 155 | 154 | comment = _buildComment(data); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,9 +22,8 @@ JS.Modules.LoadStories = (function() { | |||
| 22 | 22 | $element : $('.js-loadFeed'), | |
| 23 | 23 | $button : $('.js-loadFeed-btn'), | |
| 24 | 24 | $list : $('.js-loadFeed-list'), | |
| 25 | - increment : 25, | ||
| 26 | - offset : 25, | ||
| 27 | - path : '/news?page=', | ||
| 25 | + lastDate : $(".js-loadFeed-list .list-item .externalLink").last().data("pub"), | ||
| 26 | + path : '/news?pub_date=', | ||
| 28 | 27 | hiddenClass : 'is-hidden' | |
| 29 | 28 | }, options); | |
| 30 | 29 | ||
@@ -36,15 +35,15 @@ JS.Modules.LoadStories = (function() { | |||
| 36 | 35 | // ------------------------------------- | |
| 37 | 36 | ||
| 38 | 37 | var _appendStories = function(data) { | |
| 39 | - var stories = data.flow, | ||
| 38 | + var stories = data.docs, | ||
| 40 | 39 | markup = ''; | |
| 41 | 40 | ||
| 42 | 41 | stories.forEach(function(story) { | |
| 43 | 42 | markup += | |
| 44 | 43 | '<li class="list-item">' + | |
| 45 | 44 | '<article class="bucket">' + | |
| 46 | 45 | '<div class="bucket-media">' + | |
| 47 | - '<img class="thumb" src="' + story.avatar_url + '" width="50"/>' + | ||
| 46 | + '<img class="thumb" src="' + story.user.avatar_url + '" width="50"/>' + | ||
| 48 | 47 | '</div>' + | |
| 49 | 48 | '<div class="bucket-content">' + | |
| 50 | 49 | '<h2 class="h h--4">' + | |
@@ -55,7 +54,7 @@ JS.Modules.LoadStories = (function() { | |||
| 55 | 54 | '</a>' + | |
| 56 | 55 | '</h2>' + | |
| 57 | 56 | '<p class="mbf tcs tfh tss">' + | |
| 58 | - 'via ' + '<span class="twsb">' + story.name + '</span>' + | ||
| 57 | + 'via ' + '<span class="twsb">' + story.user.name + '</span>' + | ||
| 59 | 58 | ' | ' + '<a class="' + commentClass(story.comment_count) + '" href="/news/' + story.slug + '#comments">View Discussion ' + commentNumber(story.comment_count) + '</a>' + | |
| 60 | 59 | '</p>' + | |
| 61 | 60 | '</div>' + | |
@@ -72,12 +71,11 @@ JS.Modules.LoadStories = (function() { | |||
| 72 | 71 | // ------------------------------------- | |
| 73 | 72 | ||
| 74 | 73 | var _getStories = function() { | |
| 75 | - $.get(_settings.path + _settings.offset, function(data) { | ||
| 74 | + $.get(_settings.path + _settings.lastDate, function(data) { | ||
| 76 | 75 | _appendStories(data); | |
| 77 | 76 | _toggleButton(data); | |
| 77 | + _setNewLastDate(data); | ||
| 78 | 78 | }); | |
| 79 | - | ||
| 80 | - _settings.offset += _settings.increment; | ||
| 81 | 79 | }; | |
| 82 | 80 | ||
| 83 | 81 | // ------------------------------------- | |
@@ -108,6 +106,17 @@ JS.Modules.LoadStories = (function() { | |||
| 108 | 106 | } | |
| 109 | 107 | }; | |
| 110 | 108 | ||
| 109 | + // ------------------------------------- | ||
| 110 | + // Set New Last Date | ||
| 111 | + // ------------------------------------- | ||
| 112 | + | ||
| 113 | + var _setNewLastDate = function(data) { | ||
| 114 | + var newDate = data.docs[data.docs.length - 1].published_at; | ||
| 115 | + _settings.lastDate = new Date(newDate).valueOf() | ||
| 116 | + console.log(_settings.lastDate) | ||
| 117 | + | ||
| 118 | + }; | ||
| 119 | + | ||
| 111 | 120 | // ------------------------------------- | |
| 112 | 121 | // Toggle Button | |
| 113 | 122 | // ------------------------------------- | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -37,6 +37,7 @@ JS.Modules.Newsletter = (function() { | |||
| 37 | 37 | ||
| 38 | 38 | var _submitForm = function() { | |
| 39 | 39 | $.post('/subscribe', _settings.$form.serialize(), function(results) { | |
| 40 | + console.log(results) | ||
| 40 | 41 | if (results.error) { | |
| 41 | 42 | _updateInterface('error', results.error.error); | |
| 42 | 43 | } else { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,7 +28,6 @@ var watch = require('gulp-watch'); | |||
| 28 | 28 | var _ = require('lodash'); | |
| 29 | 29 | var run = require('run-sequence'); | |
| 30 | 30 | var Chance = require('chance'); | |
| 31 | - var db = require('./server/services/db'); | ||
| 32 | 31 | ||
| 33 | 32 | // ------------------------------------- | |
| 34 | 33 | // Variables | |
@@ -247,54 +246,3 @@ gulp.task('icons', function() { | |||
| 247 | 246 | .pipe(gulp.dest(options.icons.destDir)); | |
| 248 | 247 | }); | |
| 249 | 248 | ||
| 250 | - // ------------------------------------- | ||
| 251 | - // Task: Seeds | ||
| 252 | - // ------------------------------------- | ||
| 253 | - gulp.task('seeds', function() { | ||
| 254 | - var chance = new Chance(); | ||
| 255 | - for(i = 0; i < 50; i++) { | ||
| 256 | - var title = chance.sentence({words: 5}); | ||
| 257 | - var slug = title.toLowerCase().replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s/g,'-'); | ||
| 258 | - var body = chance.paragraph(); | ||
| 259 | - var url = chance.url(); | ||
| 260 | - var published_at = chance.date({year: 2014}); | ||
| 261 | - db.query('INSERT INTO articles (title, slug, body, url, published_at, news, approved) VALUES ($1, $2, $3, $4, $5, true, true);', | ||
| 262 | - [title, slug, body, url, published_at], | ||
| 263 | - function(){} | ||
| 264 | - ); | ||
| 265 | - } | ||
| 266 | - for (i = 0; i < 7; i++) { | ||
| 267 | - var githubId = chance.integer({min: 1, max: 6000}); | ||
| 268 | - var email = chance.email(); | ||
| 269 | - var name = chance.name(); | ||
| 270 | - var avatarUrl = 'https://avatars.githubusercontent.com/u/' + chance.pick([6965062,3412,10722,6797535,2618,30208]) + '?v=3'; | ||
| 271 | - db.query('INSERT INTO users (github_id, email, name, avatar_url) VALUES ($1, $2, $3, $4);', | ||
| 272 | - [githubId, email, name, avatarUrl], | ||
| 273 | - function(){} | ||
| 274 | - ); | ||
| 275 | - } | ||
| 276 | - | ||
| 277 | - for(i = 0; i < 50; i++) { | ||
| 278 | - var title = chance.sentence({words: 5}); | ||
| 279 | - var slug = title.toLowerCase().replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s/g,'-'); | ||
| 280 | - var body = chance.paragraph(); | ||
| 281 | - var url = chance.url(); | ||
| 282 | - var published_at = chance.date({year: 2014}); | ||
| 283 | - var userId = chance.d6(); | ||
| 284 | - db.query('INSERT INTO articles (user_id, title, slug, body, url, published_at, news, approved) VALUES ($1, $2, $3, $4, $5, $6, false, true);', | ||
| 285 | - [userId, title, slug, body, url, published_at], | ||
| 286 | - function(){} | ||
| 287 | - ); | ||
| 288 | - } | ||
| 289 | - | ||
| 290 | - for(i = 0; i < 50; i++) { | ||
| 291 | - var userId = chance.d6(); | ||
| 292 | - var body = chance.paragraph(); | ||
| 293 | - var articleId = chance.integer({min: 51, max: 100}); | ||
| 294 | - db.query('INSERT INTO comments (user_id, approved, body, article_id) VALUES ($1, true, $2, $3);', | ||
| 295 | - [userId, body, articleId], | ||
| 296 | - function(){} | ||
| 297 | - ); | ||
| 298 | - } | ||
| 299 | - | ||
| 300 | - }); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments