wip
This commit is contained in:
@ -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
|
||||
});
|
||||
|
@ -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(() => {
|
||||
|
@ -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)}`;
|
||||
}
|
||||
|
@ -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({
|
||||
|
@ -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>
|
||||
|
@ -60,7 +60,7 @@
|
||||
|
||||
Progress.start();
|
||||
|
||||
this.api('posts/show', {
|
||||
this.$root.$data.os.api('posts/show', {
|
||||
post_id: this.opts.post
|
||||
}).then(post => {
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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({
|
||||
|
@ -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({
|
||||
|
@ -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({
|
||||
|
@ -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
|
||||
}));
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user