diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-07-21 21:42:43 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2013-07-21 21:42:43 +0200 |
commit | 6172180c95695cae84e71484b4c60af4166ebf89 (patch) | |
tree | 17f4d63cca0b8407bb556911929725532bcede26 /pyload/web/app/scripts/helpers/fileHelper.js | |
parent | Replace rule Hook -> Addon (diff) | |
download | pyload-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.js | 18 |
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 |