mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-05 03:04:50 +01:00
wip
This commit is contained in:
parent
0766a76348
commit
9fd00d1179
51 changed files with 93 additions and 93 deletions
|
@ -112,7 +112,7 @@
|
||||||
this.app = this.session.app;
|
this.app = this.session.app;
|
||||||
|
|
||||||
this.cancel = () => {
|
this.cancel = () => {
|
||||||
this.api('auth/deny', {
|
this.$root.$data.os.api('auth/deny', {
|
||||||
token: this.session.token
|
token: this.session.token
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.$emit('denied');
|
this.$emit('denied');
|
||||||
|
@ -120,7 +120,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
this.accept = () => {
|
this.accept = () => {
|
||||||
this.api('auth/accept', {
|
this.$root.$data.os.api('auth/accept', {
|
||||||
token: this.session.token
|
token: this.session.token
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.$emit('accepted');
|
this.$emit('accepted');
|
||||||
|
|
|
@ -96,7 +96,7 @@
|
||||||
if (!this.SIGNIN) return;
|
if (!this.SIGNIN) return;
|
||||||
|
|
||||||
// Fetch session
|
// Fetch session
|
||||||
this.api('auth/session/show', {
|
this.$root.$data.os.api('auth/session/show', {
|
||||||
token: this.token
|
token: this.token
|
||||||
}).then(session => {
|
}).then(session => {
|
||||||
this.session = session;
|
this.session = session;
|
||||||
|
@ -104,7 +104,7 @@
|
||||||
|
|
||||||
// 既に連携していた場合
|
// 既に連携していた場合
|
||||||
if (this.session.app.is_authorized) {
|
if (this.session.app.is_authorized) {
|
||||||
this.api('auth/accept', {
|
this.$root.$data.os.api('auth/accept', {
|
||||||
token: this.session.token
|
token: this.session.token
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.accepted();
|
this.accepted();
|
||||||
|
|
|
@ -76,7 +76,7 @@
|
||||||
let fetched = false;
|
let fetched = false;
|
||||||
|
|
||||||
// チャンネル概要読み込み
|
// チャンネル概要読み込み
|
||||||
this.api('channels/show', {
|
this.$root.$data.os.api('channels/show', {
|
||||||
channel_id: this.id
|
channel_id: this.id
|
||||||
}).then(channel => {
|
}).then(channel => {
|
||||||
if (fetched) {
|
if (fetched) {
|
||||||
|
@ -95,7 +95,7 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
// 投稿読み込み
|
// 投稿読み込み
|
||||||
this.api('channels/posts', {
|
this.$root.$data.os.api('channels/posts', {
|
||||||
channel_id: this.id
|
channel_id: this.id
|
||||||
}).then(posts => {
|
}).then(posts => {
|
||||||
if (fetched) {
|
if (fetched) {
|
||||||
|
@ -125,7 +125,7 @@
|
||||||
this.posts.unshift(post);
|
this.posts.unshift(post);
|
||||||
this.update();
|
this.update();
|
||||||
|
|
||||||
if (document.hidden && this.SIGNIN && post.user_id !== this.I.id) {
|
if (document.hidden && this.SIGNIN && post.user_id !== this.$root.$data.os.i.id) {
|
||||||
this.unreadCount++;
|
this.unreadCount++;
|
||||||
document.title = `(${this.unreadCount}) ${this.channel.title} | Misskey`;
|
document.title = `(${this.unreadCount}) ${this.channel.title} | Misskey`;
|
||||||
}
|
}
|
||||||
|
@ -139,7 +139,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
this.watch = () => {
|
this.watch = () => {
|
||||||
this.api('channels/watch', {
|
this.$root.$data.os.api('channels/watch', {
|
||||||
channel_id: this.id
|
channel_id: this.id
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.channel.is_watching = true;
|
this.channel.is_watching = true;
|
||||||
|
@ -150,7 +150,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
this.unwatch = () => {
|
this.unwatch = () => {
|
||||||
this.api('channels/unwatch', {
|
this.$root.$data.os.api('channels/unwatch', {
|
||||||
channel_id: this.id
|
channel_id: this.id
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.channel.is_watching = false;
|
this.channel.is_watching = false;
|
||||||
|
@ -323,7 +323,7 @@
|
||||||
? this.files.map(f => f.id)
|
? this.files.map(f => f.id)
|
||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
this.api('posts/create', {
|
this.$root.$data.os.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: files,
|
media_ids: files,
|
||||||
reply_id: this.reply ? this.reply.id : undefined,
|
reply_id: this.reply ? this.reply.id : undefined,
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
this.mixin('api');
|
this.mixin('api');
|
||||||
|
|
||||||
this.on('mount', () => {
|
this.on('mount', () => {
|
||||||
this.api('channels', {
|
this.$root.$data.os.api('channels', {
|
||||||
limit: 100
|
limit: 100
|
||||||
}).then(channels => {
|
}).then(channels => {
|
||||||
this.update({
|
this.update({
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
this.n = () => {
|
this.n = () => {
|
||||||
const title = window.prompt('%i18n:ch.tags.mk-index.channel-title%');
|
const title = window.prompt('%i18n:ch.tags.mk-index.channel-title%');
|
||||||
|
|
||||||
this.api('channels/create', {
|
this.$root.$data.os.api('channels/create', {
|
||||||
title: title
|
title: title
|
||||||
}).then(channel => {
|
}).then(channel => {
|
||||||
location.href = '/' + channel.id;
|
location.href = '/' + channel.id;
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
this.user = this.opts.user;
|
this.user = this.opts.user;
|
||||||
|
|
||||||
this.on('mount', () => {
|
this.on('mount', () => {
|
||||||
this.api('aggregation/users/activity', {
|
this.$root.$data.os.api('aggregation/users/activity', {
|
||||||
user_id: this.user.id
|
user_id: this.user.id
|
||||||
}).then(data => {
|
}).then(data => {
|
||||||
data.forEach(d => d.total = d.posts + d.replies + d.reposts);
|
data.forEach(d => d.total = d.posts + d.replies + d.reposts);
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
this.fetching = true;
|
this.fetching = true;
|
||||||
|
|
||||||
this.on('mount', () => {
|
this.on('mount', () => {
|
||||||
this.api('i/authorized_apps').then(apps => {
|
this.$root.$data.os.api('i/authorized_apps').then(apps => {
|
||||||
this.apps = apps;
|
this.apps = apps;
|
||||||
this.fetching = false;
|
this.fetching = false;
|
||||||
this.update();
|
this.update();
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
this.fetching = true;
|
this.fetching = true;
|
||||||
|
|
||||||
this.on('mount', () => {
|
this.on('mount', () => {
|
||||||
this.api('i/signin_history').then(history => {
|
this.$root.$data.os.api('i/signin_history').then(history => {
|
||||||
this.update({
|
this.update({
|
||||||
fetching: false,
|
fetching: false,
|
||||||
history: history
|
history: history
|
||||||
|
|
|
@ -30,15 +30,15 @@
|
||||||
this.form = null;
|
this.form = null;
|
||||||
|
|
||||||
this.on('mount', () => {
|
this.on('mount', () => {
|
||||||
this.I.on('updated', this.onMeUpdated);
|
this.$root.$data.os.i.on('updated', this.onMeUpdated);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.on('unmount', () => {
|
this.on('unmount', () => {
|
||||||
this.I.off('updated', this.onMeUpdated);
|
this.$root.$data.os.i.off('updated', this.onMeUpdated);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.onMeUpdated = () => {
|
this.onMeUpdated = () => {
|
||||||
if (this.I.twitter) {
|
if (this.$root.$data.os.i.twitter) {
|
||||||
if (this.form) this.form.close();
|
if (this.form) this.form.close();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
},
|
},
|
||||||
vote(id) {
|
vote(id) {
|
||||||
if (this.poll.choices.some(c => c.is_voted)) return;
|
if (this.poll.choices.some(c => c.is_voted)) return;
|
||||||
this.api('posts/polls/vote', {
|
this.$root.$data.os.api('posts/polls/vote', {
|
||||||
post_id: this.post.id,
|
post_id: this.post.id,
|
||||||
choice: id
|
choice: id
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
|
|
@ -97,7 +97,7 @@
|
||||||
el.addEventListener('mousedown', this.mousedown);
|
el.addEventListener('mousedown', this.mousedown);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.api('users/search_by_username', {
|
this.$root.$data.os.api('users/search_by_username', {
|
||||||
query: this.q,
|
query: this.q,
|
||||||
limit: 30
|
limit: 30
|
||||||
}).then(users => {
|
}).then(users => {
|
||||||
|
|
|
@ -126,7 +126,7 @@
|
||||||
this.onclick = () => {
|
this.onclick = () => {
|
||||||
this.wait = true;
|
this.wait = true;
|
||||||
if (this.user.is_following) {
|
if (this.user.is_following) {
|
||||||
this.api('following/delete', {
|
this.$root.$data.os.api('following/delete', {
|
||||||
user_id: this.user.id
|
user_id: this.user.id
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.user.is_following = false;
|
this.user.is_following = false;
|
||||||
|
@ -137,7 +137,7 @@
|
||||||
this.update();
|
this.update();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.api('following/create', {
|
this.$root.$data.os.api('following/create', {
|
||||||
user_id: this.user.id
|
user_id: this.user.id
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.user.is_following = true;
|
this.user.is_following = true;
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
this.$destroy();
|
this.$destroy();
|
||||||
});
|
});
|
||||||
|
|
||||||
this.api('drive').then(info => {
|
this.$root.$data.os.api('drive').then(info => {
|
||||||
this.update({
|
this.update({
|
||||||
usage: info.usage / info.capacity * 100
|
usage: info.usage / info.capacity * 100
|
||||||
});
|
});
|
||||||
|
|
|
@ -62,7 +62,7 @@
|
||||||
this.$refs.ctx.close();
|
this.$refs.ctx.close();
|
||||||
|
|
||||||
inputDialog('%i18n:desktop.tags.mk-drive-browser-file-contextmenu.rename-file%', '%i18n:desktop.tags.mk-drive-browser-file-contextmenu.input-new-file-name%', this.file.name, name => {
|
inputDialog('%i18n:desktop.tags.mk-drive-browser-file-contextmenu.rename-file%', '%i18n:desktop.tags.mk-drive-browser-file-contextmenu.input-new-file-name%', this.file.name, name => {
|
||||||
this.api('drive/files/update', {
|
this.$root.$data.os.api('drive/files/update', {
|
||||||
file_id: this.file.id,
|
file_id: this.file.id,
|
||||||
name: name
|
name: name
|
||||||
})
|
})
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
this.$refs.ctx.close();
|
this.$refs.ctx.close();
|
||||||
|
|
||||||
inputDialog('%i18n:desktop.tags.mk-drive-browser-folder-contextmenu.rename-folder%', '%i18n:desktop.tags.mk-drive-browser-folder-contextmenu.input-new-folder-name%', this.folder.name, name => {
|
inputDialog('%i18n:desktop.tags.mk-drive-browser-folder-contextmenu.rename-folder%', '%i18n:desktop.tags.mk-drive-browser-folder-contextmenu.input-new-folder-name%', this.folder.name, name => {
|
||||||
this.api('drive/folders/update', {
|
this.$root.$data.os.api('drive/folders/update', {
|
||||||
folder_id: this.folder.id,
|
folder_id: this.folder.id,
|
||||||
name: name
|
name: name
|
||||||
});
|
});
|
||||||
|
|
|
@ -74,7 +74,7 @@
|
||||||
fetching: true
|
fetching: true
|
||||||
});
|
});
|
||||||
|
|
||||||
this.api('channels/show', {
|
this.$root.$data.os.api('channels/show', {
|
||||||
channel_id: this.data.channel
|
channel_id: this.data.channel
|
||||||
}).then(channel => {
|
}).then(channel => {
|
||||||
this.update({
|
this.update({
|
||||||
|
@ -159,7 +159,7 @@
|
||||||
channel: channel
|
channel: channel
|
||||||
});
|
});
|
||||||
|
|
||||||
this.api('channels/posts', {
|
this.$root.$data.os.api('channels/posts', {
|
||||||
channel_id: channel.id
|
channel_id: channel.id
|
||||||
}).then(posts => {
|
}).then(posts => {
|
||||||
this.update({
|
this.update({
|
||||||
|
@ -300,7 +300,7 @@
|
||||||
text = text.replace(/^>>([0-9]+) /, '');
|
text = text.replace(/^>>([0-9]+) /, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
this.api('posts/create', {
|
this.$root.$data.os.api('posts/create', {
|
||||||
text: text,
|
text: text,
|
||||||
reply_id: reply ? reply.id : undefined,
|
reply_id: reply ? reply.id : undefined,
|
||||||
channel_id: this.parent.channel.id
|
channel_id: this.parent.channel.id
|
||||||
|
|
|
@ -82,7 +82,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
this.fetch = cb => {
|
this.fetch = cb => {
|
||||||
this.api('posts/mentions', {
|
this.$root.$data.os.api('posts/mentions', {
|
||||||
following: this.mode == 'following'
|
following: this.mode == 'following'
|
||||||
}).then(posts => {
|
}).then(posts => {
|
||||||
this.update({
|
this.update({
|
||||||
|
@ -99,7 +99,7 @@
|
||||||
this.update({
|
this.update({
|
||||||
moreLoading: true
|
moreLoading: true
|
||||||
});
|
});
|
||||||
this.api('posts/mentions', {
|
this.$root.$data.os.api('posts/mentions', {
|
||||||
following: this.mode == 'following',
|
following: this.mode == 'following',
|
||||||
until_id: this.$refs.timeline.tail().id
|
until_id: this.$refs.timeline.tail().id
|
||||||
}).then(posts => {
|
}).then(posts => {
|
||||||
|
|
|
@ -83,7 +83,7 @@
|
||||||
posting: true
|
posting: true
|
||||||
});
|
});
|
||||||
|
|
||||||
this.api('posts/create', {
|
this.$root.$data.os.api('posts/create', {
|
||||||
text: this.$refs.text.value
|
text: this.$refs.text.value
|
||||||
}).then(data => {
|
}).then(data => {
|
||||||
this.clear();
|
this.clear();
|
||||||
|
|
|
@ -94,7 +94,7 @@
|
||||||
loading: true,
|
loading: true,
|
||||||
poll: null
|
poll: null
|
||||||
});
|
});
|
||||||
this.api('posts/polls/recommendation', {
|
this.$root.$data.os.api('posts/polls/recommendation', {
|
||||||
limit: 1,
|
limit: 1,
|
||||||
offset: this.offset
|
offset: this.offset
|
||||||
}).then(posts => {
|
}).then(posts => {
|
||||||
|
|
|
@ -96,7 +96,7 @@
|
||||||
loading: true,
|
loading: true,
|
||||||
post: null
|
post: null
|
||||||
});
|
});
|
||||||
this.api('posts/trend', {
|
this.$root.$data.os.api('posts/trend', {
|
||||||
limit: 1,
|
limit: 1,
|
||||||
offset: this.offset,
|
offset: this.offset,
|
||||||
repost: false,
|
repost: false,
|
||||||
|
|
|
@ -137,7 +137,7 @@
|
||||||
loading: true,
|
loading: true,
|
||||||
users: null
|
users: null
|
||||||
});
|
});
|
||||||
this.api('users/recommendation', {
|
this.$root.$data.os.api('users/recommendation', {
|
||||||
limit: this.limit,
|
limit: this.limit,
|
||||||
offset: this.limit * this.page
|
offset: this.limit * this.page
|
||||||
}).then(users => {
|
}).then(users => {
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
this.onStreamPost = post => {
|
this.onStreamPost = post => {
|
||||||
if (document.hidden && post.user_id != this.I.id) {
|
if (document.hidden && post.user_id != this.$root.$data.os.i.id) {
|
||||||
this.unreadCount++;
|
this.unreadCount++;
|
||||||
document.title = `(${this.unreadCount}) ${getPostSummary(post)}`;
|
document.title = `(${this.unreadCount}) ${getPostSummary(post)}`;
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
document.documentElement.style.background = '#fff';
|
document.documentElement.style.background = '#fff';
|
||||||
|
|
||||||
this.api('users/show', {
|
this.$root.$data.os.api('users/show', {
|
||||||
username: this.opts.user
|
username: this.opts.user
|
||||||
}).then(user => {
|
}).then(user => {
|
||||||
this.update({
|
this.update({
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
this.on('mount', () => {
|
this.on('mount', () => {
|
||||||
Progress.start();
|
Progress.start();
|
||||||
|
|
||||||
this.api('posts/show', {
|
this.$root.$data.os.api('posts/show', {
|
||||||
post_id: this.opts.post
|
post_id: this.opts.post
|
||||||
}).then(post => {
|
}).then(post => {
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
document.addEventListener('keydown', this.onDocumentKeydown);
|
document.addEventListener('keydown', this.onDocumentKeydown);
|
||||||
window.addEventListener('scroll', this.onScroll);
|
window.addEventListener('scroll', this.onScroll);
|
||||||
|
|
||||||
this.api('posts/search', parse(this.query)).then(posts => {
|
this.$root.$data.os.api('posts/search', parse(this.query)).then(posts => {
|
||||||
this.update({
|
this.update({
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
isEmpty: posts.length == 0
|
isEmpty: posts.length == 0
|
||||||
|
@ -77,7 +77,7 @@
|
||||||
this.update({
|
this.update({
|
||||||
moreLoading: true
|
moreLoading: true
|
||||||
});
|
});
|
||||||
return this.api('posts/search', Object.assign({}, parse(this.query), {
|
return this.$root.$data.os.api('posts/search', Object.assign({}, parse(this.query), {
|
||||||
limit: this.limit,
|
limit: this.limit,
|
||||||
offset: this.offset
|
offset: this.offset
|
||||||
})).then(posts => {
|
})).then(posts => {
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
this.user = this.opts.user;
|
this.user = this.opts.user;
|
||||||
|
|
||||||
this.fetch = (iknow, limit, cursor, cb) => {
|
this.fetch = (iknow, limit, cursor, cb) => {
|
||||||
this.api('users/followers', {
|
this.$root.$data.os.api('users/followers', {
|
||||||
user_id: this.user.id,
|
user_id: this.user.id,
|
||||||
iknow: iknow,
|
iknow: iknow,
|
||||||
limit: limit,
|
limit: limit,
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
this.user = this.opts.user;
|
this.user = this.opts.user;
|
||||||
|
|
||||||
this.fetch = (iknow, limit, cursor, cb) => {
|
this.fetch = (iknow, limit, cursor, cb) => {
|
||||||
this.api('users/following', {
|
this.$root.$data.os.api('users/following', {
|
||||||
user_id: this.user.id,
|
user_id: this.user.id,
|
||||||
iknow: iknow,
|
iknow: iknow,
|
||||||
limit: limit,
|
limit: limit,
|
||||||
|
|
|
@ -109,7 +109,7 @@
|
||||||
this.userPromise =
|
this.userPromise =
|
||||||
typeof this.u == 'string' ?
|
typeof this.u == 'string' ?
|
||||||
new Promise((resolve, reject) => {
|
new Promise((resolve, reject) => {
|
||||||
this.api('users/show', {
|
this.$root.$data.os.api('users/show', {
|
||||||
user_id: this.u[0] == '@' ? undefined : this.u,
|
user_id: this.u[0] == '@' ? undefined : this.u,
|
||||||
username: this.u[0] == '@' ? this.u.substr(1) : undefined
|
username: this.u[0] == '@' ? this.u.substr(1) : undefined
|
||||||
}).then(resolve);
|
}).then(resolve);
|
||||||
|
|
|
@ -94,7 +94,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
this.fetch = cb => {
|
this.fetch = cb => {
|
||||||
this.api('users/posts', {
|
this.$root.$data.os.api('users/posts', {
|
||||||
user_id: this.user.id,
|
user_id: this.user.id,
|
||||||
until_date: this.date ? this.date.getTime() : undefined,
|
until_date: this.date ? this.date.getTime() : undefined,
|
||||||
with_replies: this.mode == 'with-replies'
|
with_replies: this.mode == 'with-replies'
|
||||||
|
@ -113,7 +113,7 @@
|
||||||
this.update({
|
this.update({
|
||||||
moreLoading: true
|
moreLoading: true
|
||||||
});
|
});
|
||||||
this.api('users/posts', {
|
this.$root.$data.os.api('users/posts', {
|
||||||
user_id: this.user.id,
|
user_id: this.user.id,
|
||||||
with_replies: this.mode == 'with-replies',
|
with_replies: this.mode == 'with-replies',
|
||||||
until_id: this.$refs.timeline.tail().id
|
until_id: this.$refs.timeline.tail().id
|
||||||
|
|
|
@ -67,7 +67,7 @@
|
||||||
this.initializing = true;
|
this.initializing = true;
|
||||||
|
|
||||||
this.on('mount', () => {
|
this.on('mount', () => {
|
||||||
this.api('aggregation/users/activity', {
|
this.$root.$data.os.api('aggregation/users/activity', {
|
||||||
user_id: this.user.id,
|
user_id: this.user.id,
|
||||||
limit: 20 * 7
|
limit: 20 * 7
|
||||||
}).then(activity => {
|
}).then(activity => {
|
||||||
|
|
|
@ -57,7 +57,7 @@ export default Vue.extend({
|
||||||
onClick() {
|
onClick() {
|
||||||
this.wait = true;
|
this.wait = true;
|
||||||
if (this.user.is_following) {
|
if (this.user.is_following) {
|
||||||
this.api('following/delete', {
|
this.$root.$data.os.api('following/delete', {
|
||||||
user_id: this.user.id
|
user_id: this.user.id
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.user.is_following = false;
|
this.user.is_following = false;
|
||||||
|
@ -67,7 +67,7 @@ export default Vue.extend({
|
||||||
this.wait = false;
|
this.wait = false;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.api('following/create', {
|
this.$root.$data.os.api('following/create', {
|
||||||
user_id: this.user.id
|
user_id: this.user.id
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.user.is_following = true;
|
this.user.is_following = true;
|
||||||
|
|
|
@ -209,7 +209,7 @@
|
||||||
nidState: 'wait'
|
nidState: 'wait'
|
||||||
});
|
});
|
||||||
|
|
||||||
this.api('app/name_id/available', {
|
this.$root.$data.os.api('app/name_id/available', {
|
||||||
name_id: nid
|
name_id: nid
|
||||||
}).then(result => {
|
}).then(result => {
|
||||||
this.update({
|
this.update({
|
||||||
|
@ -235,7 +235,7 @@
|
||||||
|
|
||||||
const locker = document.body.appendChild(document.createElement('mk-locker'));
|
const locker = document.body.appendChild(document.createElement('mk-locker'));
|
||||||
|
|
||||||
this.api('app/create', {
|
this.$root.$data.os.api('app/create', {
|
||||||
name: name,
|
name: name,
|
||||||
name_id: nid,
|
name_id: nid,
|
||||||
description: description,
|
description: description,
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
this.fetching = true;
|
this.fetching = true;
|
||||||
|
|
||||||
this.on('mount', () => {
|
this.on('mount', () => {
|
||||||
this.api('app/show', {
|
this.$root.$data.os.api('app/show', {
|
||||||
app_id: this.opts.app
|
app_id: this.opts.app
|
||||||
}).then(app => {
|
}).then(app => {
|
||||||
this.update({
|
this.update({
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
this.fetching = true;
|
this.fetching = true;
|
||||||
|
|
||||||
this.on('mount', () => {
|
this.on('mount', () => {
|
||||||
this.api('my/apps').then(apps => {
|
this.$root.$data.os.api('my/apps').then(apps => {
|
||||||
this.fetching = false
|
this.fetching = false
|
||||||
this.apps = apps
|
this.apps = apps
|
||||||
this.update({
|
this.update({
|
||||||
|
|
|
@ -265,7 +265,7 @@
|
||||||
fetching: true
|
fetching: true
|
||||||
});
|
});
|
||||||
|
|
||||||
this.api('drive/folders/show', {
|
this.$root.$data.os.api('drive/folders/show', {
|
||||||
folder_id: target
|
folder_id: target
|
||||||
}).then(folder => {
|
}).then(folder => {
|
||||||
this.folder = folder;
|
this.folder = folder;
|
||||||
|
@ -368,7 +368,7 @@
|
||||||
const filesMax = 20;
|
const filesMax = 20;
|
||||||
|
|
||||||
// フォルダ一覧取得
|
// フォルダ一覧取得
|
||||||
this.api('drive/folders', {
|
this.$root.$data.os.api('drive/folders', {
|
||||||
folder_id: this.folder ? this.folder.id : null,
|
folder_id: this.folder ? this.folder.id : null,
|
||||||
limit: foldersMax + 1
|
limit: foldersMax + 1
|
||||||
}).then(folders => {
|
}).then(folders => {
|
||||||
|
@ -381,7 +381,7 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
// ファイル一覧取得
|
// ファイル一覧取得
|
||||||
this.api('drive/files', {
|
this.$root.$data.os.api('drive/files', {
|
||||||
folder_id: this.folder ? this.folder.id : null,
|
folder_id: this.folder ? this.folder.id : null,
|
||||||
limit: filesMax + 1
|
limit: filesMax + 1
|
||||||
}).then(files => {
|
}).then(files => {
|
||||||
|
@ -412,7 +412,7 @@
|
||||||
|
|
||||||
if (this.folder == null) {
|
if (this.folder == null) {
|
||||||
// Fetch addtional drive info
|
// Fetch addtional drive info
|
||||||
this.api('drive').then(info => {
|
this.$root.$data.os.api('drive').then(info => {
|
||||||
this.update({ info });
|
this.update({ info });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -427,7 +427,7 @@
|
||||||
const max = 30;
|
const max = 30;
|
||||||
|
|
||||||
// ファイル一覧取得
|
// ファイル一覧取得
|
||||||
this.api('drive/files', {
|
this.$root.$data.os.api('drive/files', {
|
||||||
folder_id: this.folder ? this.folder.id : null,
|
folder_id: this.folder ? this.folder.id : null,
|
||||||
limit: max + 1,
|
limit: max + 1,
|
||||||
until_id: this.files[this.files.length - 1].id
|
until_id: this.files[this.files.length - 1].id
|
||||||
|
@ -471,7 +471,7 @@
|
||||||
fetching: true
|
fetching: true
|
||||||
});
|
});
|
||||||
|
|
||||||
this.api('drive/files/show', {
|
this.$root.$data.os.api('drive/files/show', {
|
||||||
file_id: file
|
file_id: file
|
||||||
}).then(file => {
|
}).then(file => {
|
||||||
this.fetching = false;
|
this.fetching = false;
|
||||||
|
@ -523,7 +523,7 @@
|
||||||
this.createFolder = () => {
|
this.createFolder = () => {
|
||||||
const name = window.prompt('フォルダー名');
|
const name = window.prompt('フォルダー名');
|
||||||
if (name == null || name == '') return;
|
if (name == null || name == '') return;
|
||||||
this.api('drive/folders/create', {
|
this.$root.$data.os.api('drive/folders/create', {
|
||||||
name: name,
|
name: name,
|
||||||
parent_id: this.folder ? this.folder.id : undefined
|
parent_id: this.folder ? this.folder.id : undefined
|
||||||
}).then(folder => {
|
}).then(folder => {
|
||||||
|
@ -539,7 +539,7 @@
|
||||||
}
|
}
|
||||||
const name = window.prompt('フォルダー名', this.folder.name);
|
const name = window.prompt('フォルダー名', this.folder.name);
|
||||||
if (name == null || name == '') return;
|
if (name == null || name == '') return;
|
||||||
this.api('drive/folders/update', {
|
this.$root.$data.os.api('drive/folders/update', {
|
||||||
name: name,
|
name: name,
|
||||||
folder_id: this.folder.id
|
folder_id: this.folder.id
|
||||||
}).then(folder => {
|
}).then(folder => {
|
||||||
|
@ -554,7 +554,7 @@
|
||||||
}
|
}
|
||||||
const dialog = riot.mount(document.body.appendChild(document.createElement('mk-drive-folder-selector')))[0];
|
const dialog = riot.mount(document.body.appendChild(document.createElement('mk-drive-folder-selector')))[0];
|
||||||
dialog.one('selected', folder => {
|
dialog.one('selected', folder => {
|
||||||
this.api('drive/folders/update', {
|
this.$root.$data.os.api('drive/folders/update', {
|
||||||
parent_id: folder ? folder.id : null,
|
parent_id: folder ? folder.id : null,
|
||||||
folder_id: this.folder.id
|
folder_id: this.folder.id
|
||||||
}).then(folder => {
|
}).then(folder => {
|
||||||
|
@ -566,7 +566,7 @@
|
||||||
this.urlUpload = () => {
|
this.urlUpload = () => {
|
||||||
const url = window.prompt('アップロードしたいファイルのURL');
|
const url = window.prompt('アップロードしたいファイルのURL');
|
||||||
if (url == null || url == '') return;
|
if (url == null || url == '') return;
|
||||||
this.api('drive/files/upload_from_url', {
|
this.$root.$data.os.api('drive/files/upload_from_url', {
|
||||||
url: url,
|
url: url,
|
||||||
folder_id: this.folder ? this.folder.id : undefined
|
folder_id: this.folder ? this.folder.id : undefined
|
||||||
});
|
});
|
||||||
|
|
|
@ -255,7 +255,7 @@
|
||||||
this.rename = () => {
|
this.rename = () => {
|
||||||
const name = window.prompt('名前を変更', this.file.name);
|
const name = window.prompt('名前を変更', this.file.name);
|
||||||
if (name == null || name == '' || name == this.file.name) return;
|
if (name == null || name == '' || name == this.file.name) return;
|
||||||
this.api('drive/files/update', {
|
this.$root.$data.os.api('drive/files/update', {
|
||||||
file_id: this.file.id,
|
file_id: this.file.id,
|
||||||
name: name
|
name: name
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
@ -266,7 +266,7 @@
|
||||||
this.move = () => {
|
this.move = () => {
|
||||||
const dialog = riot.mount(document.body.appendChild(document.createElement('mk-drive-folder-selector')))[0];
|
const dialog = riot.mount(document.body.appendChild(document.createElement('mk-drive-folder-selector')))[0];
|
||||||
dialog.one('selected', folder => {
|
dialog.one('selected', folder => {
|
||||||
this.api('drive/files/update', {
|
this.$root.$data.os.api('drive/files/update', {
|
||||||
file_id: this.file.id,
|
file_id: this.file.id,
|
||||||
folder_id: folder == null ? null : folder.id
|
folder_id: folder == null ? null : folder.id
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
this.onStreamPost = post => {
|
this.onStreamPost = post => {
|
||||||
if (document.hidden && post.user_id !== this.I.id) {
|
if (document.hidden && post.user_id !== this.$root.$data.os.i.id) {
|
||||||
this.unreadCount++;
|
this.unreadCount++;
|
||||||
document.title = `(${this.unreadCount}) ${getPostSummary(post)}`;
|
document.title = `(${this.unreadCount}) ${getPostSummary(post)}`;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
this.fetching = true;
|
this.fetching = true;
|
||||||
|
|
||||||
this.on('mount', () => {
|
this.on('mount', () => {
|
||||||
this.api('users/show', {
|
this.$root.$data.os.api('users/show', {
|
||||||
username: this.opts.username
|
username: this.opts.username
|
||||||
}).then(user => {
|
}).then(user => {
|
||||||
this.update({
|
this.update({
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
if (!ok) return;
|
if (!ok) return;
|
||||||
|
|
||||||
this.api('notifications/mark_as_read_all');
|
this.$root.$data.os.api('notifications/mark_as_read_all');
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
</mk-notifications-page>
|
</mk-notifications-page>
|
||||||
|
|
|
@ -60,7 +60,7 @@
|
||||||
|
|
||||||
Progress.start();
|
Progress.start();
|
||||||
|
|
||||||
this.api('posts/show', {
|
this.$root.$data.os.api('posts/show', {
|
||||||
post_id: this.opts.post
|
post_id: this.opts.post
|
||||||
}).then(post => {
|
}).then(post => {
|
||||||
|
|
||||||
|
|
|
@ -182,7 +182,7 @@
|
||||||
avatarSaving: true
|
avatarSaving: true
|
||||||
});
|
});
|
||||||
|
|
||||||
this.api('i/update', {
|
this.$root.$data.os.api('i/update', {
|
||||||
avatar_id: file.id
|
avatar_id: file.id
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.update({
|
this.update({
|
||||||
|
@ -203,7 +203,7 @@
|
||||||
bannerSaving: true
|
bannerSaving: true
|
||||||
});
|
});
|
||||||
|
|
||||||
this.api('i/update', {
|
this.$root.$data.os.api('i/update', {
|
||||||
banner_id: file.id
|
banner_id: file.id
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.update({
|
this.update({
|
||||||
|
@ -230,7 +230,7 @@
|
||||||
saving: true
|
saving: true
|
||||||
});
|
});
|
||||||
|
|
||||||
this.api('i/update', {
|
this.$root.$data.os.api('i/update', {
|
||||||
name: this.$refs.name.value,
|
name: this.$refs.name.value,
|
||||||
location: this.$refs.location.value || null,
|
location: this.$refs.location.value || null,
|
||||||
description: this.$refs.description.value || null,
|
description: this.$refs.description.value || null,
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
this.on('mount', () => {
|
this.on('mount', () => {
|
||||||
Progress.start();
|
Progress.start();
|
||||||
|
|
||||||
this.api('users/show', {
|
this.$root.$data.os.api('users/show', {
|
||||||
username: this.opts.user
|
username: this.opts.user
|
||||||
}).then(user => {
|
}).then(user => {
|
||||||
this.update({
|
this.update({
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
this.on('mount', () => {
|
this.on('mount', () => {
|
||||||
Progress.start();
|
Progress.start();
|
||||||
|
|
||||||
this.api('users/show', {
|
this.$root.$data.os.api('users/show', {
|
||||||
username: this.opts.user
|
username: this.opts.user
|
||||||
}).then(user => {
|
}).then(user => {
|
||||||
this.update({
|
this.update({
|
||||||
|
|
|
@ -291,7 +291,7 @@
|
||||||
|
|
||||||
// Get replies
|
// Get replies
|
||||||
if (!this.compact) {
|
if (!this.compact) {
|
||||||
this.api('posts/replies', {
|
this.$root.$data.os.api('posts/replies', {
|
||||||
post_id: this.p.id,
|
post_id: this.p.id,
|
||||||
limit: 8
|
limit: 8
|
||||||
}).then(replies => {
|
}).then(replies => {
|
||||||
|
@ -311,7 +311,7 @@
|
||||||
this.repost = () => {
|
this.repost = () => {
|
||||||
const text = window.prompt(`「${this.summary}」をRepost`);
|
const text = window.prompt(`「${this.summary}」をRepost`);
|
||||||
if (text == null) return;
|
if (text == null) return;
|
||||||
this.api('posts/create', {
|
this.$root.$data.os.api('posts/create', {
|
||||||
repost_id: this.p.id,
|
repost_id: this.p.id,
|
||||||
text: text == '' ? undefined : text
|
text: text == '' ? undefined : text
|
||||||
});
|
});
|
||||||
|
@ -337,7 +337,7 @@
|
||||||
this.contextFetching = true;
|
this.contextFetching = true;
|
||||||
|
|
||||||
// Fetch context
|
// Fetch context
|
||||||
this.api('posts/context', {
|
this.$root.$data.os.api('posts/context', {
|
||||||
post_id: this.p.reply_id
|
post_id: this.p.reply_id
|
||||||
}).then(context => {
|
}).then(context => {
|
||||||
this.update({
|
this.update({
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
this.query = this.opts.query;
|
this.query = this.opts.query;
|
||||||
|
|
||||||
this.init = new Promise((res, rej) => {
|
this.init = new Promise((res, rej) => {
|
||||||
this.api('posts/search', parse(this.query)).then(posts => {
|
this.$root.$data.os.api('posts/search', parse(this.query)).then(posts => {
|
||||||
res(posts);
|
res(posts);
|
||||||
this.$emit('loaded');
|
this.$emit('loaded');
|
||||||
});
|
});
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
this.more = () => {
|
this.more = () => {
|
||||||
this.offset += this.limit;
|
this.offset += this.limit;
|
||||||
return this.api('posts/search', Object.assign({}, parse(this.query), {
|
return this.$root.$data.os.api('posts/search', Object.assign({}, parse(this.query), {
|
||||||
limit: this.limit,
|
limit: this.limit,
|
||||||
offset: this.offset
|
offset: this.offset
|
||||||
}));
|
}));
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
this.user = this.opts.user;
|
this.user = this.opts.user;
|
||||||
|
|
||||||
this.fetch = (iknow, limit, cursor, cb) => {
|
this.fetch = (iknow, limit, cursor, cb) => {
|
||||||
this.api('users/followers', {
|
this.$root.$data.os.api('users/followers', {
|
||||||
user_id: this.user.id,
|
user_id: this.user.id,
|
||||||
iknow: iknow,
|
iknow: iknow,
|
||||||
limit: limit,
|
limit: limit,
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
this.user = this.opts.user;
|
this.user = this.opts.user;
|
||||||
|
|
||||||
this.fetch = (iknow, limit, cursor, cb) => {
|
this.fetch = (iknow, limit, cursor, cb) => {
|
||||||
this.api('users/following', {
|
this.$root.$data.os.api('users/following', {
|
||||||
user_id: this.user.id,
|
user_id: this.user.id,
|
||||||
iknow: iknow,
|
iknow: iknow,
|
||||||
limit: limit,
|
limit: limit,
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
this.withMedia = this.opts.withMedia;
|
this.withMedia = this.opts.withMedia;
|
||||||
|
|
||||||
this.init = new Promise((res, rej) => {
|
this.init = new Promise((res, rej) => {
|
||||||
this.api('users/posts', {
|
this.$root.$data.os.api('users/posts', {
|
||||||
user_id: this.user.id,
|
user_id: this.user.id,
|
||||||
with_media: this.withMedia
|
with_media: this.withMedia
|
||||||
}).then(posts => {
|
}).then(posts => {
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
this.more = () => {
|
this.more = () => {
|
||||||
return this.api('users/posts', {
|
return this.$root.$data.os.api('users/posts', {
|
||||||
user_id: this.user.id,
|
user_id: this.user.id,
|
||||||
with_media: this.withMedia,
|
with_media: this.withMedia,
|
||||||
until_id: this.$refs.timeline.tail().id
|
until_id: this.$refs.timeline.tail().id
|
||||||
|
|
|
@ -196,7 +196,7 @@
|
||||||
this.fetching = true;
|
this.fetching = true;
|
||||||
|
|
||||||
this.on('mount', () => {
|
this.on('mount', () => {
|
||||||
this.api('users/show', {
|
this.$root.$data.os.api('users/show', {
|
||||||
username: this.username
|
username: this.username
|
||||||
}).then(user => {
|
}).then(user => {
|
||||||
this.fetching = false;
|
this.fetching = false;
|
||||||
|
@ -348,7 +348,7 @@
|
||||||
this.initializing = true;
|
this.initializing = true;
|
||||||
|
|
||||||
this.on('mount', () => {
|
this.on('mount', () => {
|
||||||
this.api('users/posts', {
|
this.$root.$data.os.api('users/posts', {
|
||||||
user_id: this.user.id
|
user_id: this.user.id
|
||||||
}).then(posts => {
|
}).then(posts => {
|
||||||
this.update({
|
this.update({
|
||||||
|
@ -485,7 +485,7 @@
|
||||||
this.user = this.opts.user;
|
this.user = this.opts.user;
|
||||||
|
|
||||||
this.on('mount', () => {
|
this.on('mount', () => {
|
||||||
this.api('users/posts', {
|
this.$root.$data.os.api('users/posts', {
|
||||||
user_id: this.user.id,
|
user_id: this.user.id,
|
||||||
with_media: true,
|
with_media: true,
|
||||||
limit: 6
|
limit: 6
|
||||||
|
@ -540,7 +540,7 @@
|
||||||
this.user = this.opts.user;
|
this.user = this.opts.user;
|
||||||
|
|
||||||
this.on('mount', () => {
|
this.on('mount', () => {
|
||||||
this.api('aggregation/users/activity', {
|
this.$root.$data.os.api('aggregation/users/activity', {
|
||||||
user_id: this.user.id,
|
user_id: this.user.id,
|
||||||
limit: 30
|
limit: 30
|
||||||
}).then(data => {
|
}).then(data => {
|
||||||
|
@ -665,7 +665,7 @@
|
||||||
this.initializing = true;
|
this.initializing = true;
|
||||||
|
|
||||||
this.on('mount', () => {
|
this.on('mount', () => {
|
||||||
this.api('users/get_frequently_replied_users', {
|
this.$root.$data.os.api('users/get_frequently_replied_users', {
|
||||||
user_id: this.user.id
|
user_id: this.user.id
|
||||||
}).then(x => {
|
}).then(x => {
|
||||||
this.update({
|
this.update({
|
||||||
|
@ -720,7 +720,7 @@
|
||||||
this.initializing = true;
|
this.initializing = true;
|
||||||
|
|
||||||
this.on('mount', () => {
|
this.on('mount', () => {
|
||||||
this.api('users/followers', {
|
this.$root.$data.os.api('users/followers', {
|
||||||
user_id: this.user.id,
|
user_id: this.user.id,
|
||||||
iknow: true,
|
iknow: true,
|
||||||
limit: 30
|
limit: 30
|
||||||
|
|
|
@ -56,7 +56,7 @@ export default Vue.extend({
|
||||||
onClick() {
|
onClick() {
|
||||||
this.wait = true;
|
this.wait = true;
|
||||||
if (this.user.is_following) {
|
if (this.user.is_following) {
|
||||||
this.api('following/delete', {
|
this.$root.$data.os.api('following/delete', {
|
||||||
user_id: this.user.id
|
user_id: this.user.id
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.user.is_following = false;
|
this.user.is_following = false;
|
||||||
|
@ -66,7 +66,7 @@ export default Vue.extend({
|
||||||
this.wait = false;
|
this.wait = false;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.api('following/create', {
|
this.$root.$data.os.api('following/create', {
|
||||||
user_id: this.user.id
|
user_id: this.user.id
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.user.is_following = true;
|
this.user.is_following = true;
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
this.initializing = true;
|
this.initializing = true;
|
||||||
|
|
||||||
this.on('mount', () => {
|
this.on('mount', () => {
|
||||||
this.api('stats').then(stats => {
|
this.$root.$data.os.api('stats').then(stats => {
|
||||||
this.update({
|
this.update({
|
||||||
initializing: false,
|
initializing: false,
|
||||||
stats
|
stats
|
||||||
|
@ -70,7 +70,7 @@
|
||||||
this.stats = this.opts.stats;
|
this.stats = this.opts.stats;
|
||||||
|
|
||||||
this.on('mount', () => {
|
this.on('mount', () => {
|
||||||
this.api('aggregation/posts', {
|
this.$root.$data.os.api('aggregation/posts', {
|
||||||
limit: 365
|
limit: 365
|
||||||
}).then(data => {
|
}).then(data => {
|
||||||
this.update({
|
this.update({
|
||||||
|
@ -96,7 +96,7 @@
|
||||||
this.stats = this.opts.stats;
|
this.stats = this.opts.stats;
|
||||||
|
|
||||||
this.on('mount', () => {
|
this.on('mount', () => {
|
||||||
this.api('aggregation/users', {
|
this.$root.$data.os.api('aggregation/users', {
|
||||||
limit: 365
|
limit: 365
|
||||||
}).then(data => {
|
}).then(data => {
|
||||||
this.update({
|
this.update({
|
||||||
|
|
|
@ -59,7 +59,7 @@
|
||||||
this.connection = new Connection();
|
this.connection = new Connection();
|
||||||
|
|
||||||
this.on('mount', () => {
|
this.on('mount', () => {
|
||||||
this.api('meta').then(meta => {
|
this.$root.$data.os.api('meta').then(meta => {
|
||||||
this.update({
|
this.update({
|
||||||
initializing: false,
|
initializing: false,
|
||||||
meta
|
meta
|
||||||
|
|
Loading…
Reference in a new issue