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
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
1 deletions
+46
-1
abvw/js/contentsearch.js
+15
-0
abvw/js/contentview.js
+16
-1
abvw/js/header.js
+15
-0
No files found.
abvw/js/contentsearch.js
View file @
cfede9da
...
@@ -1048,6 +1048,7 @@ CONTENTSEARCH.searchEventButtonFunction = function() {
...
@@ -1048,6 +1048,7 @@ CONTENTSEARCH.searchEventButtonFunction = function() {
var
myArray
=
[];
var
myArray
=
[];
var
myQuery
;
var
myQuery
;
var
myRegExpArr
=
[];
var
myRegExpArr
=
[];
var
count
=
0
;
do
{
do
{
var
match
=
myRegexp
.
exec
(
$
(
'#txtSearchWs'
).
val
());
var
match
=
myRegexp
.
exec
(
$
(
'#txtSearchWs'
).
val
());
...
@@ -1064,10 +1065,12 @@ CONTENTSEARCH.searchEventButtonFunction = function() {
...
@@ -1064,10 +1065,12 @@ CONTENTSEARCH.searchEventButtonFunction = function() {
}
else
{
}
else
{
myRegExpArr
[
0
]
=
new
RegExp
(
myArray
[
0
].
slice
(
1
));
myRegExpArr
[
0
]
=
new
RegExp
(
myArray
[
0
].
slice
(
1
));
myQuery
=
'( true'
myQuery
=
'( true'
count
++
;
}
}
}
else
{
}
else
{
myRegExpArr
[
0
]
=
new
RegExp
(
myArray
[
0
]);
myRegExpArr
[
0
]
=
new
RegExp
(
myArray
[
0
]);
myQuery
=
'true'
;
myQuery
=
'true'
;
count
++
;
}
}
for
(
var
i
=
1
;
i
<
myArray
.
length
;
i
++
){
for
(
var
i
=
1
;
i
<
myArray
.
length
;
i
++
){
...
@@ -1084,9 +1087,11 @@ CONTENTSEARCH.searchEventButtonFunction = function() {
...
@@ -1084,9 +1087,11 @@ CONTENTSEARCH.searchEventButtonFunction = function() {
if
(
myArray
[
i
-
1
]
==
"OR"
||
myArray
[
i
-
1
]
==
"or"
){
if
(
myArray
[
i
-
1
]
==
"OR"
||
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
++
;
}
else
{
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
1
));
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
1
));
myQuery
+=
' && ( true'
;
myQuery
+=
' && ( true'
;
count
++
;
}
}
}
}
}
else
if
(
myArray
[
i
].
charAt
(
myArray
[
i
].
length
-
1
)
==
")"
||
myArray
[
i
]
==
")"
){
}
else
if
(
myArray
[
i
].
charAt
(
myArray
[
i
].
length
-
1
)
==
")"
||
myArray
[
i
]
==
")"
){
...
@@ -1096,22 +1101,27 @@ CONTENTSEARCH.searchEventButtonFunction = function() {
...
@@ -1096,22 +1101,27 @@ CONTENTSEARCH.searchEventButtonFunction = function() {
if
(
myArray
[
i
-
1
]
==
"OR"
||
myArray
[
i
-
1
]
==
"or"
){
if
(
myArray
[
i
-
1
]
==
"OR"
||
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
++
;
}
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
++
;
}
}
}
}
}
else
{
}
else
{
if
(
myArray
[
i
-
1
]
==
"OR"
||
myArray
[
i
-
1
]
==
"or"
){
if
(
myArray
[
i
-
1
]
==
"OR"
||
myArray
[
i
-
1
]
==
"or"
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myQuery
+=
' || true'
;
myQuery
+=
' || true'
;
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
++
;
}
else
{
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myQuery
+=
' && true'
;
myQuery
+=
' && true'
;
count
++
;
}
}
}
}
}
}
...
@@ -1126,6 +1136,11 @@ CONTENTSEARCH.searchEventButtonFunction = function() {
...
@@ -1126,6 +1136,11 @@ CONTENTSEARCH.searchEventButtonFunction = function() {
return
;
return
;
}
}
if
(
count
>
5
){
alert
(
'語句数は最大5つです'
);
return
;
}
if
(
CONTENTSEARCH
.
overClick
()){
if
(
CONTENTSEARCH
.
overClick
()){
return
;
return
;
}
}
...
...
abvw/js/contentview.js
View file @
cfede9da
...
@@ -746,6 +746,7 @@ CONTENTVIEW.searchHandle = function() {
...
@@ -746,6 +746,7 @@ CONTENTVIEW.searchHandle = function() {
var
myArray
=
[];
var
myArray
=
[];
var
myQuery
;
var
myQuery
;
var
myRegExpArr
=
[];
var
myRegExpArr
=
[];
var
count
=
0
;
try
{
try
{
do
{
do
{
...
@@ -762,11 +763,13 @@ CONTENTVIEW.searchHandle = function() {
...
@@ -762,11 +763,13 @@ CONTENTVIEW.searchHandle = function() {
myQuery
=
'( myRegExpArr[1].test(contentPage[nIndex].pageText)'
;
myQuery
=
'( myRegExpArr[1].test(contentPage[nIndex].pageText)'
;
}
else
{
}
else
{
myRegExpArr
[
0
]
=
new
RegExp
(
myArray
[
0
].
slice
(
1
));
myRegExpArr
[
0
]
=
new
RegExp
(
myArray
[
0
].
slice
(
1
));
myQuery
=
'( myRegExpArr[0].test(contentPage[nIndex].pageText)'
myQuery
=
'( myRegExpArr[0].test(contentPage[nIndex].pageText)'
;
count
++
;
}
}
}
else
{
}
else
{
myRegExpArr
[
0
]
=
new
RegExp
(
myArray
[
0
]);
myRegExpArr
[
0
]
=
new
RegExp
(
myArray
[
0
]);
myQuery
=
'myRegExpArr[0].test(contentPage[nIndex].pageText)'
;
myQuery
=
'myRegExpArr[0].test(contentPage[nIndex].pageText)'
;
count
++
;
}
}
for
(
var
i
=
1
;
i
<
myArray
.
length
;
i
++
){
for
(
var
i
=
1
;
i
<
myArray
.
length
;
i
++
){
...
@@ -783,9 +786,11 @@ CONTENTVIEW.searchHandle = function() {
...
@@ -783,9 +786,11 @@ CONTENTVIEW.searchHandle = function() {
if
(
myArray
[
i
-
1
]
==
"OR"
||
myArray
[
i
-
1
]
==
"or"
){
if
(
myArray
[
i
-
1
]
==
"OR"
||
myArray
[
i
-
1
]
==
"or"
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
1
));
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
1
));
myQuery
+=
' || ( myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText)'
;
myQuery
+=
' || ( myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText)'
;
count
++
;
}
else
{
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
1
));
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
1
));
myQuery
+=
' && ( myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText)'
;
myQuery
+=
' && ( myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText)'
;
count
++
;
}
}
}
}
}
else
if
(
myArray
[
i
].
charAt
(
myArray
[
i
].
length
-
1
)
==
")"
||
myArray
[
i
]
==
")"
){
}
else
if
(
myArray
[
i
].
charAt
(
myArray
[
i
].
length
-
1
)
==
")"
||
myArray
[
i
]
==
")"
){
...
@@ -795,22 +800,27 @@ CONTENTVIEW.searchHandle = function() {
...
@@ -795,22 +800,27 @@ CONTENTVIEW.searchHandle = function() {
if
(
myArray
[
i
-
1
]
==
"OR"
||
myArray
[
i
-
1
]
==
"or"
){
if
(
myArray
[
i
-
1
]
==
"OR"
||
myArray
[
i
-
1
]
==
"or"
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
0
,
-
1
));
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
0
,
-
1
));
myQuery
+=
' || myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText) )'
;
myQuery
+=
' || myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText) )'
;
count
++
;
}
else
{
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
0
,
-
1
));
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
0
,
-
1
));
myQuery
+=
' && myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText) )'
;
myQuery
+=
' && myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText) )'
;
count
++
;
}
}
}
}
}
else
{
}
else
{
if
(
myArray
[
i
-
1
]
==
"OR"
||
myArray
[
i
-
1
]
==
"or"
){
if
(
myArray
[
i
-
1
]
==
"OR"
||
myArray
[
i
-
1
]
==
"or"
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myQuery
+=
' || myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText)'
;
myQuery
+=
' || myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText)'
;
count
++
;
}
else
{
}
else
{
if
(
myArray
[
i
-
1
]
==
"("
){
if
(
myArray
[
i
-
1
]
==
"("
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myQuery
+=
' myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText)'
;
myQuery
+=
' myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText)'
;
count
++
;
}
else
{
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
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() {
...
@@ -828,6 +838,11 @@ CONTENTVIEW.searchHandle = function() {
return
;
return
;
}
}
if
(
count
>
5
){
alert
(
'語句数は最大5つです'
);
return
;
}
if
(
sPageNo
.
length
>
0
)
{
if
(
sPageNo
.
length
>
0
)
{
//title start
//title start
$
(
'#bookmarkBoxHdSearching'
).
children
().
remove
();
$
(
'#bookmarkBoxHdSearching'
).
children
().
remove
();
...
...
abvw/js/header.js
View file @
cfede9da
...
@@ -276,6 +276,7 @@ HEADER.searchHeaderButtonFunction = function(){
...
@@ -276,6 +276,7 @@ HEADER.searchHeaderButtonFunction = function(){
var
myArray
=
[];
var
myArray
=
[];
var
myQuery
;
var
myQuery
;
var
myRegExpArr
=
[];
var
myRegExpArr
=
[];
var
count
=
0
;
do
{
do
{
var
match
=
myRegexp
.
exec
(
$
(
'#searchbox-key'
).
val
());
var
match
=
myRegexp
.
exec
(
$
(
'#searchbox-key'
).
val
());
...
@@ -292,10 +293,12 @@ HEADER.searchHeaderButtonFunction = function(){
...
@@ -292,10 +293,12 @@ HEADER.searchHeaderButtonFunction = function(){
}
else
{
}
else
{
myRegExpArr
[
0
]
=
new
RegExp
(
myArray
[
0
].
slice
(
1
));
myRegExpArr
[
0
]
=
new
RegExp
(
myArray
[
0
].
slice
(
1
));
myQuery
=
'( true'
myQuery
=
'( true'
count
++
;
}
}
}
else
{
}
else
{
myRegExpArr
[
0
]
=
new
RegExp
(
myArray
[
0
]);
myRegExpArr
[
0
]
=
new
RegExp
(
myArray
[
0
]);
myQuery
=
'true'
;
myQuery
=
'true'
;
count
++
;
}
}
for
(
var
i
=
1
;
i
<
myArray
.
length
;
i
++
){
for
(
var
i
=
1
;
i
<
myArray
.
length
;
i
++
){
...
@@ -312,9 +315,11 @@ HEADER.searchHeaderButtonFunction = function(){
...
@@ -312,9 +315,11 @@ HEADER.searchHeaderButtonFunction = function(){
if
(
myArray
[
i
-
1
]
==
"OR"
||
myArray
[
i
-
1
]
==
"or"
){
if
(
myArray
[
i
-
1
]
==
"OR"
||
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
++
;
}
else
{
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
1
));
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
1
));
myQuery
+=
' && ( true'
;
myQuery
+=
' && ( true'
;
count
++
;
}
}
}
}
}
else
if
(
myArray
[
i
].
charAt
(
myArray
[
i
].
length
-
1
)
==
")"
||
myArray
[
i
]
==
")"
){
}
else
if
(
myArray
[
i
].
charAt
(
myArray
[
i
].
length
-
1
)
==
")"
||
myArray
[
i
]
==
")"
){
...
@@ -324,22 +329,27 @@ HEADER.searchHeaderButtonFunction = function(){
...
@@ -324,22 +329,27 @@ HEADER.searchHeaderButtonFunction = function(){
if
(
myArray
[
i
-
1
]
==
"OR"
||
myArray
[
i
-
1
]
==
"or"
){
if
(
myArray
[
i
-
1
]
==
"OR"
||
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
++
;
}
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
++
;
}
}
}
}
}
else
{
}
else
{
if
(
myArray
[
i
-
1
]
==
"OR"
||
myArray
[
i
-
1
]
==
"or"
){
if
(
myArray
[
i
-
1
]
==
"OR"
||
myArray
[
i
-
1
]
==
"or"
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myQuery
+=
' || true'
;
myQuery
+=
' || true'
;
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
++
;
}
else
{
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myQuery
+=
' && true'
;
myQuery
+=
' && true'
;
count
++
;
}
}
}
}
}
}
...
@@ -354,6 +364,11 @@ HEADER.searchHeaderButtonFunction = function(){
...
@@ -354,6 +364,11 @@ HEADER.searchHeaderButtonFunction = function(){
return
;
return
;
}
}
if
(
count
>
5
){
alert
(
'語句数は最大5つです'
);
return
;
}
if
(
HEADER
.
overClick
()){
if
(
HEADER
.
overClick
()){
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