summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/user.go2
-rw-r--r--store/sql_user_store_test.go3
-rw-r--r--web/react/components/channel_header.jsx7
-rw-r--r--web/react/components/mention_list.jsx4
-rw-r--r--web/react/components/msg_typing.jsx8
-rw-r--r--web/react/components/post_list.jsx2
-rw-r--r--web/react/components/textbox.jsx4
-rw-r--r--web/react/components/view_image.jsx2
-rw-r--r--web/sass-files/sass/partials/_modal.scss6
-rw-r--r--web/sass-files/sass/partials/_post.scss41
-rw-r--r--web/sass-files/sass/partials/_post_right.scss4
-rw-r--r--web/sass-files/sass/partials/_responsive.scss76
-rw-r--r--web/sass-files/sass/partials/_sidebar--right.scss4
13 files changed, 117 insertions, 46 deletions
diff --git a/api/user.go b/api/user.go
index 292d2b61b..ada781bc7 100644
--- a/api/user.go
+++ b/api/user.go
@@ -593,7 +593,7 @@ func createProfileImage(username string, userId string) ([]byte, *model.AppError
h.Write([]byte(userId))
seed := h.Sum32()
- color := colors[int(seed)%len(colors)]
+ color := colors[int64(seed)%int64(len(colors))]
img := image.NewRGBA(image.Rect(0, 0, int(utils.Cfg.ImageSettings.ProfileWidth), int(utils.Cfg.ImageSettings.ProfileHeight)))
draw.Draw(img, img.Bounds(), &image.Uniform{color}, image.ZP, draw.Src)
diff --git a/store/sql_user_store_test.go b/store/sql_user_store_test.go
index f8dae0021..12737caa8 100644
--- a/store/sql_user_store_test.go
+++ b/store/sql_user_store_test.go
@@ -7,6 +7,7 @@ import (
"github.com/mattermost/platform/model"
"strings"
"testing"
+ "time"
)
func TestUserStoreSave(t *testing.T) {
@@ -66,6 +67,8 @@ func TestUserStoreUpdate(t *testing.T) {
u1.Email = model.NewId()
Must(store.User().Save(&u1))
+ time.Sleep(100 * time.Millisecond)
+
if err := (<-store.User().Update(&u1, false)).Err; err != nil {
t.Fatal(err)
}
diff --git a/web/react/components/channel_header.jsx b/web/react/components/channel_header.jsx
index 48cb4d13b..68de80228 100644
--- a/web/react/components/channel_header.jsx
+++ b/web/react/components/channel_header.jsx
@@ -4,6 +4,7 @@
var ChannelStore = require('../stores/channel_store.jsx');
var UserStore = require('../stores/user_store.jsx');
var PostStore = require('../stores/post_store.jsx');
+var SocketStore = require('../stores/socket_store.jsx')
var UserProfile = require( './user_profile.jsx' );
var NavbarSearchBox =require('./search_bar.jsx');
var AsyncClient = require('../utils/async_client.jsx');
@@ -82,6 +83,7 @@ module.exports = React.createClass({
ChannelStore.addExtraInfoChangeListener(this._onChange);
PostStore.addSearchChangeListener(this._onChange);
UserStore.addChangeListener(this._onChange);
+ SocketStore.addChangeListener(this._onSocketChange);
},
componentWillUnmount: function() {
ChannelStore.removeChangeListener(this._onChange);
@@ -96,6 +98,11 @@ module.exports = React.createClass({
}
$(".channel-header__info .description").popover({placement : 'bottom', trigger: 'hover', html: true, delay: {show: 500, hide: 500}});
},
+ _onSocketChange: function(msg) {
+ if(msg.action === "new_user") {
+ AsyncClient.getChannelExtraInfo(true);
+ }
+ },
getInitialState: function() {
return getStateFromStores();
},
diff --git a/web/react/components/mention_list.jsx b/web/react/components/mention_list.jsx
index 2fecc129a..b666fcfae 100644
--- a/web/react/components/mention_list.jsx
+++ b/web/react/components/mention_list.jsx
@@ -14,7 +14,7 @@ module.exports = React.createClass({
PostStore.addMentionDataChangeListener(this._onChange);
var self = this;
- $('#'+this.props.id).on('keypress.mentionlist',
+ $('body').on('keypress.mentionlist', '#'+this.props.id,
function(e) {
if (!self.isEmpty() && self.state.mentionText != '-1' && e.which === 13) {
e.stopPropagation();
@@ -31,7 +31,7 @@ module.exports = React.createClass({
},
componentWillUnmount: function() {
PostStore.removeMentionDataChangeListener(this._onChange);
- $('#'+this.props.id).off('keypress.mentionlist');
+ $('body').off('keypress.mentionlist', '#'+this.props.id);
},
_onChange: function(id, mentionText, excludeList) {
if (id !== this.props.id) return;
diff --git a/web/react/components/msg_typing.jsx b/web/react/components/msg_typing.jsx
index 9d3904757..a6953028f 100644
--- a/web/react/components/msg_typing.jsx
+++ b/web/react/components/msg_typing.jsx
@@ -11,6 +11,11 @@ module.exports = React.createClass({
componentDidMount: function() {
SocketStore.addChangeListener(this._onChange);
},
+ componentWillReceiveProps: function(newProps) {
+ if(this.props.channelId !== newProps.channelId) {
+ this.setState({text:""});
+ }
+ },
componentWillUnmount: function() {
SocketStore.removeChangeListener(this._onChange);
},
@@ -37,6 +42,9 @@ module.exports = React.createClass({
}, 3000);
}
}
+ else if (msg.action == "posted" && msg.channel_id === this.props.channelId) {
+ this.setState({text:""})
+ }
},
getInitialState: function() {
return { text: "" };
diff --git a/web/react/components/post_list.jsx b/web/react/components/post_list.jsx
index 169efc766..fc5157ce6 100644
--- a/web/react/components/post_list.jsx
+++ b/web/react/components/post_list.jsx
@@ -123,7 +123,7 @@ module.exports = React.createClass({
$('.post-list__content div .post').removeClass('post--last');
$('.post-list__content div:last-child .post').addClass('post--last');
- $('body').on('mouseenter mouseleave', '.post', function(ev){
+ $('body').on('mouseenter mouseleave', '.post:not(.post--comment.same--root)', function(ev){
if(ev.type === 'mouseenter'){
$(this).parent('div').prev('.date-separator, .new-separator').addClass('hovered--after');
$(this).parent('div').next('.date-separator, .new-separator').addClass('hovered--before');
diff --git a/web/react/components/textbox.jsx b/web/react/components/textbox.jsx
index 934e863a2..6b746aa78 100644
--- a/web/react/components/textbox.jsx
+++ b/web/react/components/textbox.jsx
@@ -78,6 +78,8 @@ module.exports = React.createClass({
var re = new RegExp('( |^)@' + m + '( |$|\n)', 'm');
html = html.replace(re, '$1<span class="mention">@'+m+'</span>$2');
}
+ var re2 = new RegExp('(^$)(?![.\n])', 'gm');
+ html = html.replace(re2, '<br/><br/>');
$(this.refs.textdiv.getDOMNode()).html(html);
},
handleChange: function() {
@@ -262,6 +264,8 @@ module.exports = React.createClass({
$(d).css({'height':'auto','overflow-y':'scroll'}).height(167);
$(w).css({'height':'auto'}).height(167);
}
+
+ $(d).scrollTop($(e).scrollTop());
},
handleFocus: function() {
var elm = this.refs.message.getDOMNode();
diff --git a/web/react/components/view_image.jsx b/web/react/components/view_image.jsx
index c573e9dbb..38f439946 100644
--- a/web/react/components/view_image.jsx
+++ b/web/react/components/view_image.jsx
@@ -161,7 +161,7 @@ module.exports = React.createClass({
<div className="image-links">
{ config.AllowPublicLink ?
<div>
- <a href="#" className="text" data-title="Public Image" onClick={this.getPublicLink}>Get Public Link</a>
+ <a href="#" className="public-link text" data-title="Public Image" onClick={this.getPublicLink}>Get Public Link</a>
<span className="text"> | </span>
</div>
: "" }
diff --git a/web/sass-files/sass/partials/_modal.scss b/web/sass-files/sass/partials/_modal.scss
index 971ed0935..637f908ca 100644
--- a/web/sass-files/sass/partials/_modal.scss
+++ b/web/sass-files/sass/partials/_modal.scss
@@ -2,6 +2,7 @@
padding: 20px 15px;
}
.modal {
+ width: 100%;
&.image_modal {
.modal-backdrop.in {
@include opacity(0.7);
@@ -148,7 +149,7 @@
.image-wrapper {
background: #FFF;
position: relative;
- max-width: 80%;
+ max-width: 90%;
min-width: 280px;
@include border-radius(3px);
display: table;
@@ -261,6 +262,9 @@
color:white;
margin-left:5px;
}
+ .public-link {
+ margin-right: 5px;
+ }
}
}
}
diff --git a/web/sass-files/sass/partials/_post.scss b/web/sass-files/sass/partials/_post.scss
index 769cb1091..e35979b64 100644
--- a/web/sass-files/sass/partials/_post.scss
+++ b/web/sass-files/sass/partials/_post.scss
@@ -166,7 +166,7 @@ body.ios {
color: #999;
@include single-transition(all, 0.15s);
font-size: 16px;
- padding: 9px;
+ padding: 7px 9px 6px;
&:hover, &:active {
color: #444;
box-shadow: none;
@@ -192,7 +192,7 @@ body.ios {
.post {
word-wrap: break-word;
- padding: 0.4em 1em;
+ padding: 8px 1em;
position: relative;
max-width: 100%;
@include legacy-pie-clearfix;
@@ -204,19 +204,37 @@ body.ios {
}
background: #f6f6f6;
}
+ &.current--user {
+ .post-body {
+ @include border-radius(4px);
+ background: #f5f5f5;
+ }
+ &:hover {
+ .post-body {
+ background: #fff;
+ }
+ }
+ }
&.post--comment {
&.other--root {
.post-comment {
border-left: 4px solid #EEE;
- margin-left: 30px;
- padding: 2px 0 2px 10px;
+ padding: 4px 0 6px 10px;
+ background: #F5F5F5;
+ margin: 0 0 0 30px;
+ @include border-radius(0 4px 4px 0);
+ }
+ .post-body {
+ background: transparent;
+ margin: 0;
+ padding: 1px 0px;
+ }
+ &:hover {
+ background: #f5f5f5;
+ .post-comment {
+ background: #fff;
+ }
}
- }
- }
- &.current--user {
- .post-body {
- @include border-radius(0 4px 4px 0);
- background: #f5f5f5;
}
}
&.same--root {
@@ -224,6 +242,7 @@ body.ios {
@include opacity(0);
}
div.post-profile-img__container {
+ height: 1px;
.post-profile-img {
visibility: hidden;
}
@@ -260,6 +279,7 @@ body.ios {
white-space: pre-wrap;
}
.comment-icon__container {
+ margin-left: 7px;
fill: $primary-color;
.comment-icon {
display: inline-block;
@@ -346,7 +366,6 @@ body.ios {
}
.dropdown {
min-width: 18px;
- margin-right: 7px;
display: inline-block;
@include opacity(0);
}
diff --git a/web/sass-files/sass/partials/_post_right.scss b/web/sass-files/sass/partials/_post_right.scss
index 972aef29b..0d3e75689 100644
--- a/web/sass-files/sass/partials/_post_right.scss
+++ b/web/sass-files/sass/partials/_post_right.scss
@@ -11,7 +11,8 @@
.post {
&.post--root {
- padding: 1em;
+ padding: 1em 1em 0;
+ margin: 1em 0;
hr {
border-color: #DDD;
margin: 1em 0 0 0;
@@ -20,6 +21,7 @@
}
.post-create__container {
+ margin-top: 1em;
.custom-textarea {
min-height: 100px;
}
diff --git a/web/sass-files/sass/partials/_responsive.scss b/web/sass-files/sass/partials/_responsive.scss
index 0037879cf..e2c89a6f2 100644
--- a/web/sass-files/sass/partials/_responsive.scss
+++ b/web/sass-files/sass/partials/_responsive.scss
@@ -2,13 +2,6 @@
.inner__wrap {
&.move--left {
.post {
- &.post--comment {
- &.other--root {
- .post-comment {
- margin-left: -7px;
- }
- }
- }
&.same--root {
margin-left: 60px;
padding-left: 10px;
@@ -24,13 +17,24 @@
.post-body {
width: 736px;
border: none;
- margin: 0;
+ margin: 3px 0 0;
+ }
+ }
+ &.post--comment {
+ &.other--root {
+ .post-comment {
+ margin-left: 0;
+ }
+ }
+ &.same--root {
+ margin-top: 10px;
+ margin-bottom: 10px;
}
}
.post-body {
float: none;
width: 750px;
- margin: 0;
+ margin: 3px 0 0;
}
.post__content {
width: 920px;
@@ -79,18 +83,10 @@
}
}
.post {
- &.post--comment {
- &.other--root {
- .post-comment {
- margin-left: -7px;
- }
- }
- }
&.same--root {
margin-left: 60px;
padding-left: 10px;
border-left: 4px solid #EEE;
- margin-bottom: 10px;
div.post-profile-img__container {
.post-profile-img {
display: none;
@@ -102,7 +98,18 @@
.post-body {
width: 736px;
border: none;
- margin: 0;
+ margin: 3px 0 0;
+ }
+ }
+ &.post--comment {
+ &.other--root {
+ .post-comment {
+ margin-left: 0;
+ }
+ }
+ &.same--root {
+ margin-top: 5px;
+ margin-bottom: 5px;
}
}
.post__content {
@@ -137,7 +144,7 @@
}
}
.post-body {
- margin: 0;
+ margin: 3px 0 0;
float: none;
width: 750px;
}
@@ -166,16 +173,9 @@
@media screen and (max-width: 960px) {
.post {
- &:hover {
- .post-header .post-header-col.post-header__reply {
- .comment-icon__container__hide {
- @include opacity(0);
- }
- }
- }
.post-header .post-header-col.post-header__reply {
.comment-icon__container__hide {
- @include opacity(0);
+ display: none;
}
.dropdown {
@include opacity(1);
@@ -208,7 +208,7 @@
@media screen and (max-width: 768px) {
#post-list {
- .date-seperator {
+ .date-seperator, .new-separator {
&.hovered--after {
background: none;
}
@@ -224,6 +224,26 @@
&:hover {
background: none;
}
+ &.current--user {
+ &:hover {
+ .post-body {
+ background: #f5f5f5;
+ }
+ }
+ }
+ &.post--comment {
+ &.other--root {
+ &:hover {
+ background: none;
+ .post-body {
+ background: none;
+ .post-comment {
+ background: #f5f5f5;
+ }
+ }
+ }
+ }
+ }
}
.signup-team__container {
padding: 30px 0;
diff --git a/web/sass-files/sass/partials/_sidebar--right.scss b/web/sass-files/sass/partials/_sidebar--right.scss
index d6000a515..7a91caec9 100644
--- a/web/sass-files/sass/partials/_sidebar--right.scss
+++ b/web/sass-files/sass/partials/_sidebar--right.scss
@@ -23,8 +23,12 @@
}
}
}
+ .post-body {
+ margin: 3px 0 0;
+ }
}
.post-create__container {
+ margin-top: 10px;
.post-create-footer {
padding-top: 10px;
}