2022-05-11 18:35:34 +00:00
|
|
|
<!DOCTYPE html>
|
2018-03-24 18:01:26 +00:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta charset="UTF-8"></meta>
|
2019-08-02 22:33:33 +00:00
|
|
|
<style type="text/css"></style>
|
|
|
|
<base target="_top" /><!-- this element is amazing-->
|
2018-03-24 18:01:26 +00:00
|
|
|
|
2022-02-06 19:14:18 +00:00
|
|
|
<% if (opts.theme && opts.theme.toLowerCase() == 'masto-light'){ %>
|
2022-02-06 22:48:09 +00:00
|
|
|
<link rel="stylesheet" href="/css/masto-light.css"></link>
|
2022-05-11 18:35:34 +00:00
|
|
|
<% } else if (opts.theme && opts.theme.toLowerCase() == 'masto-auto'){ %>
|
2022-02-06 22:48:09 +00:00
|
|
|
<link rel="stylesheet" href="/css/masto-auto.css"></link>
|
|
|
|
<% } else if (opts.theme && opts.theme.toLowerCase() == 'misskey-dark'){ %>
|
|
|
|
<link rel="stylesheet" href="/css/misskey-dark.css"></link>
|
|
|
|
<% } else if (opts.theme && opts.theme.toLowerCase() == 'misskey-light'){ %>
|
|
|
|
<link rel="stylesheet" href="/css/misskey-light.css"></link>
|
|
|
|
<% } else if (opts.theme && opts.theme.toLowerCase() == 'misskey-auto'){ %>
|
|
|
|
<link rel="stylesheet" href="/css/misskey-auto.css"></link>
|
|
|
|
<% } else if (opts.theme && opts.theme.toLowerCase() == 'pleroma'){ %>
|
|
|
|
<link rel="stylesheet" href="/css/pleroma.css"></link>
|
2018-03-24 18:01:26 +00:00
|
|
|
<% } else { %>
|
2022-02-06 22:48:09 +00:00
|
|
|
<link rel="stylesheet" href="/css/masto-dark.css"></link>
|
2018-03-24 18:01:26 +00:00
|
|
|
<% } %>
|
|
|
|
|
|
|
|
<% if (opts.size){ %>
|
|
|
|
<style type="text/css">
|
|
|
|
html,body{
|
|
|
|
font-size: <%= opts.size.toString().slice(0,4) %>%;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
<% } %>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<% if (opts.header !== false){ %>
|
|
|
|
<div class="meta">
|
|
|
|
|
|
|
|
<div class="header" style="<%= meta.headerImage?`background-image:url(${meta.headerImage})`:'' %>">
|
|
|
|
<a class="header-left" target="_top" href="<%= meta.link %>">
|
|
|
|
<% if (meta.avatar){ %>
|
|
|
|
<img class="avatar circular" src="<%= meta.avatar %>"></img>
|
|
|
|
<% } %>
|
|
|
|
</a>
|
|
|
|
<div class="description header-right">
|
2019-08-02 15:57:13 +00:00
|
|
|
<a class="header-title" target="_top" href="<%= meta.link %>">
|
2018-03-24 18:01:26 +00:00
|
|
|
<%= meta.title %>
|
|
|
|
</a>
|
2019-08-02 15:57:13 +00:00
|
|
|
<br><br>
|
2019-07-31 18:48:51 +00:00
|
|
|
<%- meta.description %>
|
2018-03-24 18:01:26 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% } %>
|
2018-09-09 21:19:04 +00:00
|
|
|
|
2018-03-24 18:01:26 +00:00
|
|
|
<div class="container">
|
|
|
|
|
2022-02-07 00:46:21 +00:00
|
|
|
<% let filtered = items.filter(function(item){return !((item.isBoost && !opts.boosts) || (item.isReply && !opts.replies)) })%>
|
2018-03-24 18:01:26 +00:00
|
|
|
<% filtered.forEach(function(item){ %>
|
|
|
|
<div class="item">
|
|
|
|
<% if (item.isBoost) { %>
|
|
|
|
<div class="item-title"> <%- item.title %> </div>
|
|
|
|
<% } %>
|
2018-03-24 23:33:22 +00:00
|
|
|
<div class="author">
|
|
|
|
<a target="_top" class="avatar" href="<%- item.author.uri %>">
|
|
|
|
<img class="avatar" src="<%- item.author.avatar %>"/>
|
|
|
|
</a>
|
|
|
|
<div class="author-info">
|
|
|
|
<a target="_top" class="author-displayname" href="<%- item.author.uri %>"> <%= item.author.displayName %> </a>
|
|
|
|
<div class="author-fullname"> <%= item.author.fullName %> </div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-09-29 22:29:17 +00:00
|
|
|
<% if (item.hasCw){ %>
|
2022-02-07 00:46:21 +00:00
|
|
|
<% let cwId = (item.cw+item.atomHref).replace(/\W+/g,'') %>
|
2018-09-29 22:29:17 +00:00
|
|
|
<span class="cw"><%- item.cw %></span>
|
|
|
|
<input type="checkbox" class="showmore" id="<%- cwId %>">
|
|
|
|
<label class="button" for="<%- cwId %>">Show</label>
|
|
|
|
<% } %>
|
2019-03-02 19:48:47 +00:00
|
|
|
|
2018-03-24 23:33:22 +00:00
|
|
|
<div class="item-content">
|
|
|
|
<%- item.content %>
|
|
|
|
</div>
|
2018-09-29 22:29:17 +00:00
|
|
|
|
2019-03-02 19:48:47 +00:00
|
|
|
<% if (item.enclosures.length > 0){ %>
|
|
|
|
<div class="enclosures">
|
2022-02-07 00:46:21 +00:00
|
|
|
<% for (let i = 0; i < item.enclosures.length; i ++){ %>
|
|
|
|
<% let e = item.enclosures[i] %>
|
2019-11-08 15:54:39 +00:00
|
|
|
<% if (e.type.indexOf('audio') > -1) {%>
|
|
|
|
<audio class="enclosure" controls loop src="<%= e.url %>"/>
|
|
|
|
<% }else if (e.type.indexOf('video') > -1){ %>
|
2019-03-02 19:48:47 +00:00
|
|
|
<video class="enclosure" controls loop src="<%= e.url %>"/>
|
|
|
|
<% } else { %>
|
|
|
|
<a target="_top" class="enclosure" href="<%= e.url %>" >
|
|
|
|
<% if (e.type.indexOf('image') > -1){ %>
|
2019-07-31 18:52:17 +00:00
|
|
|
<img src="<%= e.url %>" alt="<%= e.name %>" title="<%= e.name %>"/>
|
2019-03-02 19:48:47 +00:00
|
|
|
<% } else { %>
|
|
|
|
<%= e.url %>
|
|
|
|
<% } %>
|
|
|
|
</a>
|
|
|
|
<% } %>
|
|
|
|
<% } %>
|
|
|
|
</div>
|
|
|
|
<% } %>
|
2019-11-08 15:54:39 +00:00
|
|
|
<a class="date" href="<%= item.permalink %>"><%= item.stringDate %></a>
|
2018-03-24 18:01:26 +00:00
|
|
|
</div>
|
|
|
|
<% }); %>
|
2020-01-22 22:54:48 +00:00
|
|
|
<% if (nextPageLink){ %>
|
2019-12-20 00:19:32 +00:00
|
|
|
<div class="item hidden">
|
|
|
|
<a class="hacky_link" href="<%- nextPageLink %>">More</a>
|
2019-11-22 15:46:46 +00:00
|
|
|
</div>
|
2020-01-22 22:54:48 +00:00
|
|
|
<% } %>
|
2019-12-20 00:19:32 +00:00
|
|
|
</div> <!-- end item container -->
|
2020-01-22 22:54:48 +00:00
|
|
|
<% if (nextPageLink){ %>
|
2019-12-20 00:19:32 +00:00
|
|
|
<div class="pagination">
|
|
|
|
<a class="button" href="<%- nextPageLink %>">Load More</a>
|
|
|
|
</div>
|
2020-01-22 22:54:48 +00:00
|
|
|
<% } %>
|
2018-09-09 21:19:04 +00:00
|
|
|
|
|
|
|
<% if ( isIndex ){ %>
|
2022-05-11 18:35:34 +00:00
|
|
|
<script src="/lib/infinite-scroll.pkgd.min.js"></script>
|
2018-09-09 21:19:04 +00:00
|
|
|
<script type="text/javascript">
|
|
|
|
|
2022-02-07 00:46:21 +00:00
|
|
|
let lastPageLoaded = null;
|
|
|
|
let infScroll = new InfiniteScroll( '.container', {
|
2018-09-09 21:19:04 +00:00
|
|
|
// options
|
|
|
|
hideNav:'.pagination',
|
|
|
|
append: '.item',
|
|
|
|
history:false,
|
|
|
|
prefill:true,
|
|
|
|
path: function(){
|
|
|
|
// need to query this DOM my damn self
|
2022-02-07 00:46:21 +00:00
|
|
|
let pageLinks = document.querySelectorAll('.hacky_link');
|
2018-09-09 21:19:04 +00:00
|
|
|
if (!pageLinks || pageLinks.length == 0){
|
|
|
|
console.log ('next page link could not be found');
|
|
|
|
return false;
|
|
|
|
}else{
|
2022-02-07 00:46:21 +00:00
|
|
|
let finalLink = pageLinks[pageLinks.length-1].href;
|
2018-09-09 21:19:04 +00:00
|
|
|
// make sure we don't load the same page twice
|
2020-01-22 22:50:49 +00:00
|
|
|
if (!finalLink || finalLink == window.location.href || finalLink == lastPageLoaded){
|
2018-09-09 21:19:04 +00:00
|
|
|
console.log('this was the last page');
|
|
|
|
return false;
|
|
|
|
}else{
|
|
|
|
return finalLink;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<% } %>
|
2018-03-24 18:01:26 +00:00
|
|
|
</body>
|
|
|
|
|
|
|
|
</html>
|