瀏覽代碼

Fix #1110: Add support for previewing TIFF, EPS, AI, WMF files

Kartik Visweswaran 7 年之前
父節點
當前提交
25a3e95da5
共有 3 個文件被更改,包括 7 次插入7 次删除
  1. 1 0
      CHANGE.md
  2. 6 7
      js/fileinput.js
  3. 0 0
      js/fileinput.min.js

+ 1 - 0
CHANGE.md

@@ -5,6 +5,7 @@ Change Log: `bootstrap-fileinput`
 
 **Date:** Work in progress
 
+- (enh #1110): Add support for previewing TIFF, EPS, AI, WMF files.
 - (bug #1108): Correct sortable drag element parsing during sorting.
 - (enh #1106): Update Portuguese BR Translations.
 - (enh #1105): Update Russian Translations.

+ 6 - 7
js/fileinput.js

@@ -797,21 +797,20 @@
                 },
                 fileTypeSettings: {
                     image: function (vType, vName) {
-                        return $h.compare(vType, 'image.*') || $h.compare(vName, /\.(gif|png|jpe?g)$/i);
+                        return ($h.compare(vType, 'image.*') && !$h.compare(vType, /(tiff?|wmf)$/i) ||
+                            $h.compare(vName, /\.(gif|png|jpe?g)$/i)) ;
                     },
                     html: function (vType, vName) {
                         return $h.compare(vType, 'text/html') || $h.compare(vName, /\.(htm|html)$/i);
                     },
+                    office: function (vType, vName) {
+                        return $h.compare(vType, /(word|excel|powerpoint|office|iwork-pages|tiff?)$/i) ||
+                            $h.compare(vName, /\.(rtf|docx?|xlsx?|pptx?|pps|potx?|ods|odt|pages|ai|dxf|ttf|tiff?|wmf|e?ps)$/i);
+                    },
                     text: function (vType, vName) {
                         return $h.compare(vType, 'text.*') || $h.compare(vName, /\.(xml|javascript)$/i) ||
                             $h.compare(vName, /\.(txt|md|csv|nfo|ini|json|php|js|css)$/i);
                     },
-                    office: function (vType, vName) {
-                        return $h.compare(vType, 'msword') || $h.compare(vType, 'ms-excel') ||
-                            $h.compare(vType, 'ms-powerpoint') ||
-                            $h.compare(vType, 'vnd.openxmlformats-officedocument') ||
-                            $h.compare(vName, /\.(doc|docx|rtf|odt|xls|xlsx|ods|ppt|pptx|pps|pot|potx)$/i);
-                    },
                     video: function (vType, vName) {
                         return $h.compare(vType, 'video.*') && ($h.compare(vType, /(ogg|mp4|mp?g|mov|webm|3gp)$/i) ||
                             $h.compare(vName, /\.(og?|mp4|webm|mp?g|mov|3gp)$/i));

文件差異過大導致無法顯示
+ 0 - 0
js/fileinput.min.js


部分文件因文件數量過多而無法顯示