summaryrefslogtreecommitdiffstats
path: root/web/react/utils
diff options
context:
space:
mode:
authorhmhealey <harrisonmhealey@gmail.com>2015-07-24 17:04:02 -0400
committerhmhealey <harrisonmhealey@gmail.com>2015-07-29 09:56:28 -0400
commitb8a69f767c768d3ca0cebc73553a2b37e68e9347 (patch)
tree98dbe4de383e5a2db0773f39b6d5016ba586a57c /web/react/utils
parentf502fdef5061cdd10777beeb785716b9a3a1acfd (diff)
downloadchat-b8a69f767c768d3ca0cebc73553a2b37e68e9347.tar.gz
chat-b8a69f767c768d3ca0cebc73553a2b37e68e9347.tar.bz2
chat-b8a69f767c768d3ca0cebc73553a2b37e68e9347.zip
Added preview images for non-image files
Diffstat (limited to 'web/react/utils')
-rw-r--r--web/react/utils/utils.jsx13
1 files changed, 13 insertions, 0 deletions
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index aa59201cb..e48ffed9a 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -533,6 +533,19 @@ module.exports.getFileType = function(ext) {
return "other";
};
+module.exports.getPreviewImagePathForFileType = function(fileType) {
+ fileType = fileType.toLowerCase();
+
+ var icon;
+ if (fileType in Constants.ICON_FROM_TYPE) {
+ icon = Constants.ICON_FROM_TYPE[fileType];
+ } else {
+ icon = Constants.ICON_FROM_TYPE["other"];
+ }
+
+ return "/static/images/icons/" + icon + ".png";
+};
+
module.exports.getIconClassName = function(fileType) {
fileType = fileType.toLowerCase();