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 | |
parent | Replace rule Hook -> Addon (diff) | |
download | pyload-6172180c95695cae84e71484b4c60af4166ebf89.tar.xz |
guess media types by name
Diffstat (limited to 'pyload/web/app/scripts')
-rw-r--r-- | pyload/web/app/scripts/helpers/fileHelper.js | 18 | ||||
-rw-r--r-- | pyload/web/app/scripts/utils/apitypes.js | 2 |
2 files changed, 17 insertions, 3 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 diff --git a/pyload/web/app/scripts/utils/apitypes.js b/pyload/web/app/scripts/utils/apitypes.js index 342f61f68..23d87def0 100644 --- a/pyload/web/app/scripts/utils/apitypes.js +++ b/pyload/web/app/scripts/utils/apitypes.js @@ -8,7 +8,7 @@ define([], function() { FileStatus: {'Remote': 2, 'Ok': 0, 'Missing': 1}, InputType: {'PluginList': 13, 'Multiple': 11, 'Int': 2, 'NA': 0, 'Time': 7, 'List': 12, 'Bool': 8, 'File': 3, 'Text': 1, 'Table': 14, 'Folder': 4, 'Password': 6, 'Click': 9, 'Select': 10, 'Textbox': 5}, Interaction: {'Captcha': 2, 'All': 0, 'Query': 4, 'Notification': 1}, - MediaType: {'All': 0, 'Audio': 2, 'Image': 4, 'Other': 1, 'Video': 8, 'Document': 16, 'Archive': 32}, + MediaType: {'All': 0, 'Audio': 2, 'Image': 4, 'Executable': 64, 'Other': 1, 'Video': 8, 'Document': 16, 'Archive': 32}, PackageStatus: {'Paused': 1, 'Remote': 3, 'Folder': 2, 'Ok': 0}, Permission: {'All': 0, 'Interaction': 32, 'Modify': 4, 'Add': 1, 'Accounts': 16, 'Plugins': 64, 'Download': 8, 'Delete': 2}, Role: {'Admin': 0, 'User': 1}, |