mirror of
https://gitlab.com/idotj/mastodon-embed-timeline.git
synced 2025-05-24 08:52:46 +00:00
Update Readme + rename formatDate function
This commit is contained in:
parent
a17b812587
commit
8de51e853f
28
README.md
28
README.md
@ -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
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user