wip
This commit is contained in:
@ -62,7 +62,7 @@
|
||||
};
|
||||
|
||||
this.ok = () => {
|
||||
this.trigger('selected', this.refs.browser.folder);
|
||||
this.trigger('selected', this.$refs.browser.folder);
|
||||
this.unmount();
|
||||
};
|
||||
</script>
|
||||
|
@ -63,13 +63,13 @@
|
||||
this.files = [];
|
||||
|
||||
this.on('mount', () => {
|
||||
this.refs.browser.on('change-selection', files => {
|
||||
this.$refs.browser.on('change-selection', files => {
|
||||
this.update({
|
||||
files: files
|
||||
});
|
||||
});
|
||||
|
||||
this.refs.browser.on('selected', file => {
|
||||
this.$refs.browser.on('selected', file => {
|
||||
this.trigger('selected', file);
|
||||
this.unmount();
|
||||
});
|
||||
|
@ -209,7 +209,7 @@
|
||||
}
|
||||
|
||||
if (this.opts.isNaked) {
|
||||
this.refs.nav.style.top = `${this.opts.top}px`;
|
||||
this.$refs.nav.style.top = `${this.opts.top}px`;
|
||||
}
|
||||
});
|
||||
|
||||
@ -517,7 +517,7 @@
|
||||
};
|
||||
|
||||
this.selectLocalFile = () => {
|
||||
this.refs.file.click();
|
||||
this.$refs.file.click();
|
||||
};
|
||||
|
||||
this.createFolder = () => {
|
||||
@ -574,7 +574,7 @@
|
||||
};
|
||||
|
||||
this.changeLocalFile = () => {
|
||||
Array.from(this.refs.file.files).forEach(f => this.refs.uploader.upload(f, this.folder));
|
||||
Array.from(this.$refs.file.files).forEach(f => this.$refs.uploader.upload(f, this.folder));
|
||||
};
|
||||
</script>
|
||||
</mk-drive>
|
||||
|
@ -243,7 +243,7 @@
|
||||
|
||||
this.onImageLoaded = () => {
|
||||
const self = this;
|
||||
EXIF.getData(this.refs.img, function() {
|
||||
EXIF.getData(this.$refs.img, function() {
|
||||
const allMetaData = EXIF.getAllTags(this);
|
||||
self.update({
|
||||
exif: allMetaData
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
this.fetch = () => {
|
||||
this.api('posts/timeline').then(posts => {
|
||||
this.refs.timeline.setPosts(posts);
|
||||
this.$refs.timeline.setPosts(posts);
|
||||
});
|
||||
};
|
||||
|
||||
@ -47,7 +47,7 @@
|
||||
|
||||
this.more = () => {
|
||||
return this.api('posts/timeline', {
|
||||
until_id: this.refs.timeline.tail().id
|
||||
until_id: this.$refs.timeline.tail().id
|
||||
});
|
||||
};
|
||||
|
||||
@ -55,7 +55,7 @@
|
||||
this.update({
|
||||
isEmpty: false
|
||||
});
|
||||
this.refs.timeline.addPost(post);
|
||||
this.$refs.timeline.addPost(post);
|
||||
};
|
||||
|
||||
this.onStreamFollow = () => {
|
||||
|
@ -15,7 +15,7 @@
|
||||
</style>
|
||||
<script>
|
||||
this.on('mount', () => {
|
||||
this.refs.tl.on('loaded', () => {
|
||||
this.$refs.tl.on('loaded', () => {
|
||||
this.trigger('loaded');
|
||||
});
|
||||
});
|
||||
|
@ -15,22 +15,22 @@
|
||||
ui.trigger('title', '%fa:cloud%%i18n:mobile.tags.mk-drive-page.drive%');
|
||||
|
||||
ui.trigger('func', () => {
|
||||
this.refs.ui.refs.browser.openContextMenu();
|
||||
this.$refs.ui.refs.browser.openContextMenu();
|
||||
}, '%fa:ellipsis-h%');
|
||||
|
||||
this.refs.ui.refs.browser.on('begin-fetch', () => {
|
||||
this.$refs.ui.refs.browser.on('begin-fetch', () => {
|
||||
Progress.start();
|
||||
});
|
||||
|
||||
this.refs.ui.refs.browser.on('fetched-mid', () => {
|
||||
this.$refs.ui.refs.browser.on('fetched-mid', () => {
|
||||
Progress.set(0.5);
|
||||
});
|
||||
|
||||
this.refs.ui.refs.browser.on('fetched', () => {
|
||||
this.$refs.ui.refs.browser.on('fetched', () => {
|
||||
Progress.done();
|
||||
});
|
||||
|
||||
this.refs.ui.refs.browser.on('move-root', () => {
|
||||
this.$refs.ui.refs.browser.on('move-root', () => {
|
||||
const title = 'Misskey Drive';
|
||||
|
||||
// Rewrite URL
|
||||
@ -40,7 +40,7 @@
|
||||
ui.trigger('title', '%fa:cloud%%i18n:mobile.tags.mk-drive-page.drive%');
|
||||
});
|
||||
|
||||
this.refs.ui.refs.browser.on('open-folder', (folder, silent) => {
|
||||
this.$refs.ui.refs.browser.on('open-folder', (folder, silent) => {
|
||||
const title = folder.name + ' | Misskey Drive';
|
||||
|
||||
if (!silent) {
|
||||
@ -53,7 +53,7 @@
|
||||
ui.trigger('title', '%fa:R folder-open%' + folder.name);
|
||||
});
|
||||
|
||||
this.refs.ui.refs.browser.on('open-file', (file, silent) => {
|
||||
this.$refs.ui.refs.browser.on('open-file', (file, silent) => {
|
||||
const title = file.name + ' | Misskey Drive';
|
||||
|
||||
if (!silent) {
|
||||
|
@ -34,7 +34,7 @@
|
||||
this.connection.on('post', this.onStreamPost);
|
||||
document.addEventListener('visibilitychange', this.onVisibilitychange, false);
|
||||
|
||||
this.refs.ui.refs.home.on('loaded', () => {
|
||||
this.$refs.ui.refs.home.on('loaded', () => {
|
||||
Progress.done();
|
||||
});
|
||||
});
|
||||
|
@ -15,7 +15,7 @@
|
||||
document.title = 'Misskey | %i18n:mobile.tags.mk-messaging-page.message%';
|
||||
ui.trigger('title', '%fa:R comments%%i18n:mobile.tags.mk-messaging-page.message%');
|
||||
|
||||
this.refs.ui.refs.index.on('navigate-user', user => {
|
||||
this.$refs.ui.refs.index.on('navigate-user', user => {
|
||||
this.page('/i/messaging/' + user.username);
|
||||
});
|
||||
});
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
Progress.start();
|
||||
|
||||
this.refs.ui.refs.notifications.on('fetched', () => {
|
||||
this.$refs.ui.refs.notifications.on('fetched', () => {
|
||||
Progress.done();
|
||||
});
|
||||
});
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
Progress.start();
|
||||
|
||||
this.refs.ui.refs.search.on('loaded', () => {
|
||||
this.$refs.ui.refs.search.on('loaded', () => {
|
||||
Progress.done();
|
||||
});
|
||||
});
|
||||
|
@ -59,12 +59,12 @@
|
||||
this.on('mount', () => {
|
||||
document.documentElement.style.background = '#fff';
|
||||
|
||||
this.refs.browser.on('selected', file => {
|
||||
this.$refs.browser.on('selected', file => {
|
||||
this.files = [file];
|
||||
this.ok();
|
||||
});
|
||||
|
||||
this.refs.browser.on('change-selection', files => {
|
||||
this.$refs.browser.on('change-selection', files => {
|
||||
this.update({
|
||||
files: files
|
||||
});
|
||||
@ -72,7 +72,7 @@
|
||||
});
|
||||
|
||||
this.upload = () => {
|
||||
this.refs.browser.selectLocalFile();
|
||||
this.$refs.browser.selectLocalFile();
|
||||
};
|
||||
|
||||
this.close = () => {
|
||||
|
@ -231,10 +231,10 @@
|
||||
});
|
||||
|
||||
this.api('i/update', {
|
||||
name: this.refs.name.value,
|
||||
location: this.refs.location.value || null,
|
||||
description: this.refs.description.value || null,
|
||||
birthday: this.refs.birthday.value || null
|
||||
name: this.$refs.name.value,
|
||||
location: this.$refs.location.value || null,
|
||||
description: this.$refs.description.value || null,
|
||||
birthday: this.$refs.birthday.value || null
|
||||
}).then(() => {
|
||||
this.update({
|
||||
saving: false
|
||||
|
@ -31,7 +31,7 @@
|
||||
ui.trigger('title', '<img src="' + user.avatar_url + '?thumbnail&size=64">' + '%i18n:mobile.tags.mk-user-followers-page.followers-of%'.replace('{}', user.name));
|
||||
document.documentElement.style.background = '#313a42';
|
||||
|
||||
this.refs.ui.refs.list.on('loaded', () => {
|
||||
this.$refs.ui.refs.list.on('loaded', () => {
|
||||
Progress.done();
|
||||
});
|
||||
});
|
||||
|
@ -31,7 +31,7 @@
|
||||
ui.trigger('title', '<img src="' + user.avatar_url + '?thumbnail&size=64">' + '%i18n:mobile.tags.mk-user-following-page.following-of%'.replace('{}', user.name));
|
||||
document.documentElement.style.background = '#313a42';
|
||||
|
||||
this.refs.ui.refs.list.on('loaded', () => {
|
||||
this.$refs.ui.refs.list.on('loaded', () => {
|
||||
Progress.done();
|
||||
});
|
||||
});
|
||||
|
@ -16,7 +16,7 @@
|
||||
document.documentElement.style.background = '#313a42';
|
||||
Progress.start();
|
||||
|
||||
this.refs.ui.refs.user.on('loaded', user => {
|
||||
this.$refs.ui.refs.user.on('loaded', user => {
|
||||
Progress.done();
|
||||
document.title = user.name + ' | Misskey';
|
||||
// TODO: ユーザー名をエスケープ
|
||||
|
@ -273,9 +273,9 @@
|
||||
if (this.p.text) {
|
||||
const tokens = this.p.ast;
|
||||
|
||||
this.refs.text.innerHTML = compile(tokens);
|
||||
this.$refs.text.innerHTML = compile(tokens);
|
||||
|
||||
Array.from(this.refs.text.children).forEach(e => {
|
||||
Array.from(this.$refs.text.children).forEach(e => {
|
||||
if (e.tagName == 'MK-URL') riot.mount(e);
|
||||
});
|
||||
|
||||
@ -283,7 +283,7 @@
|
||||
tokens
|
||||
.filter(t => (t.type == 'url' || t.type == 'link') && !t.silent)
|
||||
.map(t => {
|
||||
riot.mount(this.refs.text.appendChild(document.createElement('mk-url-preview')), {
|
||||
riot.mount(this.$refs.text.appendChild(document.createElement('mk-url-preview')), {
|
||||
url: t.url
|
||||
});
|
||||
});
|
||||
@ -319,7 +319,7 @@
|
||||
|
||||
this.react = () => {
|
||||
riot.mount(document.body.appendChild(document.createElement('mk-reaction-picker')), {
|
||||
source: this.refs.reactButton,
|
||||
source: this.$refs.reactButton,
|
||||
post: this.p,
|
||||
compact: true
|
||||
});
|
||||
@ -327,7 +327,7 @@
|
||||
|
||||
this.menu = () => {
|
||||
riot.mount(document.body.appendChild(document.createElement('mk-post-menu')), {
|
||||
source: this.refs.menuButton,
|
||||
source: this.$refs.menuButton,
|
||||
post: this.p,
|
||||
compact: true
|
||||
});
|
||||
|
@ -156,17 +156,17 @@
|
||||
this.poll = false;
|
||||
|
||||
this.on('mount', () => {
|
||||
this.refs.uploader.on('uploaded', file => {
|
||||
this.$refs.uploader.on('uploaded', file => {
|
||||
this.addFile(file);
|
||||
});
|
||||
|
||||
this.refs.uploader.on('change-uploads', uploads => {
|
||||
this.$refs.uploader.on('change-uploads', uploads => {
|
||||
this.trigger('change-uploading-files', uploads);
|
||||
});
|
||||
|
||||
this.refs.text.focus();
|
||||
this.$refs.text.focus();
|
||||
|
||||
new Sortable(this.refs.attaches, {
|
||||
new Sortable(this.$refs.attaches, {
|
||||
animation: 150
|
||||
});
|
||||
});
|
||||
@ -184,7 +184,7 @@
|
||||
};
|
||||
|
||||
this.selectFile = () => {
|
||||
this.refs.file.click();
|
||||
this.$refs.file.click();
|
||||
};
|
||||
|
||||
this.selectFileFromDrive = () => {
|
||||
@ -197,11 +197,11 @@
|
||||
};
|
||||
|
||||
this.changeFile = () => {
|
||||
Array.from(this.refs.file.files).forEach(this.upload);
|
||||
Array.from(this.$refs.file.files).forEach(this.upload);
|
||||
};
|
||||
|
||||
this.upload = file => {
|
||||
this.refs.uploader.upload(file);
|
||||
this.$refs.uploader.upload(file);
|
||||
};
|
||||
|
||||
this.addFile = file => {
|
||||
@ -241,7 +241,7 @@
|
||||
const files = [];
|
||||
|
||||
if (this.files.length > 0) {
|
||||
Array.from(this.refs.attaches.children).forEach(el => {
|
||||
Array.from(this.$refs.attaches.children).forEach(el => {
|
||||
const id = el.getAttribute('data-id');
|
||||
const file = this.files.find(f => f.id == id);
|
||||
files.push(file);
|
||||
@ -249,10 +249,10 @@
|
||||
}
|
||||
|
||||
this.api('posts/create', {
|
||||
text: this.refs.text.value == '' ? undefined : this.refs.text.value,
|
||||
text: this.$refs.text.value == '' ? undefined : this.$refs.text.value,
|
||||
media_ids: this.files.length > 0 ? files.map(f => f.id) : undefined,
|
||||
reply_id: opts.reply ? opts.reply.id : undefined,
|
||||
poll: this.poll ? this.refs.poll.get() : undefined
|
||||
poll: this.poll ? this.$refs.poll.get() : undefined
|
||||
}).then(data => {
|
||||
this.trigger('post');
|
||||
this.unmount();
|
||||
@ -269,7 +269,7 @@
|
||||
};
|
||||
|
||||
this.kao = () => {
|
||||
this.refs.text.value += getKao();
|
||||
this.$refs.text.value += getKao();
|
||||
};
|
||||
</script>
|
||||
</mk-post-form>
|
||||
|
@ -8,7 +8,7 @@
|
||||
this.query = this.opts.query;
|
||||
|
||||
this.on('mount', () => {
|
||||
this.refs.posts.on('loaded', () => {
|
||||
this.$refs.posts.on('loaded', () => {
|
||||
this.trigger('loaded');
|
||||
});
|
||||
});
|
||||
|
@ -35,9 +35,9 @@
|
||||
this.on('mount', () => {
|
||||
if (this.post.text) {
|
||||
const tokens = this.post.ast;
|
||||
this.refs.text.innerHTML = compile(tokens, false);
|
||||
this.$refs.text.innerHTML = compile(tokens, false);
|
||||
|
||||
Array.from(this.refs.text.children).forEach(e => {
|
||||
Array.from(this.$refs.text.children).forEach(e => {
|
||||
if (e.tagName == 'MK-URL') riot.mount(e);
|
||||
});
|
||||
}
|
||||
|
@ -482,10 +482,10 @@
|
||||
this.refresh = post => {
|
||||
this.set(post);
|
||||
this.update();
|
||||
if (this.refs.reactionsViewer) this.refs.reactionsViewer.update({
|
||||
if (this.$refs.reactionsViewer) this.$refs.reactionsViewer.update({
|
||||
post
|
||||
});
|
||||
if (this.refs.pollViewer) this.refs.pollViewer.init(post);
|
||||
if (this.$refs.pollViewer) this.$refs.pollViewer.init(post);
|
||||
};
|
||||
|
||||
this.onStreamPostUpdated = data => {
|
||||
@ -529,9 +529,9 @@
|
||||
if (this.p.text) {
|
||||
const tokens = this.p.ast;
|
||||
|
||||
this.refs.text.innerHTML = this.refs.text.innerHTML.replace('<p class="dummy"></p>', compile(tokens));
|
||||
this.$refs.text.innerHTML = this.$refs.text.innerHTML.replace('<p class="dummy"></p>', compile(tokens));
|
||||
|
||||
Array.from(this.refs.text.children).forEach(e => {
|
||||
Array.from(this.$refs.text.children).forEach(e => {
|
||||
if (e.tagName == 'MK-URL') riot.mount(e);
|
||||
});
|
||||
|
||||
@ -539,7 +539,7 @@
|
||||
tokens
|
||||
.filter(t => (t.type == 'url' || t.type == 'link') && !t.silent)
|
||||
.map(t => {
|
||||
riot.mount(this.refs.text.appendChild(document.createElement('mk-url-preview')), {
|
||||
riot.mount(this.$refs.text.appendChild(document.createElement('mk-url-preview')), {
|
||||
url: t.url
|
||||
});
|
||||
});
|
||||
@ -569,7 +569,7 @@
|
||||
|
||||
this.react = () => {
|
||||
riot.mount(document.body.appendChild(document.createElement('mk-reaction-picker')), {
|
||||
source: this.refs.reactButton,
|
||||
source: this.$refs.reactButton,
|
||||
post: this.p,
|
||||
compact: true
|
||||
});
|
||||
@ -577,7 +577,7 @@
|
||||
|
||||
this.menu = () => {
|
||||
riot.mount(document.body.appendChild(document.createElement('mk-post-menu')), {
|
||||
source: this.refs.menuButton,
|
||||
source: this.$refs.menuButton,
|
||||
post: this.p,
|
||||
compact: true
|
||||
});
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
this.toggleDrawer = () => {
|
||||
this.isDrawerOpening = !this.isDrawerOpening;
|
||||
this.refs.nav.root.style.display = this.isDrawerOpening ? 'block' : 'none';
|
||||
this.$refs.nav.root.style.display = this.isDrawerOpening ? 'block' : 'none';
|
||||
};
|
||||
|
||||
this.onStreamNotification = notification => {
|
||||
@ -209,7 +209,7 @@
|
||||
};
|
||||
|
||||
this.setTitle = title => {
|
||||
this.refs.title.innerHTML = title;
|
||||
this.$refs.title.innerHTML = title;
|
||||
};
|
||||
|
||||
this.setFunc = (fn, icon) => {
|
||||
|
@ -20,7 +20,7 @@
|
||||
};
|
||||
|
||||
this.on('mount', () => {
|
||||
this.refs.list.on('loaded', () => {
|
||||
this.$refs.list.on('loaded', () => {
|
||||
this.trigger('loaded');
|
||||
});
|
||||
});
|
||||
|
@ -20,7 +20,7 @@
|
||||
};
|
||||
|
||||
this.on('mount', () => {
|
||||
this.refs.list.on('loaded', () => {
|
||||
this.$refs.list.on('loaded', () => {
|
||||
this.trigger('loaded');
|
||||
});
|
||||
});
|
||||
|
@ -26,7 +26,7 @@
|
||||
return this.api('users/posts', {
|
||||
user_id: this.user.id,
|
||||
with_media: this.withMedia,
|
||||
until_id: this.refs.timeline.tail().id
|
||||
until_id: this.$refs.timeline.tail().id
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user