Update Readme + rename formatDate function

This commit is contained in:
idotj 2021-05-23 17:46:28 +02:00
parent a17b812587
commit 8de51e853f
2 changed files with 28 additions and 4 deletions

View File

@ -1,14 +1,38 @@
# Mastodon embed timeline # Mastodon embed timeline
Embed a mastodon feed timeine in your page, with just html, css and js. Embed a mastodon feed timeine in your page, only with a css and js file.
Working version running at: Working version running at:
https://www.idotj.com https://www.idotj.com
## User guide ## User guide
Just copy both files (.css and .js) in your project
```
<link rel="stylesheet" href="mastodon-timeline.css">
```
## Licensing ```
<script src='mastodon-timeline.js'></script>
```
and add the following structure in your html page:
```
<div id="mt-timeline" class="mt-timeline">
<div id="mt-body" class="mt-body">
<div class="loading-spinner"></div>
</div>
</div>
```
## Changing the profile
At the beginning of the JS file *mastodon-timeline.js* replace the following values:
```
instance_uri: '',
account_id: '',
profile_name: '',
```
## Improve me ## Improve me

View File

@ -106,7 +106,7 @@ MastodonApi.prototype.getToots = function () {
+ '</div>'; + '</div>';
// Date // Date
date = formatDate(status_.reblog.created_at); date = this.formatDate(status_.reblog.created_at);
} else { } else {
// STANDARD toot // STANDARD toot
// Toot url // Toot url
@ -129,7 +129,7 @@ MastodonApi.prototype.getToots = function () {
+ '</div>'; + '</div>';
// Date // Date
date = formatDate(status_.created_at); date = this.formatDate(status_.created_at);
} }
// Main content // Main content