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
a962c89f
Commit
a962c89f
authored
Oct 22, 2020
by
Kim Eunchul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#39714 andやor検索(ウェブ版error処理)
parent
bbe66d21
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
180 additions
and
9 deletions
+180
-9
abvw/js/contentsearch.js
+84
-0
abvw/js/contentview.js
+12
-9
abvw/js/header.js
+84
-0
No files found.
abvw/js/contentsearch.js
View file @
a962c89f
...
@@ -1042,6 +1042,90 @@ CONTENTSEARCH.searchEventButtonFunction = function() {
...
@@ -1042,6 +1042,90 @@ CONTENTSEARCH.searchEventButtonFunction = function() {
return
;
return
;
}
}
try
{
//seperate string
var
myRegexp
=
/
[^\s
"
]
+|"
([^
"
]
*
)
"/gi
;
var
myArray
=
[];
var
myQuery
;
var
myRegExpArr
=
[];
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
{
myRegExpArr
[
0
]
=
new
RegExp
(
myArray
[
0
].
slice
(
1
));
myQuery
=
'( true'
}
}
else
{
myRegExpArr
[
0
]
=
new
RegExp
(
myArray
[
0
]);
myQuery
=
'true'
;
}
for
(
var
i
=
1
;
i
<
myArray
.
length
;
i
++
){
if
(
myArray
[
i
]
==
"OR"
||
myArray
[
i
]
==
"or"
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
}
else
if
(
myArray
[
i
].
charAt
(
0
)
==
"("
||
myArray
[
i
]
==
"("
){
if
(
myArray
[
i
]
==
"("
){
if
(
myArray
[
i
-
1
]
==
"OR"
||
myArray
[
i
-
1
]
==
"or"
){
myQuery
+=
' || ('
;
}
else
{
myQuery
+=
' && ('
;
}
}
else
{
if
(
myArray
[
i
-
1
]
==
"OR"
||
myArray
[
i
-
1
]
==
"or"
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
1
));
myQuery
+=
' || ( true'
;
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
1
));
myQuery
+=
' && ( true'
;
}
}
}
else
if
(
myArray
[
i
].
charAt
(
myArray
[
i
].
length
-
1
)
==
")"
||
myArray
[
i
]
==
")"
){
if
(
myArray
[
i
]
==
")"
){
myQuery
+=
' )'
;
}
else
{
if
(
myArray
[
i
-
1
]
==
"OR"
||
myArray
[
i
-
1
]
==
"or"
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
-
1
));
myQuery
+=
' || true )'
;
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
0
,
-
1
));
myQuery
+=
' && true )'
;
}
}
}
else
{
if
(
myArray
[
i
-
1
]
==
"OR"
||
myArray
[
i
-
1
]
==
"or"
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myQuery
+=
' || true'
;
}
else
{
if
(
myArray
[
i
-
1
]
==
"("
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myQuery
+=
' true'
;
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myQuery
+=
' && true'
;
}
}
}
}
if
(
eval
(
myQuery
))
{
//is not correct query
}
}
catch
(
error
){
alert
(
'正しくない検索です'
);
return
;
}
if
(
CONTENTSEARCH
.
overClick
()){
if
(
CONTENTSEARCH
.
overClick
()){
return
;
return
;
}
}
...
...
abvw/js/contentview.js
View file @
a962c89f
...
@@ -736,13 +736,10 @@ CONTENTVIEW.searchHandle = function() {
...
@@ -736,13 +736,10 @@ CONTENTVIEW.searchHandle = function() {
}
}
if
(
$
(
'#txtSearch'
).
val
()
!=
''
)
{
if
(
$
(
'#txtSearch'
).
val
()
!=
''
)
{
try
{
var
dataStored
=
CONTENTVIEW_GENERAL
.
arrThumbnailsLoaded
;
var
dataStored
=
CONTENTVIEW_GENERAL
.
arrThumbnailsLoaded
;
var
contentPage
=
CONTENTVIEW_GENERAL
.
dataWebContentPage
.
pages
;
var
contentPage
=
CONTENTVIEW_GENERAL
.
dataWebContentPage
.
pages
;
var
myRegExp
=
new
RegExp
(
$
(
'#txtSearch'
).
val
());
var
sPageNo
=
[];
var
sPageNo
=
[];
var
lstPageNo
=
[];
var
lstPageNo
=
[];
var
isExistData
=
false
;
//seperate string
//seperate string
var
myRegexp
=
/
[^\s
"
]
+|"
([^
"
]
*
)
"/gi
;
var
myRegexp
=
/
[^\s
"
]
+|"
([^
"
]
*
)
"/gi
;
...
@@ -750,6 +747,7 @@ CONTENTVIEW.searchHandle = function() {
...
@@ -750,6 +747,7 @@ CONTENTVIEW.searchHandle = function() {
var
myQuery
;
var
myQuery
;
var
myRegExpArr
=
[];
var
myRegExpArr
=
[];
try
{
do
{
do
{
var
match
=
myRegexp
.
exec
(
$
(
'#txtSearch'
).
val
());
var
match
=
myRegexp
.
exec
(
$
(
'#txtSearch'
).
val
());
if
(
match
!=
null
)
if
(
match
!=
null
)
...
@@ -807,8 +805,13 @@ CONTENTVIEW.searchHandle = function() {
...
@@ -807,8 +805,13 @@ CONTENTVIEW.searchHandle = function() {
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)'
;
}
else
{
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
if
(
myArray
[
i
-
1
]
==
"("
){
myQuery
+=
' && myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText)'
;
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myQuery
+=
' myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText)'
;
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myQuery
+=
' && myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText)'
;
}
}
}
}
}
}
}
...
@@ -820,10 +823,10 @@ CONTENTVIEW.searchHandle = function() {
...
@@ -820,10 +823,10 @@ CONTENTVIEW.searchHandle = function() {
}
}
}
}
}
catch
(
error
){
//
}catch(error){
alert
(
'正しくない検索です'
);
//
alert('正しくない検索です');
return
;
//
return;
}
//
}
if
(
sPageNo
.
length
>
0
)
{
if
(
sPageNo
.
length
>
0
)
{
//title start
//title start
...
...
abvw/js/header.js
View file @
a962c89f
...
@@ -270,6 +270,90 @@ HEADER.searchHeaderButtonFunction = function(){
...
@@ -270,6 +270,90 @@ HEADER.searchHeaderButtonFunction = function(){
return
;
return
;
}
}
try
{
//seperate string
var
myRegexp
=
/
[^\s
"
]
+|"
([^
"
]
*
)
"/gi
;
var
myArray
=
[];
var
myQuery
;
var
myRegExpArr
=
[];
do
{
var
match
=
myRegexp
.
exec
(
$
(
'#searchbox-key'
).
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
{
myRegExpArr
[
0
]
=
new
RegExp
(
myArray
[
0
].
slice
(
1
));
myQuery
=
'( true'
}
}
else
{
myRegExpArr
[
0
]
=
new
RegExp
(
myArray
[
0
]);
myQuery
=
'true'
;
}
for
(
var
i
=
1
;
i
<
myArray
.
length
;
i
++
){
if
(
myArray
[
i
]
==
"OR"
||
myArray
[
i
]
==
"or"
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
}
else
if
(
myArray
[
i
].
charAt
(
0
)
==
"("
||
myArray
[
i
]
==
"("
){
if
(
myArray
[
i
]
==
"("
){
if
(
myArray
[
i
-
1
]
==
"OR"
||
myArray
[
i
-
1
]
==
"or"
){
myQuery
+=
' || ('
;
}
else
{
myQuery
+=
' && ('
;
}
}
else
{
if
(
myArray
[
i
-
1
]
==
"OR"
||
myArray
[
i
-
1
]
==
"or"
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
1
));
myQuery
+=
' || ( true'
;
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
1
));
myQuery
+=
' && ( true'
;
}
}
}
else
if
(
myArray
[
i
].
charAt
(
myArray
[
i
].
length
-
1
)
==
")"
||
myArray
[
i
]
==
")"
){
if
(
myArray
[
i
]
==
")"
){
myQuery
+=
' )'
;
}
else
{
if
(
myArray
[
i
-
1
]
==
"OR"
||
myArray
[
i
-
1
]
==
"or"
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
-
1
));
myQuery
+=
' || true )'
;
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
0
,
-
1
));
myQuery
+=
' && true )'
;
}
}
}
else
{
if
(
myArray
[
i
-
1
]
==
"OR"
||
myArray
[
i
-
1
]
==
"or"
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myQuery
+=
' || true'
;
}
else
{
if
(
myArray
[
i
-
1
]
==
"("
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myQuery
+=
' true'
;
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myQuery
+=
' && true'
;
}
}
}
}
if
(
eval
(
myQuery
))
{
//is not correct query
}
}
catch
(
error
){
alert
(
'正しくない検索です'
);
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