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

@ -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;