From 12cba7a76d368c21468c1dd4ddb0b5b164e1d9ae Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 20 Feb 2017 14:33:30 +0900 Subject: [PATCH] wip --- src/web/app/auth/tags/index.tag | 2 +- .../desktop/tags/autocomplete-suggestion.tag | 6 +-- .../app/desktop/tags/big-follow-button.tag | 16 ++++---- src/web/app/desktop/tags/contextmenu.tag | 8 ++-- src/web/app/desktop/tags/dialog.tag | 26 ++++++------ src/web/app/desktop/tags/follow-button.tag | 16 ++++---- .../app/desktop/tags/following-setuper.tag | 2 +- .../desktop/tags/home-widgets/mentions.tag | 2 +- .../desktop/tags/home-widgets/timeline.tag | 2 +- .../app/desktop/tags/home-widgets/tips.tag | 8 ++-- .../tags/home-widgets/user-recommendation.tag | 4 +- src/web/app/desktop/tags/image-dialog.tag | 16 ++++---- src/web/app/desktop/tags/search-posts.tag | 2 +- src/web/app/desktop/tags/stream-indicator.tag | 12 +++--- src/web/app/desktop/tags/ui-notification.tag | 26 ++++++------ src/web/app/desktop/tags/user-followers.tag | 15 +++---- src/web/app/desktop/tags/user-following.tag | 15 +++---- .../app/desktop/tags/user-friends-graph.tag | 6 +-- src/web/app/desktop/tags/user-graphs.tag | 1 + src/web/app/desktop/tags/user-header.tag | 41 ++++++++++--------- src/web/app/desktop/tags/user-likes-graph.tag | 4 +- src/web/app/desktop/tags/user-photos.tag | 4 +- src/web/app/desktop/tags/user-posts-graph.tag | 4 +- src/web/app/desktop/tags/user-preview.tag | 12 +++--- src/web/app/desktop/tags/user-profile.tag | 4 +- src/web/app/desktop/tags/user-timeline.tag | 8 ++-- src/web/app/desktop/tags/user.tag | 2 +- src/web/app/desktop/tags/users-list.tag | 2 +- src/web/app/desktop/tags/window.tag | 26 ++++++------ src/web/app/mobile/tags/follow-button.tag | 16 ++++---- src/web/app/mobile/tags/notify.tag | 8 ++-- src/web/app/mobile/tags/stream-indicator.tag | 12 +++--- 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 | 2 +- src/web/app/mobile/tags/users-list.tag | 2 +- 37 files changed, 173 insertions(+), 167 deletions(-) diff --git a/src/web/app/auth/tags/index.tag b/src/web/app/auth/tags/index.tag index 0059fef20..e64fedb26 100644 --- a/src/web/app/auth/tags/index.tag +++ b/src/web/app/auth/tags/index.tag @@ -97,7 +97,7 @@ this.token = window.location.href.split '/' .pop! this.on('mount', () => { - if not @SIGNIN then return + if not this.SIGNIN then return // Fetch session this.api 'auth/session/show' do diff --git a/src/web/app/desktop/tags/autocomplete-suggestion.tag b/src/web/app/desktop/tags/autocomplete-suggestion.tag index 126c3f3be..29212fb05 100644 --- a/src/web/app/desktop/tags/autocomplete-suggestion.tag +++ b/src/web/app/desktop/tags/autocomplete-suggestion.tag @@ -126,7 +126,7 @@ if @select != -1 e.preventDefault(); e.stopPropagation(); - @complete @users[@select] + @complete this.users[@select] else @close! | 27 => // Key[ESC] @@ -150,7 +150,7 @@ this.select-next = () => { @select++ - if @select >= @users.length + if @select >= this.users.length this.select = 0 @apply-select! @@ -159,7 +159,7 @@ @select-- if @select < 0 - this.select = @users.length - 1 + this.select = this.users.length - 1 @apply-select! diff --git a/src/web/app/desktop/tags/big-follow-button.tag b/src/web/app/desktop/tags/big-follow-button.tag index e4200277c..f8676669f 100644 --- a/src/web/app/desktop/tags/big-follow-button.tag +++ b/src/web/app/desktop/tags/big-follow-button.tag @@ -80,7 +80,7 @@ this.wait = false this.on('mount', () => { - @user-promise.then (user) => + this.user-promise.then (user) => this.user = user this.init = false this.update(); @@ -92,22 +92,22 @@ this.stream.off 'unfollow' this.on-stream-unfollow this.on-stream-follow = (user) => { - if user.id == @user.id + if user.id == this.user.id this.user = user this.update(); this.on-stream-unfollow = (user) => { - if user.id == @user.id + if user.id == this.user.id this.user = user this.update(); this.onclick = () => { this.wait = true - if @user.is_following + if this.user.is_following this.api 'following/delete' do - user_id: @user.id + user_id: this.user.id .then => - @user.is_following = false + this.user.is_following = false .catch (err) -> console.error err .then => @@ -115,9 +115,9 @@ this.update(); else this.api 'following/create' do - user_id: @user.id + user_id: this.user.id .then => - @user.is_following = true + this.user.is_following = true .catch (err) -> console.error err .then => diff --git a/src/web/app/desktop/tags/contextmenu.tag b/src/web/app/desktop/tags/contextmenu.tag index 87dde8a84..a16e7d2d0 100644 --- a/src/web/app/desktop/tags/contextmenu.tag +++ b/src/web/app/desktop/tags/contextmenu.tag @@ -111,11 +111,11 @@ this.root.style.left = pos.x + 'px' this.root.style.top = pos.y + 'px' - Velocity this.root, 'finish' true - Velocity this.root, { opacity: 0 } 0ms - Velocity this.root, { + Velocity(this.root, 'finish' true + Velocity(this.root, { opacity: 0 } 0ms + Velocity(this.root, { opacity: 1 - } { + }, { queue: false duration: 100ms easing: 'linear' diff --git a/src/web/app/desktop/tags/dialog.tag b/src/web/app/desktop/tags/dialog.tag index d4088fabd..affa2a88d 100644 --- a/src/web/app/desktop/tags/dialog.tag +++ b/src/web/app/desktop/tags/dialog.tag @@ -91,46 +91,46 @@ this.refs.body.innerHTML = this.opts.text this.refs.bg.style.pointer-events = 'auto' - Velocity this.refs.bg, 'finish' true - Velocity this.refs.bg, { + Velocity(this.refs.bg, 'finish' true + Velocity(this.refs.bg, { opacity: 1 - } { + }, { queue: false duration: 100ms easing: 'linear' } - Velocity this.refs.main, { + Velocity(this.refs.main, { opacity: 0 scale: 1.2 - } { + }, { duration: 0 } - Velocity this.refs.main, { + Velocity(this.refs.main, { opacity: 1 scale: 1 - } { + }, { duration: 300ms easing: [ 0, 0.5, 0.5, 1 ] } this.close = () => { this.refs.bg.style.pointer-events = 'none' - Velocity this.refs.bg, 'finish' true - Velocity this.refs.bg, { + Velocity(this.refs.bg, 'finish' true + Velocity(this.refs.bg, { opacity: 0 - } { + }, { queue: false duration: 300ms easing: 'linear' } this.refs.main.style.pointer-events = 'none' - Velocity this.refs.main, 'finish' true - Velocity this.refs.main, { + Velocity(this.refs.main, 'finish' true + Velocity(this.refs.main, { opacity: 0 scale: 0.8 - } { + }, { queue: false duration: 300ms easing: [ 0.5, -0.5, 1, 0.5 ] diff --git a/src/web/app/desktop/tags/follow-button.tag b/src/web/app/desktop/tags/follow-button.tag index 7b4f8f81d..09ef98422 100644 --- a/src/web/app/desktop/tags/follow-button.tag +++ b/src/web/app/desktop/tags/follow-button.tag @@ -77,7 +77,7 @@ this.wait = false this.on('mount', () => { - @user-promise.then (user) => + this.user-promise.then (user) => this.user = user this.init = false this.update(); @@ -89,22 +89,22 @@ this.stream.off 'unfollow' this.on-stream-unfollow this.on-stream-follow = (user) => { - if user.id == @user.id + if user.id == this.user.id this.user = user this.update(); this.on-stream-unfollow = (user) => { - if user.id == @user.id + if user.id == this.user.id this.user = user this.update(); this.onclick = () => { this.wait = true - if @user.is_following + if this.user.is_following this.api 'following/delete' do - user_id: @user.id + user_id: this.user.id .then => - @user.is_following = false + this.user.is_following = false .catch (err) -> console.error err .then => @@ -112,9 +112,9 @@ this.update(); else this.api 'following/create' do - user_id: @user.id + user_id: this.user.id .then => - @user.is_following = true + this.user.is_following = true .catch (err) -> console.error err .then => diff --git a/src/web/app/desktop/tags/following-setuper.tag b/src/web/app/desktop/tags/following-setuper.tag index fa540511a..c4adfbd86 100644 --- a/src/web/app/desktop/tags/following-setuper.tag +++ b/src/web/app/desktop/tags/following-setuper.tag @@ -151,7 +151,7 @@ console.error err this.refresh = () => { - if @users.length < @limit + if this.users.length < @limit this.page = 0 else this.page++ diff --git a/src/web/app/desktop/tags/home-widgets/mentions.tag b/src/web/app/desktop/tags/home-widgets/mentions.tag index 706242547..d3f9eac3a 100644 --- a/src/web/app/desktop/tags/home-widgets/mentions.tag +++ b/src/web/app/desktop/tags/home-widgets/mentions.tag @@ -100,7 +100,7 @@ console.error err this.on-scroll = () => { - current = window.scroll-y + window.inner-height + current = window.scrollY + window.inner-height if current > document.body.offset-height - 8 @more! diff --git a/src/web/app/desktop/tags/home-widgets/timeline.tag b/src/web/app/desktop/tags/home-widgets/timeline.tag index b04068956..6e3e867e5 100644 --- a/src/web/app/desktop/tags/home-widgets/timeline.tag +++ b/src/web/app/desktop/tags/home-widgets/timeline.tag @@ -104,7 +104,7 @@ @load! this.on-scroll = () => { - current = window.scroll-y + window.inner-height + current = window.scrollY + window.inner-height if current > document.body.offset-height - 8 @more! diff --git a/src/web/app/desktop/tags/home-widgets/tips.tag b/src/web/app/desktop/tags/home-widgets/tips.tag index 6718c7063..ff7516f33 100644 --- a/src/web/app/desktop/tags/home-widgets/tips.tag +++ b/src/web/app/desktop/tags/home-widgets/tips.tag @@ -53,17 +53,17 @@ this.update(); this.change = () => { - Velocity this.refs.tip, { + Velocity(this.refs.tip, { opacity: 0 - } { + }, { duration: 500ms easing: 'linear' complete: @set } - Velocity this.refs.tip, { + Velocity(this.refs.tip, { opacity: 1 - } { + }, { duration: 500ms easing: 'linear' } 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 19b6310ea..64c9c04e9 100644 --- a/src/web/app/desktop/tags/home-widgets/user-recommendation.tag +++ b/src/web/app/desktop/tags/home-widgets/user-recommendation.tag @@ -121,7 +121,7 @@ this.on('mount', () => { @fetch! this.clock = setInterval => - if @users.length < @limit + if this.users.length < @limit @fetch true , 60000ms @@ -143,7 +143,7 @@ console.error err this.refresh = () => { - if @users.length < @limit + if this.users.length < @limit this.page = 0 else this.page++ diff --git a/src/web/app/desktop/tags/image-dialog.tag b/src/web/app/desktop/tags/image-dialog.tag index 9a8a0e3b7..a1acd05f6 100644 --- a/src/web/app/desktop/tags/image-dialog.tag +++ b/src/web/app/desktop/tags/image-dialog.tag @@ -38,34 +38,34 @@ this.image = this.opts.image this.on('mount', () => { - Velocity this.root, { + Velocity(this.root, { opacity: 1 - } { + }, { duration: 100ms easing: 'linear' } - #Velocity @img, { + #Velocity(@img, { // scale: 1 // opacity: 1 - #} { + #}, { // duration: 200ms // easing: 'ease-out' #} this.close = () => { - Velocity this.root, { + Velocity(this.root, { opacity: 0 - } { + }, { duration: 100ms easing: 'linear' complete: => this.unmount(); } - #Velocity @img, { + #Velocity(@img, { // scale: 0.9 // opacity: 0 - #} { + #}, { // duration: 200ms // easing: 'ease-in' // complete: => diff --git a/src/web/app/desktop/tags/search-posts.tag b/src/web/app/desktop/tags/search-posts.tag index c56caa05e..dd3b8e66e 100644 --- a/src/web/app/desktop/tags/search-posts.tag +++ b/src/web/app/desktop/tags/search-posts.tag @@ -79,7 +79,7 @@ console.error err this.on-scroll = () => { - current = window.scroll-y + window.inner-height + current = window.scrollY + window.inner-height if current > document.body.offset-height - 16 // 遊び @more! diff --git a/src/web/app/desktop/tags/stream-indicator.tag b/src/web/app/desktop/tags/stream-indicator.tag index c3669c074..9ca311c47 100644 --- a/src/web/app/desktop/tags/stream-indicator.tag +++ b/src/web/app/desktop/tags/stream-indicator.tag @@ -30,24 +30,24 @@ this.mixin('stream'); this.on('before-mount', () => { - this.state = @get-stream-state! + this.state = this.getStreamState(); - if @state == 'connected' + if this.state == 'connected' this.root.style.opacity = 0 this.stream-state-ev.on('connected', () => { - this.state = @get-stream-state! + this.state = this.getStreamState(); this.update(); setTimeout => - Velocity this.root, { + Velocity(this.root, { opacity: 0 } 200ms 'linear' , 1000ms this.stream-state-ev.on('closed', () => { - this.state = @get-stream-state! + this.state = this.getStreamState(); this.update(); - Velocity this.root, { + Velocity(this.root, { opacity: 1 } 0ms diff --git a/src/web/app/desktop/tags/ui-notification.tag b/src/web/app/desktop/tags/ui-notification.tag index 22ba98df9..34f310844 100644 --- a/src/web/app/desktop/tags/ui-notification.tag +++ b/src/web/app/desktop/tags/ui-notification.tag @@ -23,22 +23,22 @@ diff --git a/src/web/app/desktop/tags/user-followers.tag b/src/web/app/desktop/tags/user-followers.tag index 53c3c8985..f43e87de8 100644 --- a/src/web/app/desktop/tags/user-followers.tag +++ b/src/web/app/desktop/tags/user-followers.tag @@ -9,14 +9,15 @@ diff --git a/src/web/app/desktop/tags/user-following.tag b/src/web/app/desktop/tags/user-following.tag index a8f9ccb89..f2d21b3fe 100644 --- a/src/web/app/desktop/tags/user-following.tag +++ b/src/web/app/desktop/tags/user-following.tag @@ -9,14 +9,15 @@ diff --git a/src/web/app/desktop/tags/user-friends-graph.tag b/src/web/app/desktop/tags/user-friends-graph.tag index 923ea6fe9..76827fbda 100644 --- a/src/web/app/desktop/tags/user-friends-graph.tag +++ b/src/web/app/desktop/tags/user-friends-graph.tag @@ -15,18 +15,18 @@ this.user-promise = if @is-promise this.opts.user then this.opts.user else Promise.resolve this.opts.user this.on('mount', () => { - user <~ @user-promise.then + user <~ this.user-promise.then this.user = user this.update(); this.api 'aggregation/users/followers' do - user_id: @user.id + user_id: this.user.id limit: 30days .then (followers) => followers = followers.reverse! this.api 'aggregation/users/following' do - user_id: @user.id + user_id: this.user.id limit: 30days .then (following) => following = following.reverse! diff --git a/src/web/app/desktop/tags/user-graphs.tag b/src/web/app/desktop/tags/user-graphs.tag index ad1c4d7ee..e673f7700 100644 --- a/src/web/app/desktop/tags/user-graphs.tag +++ b/src/web/app/desktop/tags/user-graphs.tag @@ -36,5 +36,6 @@ diff --git a/src/web/app/desktop/tags/user-header.tag b/src/web/app/desktop/tags/user-header.tag index ff37b334e..c26535716 100644 --- a/src/web/app/desktop/tags/user-header.tag +++ b/src/web/app/desktop/tags/user-header.tag @@ -108,35 +108,38 @@ this.mixin('update-banner'); this.mixin('NotImplementedException'); - this.user = this.opts.user + this.user = this.opts.user; this.on('mount', () => { - window.addEventListener 'load' @scroll - window.addEventListener 'scroll' @scroll - window.addEventListener 'resize' @scroll + window.addEventListener('load', this.scroll); + window.addEventListener('scroll', this.scroll); + window.addEventListener('resize', this.scroll); + }); this.on('unmount', () => { - window.removeEventListener 'load' @scroll - window.removeEventListener 'scroll' @scroll - window.removeEventListener 'resize' @scroll + window.removeEventListener('load', this.scroll); + window.removeEventListener('scroll', this.scroll); + window.removeEventListener('resize', this.scroll); + }); this.scroll = () => { - top = window.scroll-y - height = 280px + const top = window.scrollY; + const height = 280/*px*/; - pos = 50 - ((top / height) * 50) - this.refs.banner.style.background-position = 'center ' + pos + '%' + const pos = 50 - ((top / height) * 50); + this.refs.banner.style.backgroundPosition = `center ${pos}%`; - blur = top / 32 - if blur <= 10 - this.refs.banner.style.filter = 'blur(' + blur + 'px)' + const blur = top / 32 + if (blur <= 10) this.refs.banner.style.filter = `blur(${blur}px)`; + }; - this.on-update-banner = () => { - if not @SIGNIN or this.I.id != @user.id - return + this.onUpdateBanner = () => { + if (!this.SIGNIN || this.I.id != this.user.id) return; - @update-banner this.I, (i) => - @user.banner_url = i.banner_url + this.updateBanner(this.I, i => { + this.user.banner_url = i.banner_url; this.update(); + }); + }; diff --git a/src/web/app/desktop/tags/user-likes-graph.tag b/src/web/app/desktop/tags/user-likes-graph.tag index 099040133..6030efdaf 100644 --- a/src/web/app/desktop/tags/user-likes-graph.tag +++ b/src/web/app/desktop/tags/user-likes-graph.tag @@ -15,12 +15,12 @@ this.user-promise = if @is-promise this.opts.user then this.opts.user else Promise.resolve this.opts.user this.on('mount', () => { - user <~ @user-promise.then + user <~ this.user-promise.then this.user = user this.update(); this.api 'aggregation/users/like' do - user_id: @user.id + user_id: this.user.id limit: 30days .then (likes) => likes = likes.reverse! diff --git a/src/web/app/desktop/tags/user-photos.tag b/src/web/app/desktop/tags/user-photos.tag index 71899c92e..58ba1b73d 100644 --- a/src/web/app/desktop/tags/user-photos.tag +++ b/src/web/app/desktop/tags/user-photos.tag @@ -67,12 +67,12 @@ this.user-promise = if @is-promise this.opts.user then this.opts.user else Promise.resolve this.opts.user this.on('mount', () => { - @user-promise.then (user) => + this.user-promise.then (user) => this.user = user this.update(); this.api 'users/posts' do - user_id: @user.id + user_id: this.user.id with_media: true limit: 9posts .then (posts) => diff --git a/src/web/app/desktop/tags/user-posts-graph.tag b/src/web/app/desktop/tags/user-posts-graph.tag index 0efc61310..0be3abb4e 100644 --- a/src/web/app/desktop/tags/user-posts-graph.tag +++ b/src/web/app/desktop/tags/user-posts-graph.tag @@ -15,12 +15,12 @@ this.user-promise = if @is-promise this.opts.user then this.opts.user else Promise.resolve this.opts.user this.on('mount', () => { - user <~ @user-promise.then + user <~ this.user-promise.then this.user = user this.update(); this.api 'aggregation/users/post' do - user_id: @user.id + user_id: this.user.id limit: 30days .then (data) => data = data.reverse! diff --git a/src/web/app/desktop/tags/user-preview.tag b/src/web/app/desktop/tags/user-preview.tag index 00da1d8f1..6d4f0b2b0 100644 --- a/src/web/app/desktop/tags/user-preview.tag +++ b/src/web/app/desktop/tags/user-preview.tag @@ -114,27 +114,27 @@ Promise.resolve @u this.on('mount', () => { - @user-promise.then (user) => + this.user-promise.then (user) => this.user = user this.update(); - Velocity this.root, { + Velocity(this.root, { opacity: 0 'margin-top': '-8px' } 0ms - Velocity this.root, { + Velocity(this.root, { opacity: 1 'margin-top': 0 - } { + }, { duration: 200ms easing: 'ease-out' } this.close = () => { - Velocity this.root, { + Velocity(this.root, { opacity: 0 'margin-top': '-8px' - } { + }, { duration: 200ms easing: 'ease-out' complete: => this.unmount(); diff --git a/src/web/app/desktop/tags/user-profile.tag b/src/web/app/desktop/tags/user-profile.tag index b613aa968..8df631ade 100644 --- a/src/web/app/desktop/tags/user-profile.tag +++ b/src/web/app/desktop/tags/user-profile.tag @@ -89,11 +89,11 @@ this.show-following = () => { window = document.body.appendChild document.createElement 'mk-user-following-window' riot.mount window, do - user: @user + user: this.user this.show-followers = () => { window = document.body.appendChild document.createElement 'mk-user-followers-window' riot.mount window, do - user: @user + user: this.user diff --git a/src/web/app/desktop/tags/user-timeline.tag b/src/web/app/desktop/tags/user-timeline.tag index c982a68a7..405097e06 100644 --- a/src/web/app/desktop/tags/user-timeline.tag +++ b/src/web/app/desktop/tags/user-timeline.tag @@ -63,7 +63,7 @@ document.addEventListener 'keydown' this.on-document-keydown window.addEventListener 'scroll' this.on-scroll - @user-promise.then (user) => + this.user-promise.then (user) => this.user = user this.update(); @@ -83,7 +83,7 @@ this.fetch = (cb) => { this.api 'users/posts' do - user_id: @user.id + user_id: this.user.id with_replies: this.mode == 'with-replies' .then (posts) => this.is-loading = false @@ -101,7 +101,7 @@ this.more-loading = true this.update(); this.api 'users/posts' do - user_id: @user.id + user_id: this.user.id with_replies: this.mode == 'with-replies' max_id: this.refs.timeline.tail!.id .then (posts) => @@ -126,7 +126,7 @@ document.title = 'Misskey' this.on-scroll = () => { - current = window.scroll-y + window.inner-height + current = window.scrollY + window.inner-height if current > document.body.offset-height - 16 // 遊び @more! diff --git a/src/web/app/desktop/tags/user.tag b/src/web/app/desktop/tags/user.tag index 8e151c831..a088d97db 100644 --- a/src/web/app/desktop/tags/user.tag +++ b/src/web/app/desktop/tags/user.tag @@ -41,7 +41,7 @@ this.on('mount', () => { this.api 'users/show' do - username: @username + username: this.username .then (user) => this.fetching = false this.user = user diff --git a/src/web/app/desktop/tags/users-list.tag b/src/web/app/desktop/tags/users-list.tag index dbb7069c4..2d85cd2ec 100644 --- a/src/web/app/desktop/tags/users-list.tag +++ b/src/web/app/desktop/tags/users-list.tag @@ -120,7 +120,7 @@ this.mode == 'iknow' @limit @cursor - this.users = @users.concat obj.users + this.users = this.users.concat obj.users this.next = obj.next this.more-fetching = false this.update(); diff --git a/src/web/app/desktop/tags/window.tag b/src/web/app/desktop/tags/window.tag index 3c7cc14f7..f83ccf3f8 100644 --- a/src/web/app/desktop/tags/window.tag +++ b/src/web/app/desktop/tags/window.tag @@ -243,22 +243,22 @@ if @is-modal this.refs.bg.style.pointer-events = 'auto' - Velocity this.refs.bg, 'finish' true - Velocity this.refs.bg, { + Velocity(this.refs.bg, 'finish' true + Velocity(this.refs.bg, { opacity: 1 - } { + }, { queue: false duration: 100ms easing: 'linear' } this.refs.main.style.pointer-events = 'auto' - Velocity this.refs.main, 'finish' true - Velocity this.refs.main, {scale: 1.1} 0ms - Velocity this.refs.main, { + Velocity(this.refs.main, 'finish' true + Velocity(this.refs.main, {scale: 1.1} 0ms + Velocity(this.refs.main, { opacity: 1 scale: 1 - } { + }, { queue: false duration: 200ms easing: 'ease-out' @@ -275,21 +275,21 @@ if @is-modal this.refs.bg.style.pointer-events = 'none' - Velocity this.refs.bg, 'finish' true - Velocity this.refs.bg, { + Velocity(this.refs.bg, 'finish' true + Velocity(this.refs.bg, { opacity: 0 - } { + }, { queue: false duration: 300ms easing: 'linear' } this.refs.main.style.pointer-events = 'none' - Velocity this.refs.main, 'finish' true - Velocity this.refs.main, { + Velocity(this.refs.main, 'finish' true + Velocity(this.refs.main, { opacity: 0 scale: 0.8 - } { + }, { queue: false duration: 300ms easing: [ 0.5, -0.5, 1, 0.5 ] diff --git a/src/web/app/mobile/tags/follow-button.tag b/src/web/app/mobile/tags/follow-button.tag index 71a38254d..ff4c6586d 100644 --- a/src/web/app/mobile/tags/follow-button.tag +++ b/src/web/app/mobile/tags/follow-button.tag @@ -58,7 +58,7 @@ this.wait = false this.on('mount', () => { - @user-promise.then (user) => + this.user-promise.then (user) => this.user = user this.init = false this.update(); @@ -70,22 +70,22 @@ this.stream.off 'unfollow' this.on-stream-unfollow this.on-stream-follow = (user) => { - if user.id == @user.id + if user.id == this.user.id this.user = user this.update(); this.on-stream-unfollow = (user) => { - if user.id == @user.id + if user.id == this.user.id this.user = user this.update(); this.onclick = () => { this.wait = true - if @user.is_following + if this.user.is_following this.api 'following/delete' do - user_id: @user.id + user_id: this.user.id .then => - @user.is_following = false + this.user.is_following = false .catch (err) -> console.error err .then => @@ -93,9 +93,9 @@ this.update(); else this.api 'following/create' do - user_id: @user.id + user_id: this.user.id .then => - @user.is_following = true + this.user.is_following = true .catch (err) -> console.error err .then => diff --git a/src/web/app/mobile/tags/notify.tag b/src/web/app/mobile/tags/notify.tag index 5d27860e4..3003528fe 100644 --- a/src/web/app/mobile/tags/notify.tag +++ b/src/web/app/mobile/tags/notify.tag @@ -17,17 +17,17 @@ diff --git a/src/web/app/mobile/tags/user-followers.tag b/src/web/app/mobile/tags/user-followers.tag index 4eafb1ed9..cdde081dc 100644 --- a/src/web/app/mobile/tags/user-followers.tag +++ b/src/web/app/mobile/tags/user-followers.tag @@ -12,7 +12,7 @@ this.fetch = (iknow, limit, cursor, cb) => { this.api 'users/followers' do - user_id: @user.id + user_id: this.user.id iknow: iknow limit: limit cursor: if cursor? then cursor else undefined diff --git a/src/web/app/mobile/tags/user-following.tag b/src/web/app/mobile/tags/user-following.tag index 25d3c9926..37ee0ee39 100644 --- a/src/web/app/mobile/tags/user-following.tag +++ b/src/web/app/mobile/tags/user-following.tag @@ -12,7 +12,7 @@ this.fetch = (iknow, limit, cursor, cb) => { this.api 'users/following' do - user_id: @user.id + user_id: this.user.id iknow: iknow limit: limit cursor: if cursor? then cursor else undefined diff --git a/src/web/app/mobile/tags/user-timeline.tag b/src/web/app/mobile/tags/user-timeline.tag index 82a641354..80311924f 100644 --- a/src/web/app/mobile/tags/user-timeline.tag +++ b/src/web/app/mobile/tags/user-timeline.tag @@ -16,7 +16,7 @@ this.init = new Promise (res, rej) => this.api 'users/posts' do - user_id: @user.id + user_id: this.user.id with_media: @with-media .then (posts) => res posts @@ -24,7 +24,7 @@ this.more = () => { this.api 'users/posts' do - user_id: @user.id + user_id: this.user.id with_media: @with-media max_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 d36455e6e..660b08879 100644 --- a/src/web/app/mobile/tags/user.tag +++ b/src/web/app/mobile/tags/user.tag @@ -165,7 +165,7 @@ this.on('mount', () => { this.api 'users/show' do - username: @username + username: this.username .then (user) => this.fetching = false this.user = user diff --git a/src/web/app/mobile/tags/users-list.tag b/src/web/app/mobile/tags/users-list.tag index fc582e266..ef225d5b5 100644 --- a/src/web/app/mobile/tags/users-list.tag +++ b/src/web/app/mobile/tags/users-list.tag @@ -102,7 +102,7 @@ this.mode == 'iknow' @limit @cursor - this.users = @users.concat obj.users + this.users = this.users.concat obj.users this.next = obj.next this.more-fetching = false this.update();