Convert to uppercase to allow for case insensitive entry.

This commit is contained in:
Kasen IO 2020-04-09 03:51:47 -04:00
parent 4b7f92f1d1
commit c6917cae3b

View file

@ -908,27 +908,27 @@ export default {
}, },
], ],
iconType: { iconType: {
"script": { "SCRIPT": {
"icon": "mdi-code-tags", "icon": "mdi-code-tags",
"color": "red", "color": "red",
}, },
"model": { "MODEL": {
"icon": "mdi-video-3d", "icon": "mdi-video-3d",
"color": "green", "color": "green",
}, },
"avatar": { "AVATAR": {
"icon": "mdi-account-convert", "icon": "mdi-account-convert",
"color": "purple", "color": "purple",
}, },
"serverless": { "SERVERLESS": {
"icon": "mdi-earth", "icon": "mdi-earth",
"color": "#0097A7", // cyan darken-2 "color": "#0097A7", // cyan darken-2
}, },
"json": { "JSON": {
"icon": "mdi-inbox-multiple", "icon": "mdi-inbox-multiple",
"color": "#37474F", // blue-grey darken-3 "color": "#37474F", // blue-grey darken-3
}, },
"unknown": { "UNKNOWN": {
"icon": "mdi-help", "icon": "mdi-help",
"color": "grey", "color": "grey",
} }
@ -1071,56 +1071,56 @@ export default {
switch (fileType) { switch (fileType) {
// Model Cases // Model Cases
case ".fbx": case ".fbx":
detectedItemType = "model"; detectedItemType = "MODEL";
break; break;
case ".gltf": case ".gltf":
detectedItemType = "model"; detectedItemType = "MODEL";
break; break;
// Script Cases // Script Cases
case ".js": case ".js":
detectedItemType = "script"; detectedItemType = "SCRIPT";
break; break;
// Avatar Cases // Avatar Cases
case ".fst": case ".fst":
detectedItemType = "avatar"; detectedItemType = "AVATAR";
break; break;
// JSON Cases // JSON Cases
case ".json": case ".json":
detectedItemType = "json"; detectedItemType = "JSON";
break; break;
} }
if (detectedItemType == null) { if (detectedItemType == null) {
// This is not a known item... // This is not a known item...
detectedItemType = "unknown"; detectedItemType = "UNKNOWN";
} }
return detectedItemType; return detectedItemType;
}, },
checkItemType: function(itemType) { checkItemType: function(itemType) {
var detectedItemType = null; var detectedItemType = null;
itemType = itemType.toUpperCase();
switch (itemType) { switch (itemType) {
case "model": case "MODEL":
detectedItemType = "model"; detectedItemType = "MODEL";
break; break;
case "avatar": case "AVATAR":
detectedItemType = "avatar"; detectedItemType = "AVATAR";
break; break;
case "script": case "SCRIPT":
detectedItemType = "script"; detectedItemType = "SCRIPT";
break; break;
case "serverless": case "SERVERLESS":
detectedItemType = "serverless"; detectedItemType = "SERVERLESS";
break; break;
case "json": case "JSON":
detectedItemType = "json"; detectedItemType = "JSON";
break; break;
} }
if (detectedItemType == null) { if (detectedItemType == null) {
// This is not a known item type... // This is not a known item type...
detectedItemType = "unknown"; detectedItemType = "UNKNOWN";
} }
return detectedItemType; return detectedItemType;
@ -1300,9 +1300,11 @@ export default {
} }
}, },
getIcon: function(itemType) { getIcon: function(itemType) {
itemType = itemType.toUpperCase();
return this.iconType[itemType].icon; return this.iconType[itemType].icon;
}, },
getIconColor: function(itemType) { getIconColor: function(itemType) {
itemType = itemType.toUpperCase();
return this.iconType[itemType].color; return this.iconType[itemType].color;
}, },
receiveNearbyUsers: function(receivedUsers) { receiveNearbyUsers: function(receivedUsers) {