summaryrefslogtreecommitdiffstats
path: root/web/react/utils/utils.jsx
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2015-08-25 13:17:21 -0700
committerCorey Hulen <corey@hulen.com>2015-08-25 13:17:21 -0700
commiteb5af31c17f1f8ff1dabdbfeaf4d7ae24700d6ac (patch)
tree8407caf850b9246b30d7ce2ca6726e66244b7ce2 /web/react/utils/utils.jsx
parentb4ee26373042d2c5ab422a4955022fb278cb8fa1 (diff)
parent64b179ab0e6a66c0f8edb72ab24ef28bbc2f9969 (diff)
downloadchat-eb5af31c17f1f8ff1dabdbfeaf4d7ae24700d6ac.tar.gz
chat-eb5af31c17f1f8ff1dabdbfeaf4d7ae24700d6ac.tar.bz2
chat-eb5af31c17f1f8ff1dabdbfeaf4d7ae24700d6ac.zip
Merge pull request #466 from mattermost/mm-1912
Fixes mm-1912 move get file info into its own web service call
Diffstat (limited to 'web/react/utils/utils.jsx')
-rw-r--r--web/react/utils/utils.jsx17
1 files changed, 0 insertions, 17 deletions
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index f718f7435..f19dd2b47 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -604,23 +604,6 @@ module.exports.splitFileLocation = function(fileLocation) {
return {ext: ext, name: filename, path: filePath};
};
-// Asynchronously gets the size of a file by requesting its headers. If successful, it calls the
-// provided callback with the file size in bytes as the argument.
-module.exports.getFileSize = function(url, callback) {
- var request = new XMLHttpRequest();
-
- request.open('HEAD', url, true);
- request.onreadystatechange = function onReadyStateChange() {
- if (request.readyState === 4 && request.status === 200) {
- if (callback) {
- callback(parseInt(request.getResponseHeader('content-length'), 10));
- }
- }
- };
-
- request.send();
-};
-
module.exports.toTitleCase = function(str) {
function doTitleCase(txt) {
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();