From ebddb6c6b05d251f1e87b918eaec59ab09cd97a1 Mon Sep 17 00:00:00 2001 From: nickago Date: Thu, 23 Jul 2015 11:37:59 -0700 Subject: Added support for png profile pictures --- web/react/components/user_settings.jsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/web/react/components/user_settings.jsx b/web/react/components/user_settings.jsx index 1fbbf16ed..0f600a813 100644 --- a/web/react/components/user_settings.jsx +++ b/web/react/components/user_settings.jsx @@ -683,13 +683,15 @@ var GeneralTab = React.createClass({ if(!this.submitActive) return; - if(this.state.picture.type !== "image/jpeg") { - this.setState({client_error: "Only JPG images may be used for profile pictures"}); + var picture = this.state.picture; + + if(picture.type !== "image/jpeg" && picture.type !== "image/png") { + this.setState({client_error: "Only JPG or PNG images may be used for profile pictures"}); return; } formData = new FormData(); - formData.append('image', this.state.picture, this.state.picture.name); + formData.append('image', picture, picture.name); client.uploadProfileImage(formData, function(data) { -- cgit v1.2.3-1-g7c22 From 414c2bed91f7fa9a936b2fba36e70558b5ffb997 Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Thu, 23 Jul 2015 14:04:33 -0700 Subject: Removes the blue tag highlighting from mentions that would appear after typing a mention --- web/react/components/textbox.jsx | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/web/react/components/textbox.jsx b/web/react/components/textbox.jsx index ad50b7920..d586b3918 100644 --- a/web/react/components/textbox.jsx +++ b/web/react/components/textbox.jsx @@ -119,13 +119,8 @@ module.exports = React.createClass({ }, updateTextdiv: function() { var html = utils.insertHtmlEntities(this.refs.message.getDOMNode().value); - for (var k in this.mentions) { - var m = this.mentions[k]; - var re = new RegExp('( |^)@' + m + '( |$|\n)', 'm'); - html = html.replace(re, '$1@'+m+'$2'); - } - var re2 = new RegExp('(^$)(?![.\n])', 'gm'); - html = html.replace(re2, '

'); + var re = new RegExp('(^$)(?![.\n])', 'gm'); + html = html.replace(re, '

'); $(this.refs.textdiv.getDOMNode()).html(html); }, handleChange: function() { @@ -181,7 +176,7 @@ module.exports = React.createClass({ } }, processMentions: function() { - /* First, find all the possible mentions, highlight them in the HTML and add + /* First, find all the possible mentions and add them all to a list of mentions */ var text = utils.insertHtmlEntities(this.refs.message.getDOMNode().value); @@ -194,7 +189,6 @@ module.exports = React.createClass({ if (!matches) { $(this.refs.textdiv.getDOMNode()).text(text); this.updateMentionTab(null, []); - this.mentions = []; return; } @@ -207,7 +201,7 @@ module.exports = React.createClass({ } /* Figure out what the user is currently typing. If it's a mention then we don't - want to highlight it and add it to the mention list yet, so we remove it if + want to add it to the mention list yet, so we remove it if there is only one occurence of that mention so far. */ var caret = utils.getCaretPosition(this.refs.message.getDOMNode()); @@ -225,14 +219,13 @@ module.exports = React.createClass({ typingMention = text.substring(atIndex+1, caret); } - var re3 = new RegExp('@' + typingMention + '( |$|\n)', 'g'); + var re2 = new RegExp('@' + typingMention + '( |$|\n)', 'g'); - if ((text.match(re3) || []).length === 1 && mentions.indexOf(typingMention) !== -1) { + if ((text.match(re2) || []).length === 1 && mentions.indexOf(typingMention) !== -1) { mentions.splice(mentions.indexOf(typingMention), 1); } this.updateMentionTab(null, mentions); - this.mentions = mentions; }, checkForNewMention: function(text) { var caret = utils.getCaretPosition(this.refs.message.getDOMNode()); -- cgit v1.2.3-1-g7c22 From ae83df8ed5b22f9b567cb77953d47861f59580a7 Mon Sep 17 00:00:00 2001 From: hmhealey Date: Mon, 20 Jul 2015 15:11:26 -0400 Subject: Update nfnt/resize library to the most recent version (as of July 20) --- Godeps/Godeps.json | 2 +- .../src/github.com/nfnt/resize/converter.go | 6 +- .../src/github.com/nfnt/resize/resize.go | 4 +- .../src/github.com/nfnt/resize/resize_test.go | 96 +++++++++++++++++++++- 4 files changed, 99 insertions(+), 9 deletions(-) diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 8b30d0478..86ed9e0cf 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -100,7 +100,7 @@ }, { "ImportPath": "github.com/nfnt/resize", - "Rev": "f2d1b73023c55bdfb4fa2ed385d2bec95bce3692" + "Rev": "dc93e1b98c579d90ee2fa15c1fd6dac34f6e7899" }, { "ImportPath": "github.com/stretchr/objx", diff --git a/Godeps/_workspace/src/github.com/nfnt/resize/converter.go b/Godeps/_workspace/src/github.com/nfnt/resize/converter.go index 84bd284ba..b3dd06b8d 100644 --- a/Godeps/_workspace/src/github.com/nfnt/resize/converter.go +++ b/Godeps/_workspace/src/github.com/nfnt/resize/converter.go @@ -131,11 +131,11 @@ func resizeRGBA(in *image.RGBA, out *image.NRGBA, scale float64, coeffs []int16, // reverse alpha-premultiplication. if a != 0 { - r *= 0xffff + r *= 0xff r /= a - g *= 0xffff + g *= 0xff g /= a - b *= 0xffff + b *= 0xff b /= a } diff --git a/Godeps/_workspace/src/github.com/nfnt/resize/resize.go b/Godeps/_workspace/src/github.com/nfnt/resize/resize.go index 4d4ff6e3e..c1672432e 100644 --- a/Godeps/_workspace/src/github.com/nfnt/resize/resize.go +++ b/Godeps/_workspace/src/github.com/nfnt/resize/resize.go @@ -167,7 +167,7 @@ func Resize(width, height uint, img image.Image, interp InterpolationFunction) i // accessing the YCbCr arrays in a tight loop is slow. // converting the image to ycc increases performance by 2x. temp := newYCC(image.Rect(0, 0, input.Bounds().Dy(), int(width)), input.SubsampleRatio) - result := newYCC(image.Rect(0, 0, int(width), int(height)), input.SubsampleRatio) + result := newYCC(image.Rect(0, 0, int(width), int(height)), image.YCbCrSubsampleRatio444) coeffs, offset, filterLength := createWeights8(temp.Bounds().Dy(), taps, blur, scaleX, kernel) in := imageYCbCrToYCC(input) @@ -409,7 +409,7 @@ func resizeNearest(width, height uint, scaleX, scaleY float64, img image.Image, // accessing the YCbCr arrays in a tight loop is slow. // converting the image to ycc increases performance by 2x. temp := newYCC(image.Rect(0, 0, input.Bounds().Dy(), int(width)), input.SubsampleRatio) - result := newYCC(image.Rect(0, 0, int(width), int(height)), input.SubsampleRatio) + result := newYCC(image.Rect(0, 0, int(width), int(height)), image.YCbCrSubsampleRatio444) coeffs, offset, filterLength := createWeightsNearest(temp.Bounds().Dy(), taps, blur, scaleX) in := imageYCbCrToYCC(input) diff --git a/Godeps/_workspace/src/github.com/nfnt/resize/resize_test.go b/Godeps/_workspace/src/github.com/nfnt/resize/resize_test.go index ee31ac494..6f6911316 100644 --- a/Godeps/_workspace/src/github.com/nfnt/resize/resize_test.go +++ b/Godeps/_workspace/src/github.com/nfnt/resize/resize_test.go @@ -46,7 +46,7 @@ func Test_CorrectResize(t *testing.T) { } } -func Test_SameColor(t *testing.T) { +func Test_SameColorWithRGBA(t *testing.T) { img := image.NewRGBA(image.Rect(0, 0, 20, 20)) for y := img.Bounds().Min.Y; y < img.Bounds().Max.Y; y++ { for x := img.Bounds().Min.X; x < img.Bounds().Max.X; x++ { @@ -56,9 +56,99 @@ func Test_SameColor(t *testing.T) { out := Resize(10, 10, img, Lanczos3) for y := out.Bounds().Min.Y; y < out.Bounds().Max.Y; y++ { for x := out.Bounds().Min.X; x < out.Bounds().Max.X; x++ { - color := img.At(x, y).(color.RGBA) + color := out.At(x, y).(color.NRGBA) if color.R != 0x80 || color.G != 0x80 || color.B != 0x80 || color.A != 0xFF { - t.Fail() + t.Errorf("%+v", color) + } + } + } +} + +func Test_SameColorWithNRGBA(t *testing.T) { + img := image.NewNRGBA(image.Rect(0, 0, 20, 20)) + for y := img.Bounds().Min.Y; y < img.Bounds().Max.Y; y++ { + for x := img.Bounds().Min.X; x < img.Bounds().Max.X; x++ { + img.SetNRGBA(x, y, color.NRGBA{0x80, 0x80, 0x80, 0xFF}) + } + } + out := Resize(10, 10, img, Lanczos3) + for y := out.Bounds().Min.Y; y < out.Bounds().Max.Y; y++ { + for x := out.Bounds().Min.X; x < out.Bounds().Max.X; x++ { + color := out.At(x, y).(color.NRGBA) + if color.R != 0x80 || color.G != 0x80 || color.B != 0x80 || color.A != 0xFF { + t.Errorf("%+v", color) + } + } + } +} + +func Test_SameColorWithRGBA64(t *testing.T) { + img := image.NewRGBA64(image.Rect(0, 0, 20, 20)) + for y := img.Bounds().Min.Y; y < img.Bounds().Max.Y; y++ { + for x := img.Bounds().Min.X; x < img.Bounds().Max.X; x++ { + img.SetRGBA64(x, y, color.RGBA64{0x8000, 0x8000, 0x8000, 0xFFFF}) + } + } + out := Resize(10, 10, img, Lanczos3) + for y := out.Bounds().Min.Y; y < out.Bounds().Max.Y; y++ { + for x := out.Bounds().Min.X; x < out.Bounds().Max.X; x++ { + color := out.At(x, y).(color.NRGBA64) + if color.R != 0x8000 || color.G != 0x8000 || color.B != 0x8000 || color.A != 0xFFFF { + t.Errorf("%+v", color) + } + } + } +} + +func Test_SameColorWithNRGBA64(t *testing.T) { + img := image.NewNRGBA64(image.Rect(0, 0, 20, 20)) + for y := img.Bounds().Min.Y; y < img.Bounds().Max.Y; y++ { + for x := img.Bounds().Min.X; x < img.Bounds().Max.X; x++ { + img.SetNRGBA64(x, y, color.NRGBA64{0x8000, 0x8000, 0x8000, 0xFFFF}) + } + } + out := Resize(10, 10, img, Lanczos3) + for y := out.Bounds().Min.Y; y < out.Bounds().Max.Y; y++ { + for x := out.Bounds().Min.X; x < out.Bounds().Max.X; x++ { + color := out.At(x, y).(color.NRGBA64) + if color.R != 0x8000 || color.G != 0x8000 || color.B != 0x8000 || color.A != 0xFFFF { + t.Errorf("%+v", color) + } + } + } +} + +func Test_SameColorWithGray(t *testing.T) { + img := image.NewGray(image.Rect(0, 0, 20, 20)) + for y := img.Bounds().Min.Y; y < img.Bounds().Max.Y; y++ { + for x := img.Bounds().Min.X; x < img.Bounds().Max.X; x++ { + img.SetGray(x, y, color.Gray{0x80}) + } + } + out := Resize(10, 10, img, Lanczos3) + for y := out.Bounds().Min.Y; y < out.Bounds().Max.Y; y++ { + for x := out.Bounds().Min.X; x < out.Bounds().Max.X; x++ { + color := out.At(x, y).(color.Gray) + if color.Y != 0x80 { + t.Errorf("%+v", color) + } + } + } +} + +func Test_SameColorWithGray16(t *testing.T) { + img := image.NewGray16(image.Rect(0, 0, 20, 20)) + for y := img.Bounds().Min.Y; y < img.Bounds().Max.Y; y++ { + for x := img.Bounds().Min.X; x < img.Bounds().Max.X; x++ { + img.SetGray16(x, y, color.Gray16{0x8000}) + } + } + out := Resize(10, 10, img, Lanczos3) + for y := out.Bounds().Min.Y; y < out.Bounds().Max.Y; y++ { + for x := out.Bounds().Min.X; x < out.Bounds().Max.X; x++ { + color := out.At(x, y).(color.Gray16) + if color.Y != 0x8000 { + t.Errorf("%+v", color) } } } -- cgit v1.2.3-1-g7c22 From a09f35bdcf227835497769feaad7801c2c23c58d Mon Sep 17 00:00:00 2001 From: hmhealey Date: Mon, 20 Jul 2015 15:12:21 -0400 Subject: Change image rescaling algorithm back to Lanczos3 now that it works correctly in all cases --- api/file.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/file.go b/api/file.go index 82cee9d1e..889c9dd1b 100644 --- a/api/file.go +++ b/api/file.go @@ -142,7 +142,7 @@ func fireAndForgetHandleImages(filenames []string, fileData [][]byte, teamId, ch go func() { var thumbnail image.Image if imgConfig.Width > int(utils.Cfg.ImageSettings.ThumbnailWidth) { - thumbnail = resize.Resize(utils.Cfg.ImageSettings.ThumbnailWidth, utils.Cfg.ImageSettings.ThumbnailHeight, img, resize.NearestNeighbor) + thumbnail = resize.Resize(utils.Cfg.ImageSettings.ThumbnailWidth, utils.Cfg.ImageSettings.ThumbnailHeight, img, resize.Lanczos3) } else { thumbnail = img } @@ -164,7 +164,7 @@ func fireAndForgetHandleImages(filenames []string, fileData [][]byte, teamId, ch go func() { var preview image.Image if imgConfig.Width > int(utils.Cfg.ImageSettings.PreviewWidth) { - preview = resize.Resize(utils.Cfg.ImageSettings.PreviewWidth, utils.Cfg.ImageSettings.PreviewHeight, img, resize.NearestNeighbor) + preview = resize.Resize(utils.Cfg.ImageSettings.PreviewWidth, utils.Cfg.ImageSettings.PreviewHeight, img, resize.Lanczos3) } else { preview = img } -- cgit v1.2.3-1-g7c22 From 49c50f95752071c32a3d19aee36566bfa20260df Mon Sep 17 00:00:00 2001 From: hmhealey Date: Mon, 20 Jul 2015 15:13:12 -0400 Subject: Change Makefile to use local copies of dependencies by running go through godep --- Makefile | 49 +++++++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/Makefile b/Makefile index 8793ba98a..28cdce707 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,13 @@ GOPATH ?= $(GOPATH:) GOFLAGS ?= $(GOFLAGS:) BUILD_NUMBER ?= $(BUILD_NUMBER:) +ifeq ($(shell which godep), "") + GODEP=$(GOPATH)/bin/godep +else + GODEP=godep +endif +GO=$(GODEP) go + ifeq ($(BUILD_NUMBER),) BUILD_NUMBER := dev endif @@ -21,29 +28,27 @@ travis: @echo building for travis rm -Rf $(DIST_ROOT) - @go clean $(GOFLAGS) -i ./... - + @$(GO) clean $(GOFLAGS) -i ./... + @cd web/react/ && npm install - @go build $(GOFLAGS) ./... + @$(GO) build $(GOFLAGS) ./... @mkdir -p logs - @go test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=180s ./api || exit 1 - @go test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=12s ./model || exit 1 - @go test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./store || exit 1 - @go test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./utils || exit 1 - @go test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./web || exit 1 + @$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=180s ./api || exit 1 + @$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=12s ./model || exit 1 + @$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./store || exit 1 + @$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./utils || exit 1 + @$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./web || exit 1 build: - @go build $(GOFLAGS) ./... + @$(GO) build $(GOFLAGS) ./... install: @go get $(GOFLAGS) github.com/tools/godep - @if [ $(shell docker ps -a | grep -ci mattermost-mysql) -eq 0 ]; then \ - echo restoring go libs using godep; \ - $(GOPATH)/bin/godep restore; \ + @if [ $(shell docker ps | grep -ci mattermost-mysql) -eq 0 ]; then \ echo starting mattermost-mysql; \ docker run --name mattermost-mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=mostest \ -e MYSQL_USER=mmuser -e MYSQL_PASSWORD=mostest -e MYSQL_DATABASE=mattermost_test -d mysql > /dev/null; \ @@ -64,15 +69,15 @@ install: test: install @mkdir -p logs - @go test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=180s ./api || exit 1 - @go test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=12s ./model || exit 1 - @go test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./store || exit 1 - @go test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./utils || exit 1 - @go test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./web || exit 1 + @$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=180s ./api || exit 1 + @$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=12s ./model || exit 1 + @$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./store || exit 1 + @$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./utils || exit 1 + @$(GO) test $(GOFLAGS) -run=$(TESTS) -test.v -test.timeout=120s ./web || exit 1 benchmark: install @mkdir -p logs - @go test $(GOFLAGS) -test.v -run=NO_TESTS -bench=$(BENCH) ./api || exit 1 + @$(GO) test $(GOFLAGS) -test.v -run=NO_TESTS -bench=$(BENCH) ./api || exit 1 cover: install rm -Rf $(DIST_RESULTS) @@ -94,7 +99,7 @@ cover: install clean: rm -Rf $(DIST_ROOT) - @go clean $(GOFLAGS) -i ./... + @$(GO) clean $(GOFLAGS) -i ./... @if [ $(shell docker ps -a | grep -ci mattermost-mysql) -eq 1 ]; then \ echo stopping mattermost-mysql; \ @@ -124,7 +129,7 @@ run: install @cd web/react && npm start & @echo starting go web server - @go run $(GOFLAGS) mattermost.go -config=config.json & + @$(GO) run $(GOFLAGS) mattermost.go -config=config.json & @echo starting compass watch @cd web/sass-files && compass watch & @@ -161,8 +166,8 @@ cleandb: dist: install - @go build $(GOFLAGS) -i -a ./... - @go install $(GOFLAGS) -a ./... + @$(GO) build $(GOFLAGS) -i -a ./... + @$(GO) install $(GOFLAGS) -a ./... mkdir -p $(DIST_PATH)/bin cp $(GOPATH)/bin/platform $(DIST_PATH)/bin -- cgit v1.2.3-1-g7c22 From 4e2ca3d74d1cf8e74a32d63e34c92890ec56efae Mon Sep 17 00:00:00 2001 From: hmhealey Date: Mon, 20 Jul 2015 16:06:26 -0400 Subject: Fixed detection of godep when it doesn't exist on the path --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 28cdce707..e118c23aa 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ GOPATH ?= $(GOPATH:) GOFLAGS ?= $(GOFLAGS:) BUILD_NUMBER ?= $(BUILD_NUMBER:) -ifeq ($(shell which godep), "") +ifeq ($(shell which godep),) GODEP=$(GOPATH)/bin/godep else GODEP=godep -- cgit v1.2.3-1-g7c22 From 2d91d4b9c69b3d39ba3f5c9b6e3f6385473e0248 Mon Sep 17 00:00:00 2001 From: hmhealey Date: Fri, 24 Jul 2015 12:17:48 -0400 Subject: Changed make cover to run godep go to match the rest of Makefile --- Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index e118c23aa..51fe2dace 100644 --- a/Makefile +++ b/Makefile @@ -83,17 +83,17 @@ cover: install rm -Rf $(DIST_RESULTS) mkdir -p $(DIST_RESULTS) - @go test $(GOFLAGS) -coverprofile=$(DIST_RESULTS)/api.cover.out github.com/mattermost/platform/api - @go test $(GOFLAGS) -coverprofile=$(DIST_RESULTS)/model.cover.out github.com/mattermost/platform/model - @go test $(GOFLAGS) -coverprofile=$(DIST_RESULTS)/store.cover.out github.com/mattermost/platform/store - @go test $(GOFLAGS) -coverprofile=$(DIST_RESULTS)/utils.cover.out github.com/mattermost/platform/utils - @go test $(GOFLAGS) -coverprofile=$(DIST_RESULTS)/web.cover.out github.com/mattermost/platform/web + @$(GO) test $(GOFLAGS) -coverprofile=$(DIST_RESULTS)/api.cover.out github.com/mattermost/platform/api + @$(GO) test $(GOFLAGS) -coverprofile=$(DIST_RESULTS)/model.cover.out github.com/mattermost/platform/model + @$(GO) test $(GOFLAGS) -coverprofile=$(DIST_RESULTS)/store.cover.out github.com/mattermost/platform/store + @$(GO) test $(GOFLAGS) -coverprofile=$(DIST_RESULTS)/utils.cover.out github.com/mattermost/platform/utils + @$(GO) test $(GOFLAGS) -coverprofile=$(DIST_RESULTS)/web.cover.out github.com/mattermost/platform/web cd $(DIST_RESULTS) && \ echo "mode: set" > coverage.out && cat *.cover.out | grep -v mode: | sort -r | \ awk '{if($$1 != last) {print $$0;last=$$1}}' >> coverage.out - cd $(DIST_RESULTS) && go tool cover -html=coverage.out -o=coverage.html + cd $(DIST_RESULTS) && $(GO) tool cover -html=coverage.out -o=coverage.html rm -f $(DIST_RESULTS)/*.cover.out -- cgit v1.2.3-1-g7c22 From f85d37cfb8dca3486d4630e70f2d76fe8dca32b8 Mon Sep 17 00:00:00 2001 From: hmhealey Date: Fri, 24 Jul 2015 12:37:11 -0400 Subject: Changed Makefile to just look for godep in the GOPATH to make the process simpler --- Makefile | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 51fe2dace..f8c169f15 100644 --- a/Makefile +++ b/Makefile @@ -4,12 +4,7 @@ GOPATH ?= $(GOPATH:) GOFLAGS ?= $(GOFLAGS:) BUILD_NUMBER ?= $(BUILD_NUMBER:) -ifeq ($(shell which godep),) - GODEP=$(GOPATH)/bin/godep -else - GODEP=godep -endif -GO=$(GODEP) go +GO=$(GOPATH)/bin/godep go ifeq ($(BUILD_NUMBER),) BUILD_NUMBER := dev -- cgit v1.2.3-1-g7c22 From 7355fe578c01db7d1febb04b6b905fda4994b59a Mon Sep 17 00:00:00 2001 From: hmhealey Date: Fri, 24 Jul 2015 13:50:02 -0400 Subject: Reverted accidental change to the Makefile that occurred while rebasing hmhealey/mm1494 branch --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f8c169f15..222d4ffe4 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,7 @@ build: install: @go get $(GOFLAGS) github.com/tools/godep - @if [ $(shell docker ps | grep -ci mattermost-mysql) -eq 0 ]; then \ + @if [ $(shell docker ps -a | grep -ci mattermost-mysql) -eq 0 ]; then \ echo starting mattermost-mysql; \ docker run --name mattermost-mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=mostest \ -e MYSQL_USER=mmuser -e MYSQL_PASSWORD=mostest -e MYSQL_DATABASE=mattermost_test -d mysql > /dev/null; \ -- cgit v1.2.3-1-g7c22 From b27562cedc64090ea030eaea0f540739f47ba6c2 Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Fri, 24 Jul 2015 08:52:20 -0700 Subject: Removed vestige textdiv code that is also no longer necessary due to removing the mention tags --- web/react/components/textbox.jsx | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/web/react/components/textbox.jsx b/web/react/components/textbox.jsx index d586b3918..bbd1f84b6 100644 --- a/web/react/components/textbox.jsx +++ b/web/react/components/textbox.jsx @@ -36,7 +36,6 @@ module.exports = React.createClass({ this.resize(); this.processMentions(); - this.updateTextdiv(); }, componentWillUnmount: function() { PostStore.removeAddMentionListener(this._onChange); @@ -87,7 +86,6 @@ module.exports = React.createClass({ this.processMentions(); this.doProcessMentions = false; } - this.updateTextdiv(); this.resize(); }, componentWillReceiveProps: function(nextProps) { @@ -117,12 +115,6 @@ module.exports = React.createClass({ }); }, 1); }, - updateTextdiv: function() { - var html = utils.insertHtmlEntities(this.refs.message.getDOMNode().value); - var re = new RegExp('(^$)(?![.\n])', 'gm'); - html = html.replace(re, '

'); - $(this.refs.textdiv.getDOMNode()).html(html); - }, handleChange: function() { this.props.onUserInput(this.refs.message.getDOMNode().value); this.resize(); @@ -187,7 +179,6 @@ module.exports = React.createClass({ var matches = text.match(re1); if (!matches) { - $(this.refs.textdiv.getDOMNode()).text(text); this.updateMentionTab(null, []); return; } @@ -280,15 +271,9 @@ module.exports = React.createClass({ elm.value = cmd; this.handleChange(); }, - scroll: function() { - var e = this.refs.message.getDOMNode(); - var d = this.refs.textdiv.getDOMNode(); - $(d).scrollTop($(e).scrollTop()); - }, resize: function() { var e = this.refs.message.getDOMNode(); var w = this.refs.wrapper.getDOMNode(); - var d = this.refs.textdiv.getDOMNode(); var lht = parseInt($(e).css('lineHeight'),10); var lines = e.scrollHeight / lht; @@ -296,15 +281,11 @@ module.exports = React.createClass({ if (e.scrollHeight - mod < 167) { $(e).css({'height':'auto','overflow-y':'hidden'}).height(e.scrollHeight - mod); - $(d).css({'height':'auto','overflow-y':'hidden'}).height(e.scrollHeight - mod); $(w).css({'height':'auto'}).height(e.scrollHeight+2); } else { $(e).css({'height':'auto','overflow-y':'scroll'}).height(167); - $(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(); @@ -325,8 +306,7 @@ module.exports = React.createClass({ return (
-
-