Skip to content

Commit

Permalink
Merge pull request #59 from oat-sa/feature/nec-71/add-cpp-and-passcal…
Browse files Browse the repository at this point in the history
…-files

Feature/NEC-71/mime types for C++ and Pascal files
  • Loading branch information
btamas authored Mar 11, 2020
2 parents 7c0ba3e + 80a2750 commit 695b9b4
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 77 deletions.
44 changes: 23 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oat-sa/tao-core-sdk",
"version": "1.1.1",
"version": "1.2.0",
"displayName": "TAO Core SDK",
"description": "Core libraries of TAO",
"homepage": "https://github.com/oat-sa/tao-core-sdk-fe#readme",
Expand Down
10 changes: 10 additions & 0 deletions src/core/mimetype/categories.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,15 @@
"generic" : {
"category" : "generic",
"mimes" : ["application/octet-stream", "application/force-download", "application/x-force-download"]
},
"cpp" : {
"category": "sources",
"mimes" : ["text/x-c"],
"extensions": ["cpp"]
},
"pas" : {
"category": "sources",
"mimes" : ["text/pascal"],
"extensions": ["pas"]
}
}
111 changes: 56 additions & 55 deletions src/core/mimetype/extensions.json
Original file line number Diff line number Diff line change
@@ -1,56 +1,57 @@
{
"txt" : "text/plain",
"htm" : "text/html",
"html" : "text/html",
"xhtml" : "application/xhtml+xml",
"php" : "text/html",
"css" : "text/css",
"js" : "application/javascript",
"json" : "application/json",
"xml" : "text/xml",
"rdf" : "text/xml",
"swf" : "application/x-shockwave-flash",
"flv" : "video/x-flv",
"csv" : "text/csv",
"rtx" : "text/richtext",
"rtf" : "text/rtf",
"png" : "image/png",
"jpe" : "image/jpeg",
"jpeg" : "image/jpeg",
"jpg" : "image/jpeg",
"gif" : "image/gif",
"bmp" : "image/bmp",
"ico" : "image/vnd.microsoft.icon",
"tiff" : "image/tiff",
"tif" : "image/tiff",
"svg" : "image/svg+xml",
"svgz" : "image/svg+xml",
"zip" : "application/zip",
"rar" : "application/x-rar-compressed",
"exe" : "application/x-msdownload",
"msi" : "application/x-msdownload",
"cab" : "application/vnd.ms-cab-compressed",
"mp3" : "audio/mpeg",
"oga" : "audio/ogg",
"ogg" : "audio/ogg",
"aac" : "audio/aac",
"qt" : "video/quicktime",
"mov" : "video/quicktime",
"mp4" : "video/mp4",
"webm" : "video/webm",
"ogv" : "video/ogg",
"pdf" : "application/pdf",
"psd" : "image/vnd.adobe.photoshop",
"ai" : "application/postscript",
"eps" : "application/postscript",
"ps" : "application/postscript",
"doc" : "application/msword",
"rtf" : "application/rtf",
"xls" : "application/vnd.ms-excel",
"ppt" : "application/vnd.ms-powerpoint",
"odt" : "application/vnd.oasis.opendocument.text",
"ods" : "application/vnd.oasis.opendocument.spreadsheet",
"woff" : "application/x-font-woff",
"eot" : "application/vnd.ms-fontobject",
"ttf" : "application/x-font-ttf"
}
"txt": "text/plain",
"htm": "text/html",
"html": "text/html",
"xhtml": "application/xhtml+xml",
"php": "text/html",
"css": "text/css",
"js": "application/javascript",
"json": "application/json",
"xml": "text/xml",
"rdf": "text/xml",
"swf": "application/x-shockwave-flash",
"flv": "video/x-flv",
"csv": "text/csv",
"rtx": "text/richtext",
"png": "image/png",
"jpe": "image/jpeg",
"jpeg": "image/jpeg",
"jpg": "image/jpeg",
"gif": "image/gif",
"bmp": "image/bmp",
"ico": "image/vnd.microsoft.icon",
"tiff": "image/tiff",
"tif": "image/tiff",
"svg": "image/svg+xml",
"svgz": "image/svg+xml",
"zip": "application/zip",
"rar": "application/x-rar-compressed",
"exe": "application/x-msdownload",
"msi": "application/x-msdownload",
"cab": "application/vnd.ms-cab-compressed",
"mp3": "audio/mpeg",
"oga": "audio/ogg",
"ogg": "audio/ogg",
"aac": "audio/aac",
"qt": "video/quicktime",
"mov": "video/quicktime",
"mp4": "video/mp4",
"webm": "video/webm",
"ogv": "video/ogg",
"pdf": "application/pdf",
"psd": "image/vnd.adobe.photoshop",
"ai": "application/postscript",
"eps": "application/postscript",
"ps": "application/postscript",
"doc": "application/msword",
"rtf": "application/rtf",
"xls": "application/vnd.ms-excel",
"ppt": "application/vnd.ms-powerpoint",
"odt": "application/vnd.oasis.opendocument.text",
"ods": "application/vnd.oasis.opendocument.spreadsheet",
"woff": "application/x-font-woff",
"eot": "application/vnd.ms-fontobject",
"ttf": "application/x-font-ttf",
"cpp": "text/x-c",
"pas": "text/pascal"
}
28 changes: 28 additions & 0 deletions test/core/mimetype/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,34 @@ define(['core/mimetype'], function(mimeType) {
mime: 'application/octet-stream',
equals: 'application/octet-stream',
title: 'application/octet-stream bz2'
},
{
filename: 'filename.bz2',
mime: 'application/octet-stream',
equals: 'application/octet-stream',
title: 'application/octet-stream bz2'
},
{
filename: 'filename.odt',
mime: 'application/vnd.oasis.opendocument.text',
equals: 'application/vnd.oasis.opendocument.text',
title: 'application/vnd.oasis.opendocument.text odt'
},
{
filename: 'filename.ods',
mime: 'application/vnd.oasis.opendocument.spreadsheet',
equals: 'application/vnd.oasis.opendocument.spreadsheet',
title: 'application/vnd.oasis.opendocument.spreadsheet ods'
},
{
filename: 'filename.cpp',
equals: 'text/x-c',
title: 'text/x-c cpp'
},
{
filename: 'filename.pas',
equals: 'text/pascal',
title: 'text/pascal pas'
}
])
.test('getMimeType', function(data, assert) {
Expand Down

0 comments on commit 695b9b4

Please sign in to comment.