This commit is contained in:
@@ -213,6 +213,48 @@ export default {
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
},
|
||||
//https://gist.github.com/colemanw/9c9a12aae16a4bfe2678de86b661d922
|
||||
getFontAwesomeIconFromMIME: function(mimeType) {
|
||||
// List of official MIME Types: http://www.iana.org/assignments/media-types/media-types.xhtml
|
||||
var icon_classes = {
|
||||
// Media
|
||||
image: "fa-file-image",
|
||||
audio: "fa-file-audio",
|
||||
video: "fa-file-video",
|
||||
// Documents
|
||||
"application/pdf": "fa-file-pdf",
|
||||
"application/msword": "fa-file-word",
|
||||
"application/vnd.ms-word": "fa-file-word",
|
||||
"application/vnd.oasis.opendocument.text": "fa-file-word",
|
||||
"application/vnd.openxmlformats-officedocument.wordprocessingml":
|
||||
"fa-file-word",
|
||||
"application/vnd.ms-excel": "fa-file-excel",
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml":
|
||||
"fa-file-excel",
|
||||
"application/vnd.oasis.opendocument.spreadsheet": "fa-file-excel",
|
||||
"application/vnd.ms-powerpoint": "fa-file-powerpoint",
|
||||
"application/vnd.openxmlformats-officedocument.presentationml":
|
||||
"fa-file-powerpoint",
|
||||
"application/vnd.oasis.opendocument.presentation": "fa-file-powerpoint",
|
||||
"text/plain": "fa-file-text",
|
||||
"text/html": "fa-file-code",
|
||||
"application/json": "fa-file-code",
|
||||
// Archives
|
||||
"application/gzip": "fa-file-archive",
|
||||
"application/zip": "fa-file-archive"
|
||||
};
|
||||
|
||||
for (var key in icon_classes) {
|
||||
if (icon_classes.hasOwnProperty(key)) {
|
||||
if (mimeType.search(key) === 0) {
|
||||
// Found it
|
||||
return icon_classes[key];
|
||||
}
|
||||
} else {
|
||||
return "fa-file";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//new functions above here
|
||||
|
||||
@@ -108,7 +108,7 @@ export default {
|
||||
height: 300,
|
||||
items: [
|
||||
{
|
||||
icon: "fa-file",
|
||||
icon: "fa-file-image",
|
||||
title: "drawings.pdf",
|
||||
subtitle: "2020-01-09"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user