summaryrefslogtreecommitdiffstats
path: root/pyload/web/app/scripts/helpers/fileHelper.js
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-07-21 21:42:43 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-07-21 21:42:43 +0200
commit6172180c95695cae84e71484b4c60af4166ebf89 (patch)
tree17f4d63cca0b8407bb556911929725532bcede26 /pyload/web/app/scripts/helpers/fileHelper.js
parentReplace rule Hook -> Addon (diff)
downloadpyload-6172180c95695cae84e71484b4c60af4166ebf89.tar.xz
guess media types by name
Diffstat (limited to 'pyload/web/app/scripts/helpers/fileHelper.js')
-rw-r--r--pyload/web/app/scripts/helpers/fileHelper.js18
1 files changed, 16 insertions, 2 deletions
diff --git a/pyload/web/app/scripts/helpers/fileHelper.js b/pyload/web/app/scripts/helpers/fileHelper.js
index 156be58f0..044887eea 100644
--- a/pyload/web/app/scripts/helpers/fileHelper.js
+++ b/pyload/web/app/scripts/helpers/fileHelper.js
@@ -20,9 +20,23 @@ define('helpers/fileHelper', ['handlebars', 'utils/apitypes', 'helpers/formatTim
return '';
}
- // TODO
function fileIcon(media, options) {
- return 'icon-music';
+ switch (media) {
+ case Api.MediaType.Audio:
+ return 'icon-music';
+ case Api.MediaType.Image:
+ return 'icon-picture';
+ case Api.MediaType.Video:
+ return 'icon-film';
+ case Api.MediaType.Document:
+ return 'icon-file-text';
+ case Api.MediaType.Archive:
+ return 'icon-archive';
+ case Api.MediaType.Executable:
+ return 'icon-cog';
+ default:
+ return 'icon-file-alt';
+ }
}
// TODO rest of the states