summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2015-07-31 09:39:53 -0400
committerJoramWilander <jwawilander@gmail.com>2015-07-31 09:39:53 -0400
commit8542fbd1ace1296030dbfaceec774e41a6fe07a1 (patch)
tree0a0c91c0abc52cf7295838c50d3e90340bc100a9 /web
parent36748f523aa1c894e773760705c49c362175b4b8 (diff)
downloadchat-8542fbd1ace1296030dbfaceec774e41a6fe07a1.tar.gz
chat-8542fbd1ace1296030dbfaceec774e41a6fe07a1.tar.bz2
chat-8542fbd1ace1296030dbfaceec774e41a6fe07a1.zip
removed uneccessary utils loadThumbnails function
Diffstat (limited to 'web')
-rw-r--r--web/react/utils/utils.jsx44
1 files changed, 0 insertions, 44 deletions
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index 942264fdb..e51f7f3f4 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -913,47 +913,3 @@ module.exports.getFileName = function(path) {
var split = path.split('/');
return split[split.length - 1];
};
-
-module.exports.loadThumbnails = function(filenames, self) {
- if (filenames) {
- var re1 = new RegExp(' ', 'g');
- var re2 = new RegExp('\\(', 'g');
- var re3 = new RegExp('\\)', 'g');
- for (var i = 0; i < filenames.length && i < Constants.MAX_DISPLAY_FILES; i++) {
- var fileInfo = module.exports.splitFileLocation(filenames[i]);
- if (Object.keys(fileInfo).length === 0) continue;
-
- var type = module.exports.getFileType(fileInfo.ext);
-
- // This is a temporary patch to fix issue with old files using absolute paths
- if (fileInfo.path.indexOf("/api/v1/files/get") != -1) {
- fileInfo.path = fileInfo.path.split("/api/v1/files/get")[1];
- }
- fileInfo.path = module.exports.getWindowLocationOrigin() + "/api/v1/files/get" + fileInfo.path;
-
- if (type === "image") {
- $('<img/>').attr('src', fileInfo.path+'_thumb.jpg').load(function(path, name){ return function() {
- $(this).remove();
- if (name in self.refs) {
- var imgDiv = self.refs[name].getDOMNode();
- $(imgDiv).removeClass('post__load');
- $(imgDiv).addClass('post__image');
-
- var width = this.width || $(this).width();
- var height = this.height || $(this).height();
-
- if (width < Constants.THUMBNAIL_WIDTH
- && height < Constants.THUMBNAIL_HEIGHT) {
- $(imgDiv).addClass('small');
- } else {
- $(imgDiv).addClass('normal');
- }
-
- var url = path.replace(re1, '%20').replace(re2, '%28').replace(re3, '%29');
- $(imgDiv).css('background-image', 'url('+url+'_thumb.jpg)');
- }
- }}(fileInfo.path, filenames[i]));
- }
- }
- }
-}