mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 10:47:11 +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") {
|
if (typeof String.prototype.toArrayBuffer !== "function") {
|
||||||
String.prototype.toArrayBuffer = function () {
|
String.prototype.toArrayBuffer = function () {
|
||||||
var length,
|
var length,
|
||||||
|
@ -588,8 +594,8 @@ var modelUploader = (function () {
|
||||||
form.push({ label: "Name:", value: mapping[NAME_FIELD] });
|
form.push({ label: "Name:", value: mapping[NAME_FIELD] });
|
||||||
|
|
||||||
directory = modelFile.path() + "/" + mapping[TEXDIR_FIELD];
|
directory = modelFile.path() + "/" + mapping[TEXDIR_FIELD];
|
||||||
displayAs = new RegExp("^" + modelFile.path().replace(/[\\\\\\\/]/, "[\\\\\\\/]") + "[\\\\\\\/](.*)");
|
displayAs = new RegExp("^" + modelFile.path().regExpEscape() + "[\\\\\\\/](.*)");
|
||||||
validateAs = new RegExp("^" + modelFile.path().replace(/[\\\\\\\/]/, "[\\\\\\\/]") + "([\\\\\\\/].*)?");
|
validateAs = new RegExp("^" + modelFile.path().regExpEscape() + "([\\\\\\\/].*)?");
|
||||||
|
|
||||||
form.push({
|
form.push({
|
||||||
label: "Texture directory:",
|
label: "Texture directory:",
|
||||||
|
@ -597,7 +603,7 @@ var modelUploader = (function () {
|
||||||
title: "Choose Texture Directory",
|
title: "Choose Texture Directory",
|
||||||
displayAs: displayAs,
|
displayAs: displayAs,
|
||||||
validateAs: validateAs,
|
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" });
|
form.push({ button: "Cancel" });
|
||||||
|
|
Loading…
Reference in a new issue