Ind.ie is now Small Technology Foundation.
Commit 615e649c authored by Aral Balkan's avatar Aral Balkan

Re-implemented default messages for All Friends and Private Conversations...

Re-implemented default messages for All Friends and Private Conversations timelines. Progress towards #86. Namespaced the timeline request URLs.
parent 0646b41f
......@@ -65,6 +65,7 @@ class PrivateWebServer
app.use '/css', express.static (__dirname + '/private/views/css')
app.use '/images', express.static (__dirname + '/private/views/images')
app.use '/notice/no-friends', express.static (__dirname + '/private/views/notices/no-friends.html')
app.use(bodyParser.urlencoded({ extended: false }))
......@@ -72,11 +73,11 @@ class PrivateWebServer
# Routes
#
app.get '/all-friends-timeline', require('./private/routes/all-friends.coffee')(app)
app.get '/private-timeline', require('./private/routes/private.coffee')(app)
app.get '/public-timeline', require('./private/routes/public.coffee')(app)
app.get '/conversation-with/:person', require('./private/routes/conversation.coffee')(app)
app.get '/posts-after/:timeline/:key', require('./private/routes/posts-after.coffee')(app)
app.get '/timeline/all-friends', require('./private/routes/all-friends.coffee')(app)
app.get '/timeline/private', require('./private/routes/private.coffee')(app)
app.get '/timeline/public', require('./private/routes/public.coffee')(app)
app.get '/timeline/conversation-with/:person', require('./private/routes/conversation.coffee')(app)
app.get '/timeline/posts-after/:timeline/:key', require('./private/routes/posts-after.coffee')(app)
#
# Catchall error handler.
......
......@@ -4,36 +4,41 @@
<title>All friends</title>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width'>
<link rel='stylesheet' href='/css/styles.css'>
<script type='text/javascript' src='/js/superagent.js'></script>
<script type='text/javascript' src='/js/moment.js'></script>
<script type='text/javascript' src='/js/set.js'></script>
<script type='text/javascript' src='/js/all-friends.js'></script>
<script type='text/javascript' data-set-text='meta'></script>
<link rel='stylesheet' href='/css/styles.css'>
<script type='text/javascript' src='/js/superagent.js'></script>
<script type='text/javascript' src='/js/moment.js'></script>
<script type='text/javascript' src='/js/set.js'></script>
<script type='text/javascript' src='/js/all-friends.js'></script>
<script type='text/javascript' data-set-text='meta'></script>
</head>
<body>
<section id='public-timeline'>
<h1>All Friends</h1>
<!-- Notice to display if there are no messages yet. -->
<div data-set-if='not:messages' id='notice'>
<p>This is where you will see messages from all of your friends. Messages you send will also be seen by all of your friends.</p><p>To avoid confusion, when replying to friends here, start your messages them with <em>@<their handle></em>. Although this does nothing special at the moment, it might give them a notification in the future.</p><p>Also, remember that your friends won’t see each other’s messages unless they are also friends with each other. In the future, @handle could help with discovery if we link handles to people’s public pages (thereby making it possible for your friends to discover each other through your conversations on this timeline).</p>
</div>
<!-- Notice to display if there are no messages yet. -->
<div data-set-if='not:messages' id='notice'>
<p><strong>This is where you will see messages from all of your friends.</strong></p>
<div id='messages' class='messages' data-set-if='messages'>
<!-- Repeater -->
<div id='messageRepeater' class='message' data-set-repeat='message messages' data-set-attribute='id message.key' >
<div class='messageBody' data-set-attribute='id message.key messageBodyIDFormatter'>
<div class="image-and-body">
<img class="profileImage" data-set-attribute='src message.key profileImagePathFormatter'>
<div class="bodyText" data-set-text='html message.value'>Message body HTML</div>
<div class="meta"><span data-set-text='message.key postDateFormatter'></span><span data-set-text='message.key personFormatter'></span> <a data-set-attribute='href message.key addFriendLinkFormatter' data-set-text='html message.key addFriendTextFormatter'></a></div>
</div>
</div>
<!-- <div class='messageStatus' data-set-attribute='id message.key messageStatusIDFormatter'></div>-->
</div>
</div>
<section>
<p>Messages you send will also be seen by all of your friends.</p>
<p>To avoid confusion, when replying to friends here, start your messages to them with <em>@</em>. Although this does nothing special at the moment, it might give them a notification in the future.</p>
<p>Also, remember that your friends won’t see each other’s messages unless they are also friends with each other. In the future, @messages could help with discovery if we link handles to people’s public pages (thereby making it possible for your friends to discover each other through your conversations on this timeline).</p>
</div>
<div id='messages' class='messages' data-set-if='messages'>
<!-- Repeater -->
<div id='messageRepeater' class='message' data-set-repeat='message messages' data-set-attribute='id message.key' >
<div class='messageBody' data-set-attribute='id message.key messageBodyIDFormatter'>
<div class="image-and-body">
<img class="profileImage" data-set-attribute='src message.key profileImagePathFormatter'>
<div class="bodyText" data-set-text='html message.value'>Message body HTML</div>
<div class="meta"><span data-set-text='message.key postDateFormatter'></span><span data-set-text='message.key personFormatter'></span> <a data-set-attribute='href message.key addFriendLinkFormatter' data-set-text='html message.key addFriendTextFormatter'></a></div>
</div>
</div>
<!-- <div class='messageStatus' data-set-attribute='id message.key messageStatusIDFormatter'></div>-->
</div>
</div>
<section>
</body>
</html>
\ No newline at end of file
......@@ -2,68 +2,68 @@
body
{
font-family: "Avenir Next";
padding-left:24px;
padding-right: 24px;
font-family: "Avenir Next";
padding-left:24px;
padding-right: 24px;
}
h1
{
font-weight: 400;
color: #333;
font-size: 36px;
width: 100%;
border-bottom: 2px solid #333;
/* to bring it in line w webkit margin in Cocoa */
margin-top: 0.67em;
margin-bottom: 0.67em;
font-weight: 400;
color: #333;
font-size: 36px;
width: 100%;
border-bottom: 2px solid #333;
/* to bring it in line w webkit margin in Cocoa */
margin-top: 0.67em;
margin-bottom: 0.67em;
}
.message
{
/* border-radius: 12px; */
/* background-color: #f0f0f0; */
border-bottom: 1px solid #eee;
padding: 6px;
margin-bottom: 6px;
/* border-radius: 12px; */
/* background-color: #f0f0f0; */
border-bottom: 1px solid #eee;
padding: 6px;
margin-bottom: 6px;
}
img
{
/* Make photos break the flow */
display:block;
/* Make photos break the flow */
display:block;
/* Limit the size of photos so that they don’t overwhelm the display. */
max-width:100%;
/* Limit the size of photos so that they don’t overwhelm the display. */
max-width:100%;
}
.timestamp
{
font-size:10px;
color: #ccc;
text-align: center;
font-size:10px;
color: #ccc;
text-align: center;
}
.bodyText, .meta
{
max-width: 500px;
margin-left: 96px;
max-width: 500px;
margin-left: 96px;
}
.image-and-body
{
width: 100%;
break: both;
overflow: hidden;
margin-bottom: 6px;
width: 100%;
break: both;
overflow: hidden;
margin-bottom: 6px;
}
.profileImage
{
width: 56px;
border-radius: 28px;
float: left;
margin-right: 36px;
width: 56px;
border-radius: 28px;
float: left;
margin-right: 36px;
}
.meta
......@@ -85,3 +85,8 @@ img
display:inline;
vertical-align: middle;
}
#notice
{
max-width: 520px;
}
......@@ -33,7 +33,7 @@ window.addEventListener('load', function(){
// TODO: Do not hard code this URL.
// TODO: Fix Set injectData so we don’t have to use this metadata injection workaround.
superagent
.get('http://127.0.0.1:42003/posts-after/'+newestPostID+'/allfriends')
.get('http://127.0.0.1:42003/timeline/posts-after/'+newestPostID+'/allfriends')
.end(function(error, posts) {
//
// Optimisation: clone the repeater seed node and only apply the set
......
......@@ -23,7 +23,7 @@ window.addEventListener('load', function(){
// TODO: Do not hard code this URL.
// TODO: Fix Set injectData so we don’t have to use this metadata injection workaround.
superagent
.get('http://127.0.0.1/posts-after/'+newestPostID+'/'+person)
.get('http://127.0.0.1:42003/timeline/posts-after/'+newestPostID+'/'+person)
.end(function(error, posts) {
//
// Optimisation: clone the repeater seed node and only apply the set
......
......@@ -19,7 +19,7 @@ window.addEventListener('load', function(){
// TODO: Do not hard code this URL.
// TODO: Fix Set injectData so we don’t have to use this metadata injection workaround.
superagent
.get('http://127.0.0.1:42003/posts-after/'+newestPostID+'/public')
.get('http://127.0.0.1:42003/timeline/posts-after/'+newestPostID+'/public')
.end(function(error, posts) {
//
// Optimisation: clone the repeater seed node and only apply the set
......
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