fix(dom) selectByPattern: "." -> "\."

This commit is contained in:
coderaiser 2014-01-10 11:16:39 -05:00
parent ecbde3a90a
commit 08b881578b

View file

@ -1179,7 +1179,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
function selectByPattern(msg, files) {
var allMsg = 'Specify file type for ' + msg + ' selection',
i = 0,
n,
n = files && files.length,
arr = [],
type,
matches = 0,
@ -1198,23 +1198,11 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
type = '*';
type = '^' + type; /* search from start of line */
type = Util.replaceStr(type, '*', '.*\\');
type = Util.replaceStr(type, '.', '\\.');
type = Util.replaceStr(type, '*', '.*');
type = Util.replaceStr(type, '?', '.?\\');
arr = type && type.split('');
n = arr.length;
/* back slash at end of line
* do not need
*/
if (arr[n - 1] === '\\') {
arr.pop();
type = arr.join('');
}
type += '$'; /* search to end of line */
n = files && files.length;
do {
if (shouldSel)
current = files[i++];