mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 23:13:09 +02:00
Fix texture directory display and validation
This commit is contained in:
parent
35bc1a03af
commit
54ea86d6be
1 changed files with 9 additions and 3 deletions
|
@ -83,6 +83,12 @@ if (typeof String.prototype.path !== "function") {
|
|||
};
|
||||
}
|
||||
|
||||
if (typeof String.prototype.regExpEscape !== "function") {
|
||||
String.prototype.regExpEscape = function () {
|
||||
return this.replace(/([$^.+*?|\\\/{}()\[\]])/g, '\\$1');
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof String.prototype.toArrayBuffer !== "function") {
|
||||
String.prototype.toArrayBuffer = function () {
|
||||
var length,
|
||||
|
@ -588,8 +594,8 @@ var modelUploader = (function () {
|
|||
form.push({ label: "Name:", value: mapping[NAME_FIELD] });
|
||||
|
||||
directory = modelFile.path() + "/" + mapping[TEXDIR_FIELD];
|
||||
displayAs = new RegExp("^" + modelFile.path().replace(/[\\\\\\\/]/, "[\\\\\\\/]") + "[\\\\\\\/](.*)");
|
||||
validateAs = new RegExp("^" + modelFile.path().replace(/[\\\\\\\/]/, "[\\\\\\\/]") + "([\\\\\\\/].*)?");
|
||||
displayAs = new RegExp("^" + modelFile.path().regExpEscape() + "[\\\\\\\/](.*)");
|
||||
validateAs = new RegExp("^" + modelFile.path().regExpEscape() + "([\\\\\\\/].*)?");
|
||||
|
||||
form.push({
|
||||
label: "Texture directory:",
|
||||
|
@ -597,7 +603,7 @@ var modelUploader = (function () {
|
|||
title: "Choose Texture Directory",
|
||||
displayAs: displayAs,
|
||||
validateAs: validateAs,
|
||||
errorMessage: "Texture directory must be subdirectory of model directory."
|
||||
errorMessage: "Texture directory must be subdirectory of the model directory."
|
||||
});
|
||||
|
||||
form.push({ button: "Cancel" });
|
||||
|
|
Loading…
Reference in a new issue