This commit is contained in:
こぴなたみぽ 2018-02-15 17:24:52 +09:00
parent 0766a76348
commit 9fd00d1179
51 changed files with 93 additions and 93 deletions

View file

@ -112,7 +112,7 @@
this.app = this.session.app;
this.cancel = () => {
this.api('auth/deny', {
this.$root.$data.os.api('auth/deny', {
token: this.session.token
}).then(() => {
this.$emit('denied');
@ -120,7 +120,7 @@
};
this.accept = () => {
this.api('auth/accept', {
this.$root.$data.os.api('auth/accept', {
token: this.session.token
}).then(() => {
this.$emit('accepted');

View file

@ -96,7 +96,7 @@
if (!this.SIGNIN) return;
// Fetch session
this.api('auth/session/show', {
this.$root.$data.os.api('auth/session/show', {
token: this.token
}).then(session => {
this.session = session;
@ -104,7 +104,7 @@
// 既に連携していた場合
if (this.session.app.is_authorized) {
this.api('auth/accept', {
this.$root.$data.os.api('auth/accept', {
token: this.session.token
}).then(() => {
this.accepted();

View file

@ -76,7 +76,7 @@
let fetched = false;
// チャンネル概要読み込み
this.api('channels/show', {
this.$root.$data.os.api('channels/show', {
channel_id: this.id
}).then(channel => {
if (fetched) {
@ -95,7 +95,7 @@
});
// 投稿読み込み
this.api('channels/posts', {
this.$root.$data.os.api('channels/posts', {
channel_id: this.id
}).then(posts => {
if (fetched) {
@ -125,7 +125,7 @@
this.posts.unshift(post);
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++;
document.title = `(${this.unreadCount}) ${this.channel.title} | Misskey`;
}
@ -139,7 +139,7 @@
};
this.watch = () => {
this.api('channels/watch', {
this.$root.$data.os.api('channels/watch', {
channel_id: this.id
}).then(() => {
this.channel.is_watching = true;
@ -150,7 +150,7 @@
};
this.unwatch = () => {
this.api('channels/unwatch', {
this.$root.$data.os.api('channels/unwatch', {
channel_id: this.id
}).then(() => {
this.channel.is_watching = false;
@ -323,7 +323,7 @@
? this.files.map(f => f.id)
: undefined;
this.api('posts/create', {
this.$root.$data.os.api('posts/create', {
text: this.$refs.text.value == '' ? undefined : this.$refs.text.value,
media_ids: files,
reply_id: this.reply ? this.reply.id : undefined,

View file

@ -15,7 +15,7 @@
this.mixin('api');
this.on('mount', () => {
this.api('channels', {
this.$root.$data.os.api('channels', {
limit: 100
}).then(channels => {
this.update({
@ -27,7 +27,7 @@
this.n = () => {
const title = window.prompt('%i18n:ch.tags.mk-index.channel-title%');
this.api('channels/create', {
this.$root.$data.os.api('channels/create', {
title: title
}).then(channel => {
location.href = '/' + channel.id;

View file

@ -31,7 +31,7 @@
this.user = this.opts.user;
this.on('mount', () => {
this.api('aggregation/users/activity', {
this.$root.$data.os.api('aggregation/users/activity', {
user_id: this.user.id
}).then(data => {
data.forEach(d => d.total = d.posts + d.replies + d.reposts);

View file

@ -25,7 +25,7 @@
this.fetching = true;
this.on('mount', () => {
this.api('i/authorized_apps').then(apps => {
this.$root.$data.os.api('i/authorized_apps').then(apps => {
this.apps = apps;
this.fetching = false;
this.update();

View file

@ -19,7 +19,7 @@
this.fetching = true;
this.on('mount', () => {
this.api('i/signin_history').then(history => {
this.$root.$data.os.api('i/signin_history').then(history => {
this.update({
fetching: false,
history: history

View file

@ -30,15 +30,15 @@
this.form = null;
this.on('mount', () => {
this.I.on('updated', this.onMeUpdated);
this.$root.$data.os.i.on('updated', this.onMeUpdated);
});
this.on('unmount', () => {
this.I.off('updated', this.onMeUpdated);
this.$root.$data.os.i.off('updated', this.onMeUpdated);
});
this.onMeUpdated = () => {
if (this.I.twitter) {
if (this.$root.$data.os.i.twitter) {
if (this.form) this.form.close();
}
};

View file

@ -47,7 +47,7 @@
},
vote(id) {
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,
choice: id
}).then(() => {

View file

@ -97,7 +97,7 @@
el.addEventListener('mousedown', this.mousedown);
});
this.api('users/search_by_username', {
this.$root.$data.os.api('users/search_by_username', {
query: this.q,
limit: 30
}).then(users => {

View file

@ -126,7 +126,7 @@
this.onclick = () => {
this.wait = true;
if (this.user.is_following) {
this.api('following/delete', {
this.$root.$data.os.api('following/delete', {
user_id: this.user.id
}).then(() => {
this.user.is_following = false;
@ -137,7 +137,7 @@
this.update();
});
} else {
this.api('following/create', {
this.$root.$data.os.api('following/create', {
user_id: this.user.id
}).then(() => {
this.user.is_following = true;

View file

@ -46,7 +46,7 @@
this.$destroy();
});
this.api('drive').then(info => {
this.$root.$data.os.api('drive').then(info => {
this.update({
usage: info.usage / info.capacity * 100
});

View file

@ -62,7 +62,7 @@
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 => {
this.api('drive/files/update', {
this.$root.$data.os.api('drive/files/update', {
file_id: this.file.id,
name: name
})

View file

@ -53,7 +53,7 @@
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 => {
this.api('drive/folders/update', {
this.$root.$data.os.api('drive/folders/update', {
folder_id: this.folder.id,
name: name
});

View file

@ -74,7 +74,7 @@
fetching: true
});
this.api('channels/show', {
this.$root.$data.os.api('channels/show', {
channel_id: this.data.channel
}).then(channel => {
this.update({
@ -159,7 +159,7 @@
channel: channel
});
this.api('channels/posts', {
this.$root.$data.os.api('channels/posts', {
channel_id: channel.id
}).then(posts => {
this.update({
@ -300,7 +300,7 @@
text = text.replace(/^>>([0-9]+) /, '');
}
this.api('posts/create', {
this.$root.$data.os.api('posts/create', {
text: text,
reply_id: reply ? reply.id : undefined,
channel_id: this.parent.channel.id

View file

@ -82,7 +82,7 @@
};
this.fetch = cb => {
this.api('posts/mentions', {
this.$root.$data.os.api('posts/mentions', {
following: this.mode == 'following'
}).then(posts => {
this.update({
@ -99,7 +99,7 @@
this.update({
moreLoading: true
});
this.api('posts/mentions', {
this.$root.$data.os.api('posts/mentions', {
following: this.mode == 'following',
until_id: this.$refs.timeline.tail().id
}).then(posts => {

View file

@ -83,7 +83,7 @@
posting: true
});
this.api('posts/create', {
this.$root.$data.os.api('posts/create', {
text: this.$refs.text.value
}).then(data => {
this.clear();

View file

@ -94,7 +94,7 @@
loading: true,
poll: null
});
this.api('posts/polls/recommendation', {
this.$root.$data.os.api('posts/polls/recommendation', {
limit: 1,
offset: this.offset
}).then(posts => {

View file

@ -96,7 +96,7 @@
loading: true,
post: null
});
this.api('posts/trend', {
this.$root.$data.os.api('posts/trend', {
limit: 1,
offset: this.offset,
repost: false,

View file

@ -137,7 +137,7 @@
loading: true,
users: null
});
this.api('users/recommendation', {
this.$root.$data.os.api('users/recommendation', {
limit: this.limit,
offset: this.limit * this.page
}).then(users => {

View file

@ -38,7 +38,7 @@
});
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++;
document.title = `(${this.unreadCount}) ${getPostSummary(post)}`;
}

View file

@ -20,7 +20,7 @@
document.documentElement.style.background = '#fff';
this.api('users/show', {
this.$root.$data.os.api('users/show', {
username: this.opts.user
}).then(user => {
this.update({

View file

@ -42,7 +42,7 @@
this.on('mount', () => {
Progress.start();
this.api('posts/show', {
this.$root.$data.os.api('posts/show', {
post_id: this.opts.post
}).then(post => {

View file

@ -48,7 +48,7 @@
document.addEventListener('keydown', this.onDocumentKeydown);
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({
isLoading: false,
isEmpty: posts.length == 0
@ -77,7 +77,7 @@
this.update({
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,
offset: this.offset
})).then(posts => {

View file

@ -12,7 +12,7 @@
this.user = this.opts.user;
this.fetch = (iknow, limit, cursor, cb) => {
this.api('users/followers', {
this.$root.$data.os.api('users/followers', {
user_id: this.user.id,
iknow: iknow,
limit: limit,

View file

@ -12,7 +12,7 @@
this.user = this.opts.user;
this.fetch = (iknow, limit, cursor, cb) => {
this.api('users/following', {
this.$root.$data.os.api('users/following', {
user_id: this.user.id,
iknow: iknow,
limit: limit,

View file

@ -109,7 +109,7 @@
this.userPromise =
typeof this.u == 'string' ?
new Promise((resolve, reject) => {
this.api('users/show', {
this.$root.$data.os.api('users/show', {
user_id: this.u[0] == '@' ? undefined : this.u,
username: this.u[0] == '@' ? this.u.substr(1) : undefined
}).then(resolve);

View file

@ -94,7 +94,7 @@
};
this.fetch = cb => {
this.api('users/posts', {
this.$root.$data.os.api('users/posts', {
user_id: this.user.id,
until_date: this.date ? this.date.getTime() : undefined,
with_replies: this.mode == 'with-replies'
@ -113,7 +113,7 @@
this.update({
moreLoading: true
});
this.api('users/posts', {
this.$root.$data.os.api('users/posts', {
user_id: this.user.id,
with_replies: this.mode == 'with-replies',
until_id: this.$refs.timeline.tail().id

View file

@ -67,7 +67,7 @@
this.initializing = true;
this.on('mount', () => {
this.api('aggregation/users/activity', {
this.$root.$data.os.api('aggregation/users/activity', {
user_id: this.user.id,
limit: 20 * 7
}).then(activity => {

View file

@ -57,7 +57,7 @@ export default Vue.extend({
onClick() {
this.wait = true;
if (this.user.is_following) {
this.api('following/delete', {
this.$root.$data.os.api('following/delete', {
user_id: this.user.id
}).then(() => {
this.user.is_following = false;
@ -67,7 +67,7 @@ export default Vue.extend({
this.wait = false;
});
} else {
this.api('following/create', {
this.$root.$data.os.api('following/create', {
user_id: this.user.id
}).then(() => {
this.user.is_following = true;

View file

@ -209,7 +209,7 @@
nidState: 'wait'
});
this.api('app/name_id/available', {
this.$root.$data.os.api('app/name_id/available', {
name_id: nid
}).then(result => {
this.update({
@ -235,7 +235,7 @@
const locker = document.body.appendChild(document.createElement('mk-locker'));
this.api('app/create', {
this.$root.$data.os.api('app/create', {
name: name,
name_id: nid,
description: description,

View file

@ -19,7 +19,7 @@
this.fetching = true;
this.on('mount', () => {
this.api('app/show', {
this.$root.$data.os.api('app/show', {
app_id: this.opts.app
}).then(app => {
this.update({

View file

@ -20,7 +20,7 @@
this.fetching = true;
this.on('mount', () => {
this.api('my/apps').then(apps => {
this.$root.$data.os.api('my/apps').then(apps => {
this.fetching = false
this.apps = apps
this.update({

View file

@ -265,7 +265,7 @@
fetching: true
});
this.api('drive/folders/show', {
this.$root.$data.os.api('drive/folders/show', {
folder_id: target
}).then(folder => {
this.folder = folder;
@ -368,7 +368,7 @@
const filesMax = 20;
// フォルダ一覧取得
this.api('drive/folders', {
this.$root.$data.os.api('drive/folders', {
folder_id: this.folder ? this.folder.id : null,
limit: foldersMax + 1
}).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,
limit: filesMax + 1
}).then(files => {
@ -412,7 +412,7 @@
if (this.folder == null) {
// Fetch addtional drive info
this.api('drive').then(info => {
this.$root.$data.os.api('drive').then(info => {
this.update({ info });
});
}
@ -427,7 +427,7 @@
const max = 30;
// ファイル一覧取得
this.api('drive/files', {
this.$root.$data.os.api('drive/files', {
folder_id: this.folder ? this.folder.id : null,
limit: max + 1,
until_id: this.files[this.files.length - 1].id
@ -471,7 +471,7 @@
fetching: true
});
this.api('drive/files/show', {
this.$root.$data.os.api('drive/files/show', {
file_id: file
}).then(file => {
this.fetching = false;
@ -523,7 +523,7 @@
this.createFolder = () => {
const name = window.prompt('フォルダー名');
if (name == null || name == '') return;
this.api('drive/folders/create', {
this.$root.$data.os.api('drive/folders/create', {
name: name,
parent_id: this.folder ? this.folder.id : undefined
}).then(folder => {
@ -539,7 +539,7 @@
}
const name = window.prompt('フォルダー名', this.folder.name);
if (name == null || name == '') return;
this.api('drive/folders/update', {
this.$root.$data.os.api('drive/folders/update', {
name: name,
folder_id: this.folder.id
}).then(folder => {
@ -554,7 +554,7 @@
}
const dialog = riot.mount(document.body.appendChild(document.createElement('mk-drive-folder-selector')))[0];
dialog.one('selected', folder => {
this.api('drive/folders/update', {
this.$root.$data.os.api('drive/folders/update', {
parent_id: folder ? folder.id : null,
folder_id: this.folder.id
}).then(folder => {
@ -566,7 +566,7 @@
this.urlUpload = () => {
const url = window.prompt('アップロードしたいファイルのURL');
if (url == null || url == '') return;
this.api('drive/files/upload_from_url', {
this.$root.$data.os.api('drive/files/upload_from_url', {
url: url,
folder_id: this.folder ? this.folder.id : undefined
});

View file

@ -255,7 +255,7 @@
this.rename = () => {
const name = window.prompt('名前を変更', this.file.name);
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,
name: name
}).then(() => {
@ -266,7 +266,7 @@
this.move = () => {
const dialog = riot.mount(document.body.appendChild(document.createElement('mk-drive-folder-selector')))[0];
dialog.one('selected', folder => {
this.api('drive/files/update', {
this.$root.$data.os.api('drive/files/update', {
file_id: this.file.id,
folder_id: folder == null ? null : folder.id
}).then(() => {

View file

@ -46,7 +46,7 @@
});
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++;
document.title = `(${this.unreadCount}) ${getPostSummary(post)}`;
}

View file

@ -14,7 +14,7 @@
this.fetching = true;
this.on('mount', () => {
this.api('users/show', {
this.$root.$data.os.api('users/show', {
username: this.opts.username
}).then(user => {
this.update({

View file

@ -33,7 +33,7 @@
if (!ok) return;
this.api('notifications/mark_as_read_all');
this.$root.$data.os.api('notifications/mark_as_read_all');
};
</script>
</mk-notifications-page>

View file

@ -60,7 +60,7 @@
Progress.start();
this.api('posts/show', {
this.$root.$data.os.api('posts/show', {
post_id: this.opts.post
}).then(post => {

View file

@ -182,7 +182,7 @@
avatarSaving: true
});
this.api('i/update', {
this.$root.$data.os.api('i/update', {
avatar_id: file.id
}).then(() => {
this.update({
@ -203,7 +203,7 @@
bannerSaving: true
});
this.api('i/update', {
this.$root.$data.os.api('i/update', {
banner_id: file.id
}).then(() => {
this.update({
@ -230,7 +230,7 @@
saving: true
});
this.api('i/update', {
this.$root.$data.os.api('i/update', {
name: this.$refs.name.value,
location: this.$refs.location.value || null,
description: this.$refs.description.value || null,

View file

@ -18,7 +18,7 @@
this.on('mount', () => {
Progress.start();
this.api('users/show', {
this.$root.$data.os.api('users/show', {
username: this.opts.user
}).then(user => {
this.update({

View file

@ -18,7 +18,7 @@
this.on('mount', () => {
Progress.start();
this.api('users/show', {
this.$root.$data.os.api('users/show', {
username: this.opts.user
}).then(user => {
this.update({

View file

@ -291,7 +291,7 @@
// Get replies
if (!this.compact) {
this.api('posts/replies', {
this.$root.$data.os.api('posts/replies', {
post_id: this.p.id,
limit: 8
}).then(replies => {
@ -311,7 +311,7 @@
this.repost = () => {
const text = window.prompt(`「${this.summary}」をRepost`);
if (text == null) return;
this.api('posts/create', {
this.$root.$data.os.api('posts/create', {
repost_id: this.p.id,
text: text == '' ? undefined : text
});
@ -337,7 +337,7 @@
this.contextFetching = true;
// Fetch context
this.api('posts/context', {
this.$root.$data.os.api('posts/context', {
post_id: this.p.reply_id
}).then(context => {
this.update({

View file

@ -25,7 +25,7 @@
this.query = this.opts.query;
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);
this.$emit('loaded');
});
@ -33,7 +33,7 @@
this.more = () => {
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,
offset: this.offset
}));

View file

@ -11,7 +11,7 @@
this.user = this.opts.user;
this.fetch = (iknow, limit, cursor, cb) => {
this.api('users/followers', {
this.$root.$data.os.api('users/followers', {
user_id: this.user.id,
iknow: iknow,
limit: limit,

View file

@ -11,7 +11,7 @@
this.user = this.opts.user;
this.fetch = (iknow, limit, cursor, cb) => {
this.api('users/following', {
this.$root.$data.os.api('users/following', {
user_id: this.user.id,
iknow: iknow,
limit: limit,

View file

@ -13,7 +13,7 @@
this.withMedia = this.opts.withMedia;
this.init = new Promise((res, rej) => {
this.api('users/posts', {
this.$root.$data.os.api('users/posts', {
user_id: this.user.id,
with_media: this.withMedia
}).then(posts => {
@ -23,7 +23,7 @@
});
this.more = () => {
return this.api('users/posts', {
return this.$root.$data.os.api('users/posts', {
user_id: this.user.id,
with_media: this.withMedia,
until_id: this.$refs.timeline.tail().id

View file

@ -196,7 +196,7 @@
this.fetching = true;
this.on('mount', () => {
this.api('users/show', {
this.$root.$data.os.api('users/show', {
username: this.username
}).then(user => {
this.fetching = false;
@ -348,7 +348,7 @@
this.initializing = true;
this.on('mount', () => {
this.api('users/posts', {
this.$root.$data.os.api('users/posts', {
user_id: this.user.id
}).then(posts => {
this.update({
@ -485,7 +485,7 @@
this.user = this.opts.user;
this.on('mount', () => {
this.api('users/posts', {
this.$root.$data.os.api('users/posts', {
user_id: this.user.id,
with_media: true,
limit: 6
@ -540,7 +540,7 @@
this.user = this.opts.user;
this.on('mount', () => {
this.api('aggregation/users/activity', {
this.$root.$data.os.api('aggregation/users/activity', {
user_id: this.user.id,
limit: 30
}).then(data => {
@ -665,7 +665,7 @@
this.initializing = true;
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
}).then(x => {
this.update({
@ -720,7 +720,7 @@
this.initializing = true;
this.on('mount', () => {
this.api('users/followers', {
this.$root.$data.os.api('users/followers', {
user_id: this.user.id,
iknow: true,
limit: 30

View file

@ -56,7 +56,7 @@ export default Vue.extend({
onClick() {
this.wait = true;
if (this.user.is_following) {
this.api('following/delete', {
this.$root.$data.os.api('following/delete', {
user_id: this.user.id
}).then(() => {
this.user.is_following = false;
@ -66,7 +66,7 @@ export default Vue.extend({
this.wait = false;
});
} else {
this.api('following/create', {
this.$root.$data.os.api('following/create', {
user_id: this.user.id
}).then(() => {
this.user.is_following = true;

View file

@ -46,7 +46,7 @@
this.initializing = true;
this.on('mount', () => {
this.api('stats').then(stats => {
this.$root.$data.os.api('stats').then(stats => {
this.update({
initializing: false,
stats
@ -70,7 +70,7 @@
this.stats = this.opts.stats;
this.on('mount', () => {
this.api('aggregation/posts', {
this.$root.$data.os.api('aggregation/posts', {
limit: 365
}).then(data => {
this.update({
@ -96,7 +96,7 @@
this.stats = this.opts.stats;
this.on('mount', () => {
this.api('aggregation/users', {
this.$root.$data.os.api('aggregation/users', {
limit: 365
}).then(data => {
this.update({

View file

@ -59,7 +59,7 @@
this.connection = new Connection();
this.on('mount', () => {
this.api('meta').then(meta => {
this.$root.$data.os.api('meta').then(meta => {
this.update({
initializing: false,
meta