From c39ba354d566e4f70f9b3825e0d62bcdef0ac05d Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Fri, 8 Jan 2016 14:26:16 -0800 Subject: Fix issue with drag n drop overlay in ie11 --- web/react/utils/utils.jsx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'web/react/utils/utils.jsx') diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 2ddd0e5e3..8c02c2d93 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -1295,5 +1295,9 @@ export function fillArray(value, length) { // Checks if a data transfer contains files not text, folders, etc.. // Slightly modified from http://stackoverflow.com/questions/6848043/how-do-i-detect-a-file-is-being-dragged-rather-than-a-draggable-element-on-my-pa export function isFileTransfer(files) { + if (isBrowserIE()) { + return files.types != null && files.types.contains('Files'); + } + return files.types != null && (files.types.indexOf ? files.types.indexOf('Files') !== -1 : files.types.contains('application/x-moz-file')); } -- cgit v1.2.3-1-g7c22 From 6faabe34e8a56e247953be631a6af31a132b8b0b Mon Sep 17 00:00:00 2001 From: Andy Lo-A-Foe Date: Tue, 19 Jan 2016 19:41:39 +0100 Subject: Optionally specify ws:// and wss:// port in config --- web/react/utils/utils.jsx | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'web/react/utils/utils.jsx') diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 24042321f..92ad82739 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -1101,6 +1101,17 @@ export function getFileName(path) { return split[split.length - 1]; } +// Gets the websocket port to use. Configurable on the server. +export function getWebsocketPort(protocol) { + if ((/^wss:/).test(protocol)) { // wss:// + return ':' + global.window.mm_config.WebsocketSecurePort; + } + if ((/^ws:/).test(protocol)) { + return ':' + global.window.mm_config.WebsocketPort; + } + return ''; +} + export function getSessionIndex() { if (global.window.mm_session_token_index >= 0) { return 'session_token_index=' + global.window.mm_session_token_index; -- cgit v1.2.3-1-g7c22 From b870c0117f605364fce627cfa3341f84bebbba17 Mon Sep 17 00:00:00 2001 From: Andy Lo-A-Foe Date: Wed, 20 Jan 2016 01:03:17 +0100 Subject: Fix indentation --- web/react/utils/utils.jsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'web/react/utils/utils.jsx') diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 92ad82739..718095757 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -1103,13 +1103,13 @@ export function getFileName(path) { // Gets the websocket port to use. Configurable on the server. export function getWebsocketPort(protocol) { - if ((/^wss:/).test(protocol)) { // wss:// - return ':' + global.window.mm_config.WebsocketSecurePort; - } - if ((/^ws:/).test(protocol)) { - return ':' + global.window.mm_config.WebsocketPort; - } - return ''; + if ((/^wss:/).test(protocol)) { // wss:// + return ':' + global.window.mm_config.WebsocketSecurePort; + } + if ((/^ws:/).test(protocol)) { + return ':' + global.window.mm_config.WebsocketPort; + } + return ''; } export function getSessionIndex() { -- cgit v1.2.3-1-g7c22 From 76f000056512d323febeb6c941e43efb438030ba Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Tue, 19 Jan 2016 12:39:51 -0800 Subject: Removed extraneous error when providing a short username --- web/react/utils/utils.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'web/react/utils/utils.jsx') diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 24042321f..c51ae1a21 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -879,8 +879,8 @@ export function isValidUsername(name) { var error = ''; if (!name) { error = 'This field is required'; - } else if (name.length < 3 || name.length > 15) { - error = 'Must be between 3 and 15 characters'; + } else if (name.length < Constants.MIN_USERNAME_LENGTH || name.length > Constants.MAX_USERNAME_LENGTH) { + error = 'Must be between ' + Constants.MIN_USERNAME_LENGTH + ' and ' + Constants.MAX_USERNAME_LENGTH + ' characters'; } else if (!(/^[a-z0-9\.\-\_]+$/).test(name)) { error = "Must contain only letters, numbers, and the symbols '.', '-', and '_'."; } else if (!(/[a-z]/).test(name.charAt(0))) { //eslint-disable-line no-negated-condition -- cgit v1.2.3-1-g7c22 From 261b38be45420b45f97842ec55247ea7b47a527e Mon Sep 17 00:00:00 2001 From: hmhealey Date: Thu, 21 Jan 2016 13:55:47 -0500 Subject: Added download param to getFile api call --- web/react/utils/utils.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'web/react/utils/utils.jsx') diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 71fd0852b..1b31adf69 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -1091,8 +1091,9 @@ export function fileSizeToString(bytes) { } // Converts a filename (like those attached to Post objects) to a url that can be used to retrieve attachments from the server. -export function getFileUrl(filename) { - return getWindowLocationOrigin() + '/api/v1/files/get' + filename + '?' + getSessionIndex(); +export function getFileUrl(filename, isDownload) { + const downloadParam = isDownload ? '&download=1' : ''; + return getWindowLocationOrigin() + '/api/v1/files/get' + filename + '?' + getSessionIndex() + downloadParam; } // Gets the name of a file (including extension) from a given url or file path. -- cgit v1.2.3-1-g7c22 From da1d52d546121e6c36cca9dea90c4a3bc540b0b7 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Fri, 22 Jan 2016 09:10:08 -0600 Subject: PLT-7 adding lang selector --- web/react/utils/utils.jsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'web/react/utils/utils.jsx') diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 1b31adf69..82e9bc447 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -1340,3 +1340,18 @@ export function clearFileInput(elm) { // Do nothing } } + +export function languages() { + return ( + [ + { + value: 'en', + name: 'English' + }, + { + value: 'es', + name: 'EspaƱol' + } + ] + ); +} -- cgit v1.2.3-1-g7c22