summaryrefslogtreecommitdiffstats
path: root/web/react/utils
diff options
context:
space:
mode:
Diffstat (limited to 'web/react/utils')
-rw-r--r--web/react/utils/constants.jsx8
-rw-r--r--web/react/utils/markdown.jsx2
-rw-r--r--web/react/utils/utils.jsx21
3 files changed, 20 insertions, 11 deletions
diff --git a/web/react/utils/constants.jsx b/web/react/utils/constants.jsx
index 2d0edd596..b4d56bccb 100644
--- a/web/react/utils/constants.jsx
+++ b/web/react/utils/constants.jsx
@@ -121,6 +121,7 @@ export default {
POST_DELETED: 'deleted',
POST_TYPE_JOIN_LEAVE: 'system_join_leave',
SYSTEM_MESSAGE_PREFIX: 'system_',
+ SYSTEM_MESSAGE_PROFILE_NAME: 'System',
SYSTEM_MESSAGE_PROFILE_IMAGE: '/static/images/logo_compact.png',
RESERVED_TEAM_NAMES: [
'www',
@@ -391,7 +392,8 @@ export default {
BACKSPACE: 8,
ENTER: 13,
ESCAPE: 27,
- SPACE: 32
+ SPACE: 32,
+ TAB: 9
},
HighlightedLanguages: {
diff: 'Diff',
@@ -431,6 +433,10 @@ export default {
MARKDOWN_PREVIEW: {
label: 'markdown_preview', // github issue: https://github.com/mattermost/platform/pull/1389
description: 'Show markdown preview option in message input box'
+ },
+ EMBED_PREVIEW: {
+ label: 'embed_preview',
+ description: 'Show preview snippet of links below message'
}
}
};
diff --git a/web/react/utils/markdown.jsx b/web/react/utils/markdown.jsx
index f2721c81d..d600ef069 100644
--- a/web/react/utils/markdown.jsx
+++ b/web/react/utils/markdown.jsx
@@ -228,7 +228,7 @@ class MattermostMarkdownRenderer extends marked.Renderer {
const isTaskList = taskListReg.exec(text);
if (isTaskList) {
- return `<li>${'<input type="checkbox" disabled="disabled" ' + (isTaskList[1] === ' ' ? '' : 'checked="checked" ') + '/> '}${text.replace(taskListReg, '')}</li>`;
+ return `<li class="list-item--task-list">${'<input type="checkbox" disabled="disabled" ' + (isTaskList[1] === ' ' ? '' : 'checked="checked" ') + '/> '}${text.replace(taskListReg, '')}</li>`;
}
return `<li>${text}</li>`;
}
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index afe27ef96..eb1d36ced 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -252,13 +252,6 @@ export function getTimestamp() {
// extracts links not styled by Markdown
export function extractLinks(text) {
- const urlMatcher = new Autolinker.matchParser.MatchParser({
- urls: true,
- emails: false,
- twitter: false,
- phone: false,
- hashtag: false
- });
const links = [];
let replaceText = text;
@@ -271,7 +264,7 @@ export function extractLinks(text) {
}
}
- function replaceFn(match) {
+ function replaceFn(autolinker, match) {
let link = '';
const matchText = match.getMatchedText();
const tempText = replaceText;
@@ -304,7 +297,16 @@ export function extractLinks(text) {
links.push(link);
}
- urlMatcher.replace(text, replaceFn, this);
+
+ Autolinker.link(text, {
+ replaceFn,
+ urls: true,
+ emails: false,
+ twitter: false,
+ phone: false,
+ hashtag: false
+ });
+
return {links, text};
}
@@ -574,6 +576,7 @@ export function applyTheme(theme) {
if (theme.sidebarHeaderTextColor) {
changeCss('.sidebar--left .team__header .header__info, .sidebar--menu .team__header .header__info', 'color:' + theme.sidebarHeaderTextColor, 1);
+ changeCss('.sidebar--left .team__header .navbar-right .dropdown__icon, .sidebar--menu .team__header .navbar-right .dropdown__icon', 'fill:' + theme.sidebarHeaderTextColor, 1);
changeCss('.sidebar--left .team__header .user__name, .sidebar--menu .team__header .user__name', 'color:' + changeOpacity(theme.sidebarHeaderTextColor, 0.8), 1);
changeCss('.sidebar--left .team__header:hover .user__name, .sidebar--menu .team__header:hover .user__name', 'color:' + theme.sidebarHeaderTextColor, 1);
changeCss('.modal .modal-header .modal-title, .modal .modal-header .modal-title .name, .modal .modal-header button.close', 'color:' + theme.sidebarHeaderTextColor, 1);