Commit cd6ed456 authored by ty kayn's avatar ty kayn

display config vars

parent b9a34c87
......@@ -21,26 +21,29 @@ class Conversion {
}
filterToots(toots, options) {
let minchartoots;
let filteredToots = toots;
if(options.showMostRecentTootsOnTop){
filteredToots = filteredToots.reverse();
}
if (options.filterBiggerTottsBeforeSlicing) {
minchartoots = toots.filter(item => {
filteredToots = filteredToots.filter(item => {
return item['object'].content && item['object'].content.length > options.min_length;
});
minchartoots = minchartoots.slice(0, options.max_toots);
filteredToots = filteredToots.slice(0, options.max_toots);
} else {
const slice = toots.slice(0, options.max_toots);
minchartoots = slice.filter(item => {
filteredToots = slice.filter(item => {
return item['object'].content && item['object'].content.length > options.min_length;
});
}
minchartoots.forEach(toot => {
filteredToots.forEach(toot => {
toot = this.findMediaUrl(toot);
toot = this.removeLastChars(toot);
return toot;
});
return minchartoots;
return filteredToots;
}
//
......
......@@ -15,6 +15,7 @@ const max_toots = 10; // filter only long toots
const filterBiggerTottsBeforeSlicing = false; // filter only long toots
const filterOnlyHavingMedias = true; // filter only toots having medias
const writeStatsJson = false; // filter only toots having medias
const showMostRecentTootsOnTop = true; // filter only toots having medias
const TemplateVars = {
pageTitle : 'Mastodon export converter to HTML',
likes : jsonParsedLikes,
......@@ -26,6 +27,7 @@ const TemplateVars = {
filterOnlyHavingMedias,
filterBiggerTottsBeforeSlicing,
writeStatsJson,
showMostRecentTootsOnTop
};
const masto_converter = require('./conversion');
......
{
"scripts": {
"start": "node main.js"
"start": "nodemon main.js"
},
"dependencies": {
"bulma": "^0.9.0",
......
......@@ -33,7 +33,7 @@ a {
}
.media-media-displayed {
min-height: 500px;
min-height: 300px;
margin-right: 1em;
}
......
h2 #{outbox.length} of Messages #{outboxTotalLength} in your outbox.First #{max_toots} toots, filtered by a minimal length of #{min_length} characters of content.
h2 Configuration of this page
div.config
p Showing #{outbox.length} of Messages #{outboxTotalLength} in your outbox.First #{max_toots} toots, filtered by a minimal length of #{min_length} characters of content.
p filter bigger toots: #{filterBiggerTottsBeforeSlicing}
p write statistics in output folder #{writeStatsJson}
p showing only toots with medias attached to them #{filterOnlyHavingMedias}
p show most recent toot first #{showMostRecentTootsOnTop}
......@@ -13,4 +13,4 @@ div.media-gallery
if(media.mediaType.search('image') != -1)
figure.media-media-displayed.media-image
a(href=media.href)
img(src=media.href,alt=media.href)
img(src=media.href,alt=media.href)
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