diff --git a/web/app/components/auth-panel/__select/auth-panel__select.scss b/web/app/components/auth-panel/__select/auth-panel__select.scss new file mode 100644 index 00000000..e4c04dbc --- /dev/null +++ b/web/app/components/auth-panel/__select/auth-panel__select.scss @@ -0,0 +1,5 @@ +.auth-panel__select { + &:focus { + outline: none; + } +} diff --git a/web/app/components/auth-panel/index.js b/web/app/components/auth-panel/index.js index 2bc0ac08..18533567 100644 --- a/web/app/components/auth-panel/index.js +++ b/web/app/components/auth-panel/index.js @@ -4,6 +4,7 @@ require('./auth-panel.scss'); require('./__column/auth-panel__column.scss'); require('./__pseudo-link/auth-panel__pseudo-link.scss'); +require('./__select/auth-panel__select.scss'); require('./__sort/auth-panel__sort.scss'); require('./__username/auth-panel__username.scss'); require('./__user-id/auth-panel__user-id.scss'); diff --git a/web/app/components/comment/__user-id/comment__user-id.scss b/web/app/components/comment/__user-id/comment__user-id.scss new file mode 100644 index 00000000..5fea35bb --- /dev/null +++ b/web/app/components/comment/__user-id/comment__user-id.scss @@ -0,0 +1,4 @@ +.comment__user-id { + color: #888; + font-weight: 400; +} diff --git a/web/app/components/comment/__username/comment__username.scss b/web/app/components/comment/__username/comment__username.scss index 34b12dd2..2e0683a8 100644 --- a/web/app/components/comment/__username/comment__username.scss +++ b/web/app/components/comment/__username/comment__username.scss @@ -3,10 +3,9 @@ font-weight: 700; text-decoration: none; color: #777; + cursor: pointer; - &:link { - &:hover { - text-decoration: underline; - } + &:hover { + opacity: .75; } } diff --git a/web/app/components/comment/_pinned/comment_pinned.scss b/web/app/components/comment/_pinned/comment_pinned.scss deleted file mode 100644 index 5a30cbec..00000000 --- a/web/app/components/comment/_pinned/comment_pinned.scss +++ /dev/null @@ -1,7 +0,0 @@ -.comment_pinned { - &, &.comment_view_admin { - .comment__username { - font-weight: 700; - } - } -} diff --git a/web/app/components/comment/comment.jsx b/web/app/components/comment/comment.jsx index 83608ef0..17dcde07 100644 --- a/web/app/components/comment/comment.jsx +++ b/web/app/components/comment/comment.jsx @@ -13,6 +13,7 @@ export default class Comment extends Component { this.state = { isInputVisible: false, + isUserIdVisible: false, }; this.updateState(props); @@ -20,6 +21,7 @@ export default class Comment extends Component { this.decreaseScore = this.decreaseScore.bind(this); this.increaseScore = this.increaseScore.bind(this); this.toggleInputVisibility = this.toggleInputVisibility.bind(this); + this.toggleUserIdVisibility = this.toggleUserIdVisibility.bind(this); this.onReply = this.onReply.bind(this); this.onPinClick = this.onPinClick.bind(this); this.onUnpinClick = this.onUnpinClick.bind(this); @@ -73,6 +75,10 @@ export default class Comment extends Component { } } + toggleUserIdVisibility() { + this.setState({ isUserIdVisible: !this.state.isUserIdVisible }); + } + onPinClick() { const { id } = this.props.data; @@ -175,7 +181,7 @@ export default class Comment extends Component { }); } - render(props, { guest, userBlocked, pinned, score, scoreIncreased, scoreDecreased, deleted, isInputVisible }) { + render(props, { guest, isUserIdVisible, userBlocked, pinned, score, scoreIncreased, scoreDecreased, deleted, isInputVisible }) { const { data, mix, mods = {} } = props; const isAdmin = !guest && store.get('user').admin; const isGuest = guest || !Object.keys(store.get('user')).length; @@ -242,7 +248,15 @@ export default class Comment extends Component { alt="" /> - {o.user.name} + {o.user.name} + + { + isUserIdVisible && ({o.user.id}) + } {o.time} @@ -358,6 +372,7 @@ export default class Comment extends Component { diff --git a/web/app/components/comment/index.js b/web/app/components/comment/index.js index 95a94aa4..83277664 100644 --- a/web/app/components/comment/index.js +++ b/web/app/components/comment/index.js @@ -22,6 +22,7 @@ require('./__score-value/comment__score-value.scss'); require('./__status/comment__status.scss'); require('./__text/comment__text.scss'); require('./__time/comment__time.scss'); +require('./__user-id/comment__user-id.scss'); require('./__username/comment__username.scss'); require('./__vote/comment__vote.scss'); @@ -31,7 +32,6 @@ require('./__vote/_type/_down/comment__vote_type_down.scss'); require('./__vote/_type/_up/comment__vote_type_up.scss'); require('./_level/comment_level.scss'); -require('./_pinned/comment_pinned.scss'); require('./_replying/comment_replying.scss'); require('./_useless/comment_useless.scss'); diff --git a/web/app/components/input/__button/input__button.scss b/web/app/components/input/__button/input__button.scss index 7e183fa8..5db2fff3 100644 --- a/web/app/components/input/__button/input__button.scss +++ b/web/app/components/input/__button/input__button.scss @@ -1,5 +1,6 @@ .input__button { box-sizing: border-box; + margin: 0; padding: 8px 12px; font-size: 16px; border: 0; diff --git a/web/app/components/input/__field/input__field.scss b/web/app/components/input/__field/input__field.scss index e9929f94..26ac0500 100644 --- a/web/app/components/input/__field/input__field.scss +++ b/web/app/components/input/__field/input__field.scss @@ -16,6 +16,7 @@ background: #fff; border: 0; resize: none; + backface-visibility: hidden; // let's try to fix blinking in Safari &:focus { box-shadow: inset 0 0 0 2px #259C9A; diff --git a/web/app/components/input/input.jsx b/web/app/components/input/input.jsx index 439a083e..f47b5fca 100644 --- a/web/app/components/input/input.jsx +++ b/web/app/components/input/input.jsx @@ -25,17 +25,22 @@ export default class Input extends Component { } onKeyDown(e) { + // send on cmd+enter / ctrl+enter if (e.keyCode === 13 && (e.metaKey || e.ctrlKey)) { this.send(); } + + // cancel on esc + if (e.keyCode === 27 && this.props.onCancel) { + this.props.onCancel(); + } } autoResize() { this.fieldNode.style.height = ''; - this.setState({ - height: this.fieldNode.scrollHeight, - preview: null, - }); + this.fieldNode.style.height = `${this.fieldNode.scrollHeight}px`; + + this.setState({ preview: null }); } send(e) { @@ -56,7 +61,8 @@ export default class Input extends Component { } this.fieldNode.value = ''; - this.setState({ height: null, preview: null }); + this.fieldNode.style.height = ''; + this.setState({ preview: null }); }) .catch(() => { // TODO: do smth? @@ -76,7 +82,7 @@ export default class Input extends Component { }); } - render(props, { height, isFieldDisabled, preview }) { + render(props, { isFieldDisabled, preview }) { return (