From 5c349bdfa6999116fcee439658e273e195f7ebc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=93=E3=81=B4=E3=81=AA=E3=81=9F=E3=81=BF=E3=81=BD?= Date: Thu, 15 Feb 2018 17:24:52 +0900 Subject: [PATCH] wip --- src/web/app/auth/tags/form.tag | 4 ++-- src/web/app/auth/tags/index.tag | 4 ++-- src/web/app/ch/tags/channel.tag | 12 +++++------ src/web/app/ch/tags/index.tag | 4 ++-- src/web/app/common/-tags/activity-table.tag | 2 +- src/web/app/common/-tags/authorized-apps.tag | 2 +- src/web/app/common/-tags/signin-history.tag | 2 +- src/web/app/common/-tags/twitter-setting.tag | 6 +++--- src/web/app/common/views/components/poll.vue | 2 +- .../desktop/-tags/autocomplete-suggestion.tag | 2 +- .../app/desktop/-tags/big-follow-button.tag | 4 ++-- .../desktop/-tags/drive/browser-window.tag | 2 +- .../desktop/-tags/drive/file-contextmenu.tag | 2 +- .../-tags/drive/folder-contextmenu.tag | 2 +- .../desktop/-tags/home-widgets/channel.tag | 6 +++--- .../desktop/-tags/home-widgets/mentions.tag | 4 ++-- .../desktop/-tags/home-widgets/post-form.tag | 2 +- .../-tags/home-widgets/recommended-polls.tag | 2 +- .../app/desktop/-tags/home-widgets/trends.tag | 2 +- .../home-widgets/user-recommendation.tag | 2 +- src/web/app/desktop/-tags/pages/home.tag | 2 +- .../desktop/-tags/pages/messaging-room.tag | 2 +- src/web/app/desktop/-tags/pages/post.tag | 2 +- src/web/app/desktop/-tags/search-posts.tag | 4 ++-- src/web/app/desktop/-tags/user-followers.tag | 2 +- src/web/app/desktop/-tags/user-following.tag | 2 +- src/web/app/desktop/-tags/user-preview.tag | 2 +- src/web/app/desktop/-tags/user-timeline.tag | 4 ++-- .../app/desktop/-tags/widgets/activity.tag | 2 +- .../views/components/follow-button.vue | 4 ++-- src/web/app/dev/tags/new-app-form.tag | 4 ++-- src/web/app/dev/tags/pages/app.tag | 2 +- src/web/app/dev/tags/pages/apps.tag | 2 +- src/web/app/mobile/tags/drive.tag | 20 +++++++++---------- src/web/app/mobile/tags/drive/file-viewer.tag | 4 ++-- src/web/app/mobile/tags/page/home.tag | 2 +- .../app/mobile/tags/page/messaging-room.tag | 2 +- .../app/mobile/tags/page/notifications.tag | 2 +- src/web/app/mobile/tags/page/post.tag | 2 +- .../app/mobile/tags/page/settings/profile.tag | 6 +++--- .../app/mobile/tags/page/user-followers.tag | 2 +- .../app/mobile/tags/page/user-following.tag | 2 +- src/web/app/mobile/tags/post-detail.tag | 6 +++--- src/web/app/mobile/tags/search-posts.tag | 4 ++-- src/web/app/mobile/tags/user-followers.tag | 2 +- src/web/app/mobile/tags/user-following.tag | 2 +- src/web/app/mobile/tags/user-timeline.tag | 4 ++-- src/web/app/mobile/tags/user.tag | 12 +++++------ .../mobile/views/components/follow-button.vue | 4 ++-- src/web/app/stats/tags/index.tag | 6 +++--- src/web/app/status/tags/index.tag | 2 +- 51 files changed, 93 insertions(+), 93 deletions(-) diff --git a/src/web/app/auth/tags/form.tag b/src/web/app/auth/tags/form.tag index 043b6313b..b1de0baab 100644 --- a/src/web/app/auth/tags/form.tag +++ b/src/web/app/auth/tags/form.tag @@ -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'); diff --git a/src/web/app/auth/tags/index.tag b/src/web/app/auth/tags/index.tag index e6b1cdb3f..3a24c2d6b 100644 --- a/src/web/app/auth/tags/index.tag +++ b/src/web/app/auth/tags/index.tag @@ -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(); diff --git a/src/web/app/ch/tags/channel.tag b/src/web/app/ch/tags/channel.tag index 524d04270..d95de9737 100644 --- a/src/web/app/ch/tags/channel.tag +++ b/src/web/app/ch/tags/channel.tag @@ -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, diff --git a/src/web/app/ch/tags/index.tag b/src/web/app/ch/tags/index.tag index 6e0b451e8..88df2ec45 100644 --- a/src/web/app/ch/tags/index.tag +++ b/src/web/app/ch/tags/index.tag @@ -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; diff --git a/src/web/app/common/-tags/activity-table.tag b/src/web/app/common/-tags/activity-table.tag index 2f716912f..cd74b0920 100644 --- a/src/web/app/common/-tags/activity-table.tag +++ b/src/web/app/common/-tags/activity-table.tag @@ -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); diff --git a/src/web/app/common/-tags/authorized-apps.tag b/src/web/app/common/-tags/authorized-apps.tag index 26efa1316..288c2fcc2 100644 --- a/src/web/app/common/-tags/authorized-apps.tag +++ b/src/web/app/common/-tags/authorized-apps.tag @@ -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(); diff --git a/src/web/app/common/-tags/signin-history.tag b/src/web/app/common/-tags/signin-history.tag index 57ac5ec97..a347c7c23 100644 --- a/src/web/app/common/-tags/signin-history.tag +++ b/src/web/app/common/-tags/signin-history.tag @@ -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 diff --git a/src/web/app/common/-tags/twitter-setting.tag b/src/web/app/common/-tags/twitter-setting.tag index 935239f44..a62329083 100644 --- a/src/web/app/common/-tags/twitter-setting.tag +++ b/src/web/app/common/-tags/twitter-setting.tag @@ -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(); } }; diff --git a/src/web/app/common/views/components/poll.vue b/src/web/app/common/views/components/poll.vue index d85caa00c..19ce557e7 100644 --- a/src/web/app/common/views/components/poll.vue +++ b/src/web/app/common/views/components/poll.vue @@ -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(() => { diff --git a/src/web/app/desktop/-tags/autocomplete-suggestion.tag b/src/web/app/desktop/-tags/autocomplete-suggestion.tag index a0215666c..d3c3b6b35 100644 --- a/src/web/app/desktop/-tags/autocomplete-suggestion.tag +++ b/src/web/app/desktop/-tags/autocomplete-suggestion.tag @@ -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 => { diff --git a/src/web/app/desktop/-tags/big-follow-button.tag b/src/web/app/desktop/-tags/big-follow-button.tag index 5ea09fdfc..d8222f92c 100644 --- a/src/web/app/desktop/-tags/big-follow-button.tag +++ b/src/web/app/desktop/-tags/big-follow-button.tag @@ -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; diff --git a/src/web/app/desktop/-tags/drive/browser-window.tag b/src/web/app/desktop/-tags/drive/browser-window.tag index db7b89834..c9c765252 100644 --- a/src/web/app/desktop/-tags/drive/browser-window.tag +++ b/src/web/app/desktop/-tags/drive/browser-window.tag @@ -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 }); diff --git a/src/web/app/desktop/-tags/drive/file-contextmenu.tag b/src/web/app/desktop/-tags/drive/file-contextmenu.tag index 125f70b61..8776fcc02 100644 --- a/src/web/app/desktop/-tags/drive/file-contextmenu.tag +++ b/src/web/app/desktop/-tags/drive/file-contextmenu.tag @@ -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 }) diff --git a/src/web/app/desktop/-tags/drive/folder-contextmenu.tag b/src/web/app/desktop/-tags/drive/folder-contextmenu.tag index 0cb7f6eb8..a0146410f 100644 --- a/src/web/app/desktop/-tags/drive/folder-contextmenu.tag +++ b/src/web/app/desktop/-tags/drive/folder-contextmenu.tag @@ -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 }); diff --git a/src/web/app/desktop/-tags/home-widgets/channel.tag b/src/web/app/desktop/-tags/home-widgets/channel.tag index 98bf6bf7e..c20a851e7 100644 --- a/src/web/app/desktop/-tags/home-widgets/channel.tag +++ b/src/web/app/desktop/-tags/home-widgets/channel.tag @@ -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 diff --git a/src/web/app/desktop/-tags/home-widgets/mentions.tag b/src/web/app/desktop/-tags/home-widgets/mentions.tag index 81f9b2875..d38ccabb5 100644 --- a/src/web/app/desktop/-tags/home-widgets/mentions.tag +++ b/src/web/app/desktop/-tags/home-widgets/mentions.tag @@ -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 => { diff --git a/src/web/app/desktop/-tags/home-widgets/post-form.tag b/src/web/app/desktop/-tags/home-widgets/post-form.tag index d5824477b..8564cdf02 100644 --- a/src/web/app/desktop/-tags/home-widgets/post-form.tag +++ b/src/web/app/desktop/-tags/home-widgets/post-form.tag @@ -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(); diff --git a/src/web/app/desktop/-tags/home-widgets/recommended-polls.tag b/src/web/app/desktop/-tags/home-widgets/recommended-polls.tag index cfbcd1e92..43c6096a3 100644 --- a/src/web/app/desktop/-tags/home-widgets/recommended-polls.tag +++ b/src/web/app/desktop/-tags/home-widgets/recommended-polls.tag @@ -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 => { diff --git a/src/web/app/desktop/-tags/home-widgets/trends.tag b/src/web/app/desktop/-tags/home-widgets/trends.tag index 5e297ebc7..9f1be68c7 100644 --- a/src/web/app/desktop/-tags/home-widgets/trends.tag +++ b/src/web/app/desktop/-tags/home-widgets/trends.tag @@ -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, diff --git a/src/web/app/desktop/-tags/home-widgets/user-recommendation.tag b/src/web/app/desktop/-tags/home-widgets/user-recommendation.tag index 5344da1f2..bc873539e 100644 --- a/src/web/app/desktop/-tags/home-widgets/user-recommendation.tag +++ b/src/web/app/desktop/-tags/home-widgets/user-recommendation.tag @@ -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 => { diff --git a/src/web/app/desktop/-tags/pages/home.tag b/src/web/app/desktop/-tags/pages/home.tag index 9b9d455b5..83ceb3846 100644 --- a/src/web/app/desktop/-tags/pages/home.tag +++ b/src/web/app/desktop/-tags/pages/home.tag @@ -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)}`; } diff --git a/src/web/app/desktop/-tags/pages/messaging-room.tag b/src/web/app/desktop/-tags/pages/messaging-room.tag index bfa8c2465..cfacc4a1b 100644 --- a/src/web/app/desktop/-tags/pages/messaging-room.tag +++ b/src/web/app/desktop/-tags/pages/messaging-room.tag @@ -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({ diff --git a/src/web/app/desktop/-tags/pages/post.tag b/src/web/app/desktop/-tags/pages/post.tag index 488adc6e3..baec48c0a 100644 --- a/src/web/app/desktop/-tags/pages/post.tag +++ b/src/web/app/desktop/-tags/pages/post.tag @@ -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 => { diff --git a/src/web/app/desktop/-tags/search-posts.tag b/src/web/app/desktop/-tags/search-posts.tag index 52c68b754..94a6f2524 100644 --- a/src/web/app/desktop/-tags/search-posts.tag +++ b/src/web/app/desktop/-tags/search-posts.tag @@ -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 => { diff --git a/src/web/app/desktop/-tags/user-followers.tag b/src/web/app/desktop/-tags/user-followers.tag index a1b44f0f5..3a5430d37 100644 --- a/src/web/app/desktop/-tags/user-followers.tag +++ b/src/web/app/desktop/-tags/user-followers.tag @@ -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, diff --git a/src/web/app/desktop/-tags/user-following.tag b/src/web/app/desktop/-tags/user-following.tag index db46bf110..42ad5f88a 100644 --- a/src/web/app/desktop/-tags/user-following.tag +++ b/src/web/app/desktop/-tags/user-following.tag @@ -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, diff --git a/src/web/app/desktop/-tags/user-preview.tag b/src/web/app/desktop/-tags/user-preview.tag index 18465c224..3a65fb79b 100644 --- a/src/web/app/desktop/-tags/user-preview.tag +++ b/src/web/app/desktop/-tags/user-preview.tag @@ -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); diff --git a/src/web/app/desktop/-tags/user-timeline.tag b/src/web/app/desktop/-tags/user-timeline.tag index f018ba64e..1071b6e2b 100644 --- a/src/web/app/desktop/-tags/user-timeline.tag +++ b/src/web/app/desktop/-tags/user-timeline.tag @@ -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 diff --git a/src/web/app/desktop/-tags/widgets/activity.tag b/src/web/app/desktop/-tags/widgets/activity.tag index 8c20ef5a6..1f9bee5ed 100644 --- a/src/web/app/desktop/-tags/widgets/activity.tag +++ b/src/web/app/desktop/-tags/widgets/activity.tag @@ -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 => { diff --git a/src/web/app/desktop/views/components/follow-button.vue b/src/web/app/desktop/views/components/follow-button.vue index 588bcd641..0fffbda91 100644 --- a/src/web/app/desktop/views/components/follow-button.vue +++ b/src/web/app/desktop/views/components/follow-button.vue @@ -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; diff --git a/src/web/app/dev/tags/new-app-form.tag b/src/web/app/dev/tags/new-app-form.tag index 672c31570..cf3c44007 100644 --- a/src/web/app/dev/tags/new-app-form.tag +++ b/src/web/app/dev/tags/new-app-form.tag @@ -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, diff --git a/src/web/app/dev/tags/pages/app.tag b/src/web/app/dev/tags/pages/app.tag index 42937a21b..982549ed2 100644 --- a/src/web/app/dev/tags/pages/app.tag +++ b/src/web/app/dev/tags/pages/app.tag @@ -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({ diff --git a/src/web/app/dev/tags/pages/apps.tag b/src/web/app/dev/tags/pages/apps.tag index bf9552f07..6ae6031e6 100644 --- a/src/web/app/dev/tags/pages/apps.tag +++ b/src/web/app/dev/tags/pages/apps.tag @@ -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({ diff --git a/src/web/app/mobile/tags/drive.tag b/src/web/app/mobile/tags/drive.tag index a7a8a35c3..e0a5872d8 100644 --- a/src/web/app/mobile/tags/drive.tag +++ b/src/web/app/mobile/tags/drive.tag @@ -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 }); diff --git a/src/web/app/mobile/tags/drive/file-viewer.tag b/src/web/app/mobile/tags/drive/file-viewer.tag index ab0c94ae9..e9a89493e 100644 --- a/src/web/app/mobile/tags/drive/file-viewer.tag +++ b/src/web/app/mobile/tags/drive/file-viewer.tag @@ -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(() => { diff --git a/src/web/app/mobile/tags/page/home.tag b/src/web/app/mobile/tags/page/home.tag index cf57cdb22..10af292f3 100644 --- a/src/web/app/mobile/tags/page/home.tag +++ b/src/web/app/mobile/tags/page/home.tag @@ -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)}`; } diff --git a/src/web/app/mobile/tags/page/messaging-room.tag b/src/web/app/mobile/tags/page/messaging-room.tag index 67f46e4b1..262ece07a 100644 --- a/src/web/app/mobile/tags/page/messaging-room.tag +++ b/src/web/app/mobile/tags/page/messaging-room.tag @@ -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({ diff --git a/src/web/app/mobile/tags/page/notifications.tag b/src/web/app/mobile/tags/page/notifications.tag index eda5a1932..169ff029b 100644 --- a/src/web/app/mobile/tags/page/notifications.tag +++ b/src/web/app/mobile/tags/page/notifications.tag @@ -33,7 +33,7 @@ if (!ok) return; - this.api('notifications/mark_as_read_all'); + this.$root.$data.os.api('notifications/mark_as_read_all'); }; diff --git a/src/web/app/mobile/tags/page/post.tag b/src/web/app/mobile/tags/page/post.tag index 5e8cd2448..ed7cb5254 100644 --- a/src/web/app/mobile/tags/page/post.tag +++ b/src/web/app/mobile/tags/page/post.tag @@ -60,7 +60,7 @@ Progress.start(); - this.api('posts/show', { + this.$root.$data.os.api('posts/show', { post_id: this.opts.post }).then(post => { diff --git a/src/web/app/mobile/tags/page/settings/profile.tag b/src/web/app/mobile/tags/page/settings/profile.tag index cafe65f27..6f7ef3ac3 100644 --- a/src/web/app/mobile/tags/page/settings/profile.tag +++ b/src/web/app/mobile/tags/page/settings/profile.tag @@ -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, diff --git a/src/web/app/mobile/tags/page/user-followers.tag b/src/web/app/mobile/tags/page/user-followers.tag index 1123fd422..a65809484 100644 --- a/src/web/app/mobile/tags/page/user-followers.tag +++ b/src/web/app/mobile/tags/page/user-followers.tag @@ -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({ diff --git a/src/web/app/mobile/tags/page/user-following.tag b/src/web/app/mobile/tags/page/user-following.tag index b1c22cae1..8fe0f5fce 100644 --- a/src/web/app/mobile/tags/page/user-following.tag +++ b/src/web/app/mobile/tags/page/user-following.tag @@ -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({ diff --git a/src/web/app/mobile/tags/post-detail.tag b/src/web/app/mobile/tags/post-detail.tag index d812aba42..4b8566f96 100644 --- a/src/web/app/mobile/tags/post-detail.tag +++ b/src/web/app/mobile/tags/post-detail.tag @@ -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({ diff --git a/src/web/app/mobile/tags/search-posts.tag b/src/web/app/mobile/tags/search-posts.tag index c650fbce5..7b4d73f2d 100644 --- a/src/web/app/mobile/tags/search-posts.tag +++ b/src/web/app/mobile/tags/search-posts.tag @@ -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 })); diff --git a/src/web/app/mobile/tags/user-followers.tag b/src/web/app/mobile/tags/user-followers.tag index b9101e212..f3f70b2a6 100644 --- a/src/web/app/mobile/tags/user-followers.tag +++ b/src/web/app/mobile/tags/user-followers.tag @@ -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, diff --git a/src/web/app/mobile/tags/user-following.tag b/src/web/app/mobile/tags/user-following.tag index 5cfe60fec..b76757143 100644 --- a/src/web/app/mobile/tags/user-following.tag +++ b/src/web/app/mobile/tags/user-following.tag @@ -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, diff --git a/src/web/app/mobile/tags/user-timeline.tag b/src/web/app/mobile/tags/user-timeline.tag index b9f5dfbd5..546558155 100644 --- a/src/web/app/mobile/tags/user-timeline.tag +++ b/src/web/app/mobile/tags/user-timeline.tag @@ -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 diff --git a/src/web/app/mobile/tags/user.tag b/src/web/app/mobile/tags/user.tag index 87e63471e..b9bb4e17a 100644 --- a/src/web/app/mobile/tags/user.tag +++ b/src/web/app/mobile/tags/user.tag @@ -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 diff --git a/src/web/app/mobile/views/components/follow-button.vue b/src/web/app/mobile/views/components/follow-button.vue index 455be388c..047005cc9 100644 --- a/src/web/app/mobile/views/components/follow-button.vue +++ b/src/web/app/mobile/views/components/follow-button.vue @@ -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; diff --git a/src/web/app/stats/tags/index.tag b/src/web/app/stats/tags/index.tag index 3b2b10b0a..4b167ccbc 100644 --- a/src/web/app/stats/tags/index.tag +++ b/src/web/app/stats/tags/index.tag @@ -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({ diff --git a/src/web/app/status/tags/index.tag b/src/web/app/status/tags/index.tag index e06258c49..899467097 100644 --- a/src/web/app/status/tags/index.tag +++ b/src/web/app/status/tags/index.tag @@ -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