|
@ -4,9 +4,7 @@ import { delegate } from 'rails-ujs'; |
|
|
import emojify from '../mastodon/emoji'; |
|
|
import emojify from '../mastodon/emoji'; |
|
|
import { getLocale } from '../mastodon/locales'; |
|
|
import { getLocale } from '../mastodon/locales'; |
|
|
import loadPolyfills from '../mastodon/load_polyfills'; |
|
|
import loadPolyfills from '../mastodon/load_polyfills'; |
|
|
import TimelineContainer from '../mastodon/containers/timeline_container'; |
|
|
|
|
|
import React from 'react'; |
|
|
|
|
|
import ReactDOM from 'react-dom'; |
|
|
|
|
|
|
|
|
import ready from '../mastodon/ready'; |
|
|
|
|
|
|
|
|
require.context('../images/', true); |
|
|
require.context('../images/', true); |
|
|
|
|
|
|
|
@ -39,21 +37,10 @@ function loaded() { |
|
|
const datetime = new Date(content.getAttribute('datetime')); |
|
|
const datetime = new Date(content.getAttribute('datetime')); |
|
|
content.textContent = relativeFormat.format(datetime);; |
|
|
content.textContent = relativeFormat.format(datetime);; |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
const mountNode = document.getElementById('mastodon-timeline'); |
|
|
|
|
|
|
|
|
|
|
|
if (mountNode !== null) { |
|
|
|
|
|
const props = JSON.parse(mountNode.getAttribute('data-props')); |
|
|
|
|
|
ReactDOM.render(<TimelineContainer {...props} />, mountNode); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function main() { |
|
|
function main() { |
|
|
if (['interactive', 'complete'].includes(document.readyState)) { |
|
|
|
|
|
loaded(); |
|
|
|
|
|
} else { |
|
|
|
|
|
document.addEventListener('DOMContentLoaded', loaded); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
ready(loaded); |
|
|
|
|
|
|
|
|
delegate(document, '.video-player video', 'click', ({ target }) => { |
|
|
delegate(document, '.video-player video', 'click', ({ target }) => { |
|
|
if (target.paused) { |
|
|
if (target.paused) { |
|
|