Skip to content

Deepan190703/fix .mtl #3071

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/modules/IDE/components/Editor/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ class Editor extends React.Component {
mode = 'application/json';
} else if (fileName.match(/.+\.(frag|glsl)$/i)) {
mode = 'x-shader/x-fragment';
} else if (fileName.match(/.+\.(vert|stl)$/i)) {
} else if (fileName.match(/.+\.(vert|stl|mtl)$/i)) {
mode = 'x-shader/x-vertex';
} else {
mode = 'text/plain';
Expand Down
9 changes: 5 additions & 4 deletions server/utils/fileUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ export const fileExtensionsArray = [
'frag',
'bin',
'xml',
'stl'
'stl',
'mtl'
];

export const mimeTypes = `image/*,audio/*,text/javascript,text/html,text/css,
Expand All @@ -66,10 +67,10 @@ export const MEDIA_FILE_QUOTED_REGEX = new RegExp(

export const STRING_REGEX = /(['"])((\\\1|.)*?)\1/gm;
// these are files that have to be linked to with a blob url
export const PLAINTEXT_FILE_REGEX = /.+\.(json|txt|csv|vert|frag|tsv|xml|stl)$/i;
export const PLAINTEXT_FILE_REGEX = /.+\.(json|txt|csv|vert|frag|tsv|xml|stl|mtl)$/i;
// these are files that users would want to edit as text (maybe svg should be here?)
export const TEXT_FILE_REGEX = /.+\.(json|txt|csv|tsv|vert|frag|js|css|html|htm|jsx|xml|stl)$/i;
export const TEXT_FILE_REGEX = /.+\.(json|txt|csv|tsv|vert|frag|js|css|html|htm|jsx|xml|stl|mtl)$/i;
export const NOT_EXTERNAL_LINK_REGEX = /^(?!(http:\/\/|https:\/\/))/;
export const EXTERNAL_LINK_REGEX = /^(http:\/\/|https:\/\/)/;

export const CREATE_FILE_REGEX = /.+\.(json|txt|csv|tsv|js|css|frag|vert|xml|html|htm|stl)$/i;
export const CREATE_FILE_REGEX = /.+\.(json|txt|csv|tsv|js|css|frag|vert|xml|html|htm|stl|mtl)$/i;
2 changes: 1 addition & 1 deletion translations/locales/be/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
"Title": "ফাইল তৈরি করুন",
"CloseButtonARIA": "নতুন ফাইল মোডাল বন্ধ করুন",
"EnterName": "নাম লিখুন",
"InvalidType": "অবৈধ ফাইল ধরন। বৈধ এক্সটেনশনগুলি হলো .js, .css, .json, .xml, .stl, .txt, .csv, .tsv, .frag এবং .vert."
"InvalidType": "অবৈধ ফাইল ধরন। বৈধ এক্সটেনশনগুলি হলো .js, .css, .json, .xml, .stl, .txt, .csv, .tsv, .mtl, .frag এবং .vert."
},
"NewFileForm": {
"AddFileSubmit": "ফাইল যোগ করুন",
Expand Down
2 changes: 1 addition & 1 deletion translations/locales/en-US/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@
"Title": "Create File",
"CloseButtonARIA": "Close New File Modal",
"EnterName": "Please enter a name",
"InvalidType": "Invalid file type. Valid extensions are .js, .css, .json, .xml, .stl, .txt, .csv, .tsv, .frag, and .vert."
"InvalidType": "Invalid file type. Valid extensions are .js, .css, .json, .xml, .stl, .txt, .csv, .tsv, .mtl, .frag, and .vert."
},
"NewFileForm": {
"AddFileSubmit": "Add File",
Expand Down
2 changes: 1 addition & 1 deletion translations/locales/es-419/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
"Title": "Crear Archivo",
"CloseButtonARIA": "Cerrar diálogo de crear archivo",
"EnterName": "Por favor introduce un nombre",
"InvalidType": "Tipo de archivo inválido. Las extensiones válidas son .js, .css, .json, .xml, .stl, .txt, .csv, .tsv, .frag y .vert."
"InvalidType": "Tipo de archivo inválido. Las extensiones válidas son .js, .css, .json, .xml, .stl, .txt, .csv, .tsv, .mtl, .frag y .vert."
},
"NewFileForm": {
"AddFileSubmit": "Agregar Archivo",
Expand Down
2 changes: 1 addition & 1 deletion translations/locales/hi/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@
"Title": "फ़ाइल बनाएँ",
"CloseButtonARIA": "नई फ़ाइल मोडल बंद करें",
"EnterName": "कृपया एक नाम दर्ज करें",
"InvalidType": "अमान्य फ़ाइल प्रकार। मान्य एक्सटेंशन हैं .js, .css, .json, .xml, .stl, .txt, .csv, .tsv, .frag, और .vert."
"InvalidType": "अमान्य फ़ाइल प्रकार। मान्य एक्सटेंशन हैं .js, .css, .json, .xml, .stl, .txt, .csv, .tsv, .mtl, .frag, और .vert."
},
"NewFileForm": {
"AddFileSubmit": "फाइल जोडें",
Expand Down
2 changes: 1 addition & 1 deletion translations/locales/ja/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
"Title": "ファイル作成",
"CloseButtonARIA": "新規ファイルモーダルを閉じる",
"EnterName": "ファイル名を入力してください",
"InvalidType": "ファイルタイプが無効です。有効な拡張子は、.js、.css、.json、.xml、.stl、.txt、.csv、.tsv、.frag、.vertです。"
"InvalidType": "ファイルタイプが無効です。有効な拡張子は、.js、.css、.json、.xml、.stl、.txt、.csv、.tsv、.mtl、.frag、.vertです。"
},
"NewFileForm": {
"AddFileSubmit": "ファイルを追加",
Expand Down