summaryrefslogtreecommitdiffstats
path: root/webapp/utils
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/utils')
-rw-r--r--webapp/utils/async_client.jsx17
-rw-r--r--webapp/utils/constants.jsx32
-rw-r--r--webapp/utils/utils.jsx12
3 files changed, 40 insertions, 21 deletions
diff --git a/webapp/utils/async_client.jsx b/webapp/utils/async_client.jsx
index d3f91bb0e..6140fd9e0 100644
--- a/webapp/utils/async_client.jsx
+++ b/webapp/utils/async_client.jsx
@@ -673,9 +673,9 @@ export function getStatuses() {
const preferences = PreferenceStore.getCategory(Constants.Preferences.CATEGORY_DIRECT_CHANNEL_SHOW);
const teammateIds = [];
- for (const preference of preferences) {
- if (preference.value === 'true') {
- teammateIds.push(preference.name);
+ for (const [name, value] of preferences) {
+ if (value === 'true') {
+ teammateIds.push(name);
}
}
@@ -756,6 +756,17 @@ export function getAllPreferences() {
);
}
+export function savePreference(category, name, value, success, error) {
+ const preference = {
+ user_id: UserStore.getCurrentId(),
+ category,
+ name,
+ value
+ };
+
+ savePreferences([preference], success, error);
+}
+
export function savePreferences(preferences, success, error) {
client.savePreferences(
preferences,
diff --git a/webapp/utils/constants.jsx b/webapp/utils/constants.jsx
index a4aa7604c..859348c73 100644
--- a/webapp/utils/constants.jsx
+++ b/webapp/utils/constants.jsx
@@ -83,6 +83,8 @@ export default {
SHOW_SEARCH: null,
+ USER_TYPING: null,
+
TOGGLE_IMPORT_THEME_MODAL: null,
TOGGLE_INVITE_MEMBER_MODAL: null,
TOGGLE_DELETE_POST_MODAL: null,
@@ -429,6 +431,21 @@ export default {
uiName: 'Mention Highlight Link'
},
{
+ group: 'linkAndButtonElements',
+ id: 'linkColor',
+ uiName: 'Link Color'
+ },
+ {
+ group: 'linkAndButtonElements',
+ id: 'buttonBg',
+ uiName: 'Button BG'
+ },
+ {
+ group: 'linkAndButtonElements',
+ id: 'buttonColor',
+ uiName: 'Button Text'
+ },
+ {
group: 'centerChannelElements',
id: 'codeTheme',
uiName: 'Code Theme',
@@ -458,21 +475,6 @@ export default {
iconURL: monokaiIcon
}
]
- },
- {
- group: 'linkAndButtonElements',
- id: 'linkColor',
- uiName: 'Link Color'
- },
- {
- group: 'linkAndButtonElements',
- id: 'buttonBg',
- uiName: 'Button BG'
- },
- {
- group: 'linkAndButtonElements',
- id: 'buttonColor',
- uiName: 'Button Text'
}
],
DEFAULT_CODE_THEME: 'github',
diff --git a/webapp/utils/utils.jsx b/webapp/utils/utils.jsx
index 95a0f99d5..1379455ca 100644
--- a/webapp/utils/utils.jsx
+++ b/webapp/utils/utils.jsx
@@ -314,7 +314,13 @@ export function getTimestamp() {
// extracts links not styled by Markdown
export function extractLinks(text) {
- const links = [];
+ text; // eslint-disable-line no-unused-expressions
+ Autolinker; // eslint-disable-line no-unused-expressions
+
+ // skip this operation because autolinker is having issues
+ return [];
+
+ /*const links = [];
let inText = text;
// strip out code blocks
@@ -348,7 +354,7 @@ export function extractLinks(text) {
}
);
- return links;
+ return links;*/
}
export function escapeRegExp(string) {
@@ -681,7 +687,7 @@ export function applyTheme(theme) {
}
if (theme.centerChannelBg) {
- changeCss('.app__content, .markdown__table, .markdown__table tbody tr, .suggestion-list__content, .modal .modal-content, .modal .modal-back', 'background:' + theme.centerChannelBg, 1);
+ changeCss('.app__content, .markdown__table, .markdown__table tbody tr, .suggestion-list__content, .modal .modal-content', 'background:' + theme.centerChannelBg, 1);
changeCss('#post-list .post-list-holder-by-time', 'background:' + theme.centerChannelBg, 1);
changeCss('#post-create', 'background:' + theme.centerChannelBg, 1);
changeCss('.date-separator .separator__text, .new-separator .separator__text', 'background:' + theme.centerChannelBg, 1);