LSP edits for multi-input formats.

This commit is contained in:
Thulinma 2016-05-05 13:23:45 +02:00
parent b91d817e33
commit c7e70ad9f8
2 changed files with 42 additions and 32 deletions

View file

@ -4165,11 +4165,21 @@ var mist = {
},
inputMatch: function(match,string){
if (typeof match == 'undefined') { return false; }
var query = match.replace(/[^\w\s]/g,'\\$&'); //prefix any special chars with a \
query = query.replace(/\\\?/g,'.').replace(/\\\*/g,'(?:.)*'); //replace ? with . and * with any amount of .
var regex = new RegExp('^'+query+'$','i'); //case insensitive
return regex.test(string);
if (typeof match == 'string') {
var query = match.replace(/[^\w\s]/g,'\\$&'); //prefix any special chars with a \
query = query.replace(/\\\?/g,'.').replace(/\\\*/g,'(?:.)*'); //replace ? with . and * with any amount of .
var regex = new RegExp('^'+query+'$','i'); //case insensitive
return regex.test(string);
}
for (var s in match){
var query = match[s].replace(/[^\w\s]/g,'\\$&'); //prefix any special chars with a \
query = query.replace(/\\\?/g,'.').replace(/\\\*/g,'(?:.)*'); //replace ? with . and * with any amount of .
var regex = new RegExp('^'+query+'$','i'); //case insensitive
if (regex.test(string)){
return true;
}
}
return false;
},
convertBuildOptions: function(input,saveas) {
var build = [];