This commit is contained in:
syuilo
2017-02-20 20:13:42 +09:00
parent 3a39a36bed
commit 2a3a5d4b50
35 changed files with 402 additions and 367 deletions

View File

@@ -192,9 +192,9 @@
name = window.prompt '名前を変更' this.file.name
if name? and name != '' and name != this.file.name
this.api('drive/files/update', {
file_id: this.file.id
file_id: this.file.id,
name: name
.then =>
}).then(() => {
this.parent.cf this.file, true
</script>

View File

@@ -84,21 +84,21 @@
if this.user.is_following
this.api('following/delete', {
user_id: this.user.id
.then =>
}).then(() => {
this.user.is_following = false
.catch (err) ->
console.error err
.then =>
}).then(() => {
this.wait = false
this.update();
else
this.api('following/create', {
user_id: this.user.id
.then =>
}).then(() => {
this.user.is_following = true
.catch (err) ->
console.error err
.then =>
}).then(() => {
this.wait = false
this.update();
</script>

View File

@@ -406,13 +406,13 @@
if this.p.is_liked
this.api('posts/likes/delete', {
post_id: this.p.id
.then =>
}).then(() => {
this.p.is_liked = false
this.update();
else
this.api('posts/likes/create', {
post_id: this.p.id
.then =>
}).then(() => {
this.p.is_liked = true
this.update();

View File

@@ -9,24 +9,24 @@
<script>
this.mixin('api');
this.max = 30
this.offset = 0
this.max = 30;
this.offset = 0;
this.query = this.opts.query
this.with-media = this.opts.with-media
this.query = this.opts.query;
this.withMedia = this.opts.withMedia;
this.init = new Promise (res, rej) =>
this.api('posts/search', {
query: @query
}).then((posts) => {
query: this.query
}).then(posts => {
res posts
this.trigger('loaded');
this.more = () => {
@offset += @max
this.offset += this.max;
this.api('posts/search', {
query: @query
max: @max
offset: @offset
query: this.query
max: this.max
offset: this.offset
</script>
</mk-search-posts>

View File

@@ -11,21 +11,21 @@
<script>
this.mixin('api');
this.user = this.opts.user
this.with-media = this.opts.with-media
this.user = this.opts.user;
this.withMedia = this.opts.withMedia;
this.init = new Promise (res, rej) =>
this.api('users/posts', {
user_id: this.user.id
with_media: @with-media
}).then((posts) => {
with_media: @withMedia
}).then(posts => {
res posts
this.trigger('loaded');
this.more = () => {
this.api('users/posts', {
user_id: this.user.id
with_media: @with-media
with_media: this.withMedia
max_id: this.refs.timeline.tail!.id
</script>
</mk-user-timeline>