mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-12-25 12:08:06 +09:00
24 lines
514 B
JavaScript
24 lines
514 B
JavaScript
|
const riot = require('riot');
|
||
|
|
||
|
module.exports = me => {
|
||
|
if (me) {
|
||
|
require('./scripts/stream.ls')(me);
|
||
|
}
|
||
|
|
||
|
require('./scripts/ui.ls');
|
||
|
|
||
|
riot.mixin('open-post-form', {
|
||
|
openPostForm: opts => {
|
||
|
const app = document.getElementById('app');
|
||
|
app.style.display = 'none';
|
||
|
const form = riot.mount(document.body.appendChild(document.createElement('mk-post-form')), opts)[0];
|
||
|
function recover() {
|
||
|
app.style.display = 'block';
|
||
|
}
|
||
|
form
|
||
|
.on('cancel', recover)
|
||
|
.on('post', recover);
|
||
|
}
|
||
|
});
|
||
|
};
|