Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
check
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abook_web
check
Commits
8af26de0
Commit
8af26de0
authored
Oct 27, 2020
by
Kim Eunchul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#39714 andやor検索(未入力検索修正)
parent
05dc286c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
167 additions
and
166 deletions
+167
-166
abvw/js/contentsearch.js
+77
-76
abvw/js/header.js
+90
-90
No files found.
abvw/js/contentsearch.js
View file @
8af26de0
...
@@ -1041,101 +1041,102 @@ CONTENTSEARCH.searchEventButtonFunction = function() {
...
@@ -1041,101 +1041,102 @@ CONTENTSEARCH.searchEventButtonFunction = function() {
alert
(
'200字以下のテキストを入力してください'
);
alert
(
'200字以下のテキストを入力してください'
);
return
;
return
;
}
}
if
(
$
(
'#txtSearch'
).
val
()
!=
''
)
{
try
{
//seperate string
var
myRegexp
=
/
[^\s
"
]
+|"
([^
"
]
*
)
"/gi
;
var
myArray
=
[];
var
myQuery
;
var
myRegExpArr
=
[];
var
count
=
0
;
do
{
var
match
=
myRegexp
.
exec
(
$
(
'#txtSearchWs'
).
val
());
if
(
match
!=
null
)
{
myArray
.
push
(
match
[
1
]
?
match
[
1
]
:
match
[
0
]);
}
}
while
(
match
!=
null
);
try
{
if
(
myArray
[
0
].
charAt
(
0
)
==
"("
){
//seperate string
if
(
myArray
[
0
]
==
"("
){
var
myRegexp
=
/
[^\s
"
]
+|"
([^
"
]
*
)
"/gi
;
myRegExpArr
[
1
]
=
new
RegExp
(
myArray
[
1
]);
var
myArray
=
[];
myQuery
=
'( true'
;
var
myQuery
;
}
else
{
var
myRegExpArr
=
[];
myRegExpArr
[
0
]
=
new
RegExp
(
myArray
[
0
].
slice
(
1
));
var
count
=
0
;
myQuery
=
'( true'
count
++
;
do
{
}
var
match
=
myRegexp
.
exec
(
$
(
'#txtSearchWs'
).
val
());
if
(
match
!=
null
)
{
myArray
.
push
(
match
[
1
]
?
match
[
1
]
:
match
[
0
]);
}
}
while
(
match
!=
null
);
if
(
myArray
[
0
].
charAt
(
0
)
==
"("
){
if
(
myArray
[
0
]
==
"("
){
myRegExpArr
[
1
]
=
new
RegExp
(
myArray
[
1
]);
myQuery
=
'( true'
;
}
else
{
}
else
{
myRegExpArr
[
0
]
=
new
RegExp
(
myArray
[
0
]
.
slice
(
1
)
);
myRegExpArr
[
0
]
=
new
RegExp
(
myArray
[
0
]);
myQuery
=
'
( true'
myQuery
=
'
true'
;
count
++
;
count
++
;
}
}
}
else
{
myRegExpArr
[
0
]
=
new
RegExp
(
myArray
[
0
]);
myQuery
=
'true'
;
count
++
;
}
for
(
var
i
=
1
;
i
<
myArray
.
length
;
i
++
){
for
(
var
i
=
1
;
i
<
myArray
.
length
;
i
++
){
if
(
myArray
[
i
]
==
"OR"
){
if
(
myArray
[
i
]
==
"OR"
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
}
else
if
(
myArray
[
i
].
charAt
(
0
)
==
"("
||
myArray
[
i
]
==
"("
){
}
else
if
(
myArray
[
i
].
charAt
(
0
)
==
"("
||
myArray
[
i
]
==
"("
){
if
(
myArray
[
i
]
==
"("
){
if
(
myArray
[
i
]
==
"("
){
if
(
myArray
[
i
-
1
]
==
"OR"
){
if
(
myArray
[
i
-
1
]
==
"OR"
){
myQuery
+=
' || ('
;
myQuery
+=
' || ('
;
}
else
{
myQuery
+=
' && ('
;
}
}
else
{
}
else
{
myQuery
+=
' && ('
;
if
(
myArray
[
i
-
1
]
==
"OR"
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
1
));
myQuery
+=
' || ( true'
;
count
++
;
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
1
));
myQuery
+=
' && ( true'
;
count
++
;
}
}
}
}
else
{
}
else
if
(
myArray
[
i
].
charAt
(
myArray
[
i
].
length
-
1
)
==
")"
||
myArray
[
i
]
==
")"
){
if
(
myArray
[
i
-
1
]
==
"OR"
){
if
(
myArray
[
i
]
==
")"
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
1
));
myQuery
+=
' )'
;
myQuery
+=
' || ( true'
;
count
++
;
}
else
{
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
1
));
if
(
myArray
[
i
-
1
]
==
"OR"
){
myQuery
+=
' && ( true'
;
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
0
,
-
1
));
count
++
;
myQuery
+=
' || true )'
;
count
++
;
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
0
,
-
1
));
myQuery
+=
' && true )'
;
count
++
;
}
}
}
}
}
else
if
(
myArray
[
i
].
charAt
(
myArray
[
i
].
length
-
1
)
==
")"
||
myArray
[
i
]
==
")"
){
if
(
myArray
[
i
]
==
")"
){
myQuery
+=
' )'
;
}
else
{
}
else
{
if
(
myArray
[
i
-
1
]
==
"OR"
){
if
(
myArray
[
i
-
1
]
==
"OR"
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
0
,
-
1
));
myQuery
+=
' || true )'
;
count
++
;
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
0
,
-
1
));
myQuery
+=
' && true )'
;
count
++
;
}
}
}
else
{
if
(
myArray
[
i
-
1
]
==
"OR"
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myQuery
+=
' || true'
;
count
++
;
}
else
{
if
(
myArray
[
i
-
1
]
==
"("
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myQuery
+=
'
true'
;
myQuery
+=
'
|| true'
;
count
++
;
count
++
;
}
else
{
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
if
(
myArray
[
i
-
1
]
==
"("
){
myQuery
+=
' && true'
;
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
count
++
;
myQuery
+=
' true'
;
count
++
;
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myQuery
+=
' && true'
;
count
++
;
}
}
}
}
}
}
}
}
if
(
eval
(
myQuery
))
{
if
(
eval
(
myQuery
))
{
//is not correct query
//is not correct query
}
}
}
catch
(
error
){
}
catch
(
error
){
alert
(
'正しくない検索です'
);
alert
(
'正しくない検索です'
);
return
;
return
;
}
}
}
if
(
count
>
5
){
if
(
count
>
5
){
alert
(
'語句数は最大5つです'
);
alert
(
'語句数は最大5つです'
);
return
;
return
;
...
...
abvw/js/header.js
View file @
8af26de0
...
@@ -269,101 +269,101 @@ HEADER.searchHeaderButtonFunction = function(){
...
@@ -269,101 +269,101 @@ HEADER.searchHeaderButtonFunction = function(){
alert
(
'200字以下のテキストを入力してください'
);
alert
(
'200字以下のテキストを入力してください'
);
return
;
return
;
}
}
if
(
$
(
'#txtSearch'
).
val
()
!=
''
)
{
try
{
try
{
//seperate string
//seperate string
var
myRegexp
=
/
[^\s
"
]
+|"
([^
"
]
*
)
"/gi
;
var
myRegexp
=
/
[^\s
"
]
+|"
([^
"
]
*
)
"/gi
;
var
myArray
=
[];
var
myArray
=
[];
var
myQuery
;
var
myQuery
;
var
myRegExpArr
=
[];
var
myRegExpArr
=
[];
var
count
=
0
;
var
count
=
0
;
do
{
do
{
var
match
=
myRegexp
.
exec
(
$
(
'#searchbox-key'
).
val
());
var
match
=
myRegexp
.
exec
(
$
(
'#searchbox-key'
).
val
());
if
(
match
!=
null
)
if
(
match
!=
null
)
{
{
myArray
.
push
(
match
[
1
]
?
match
[
1
]
:
match
[
0
]);
myArray
.
push
(
match
[
1
]
?
match
[
1
]
:
match
[
0
]);
}
}
}
while
(
match
!=
null
);
}
while
(
match
!=
null
);
if
(
myArray
[
0
].
charAt
(
0
)
==
"("
){
if
(
myArray
[
0
].
charAt
(
0
)
==
"("
){
if
(
myArray
[
0
]
==
"("
){
if
(
myArray
[
0
]
==
"("
){
myRegExpArr
[
1
]
=
new
RegExp
(
myArray
[
1
]);
myRegExpArr
[
1
]
=
new
RegExp
(
myArray
[
1
]);
myQuery
=
'( true'
;
myQuery
=
'( true'
;
}
else
{
}
else
{
myRegExpArr
[
0
]
=
new
RegExp
(
myArray
[
0
].
slice
(
1
));
myRegExpArr
[
0
]
=
new
RegExp
(
myArray
[
0
].
slice
(
1
));
myQuery
=
'( true'
myQuery
=
'( true'
count
++
;
}
}
else
{
myRegExpArr
[
0
]
=
new
RegExp
(
myArray
[
0
]);
myQuery
=
'true'
;
count
++
;
count
++
;
}
}
}
else
{
myRegExpArr
[
0
]
=
new
RegExp
(
myArray
[
0
]);
myQuery
=
'true'
;
count
++
;
}
for
(
var
i
=
1
;
i
<
myArray
.
length
;
i
++
){
for
(
var
i
=
1
;
i
<
myArray
.
length
;
i
++
){
if
(
myArray
[
i
]
==
"OR"
){
if
(
myArray
[
i
]
==
"OR"
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
}
else
if
(
myArray
[
i
].
charAt
(
0
)
==
"("
||
myArray
[
i
]
==
"("
){
}
else
if
(
myArray
[
i
].
charAt
(
0
)
==
"("
||
myArray
[
i
]
==
"("
){
if
(
myArray
[
i
]
==
"("
){
if
(
myArray
[
i
]
==
"("
){
if
(
myArray
[
i
-
1
]
==
"OR"
){
if
(
myArray
[
i
-
1
]
==
"OR"
){
myQuery
+=
' || ('
;
myQuery
+=
' || ('
;
}
else
{
}
else
{
myQuery
+=
' && ('
;
myQuery
+=
' && ('
;
}
}
}
else
{
}
else
{
if
(
myArray
[
i
-
1
]
==
"OR"
){
if
(
myArray
[
i
-
1
]
==
"OR"
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
1
));
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
1
));
myQuery
+=
' || ( true'
;
myQuery
+=
' || ( true'
;
count
++
;
count
++
;
}
else
{
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
1
));
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
1
));
myQuery
+=
' && ( true'
;
myQuery
+=
' && ( true'
;
count
++
;
count
++
;
}
}
}
}
}
else
if
(
myArray
[
i
].
charAt
(
myArray
[
i
].
length
-
1
)
==
")"
||
myArray
[
i
]
==
")"
){
}
else
if
(
myArray
[
i
].
charAt
(
myArray
[
i
].
length
-
1
)
==
")"
||
myArray
[
i
]
==
")"
){
if
(
myArray
[
i
]
==
")"
){
if
(
myArray
[
i
]
==
")"
){
myQuery
+=
' )'
;
myQuery
+=
' )'
;
}
else
{
}
else
{
if
(
myArray
[
i
-
1
]
==
"OR"
){
if
(
myArray
[
i
-
1
]
==
"OR"
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
0
,
-
1
));
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
0
,
-
1
));
myQuery
+=
' || true )'
;
myQuery
+=
' || true )'
;
count
++
;
count
++
;
}
else
{
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
0
,
-
1
));
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
0
,
-
1
));
myQuery
+=
' && true )'
;
myQuery
+=
' && true )'
;
count
++
;
count
++
;
}
}
}
}
}
else
{
}
else
{
if
(
myArray
[
i
-
1
]
==
"OR"
){
if
(
myArray
[
i
-
1
]
==
"OR"
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myQuery
+=
' || true'
;
myQuery
+=
' || true'
;
count
++
;
count
++
;
}
else
{
}
else
{
if
(
myArray
[
i
-
1
]
==
"("
){
if
(
myArray
[
i
-
1
]
==
"("
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myQuery
+=
' true'
;
myQuery
+=
' true'
;
count
++
;
count
++
;
}
else
{
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myQuery
+=
' && true'
;
myQuery
+=
' && true'
;
count
++
;
count
++
;
}
}
}
}
}
}
}
}
if
(
eval
(
myQuery
))
{
if
(
eval
(
myQuery
))
{
//is not correct query
//is not correct query
}
}
}
catch
(
error
){
}
catch
(
error
){
alert
(
'正しくない検索です'
);
alert
(
'正しくない検索です'
);
return
;
return
;
}
}
}
if
(
count
>
5
){
if
(
count
>
5
){
alert
(
'語句数は最大5つです'
);
alert
(
'語句数は最大5つです'
);
return
;
return
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment