Commit b64f9604 authored by Aral Balkan's avatar Aral Balkan

Infinite scroll is working on the Everyone timeline.

parent a67bacf5
......@@ -86,7 +86,7 @@ class PublicTimelineWeaver
# Returns a promise to return the requested timeline.
# (We need to stream the timelines contents from the database.)
#
getTimeline: (from='\x00', to='\uffff', limit=50) =>
getTimeline: (from='\x00', to='\uffff', limit=20) =>
# console.log "Streamweaver::getTimeline: #{timeline}"
# console.log "getTimeline: from: >#{from.charCodeAt(0)}<, to: >#{to.charCodeAt(0)}<, limit: #{limit}."
......
......@@ -319,6 +319,7 @@ app.get '/', require('./routes/public/public.coffee')(app)
# Ajax updates
#
app.get '/posts-after/:key', require('./routes/public/posts-after.coffee')(app)
app.get '/posts-before/:key', require('./routes/public/posts-before.coffee')(app)
#
# Middleware: create static assets servers for all users’ public assets
......
......@@ -18,6 +18,5 @@ module.exports = (app) ->
# console.log 'Found new posts: '
# console.log messages
# Reverse the message order to match that of the Cocoa client.
messages.reverse()
response.end JSON.stringify messages
#
# Gets posts before a given lexographical key.
# TODO: Refactor w. Heartbeat to remove redundancy.
#
PublicTimelineWeaver = require '../../PublicTimelineWeaver'
module.exports = (app) ->
route = (request, response) ->
# Read the details
key = request.param 'key'
console.log "Looking up posts prior to key #{key}…"
(new PublicTimelineWeaver).getPostsBefore(key).then (messages) ->
# console.log 'Get posts before: found new posts: '
# console.log messages
response.end JSON.stringify messages
This diff is collapsed.
......@@ -10,6 +10,21 @@
<script src="/js/set.js"></script>
<script src="/js/public.js"></script>
<script data-set-text='meta'></script>
<style type="text/css">
.displayNone
{
display:none;
}
.progress-spinner
{
display:inline;
width:16px;
vertical-align:top;
padding-top: 2px;
padding-right:5px;
}
</style>
</head>
<body>
<section id='public-timeline'>
......@@ -31,7 +46,11 @@
<!-- <div class='messageStatus' data-set-attribute='id message.key messageStatusIDFormatter'></div>-->
</div>
</div>
<section>
<div id='loadProgress' class='displayNone'>
<p style='text-align:center;'><img class='progress-spinner' src='/images/progress-spinner@2x.gif'></p>
</div>
<section>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment