mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 17:05:17 +00:00
fix(dom) selectByPattern: "." -> "\."
This commit is contained in:
parent
ecbde3a90a
commit
08b881578b
1 changed files with 3 additions and 15 deletions
|
|
@ -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++];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue