OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * Namespace object for file type utility functions. | 6 * Namespace object for file type utility functions. |
7 */ | 7 */ |
8 var FileType = {}; | 8 var FileType = {}; |
9 | 9 |
10 /** | 10 /** |
(...skipping 27 matching lines...) Expand all Loading... |
38 pattern: /\.webp$/i | 38 pattern: /\.webp$/i |
39 }, | 39 }, |
40 { | 40 { |
41 type: 'image', name: 'IMAGE_FILE_TYPE', subtype: 'TIFF', | 41 type: 'image', name: 'IMAGE_FILE_TYPE', subtype: 'TIFF', |
42 pattern: /\.tiff?$/i | 42 pattern: /\.tiff?$/i |
43 }, | 43 }, |
44 | 44 |
45 // Raw | 45 // Raw |
46 { | 46 { |
47 type: 'raw', name: 'IMAGE_FILE_TYPE', subtype: 'ARW', | 47 type: 'raw', name: 'IMAGE_FILE_TYPE', subtype: 'ARW', |
48 pattern: /\.arw?$/i, icon: 'image' | 48 pattern: /\.arw$/i, icon: 'image' |
49 }, | 49 }, |
50 { | 50 { |
51 type: 'raw', name: 'IMAGE_FILE_TYPE', subtype: 'CR2', | 51 type: 'raw', name: 'IMAGE_FILE_TYPE', subtype: 'CR2', |
52 pattern: /\.cr2?$/i, icon: 'image' | 52 pattern: /\.cr2$/i, icon: 'image' |
53 }, | 53 }, |
54 { | 54 { |
55 type: 'raw', name: 'IMAGE_FILE_TYPE', subtype: 'DNG', | 55 type: 'raw', name: 'IMAGE_FILE_TYPE', subtype: 'DNG', |
56 pattern: /\.dng?$/i, icon: 'image' | 56 pattern: /\.dng$/i, icon: 'image' |
57 }, | 57 }, |
58 { | 58 { |
59 type: 'raw', name: 'IMAGE_FILE_TYPE', subtype: 'NEF', | 59 type: 'raw', name: 'IMAGE_FILE_TYPE', subtype: 'NEF', |
60 pattern: /\.nef?$/i, icon: 'image' | 60 pattern: /\.nef$/i, icon: 'image' |
61 }, | 61 }, |
62 { | 62 { |
63 type: 'raw', name: 'IMAGE_FILE_TYPE', subtype: 'NRW', | 63 type: 'raw', name: 'IMAGE_FILE_TYPE', subtype: 'NRW', |
64 pattern: /\.nrw?$/i, icon: 'image' | 64 pattern: /\.nrw$/i, icon: 'image' |
65 }, | 65 }, |
66 { | 66 { |
67 type: 'raw', name: 'IMAGE_FILE_TYPE', subtype: 'ORW', | 67 type: 'raw', name: 'IMAGE_FILE_TYPE', subtype: 'ORF', |
68 pattern: /\.orf?$/i, icon: 'image' | 68 pattern: /\.orf$/i, icon: 'image' |
69 }, | 69 }, |
70 { | 70 { |
71 type: 'raw', name: 'IMAGE_FILE_TYPE', subtype: 'RAF', | 71 type: 'raw', name: 'IMAGE_FILE_TYPE', subtype: 'RAF', |
72 pattern: /\.raf?$/i, icon: 'image' | 72 pattern: /\.raf$/i, icon: 'image' |
73 }, | 73 }, |
74 { | 74 { |
75 type: 'raw', name: 'IMAGE_FILE_TYPE', subtype: 'RW2', | 75 type: 'raw', name: 'IMAGE_FILE_TYPE', subtype: 'RW2', |
76 pattern: /\.rw2?$/i, icon: 'image' | 76 pattern: /\.rw2$/i, icon: 'image' |
77 }, | 77 }, |
78 | 78 |
79 // Video | 79 // Video |
80 { | 80 { |
81 type: 'video', name: 'VIDEO_FILE_TYPE', subtype: '3GP', | 81 type: 'video', name: 'VIDEO_FILE_TYPE', subtype: '3GP', |
82 pattern: /\.3gp$/i | 82 pattern: /\.3gp$/i |
83 }, | 83 }, |
84 { | 84 { |
85 type: 'video', name: 'VIDEO_FILE_TYPE', subtype: 'AVI', | 85 type: 'video', name: 'VIDEO_FILE_TYPE', subtype: 'AVI', |
86 pattern: /\.avi$/i | 86 pattern: /\.avi$/i |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 | 365 |
366 /** | 366 /** |
367 * @param {Entry} entry Reference to the file. | 367 * @param {Entry} entry Reference to the file. |
368 * @return {string} Returns string that represents the file icon. | 368 * @return {string} Returns string that represents the file icon. |
369 * It refers to a file 'images/filetype_' + icon + '.png'. | 369 * It refers to a file 'images/filetype_' + icon + '.png'. |
370 */ | 370 */ |
371 FileType.getIcon = function(entry) { | 371 FileType.getIcon = function(entry) { |
372 var fileType = FileType.getType(entry); | 372 var fileType = FileType.getType(entry); |
373 return fileType.icon || fileType.type || 'unknown'; | 373 return fileType.icon || fileType.type || 'unknown'; |
374 }; | 374 }; |
OLD | NEW |