diff options
author | hmhealey <harrisonmhealey@gmail.com> | 2015-07-24 17:04:02 -0400 |
---|---|---|
committer | hmhealey <harrisonmhealey@gmail.com> | 2015-07-29 09:56:28 -0400 |
commit | b8a69f767c768d3ca0cebc73553a2b37e68e9347 (patch) | |
tree | 98dbe4de383e5a2db0773f39b6d5016ba586a57c /web/react/utils/utils.jsx | |
parent | f502fdef5061cdd10777beeb785716b9a3a1acfd (diff) | |
download | chat-b8a69f767c768d3ca0cebc73553a2b37e68e9347.tar.gz chat-b8a69f767c768d3ca0cebc73553a2b37e68e9347.tar.bz2 chat-b8a69f767c768d3ca0cebc73553a2b37e68e9347.zip |
Added preview images for non-image files
Diffstat (limited to 'web/react/utils/utils.jsx')
-rw-r--r-- | web/react/utils/utils.jsx | 13 |
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(); |