From d167e18f0048344c54685a08c19113a84a995ed9 Mon Sep 17 00:00:00 2001 From: Florian Orben Date: Sat, 17 Oct 2015 01:58:34 +0200 Subject: PLT-616: Enable playing of animated GIF in thumbnails and preview --- web/react/utils/utils.jsx | 1 + 1 file changed, 1 insertion(+) (limited to 'web/react/utils') diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 5f266bba3..69c026271 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -544,6 +544,7 @@ export function applyTheme(theme) { if (theme.buttonBg) { changeCss('.btn.btn-primary', 'background:' + theme.buttonBg, 1); changeCss('.btn.btn-primary:hover, .btn.btn-primary:active, .btn.btn-primary:focus', 'background:' + changeColor(theme.buttonBg, -0.25), 1); + changeCss('.file-play-button', 'color:' + changeColor(theme.buttonBg, -0.25), 1); } if (theme.buttonColor) { -- cgit v1.2.3-1-g7c22 From cd5df514c7d3130c9765a8160dfd31abccb8b741 Mon Sep 17 00:00:00 2001 From: Florian Orben Date: Mon, 19 Oct 2015 22:30:00 +0200 Subject: Add stop button to stop animated gifs --- web/react/utils/utils.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web/react/utils') diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 69c026271..b9084b26e 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -544,7 +544,7 @@ export function applyTheme(theme) { if (theme.buttonBg) { changeCss('.btn.btn-primary', 'background:' + theme.buttonBg, 1); changeCss('.btn.btn-primary:hover, .btn.btn-primary:active, .btn.btn-primary:focus', 'background:' + changeColor(theme.buttonBg, -0.25), 1); - changeCss('.file-play-button', 'color:' + changeColor(theme.buttonBg, -0.25), 1); + changeCss('.file-playback-controls', 'color:' + changeColor(theme.buttonBg, -0.25), 1); } if (theme.buttonColor) { -- cgit v1.2.3-1-g7c22 From 7e24890bd37e62ec9992452751c203430cdc3ea4 Mon Sep 17 00:00:00 2001 From: Pat Lathem Date: Wed, 21 Oct 2015 14:39:33 -0500 Subject: Add a call to doFormatText inside of the markdown paragraph handler --- web/react/utils/markdown.jsx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'web/react/utils') diff --git a/web/react/utils/markdown.jsx b/web/react/utils/markdown.jsx index 2813798d2..04f0bfc98 100644 --- a/web/react/utils/markdown.jsx +++ b/web/react/utils/markdown.jsx @@ -3,6 +3,7 @@ const TextFormatting = require('./text_formatting.jsx'); const Utils = require('./utils.jsx'); +const Emoticons = require('./emoticons.jsx'); const marked = require('marked'); @@ -53,6 +54,8 @@ export class MattermostMarkdownRenderer extends marked.Renderer { } paragraph(text) { + text = TextFormatting.doFormatText(text, this.options) + if (this.formattingOptions.singleline) { return `

${text}

`; } -- cgit v1.2.3-1-g7c22 From 9dd7a5e01e08da947b638a9c89c872a28e8f56df Mon Sep 17 00:00:00 2001 From: Pat Lathem Date: Wed, 21 Oct 2015 14:44:22 -0500 Subject: Remove stray emoticons.jsx import --- web/react/utils/markdown.jsx | 1 - 1 file changed, 1 deletion(-) (limited to 'web/react/utils') diff --git a/web/react/utils/markdown.jsx b/web/react/utils/markdown.jsx index 04f0bfc98..1c3d498a9 100644 --- a/web/react/utils/markdown.jsx +++ b/web/react/utils/markdown.jsx @@ -3,7 +3,6 @@ const TextFormatting = require('./text_formatting.jsx'); const Utils = require('./utils.jsx'); -const Emoticons = require('./emoticons.jsx'); const marked = require('marked'); -- cgit v1.2.3-1-g7c22 From 8eb2c0266c562d43805cb5a30a04102c7e728924 Mon Sep 17 00:00:00 2001 From: Pat Lathem Date: Wed, 21 Oct 2015 14:52:19 -0500 Subject: Missing semicolon --- web/react/utils/markdown.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web/react/utils') diff --git a/web/react/utils/markdown.jsx b/web/react/utils/markdown.jsx index 1c3d498a9..e8e5798bd 100644 --- a/web/react/utils/markdown.jsx +++ b/web/react/utils/markdown.jsx @@ -53,7 +53,7 @@ export class MattermostMarkdownRenderer extends marked.Renderer { } paragraph(text) { - text = TextFormatting.doFormatText(text, this.options) + text = TextFormatting.doFormatText(text, this.options); if (this.formattingOptions.singleline) { return `

${text}

`; -- cgit v1.2.3-1-g7c22 From fba89915ac9a0421a5441cdb23958099467a0a56 Mon Sep 17 00:00:00 2001 From: Pat Lathem Date: Wed, 21 Oct 2015 15:02:23 -0500 Subject: Pass eslint tests --- web/react/utils/markdown.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'web/react/utils') diff --git a/web/react/utils/markdown.jsx b/web/react/utils/markdown.jsx index e8e5798bd..1b699bc98 100644 --- a/web/react/utils/markdown.jsx +++ b/web/react/utils/markdown.jsx @@ -53,13 +53,13 @@ export class MattermostMarkdownRenderer extends marked.Renderer { } paragraph(text) { - text = TextFormatting.doFormatText(text, this.options); + let outText = TextFormatting.doFormatText(text, this.options); if (this.formattingOptions.singleline) { - return `

${text}

`; + return `

${outText}

`; } - return super.paragraph(text); + return super.paragraph(outText); } table(header, body) { -- cgit v1.2.3-1-g7c22 From 74402df462a0efa0b015792ee8c77a16dc72bedb Mon Sep 17 00:00:00 2001 From: hmhealey Date: Thu, 22 Oct 2015 09:47:04 -0400 Subject: Fixed improperly quoted html attributes for emoticons --- web/react/utils/emoticons.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web/react/utils') diff --git a/web/react/utils/emoticons.jsx b/web/react/utils/emoticons.jsx index 7b43e48b4..aabddcffd 100644 --- a/web/react/utils/emoticons.jsx +++ b/web/react/utils/emoticons.jsx @@ -133,7 +133,7 @@ export function handleEmoticons(text, tokens) { const alias = `MM_EMOTICON${index}`; tokens.set(alias, { - value: `${match}`, + value: `${match}`, originalText: match }); -- cgit v1.2.3-1-g7c22 From 25e018ece082a8136024b6d0a6c9db46cb113db1 Mon Sep 17 00:00:00 2001 From: hmhealey Date: Thu, 22 Oct 2015 09:47:28 -0400 Subject: Changed markdown renderer to only parse emoticons twice --- web/react/utils/markdown.jsx | 7 ++++++- web/react/utils/text_formatting.jsx | 9 +++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'web/react/utils') diff --git a/web/react/utils/markdown.jsx b/web/react/utils/markdown.jsx index 1b699bc98..7a4e70054 100644 --- a/web/react/utils/markdown.jsx +++ b/web/react/utils/markdown.jsx @@ -11,6 +11,7 @@ export class MattermostMarkdownRenderer extends marked.Renderer { super(options); this.heading = this.heading.bind(this); + this.paragraph = this.paragraph.bind(this); this.text = this.text.bind(this); this.formattingOptions = formattingOptions; @@ -53,7 +54,11 @@ export class MattermostMarkdownRenderer extends marked.Renderer { } paragraph(text) { - let outText = TextFormatting.doFormatText(text, this.options); + let outText = text; + + if (!('emoticons' in this.options) || this.options.emoticon) { + outText = TextFormatting.doFormatEmoticons(text); + } if (this.formattingOptions.singleline) { return `

${outText}

`; diff --git a/web/react/utils/text_formatting.jsx b/web/react/utils/text_formatting.jsx index d79aeed68..5c2e68f1e 100644 --- a/web/react/utils/text_formatting.jsx +++ b/web/react/utils/text_formatting.jsx @@ -69,6 +69,15 @@ export function doFormatText(text, options) { return output; } +export function doFormatEmoticons(text) { + const tokens = new Map(); + + let output = Emoticons.handleEmoticons(text, tokens); + output = replaceTokens(output, tokens); + + return output; +} + export function sanitizeHtml(text) { let output = text; -- cgit v1.2.3-1-g7c22