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
cfede9da
Commit
cfede9da
authored
Oct 22, 2020
by
Kim Eunchul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#39714 andやor検索(検索語5つ制限)
parent
78373de5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
15 deletions
+60
-15
abvw/js/contentsearch.js
+16
-1
abvw/js/contentview.js
+19
-4
abvw/js/header.js
+25
-10
No files found.
abvw/js/contentsearch.js
View file @
cfede9da
...
...
@@ -1048,6 +1048,7 @@ CONTENTSEARCH.searchEventButtonFunction = function() {
var
myArray
=
[];
var
myQuery
;
var
myRegExpArr
=
[];
var
count
=
0
;
do
{
var
match
=
myRegexp
.
exec
(
$
(
'#txtSearchWs'
).
val
());
...
...
@@ -1064,10 +1065,12 @@ CONTENTSEARCH.searchEventButtonFunction = function() {
}
else
{
myRegExpArr
[
0
]
=
new
RegExp
(
myArray
[
0
].
slice
(
1
));
myQuery
=
'( true'
count
++
;
}
}
else
{
myRegExpArr
[
0
]
=
new
RegExp
(
myArray
[
0
]);
myQuery
=
'true'
;
count
++
;
}
for
(
var
i
=
1
;
i
<
myArray
.
length
;
i
++
){
...
...
@@ -1084,9 +1087,11 @@ CONTENTSEARCH.searchEventButtonFunction = function() {
if
(
myArray
[
i
-
1
]
==
"OR"
||
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
if
(
myArray
[
i
].
charAt
(
myArray
[
i
].
length
-
1
)
==
")"
||
myArray
[
i
]
==
")"
){
...
...
@@ -1096,22 +1101,27 @@ CONTENTSEARCH.searchEventButtonFunction = function() {
if
(
myArray
[
i
-
1
]
==
"OR"
||
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"
||
myArray
[
i
-
1
]
==
"or"
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myQuery
+=
' || true'
;
myQuery
+=
' || true'
;
count
++
;
}
else
{
if
(
myArray
[
i
-
1
]
==
"("
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myQuery
+=
' true'
;
count
++
;
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myQuery
+=
' && true'
;
count
++
;
}
}
}
...
...
@@ -1126,6 +1136,11 @@ CONTENTSEARCH.searchEventButtonFunction = function() {
return
;
}
if
(
count
>
5
){
alert
(
'語句数は最大5つです'
);
return
;
}
if
(
CONTENTSEARCH
.
overClick
()){
return
;
}
...
...
abvw/js/contentview.js
View file @
cfede9da
...
...
@@ -746,6 +746,7 @@ CONTENTVIEW.searchHandle = function() {
var
myArray
=
[];
var
myQuery
;
var
myRegExpArr
=
[];
var
count
=
0
;
try
{
do
{
...
...
@@ -762,11 +763,13 @@ CONTENTVIEW.searchHandle = function() {
myQuery
=
'( myRegExpArr[1].test(contentPage[nIndex].pageText)'
;
}
else
{
myRegExpArr
[
0
]
=
new
RegExp
(
myArray
[
0
].
slice
(
1
));
myQuery
=
'( myRegExpArr[0].test(contentPage[nIndex].pageText)'
myQuery
=
'( myRegExpArr[0].test(contentPage[nIndex].pageText)'
;
count
++
;
}
}
else
{
myRegExpArr
[
0
]
=
new
RegExp
(
myArray
[
0
]);
myQuery
=
'myRegExpArr[0].test(contentPage[nIndex].pageText)'
;
count
++
;
}
for
(
var
i
=
1
;
i
<
myArray
.
length
;
i
++
){
...
...
@@ -783,9 +786,11 @@ CONTENTVIEW.searchHandle = function() {
if
(
myArray
[
i
-
1
]
==
"OR"
||
myArray
[
i
-
1
]
==
"or"
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
1
));
myQuery
+=
' || ( myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText)'
;
count
++
;
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
1
));
myQuery
+=
' && ( myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText)'
;
count
++
;
}
}
}
else
if
(
myArray
[
i
].
charAt
(
myArray
[
i
].
length
-
1
)
==
")"
||
myArray
[
i
]
==
")"
){
...
...
@@ -795,22 +800,27 @@ CONTENTVIEW.searchHandle = function() {
if
(
myArray
[
i
-
1
]
==
"OR"
||
myArray
[
i
-
1
]
==
"or"
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
0
,
-
1
));
myQuery
+=
' || myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText) )'
;
count
++
;
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
0
,
-
1
));
myQuery
+=
' && myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText) )'
;
count
++
;
}
}
}
else
{
if
(
myArray
[
i
-
1
]
==
"OR"
||
myArray
[
i
-
1
]
==
"or"
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myQuery
+=
' || myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText)'
;
myQuery
+=
' || myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText)'
;
count
++
;
}
else
{
if
(
myArray
[
i
-
1
]
==
"("
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myQuery
+=
' myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText)'
;
myQuery
+=
' myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText)'
;
count
++
;
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myQuery
+=
' && myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText)'
;
myQuery
+=
' && myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText)'
;
count
++
;
}
}
}
...
...
@@ -828,6 +838,11 @@ CONTENTVIEW.searchHandle = function() {
return
;
}
if
(
count
>
5
){
alert
(
'語句数は最大5つです'
);
return
;
}
if
(
sPageNo
.
length
>
0
)
{
//title start
$
(
'#bookmarkBoxHdSearching'
).
children
().
remove
();
...
...
abvw/js/header.js
View file @
cfede9da
...
...
@@ -275,7 +275,8 @@ HEADER.searchHeaderButtonFunction = function(){
var
myRegexp
=
/
[^\s
"
]
+|"
([^
"
]
*
)
"/gi
;
var
myArray
=
[];
var
myQuery
;
var
myRegExpArr
=
[];
var
myRegExpArr
=
[];
var
count
=
0
;
do
{
var
match
=
myRegexp
.
exec
(
$
(
'#searchbox-key'
).
val
());
...
...
@@ -291,11 +292,13 @@ HEADER.searchHeaderButtonFunction = function(){
myQuery
=
'( true'
;
}
else
{
myRegExpArr
[
0
]
=
new
RegExp
(
myArray
[
0
].
slice
(
1
));
myQuery
=
'( true'
myQuery
=
'( true'
count
++
;
}
}
else
{
myRegExpArr
[
0
]
=
new
RegExp
(
myArray
[
0
]);
myQuery
=
'true'
;
myQuery
=
'true'
;
count
++
;
}
for
(
var
i
=
1
;
i
<
myArray
.
length
;
i
++
){
...
...
@@ -311,10 +314,12 @@ HEADER.searchHeaderButtonFunction = function(){
}
else
{
if
(
myArray
[
i
-
1
]
==
"OR"
||
myArray
[
i
-
1
]
==
"or"
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
1
));
myQuery
+=
' || ( true'
;
myQuery
+=
' || ( true'
;
count
++
;
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
1
));
myQuery
+=
' && ( true'
;
myQuery
+=
' && ( true'
;
count
++
;
}
}
}
else
if
(
myArray
[
i
].
charAt
(
myArray
[
i
].
length
-
1
)
==
")"
||
myArray
[
i
]
==
")"
){
...
...
@@ -323,23 +328,28 @@ HEADER.searchHeaderButtonFunction = function(){
}
else
{
if
(
myArray
[
i
-
1
]
==
"OR"
||
myArray
[
i
-
1
]
==
"or"
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
0
,
-
1
));
myQuery
+=
' || true )'
;
myQuery
+=
' || true )'
;
count
++
;
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
0
,
-
1
));
myQuery
+=
' && true )'
;
myQuery
+=
' && true )'
;
count
++
;
}
}
}
else
{
if
(
myArray
[
i
-
1
]
==
"OR"
||
myArray
[
i
-
1
]
==
"or"
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myQuery
+=
' || true'
;
myQuery
+=
' || true'
;
count
++
;
}
else
{
if
(
myArray
[
i
-
1
]
==
"("
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myQuery
+=
' true'
;
myQuery
+=
' true'
;
count
++
;
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myQuery
+=
' && true'
;
myQuery
+=
' && true'
;
count
++
;
}
}
}
...
...
@@ -353,6 +363,11 @@ HEADER.searchHeaderButtonFunction = function(){
alert
(
'正しくない検索です'
);
return
;
}
if
(
count
>
5
){
alert
(
'語句数は最大5つです'
);
return
;
}
if
(
HEADER
.
overClick
()){
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