mirror of
https://github.com/fenwick67/mastofeed
synced 2025-02-10 00:50:34 +01:00
improve stylesheet, make audio enclosures work, add toot permalink
This commit is contained in:
parent
9ec240eb8b
commit
de53c677a6
@ -113,7 +113,6 @@ function metaForUser(user) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO make function
|
|
||||||
async function itemsForFeed(opts,user,feed) {
|
async function itemsForFeed(opts,user,feed) {
|
||||||
|
|
||||||
var items = feed.orderedItems;
|
var items = feed.orderedItems;
|
||||||
@ -189,9 +188,10 @@ async function itemsForFeed(opts,user,feed) {
|
|||||||
hasCw:item.object.sensitive||false,
|
hasCw:item.object.sensitive||false,
|
||||||
cw:item.object.summary,
|
cw:item.object.summary,
|
||||||
content: item.object&&item.object.content?item.object.content:'',//TODO sanitize then render without entity escapes
|
content: item.object&&item.object.content?item.object.content:'',//TODO sanitize then render without entity escapes
|
||||||
atomHref:item.published?item.published.replace(/\W+/g,''):Math.random().toString().replace('.',''),
|
atomHref:item.published?item.published.replace(/\W+/g,''):Math.random().toString().replace('.',''),// used for IDs
|
||||||
enclosures:enclosures,
|
enclosures:enclosures,
|
||||||
stringDate:item.published?getTimeDisplay(Date.parse(item.published)):'',
|
stringDate:item.published?getTimeDisplay(Date.parse(item.published)):'',
|
||||||
|
permalink:item.object.id?item.object.id:'#',
|
||||||
author:{
|
author:{
|
||||||
uri:op.url,// link to author page
|
uri:op.url,// link to author page
|
||||||
avatar:op.icon&&op.icon.url?op.icon.url:'',
|
avatar:op.icon&&op.icon.url?op.icon.url:'',
|
||||||
@ -202,7 +202,6 @@ async function itemsForFeed(opts,user,feed) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
|
||||||
function getNextPage(opts,user,feed){
|
function getNextPage(opts,user,feed){
|
||||||
//based on feed.next
|
//based on feed.next
|
||||||
// take feed.next, uriencode it, then take user url, then take options.mastofeedUrl
|
// take feed.next, uriencode it, then take user url, then take options.mastofeedUrl
|
||||||
|
@ -73,7 +73,9 @@
|
|||||||
<div class="enclosures">
|
<div class="enclosures">
|
||||||
<% for (var i = 0; i < item.enclosures.length; i ++){ %>
|
<% for (var i = 0; i < item.enclosures.length; i ++){ %>
|
||||||
<% var e = item.enclosures[i] %>
|
<% var e = item.enclosures[i] %>
|
||||||
<% if (e.type.indexOf('video') > -1){ %>
|
<% if (e.type.indexOf('audio') > -1) {%>
|
||||||
|
<audio class="enclosure" controls loop src="<%= e.url %>"/>
|
||||||
|
<% }else if (e.type.indexOf('video') > -1){ %>
|
||||||
<video class="enclosure" controls loop src="<%= e.url %>"/>
|
<video class="enclosure" controls loop src="<%= e.url %>"/>
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
<a target="_top" class="enclosure" href="<%= e.url %>" >
|
<a target="_top" class="enclosure" href="<%= e.url %>" >
|
||||||
@ -87,7 +89,7 @@
|
|||||||
<% } %>
|
<% } %>
|
||||||
</div>
|
</div>
|
||||||
<% } %>
|
<% } %>
|
||||||
<div class="date"><%= item.stringDate %></div>
|
<a class="date" href="<%= item.permalink %>"><%= item.stringDate %></a>
|
||||||
</div>
|
</div>
|
||||||
<% }); %>
|
<% }); %>
|
||||||
<% if (nextPageLink) %>
|
<% if (nextPageLink) %>
|
||||||
|
@ -65,11 +65,17 @@ a * {
|
|||||||
font-size: 0.9rem; }
|
font-size: 0.9rem; }
|
||||||
|
|
||||||
.date {
|
.date {
|
||||||
margin: 1rem 0 0 0; }
|
margin: 1rem 0 0 0;
|
||||||
|
text-decoration: none; }
|
||||||
|
|
||||||
|
.date:hover {
|
||||||
|
text-decoration: underline; }
|
||||||
|
|
||||||
|
.item-title {
|
||||||
|
margin-bottom: 0.7rem; }
|
||||||
|
|
||||||
.author {
|
.author {
|
||||||
display: flex;
|
display: flex; }
|
||||||
margin: 1rem 0; }
|
|
||||||
|
|
||||||
.author-info {
|
.author-info {
|
||||||
margin: 0 1rem;
|
margin: 0 1rem;
|
||||||
@ -220,10 +226,14 @@ body {
|
|||||||
color: #9baec8;
|
color: #9baec8;
|
||||||
font-size: 0.9rem; }
|
font-size: 0.9rem; }
|
||||||
.date {
|
.date {
|
||||||
margin: 1rem 0 0 0; }
|
margin: 1rem 0 0 0;
|
||||||
|
text-decoration: none; }
|
||||||
|
.date:hover {
|
||||||
|
text-decoration: underline; }
|
||||||
|
.item-title {
|
||||||
|
margin-bottom: 0.7rem; }
|
||||||
.author {
|
.author {
|
||||||
display: flex;
|
display: flex; }
|
||||||
margin: 1rem 0; }
|
|
||||||
.author-info {
|
.author-info {
|
||||||
margin: 0 1rem;
|
margin: 0 1rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -65,11 +65,17 @@ a * {
|
|||||||
font-size: 0.9rem; }
|
font-size: 0.9rem; }
|
||||||
|
|
||||||
.date {
|
.date {
|
||||||
margin: 1rem 0 0 0; }
|
margin: 1rem 0 0 0;
|
||||||
|
text-decoration: none; }
|
||||||
|
|
||||||
|
.date:hover {
|
||||||
|
text-decoration: underline; }
|
||||||
|
|
||||||
|
.item-title {
|
||||||
|
margin-bottom: 0.7rem; }
|
||||||
|
|
||||||
.author {
|
.author {
|
||||||
display: flex;
|
display: flex; }
|
||||||
margin: 1rem 0; }
|
|
||||||
|
|
||||||
.author-info {
|
.author-info {
|
||||||
margin: 0 1rem;
|
margin: 0 1rem;
|
||||||
|
@ -65,11 +65,17 @@ a * {
|
|||||||
font-size: 0.9rem; }
|
font-size: 0.9rem; }
|
||||||
|
|
||||||
.date {
|
.date {
|
||||||
margin: 1rem 0 0 0; }
|
margin: 1rem 0 0 0;
|
||||||
|
text-decoration: none; }
|
||||||
|
|
||||||
|
.date:hover {
|
||||||
|
text-decoration: underline; }
|
||||||
|
|
||||||
|
.item-title {
|
||||||
|
margin-bottom: 0.7rem; }
|
||||||
|
|
||||||
.author {
|
.author {
|
||||||
display: flex;
|
display: flex; }
|
||||||
margin: 1rem 0; }
|
|
||||||
|
|
||||||
.author-info {
|
.author-info {
|
||||||
margin: 0 1rem;
|
margin: 0 1rem;
|
||||||
|
@ -88,11 +88,17 @@ a * {
|
|||||||
}
|
}
|
||||||
.date{
|
.date{
|
||||||
margin: 1rem 0 0 0;
|
margin: 1rem 0 0 0;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
.date:hover{
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
.item-title{
|
||||||
|
margin-bottom:0.7rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.author {
|
.author {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin: 1rem 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.author-info {
|
.author-info {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user