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
c58e05a5
Commit
c58e05a5
authored
Oct 19, 2020
by
Kim Eunchul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#39714 andやor検索(ウェブ版error処理)
parent
3557e19b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
59 deletions
+79
-59
abvw/js/contentview.js
+63
-58
abvw/js/contentview_Events.js
+16
-1
No files found.
abvw/js/contentview.js
View file @
c58e05a5
...
@@ -736,76 +736,81 @@ CONTENTVIEW.searchHandle = function() {
...
@@ -736,76 +736,81 @@ CONTENTVIEW.searchHandle = function() {
}
}
if
(
$
(
'#txtSearch'
).
val
()
!=
''
)
{
if
(
$
(
'#txtSearch'
).
val
()
!=
''
)
{
var
dataStored
=
CONTENTVIEW_GENERAL
.
arrThumbnailsLoaded
;
try
{
var
contentPage
=
CONTENTVIEW_GENERAL
.
dataWebContentPage
.
pages
;
var
dataStored
=
CONTENTVIEW_GENERAL
.
arrThumbnailsLoaded
;
var
myRegExp
=
new
RegExp
(
$
(
'#txtSearch'
).
val
());
var
contentPage
=
CONTENTVIEW_GENERAL
.
dataWebContentPage
.
pages
;
var
sPageNo
=
[];
var
myRegExp
=
new
RegExp
(
$
(
'#txtSearch'
).
val
());
var
lstPageNo
=
[];
var
sPageNo
=
[];
var
isExistData
=
false
;
var
lstPageNo
=
[];
var
isExistData
=
false
;
//seperate string
var
myRegexp
=
/
[^\s
"
]
+|"
([^
"
]
*
)
"/gi
;
//seperate string
var
myArray
=
[];
var
myRegexp
=
/
[^\s
"
]
+|"
([^
"
]
*
)
"/gi
;
var
myQuery
=
'myRegExpArr[0].test(contentPage[nIndex].pageText)'
;
var
myArray
=
[];
var
myRegExpArr
=
[];
var
myQuery
=
'myRegExpArr[0].test(contentPage[nIndex].pageText)'
;
var
myRegExpArr
=
[];
do
{
var
match
=
myRegexp
.
exec
(
$
(
'#txtSearch'
).
val
());
do
{
if
(
match
!=
null
)
var
match
=
myRegexp
.
exec
(
$
(
'#txtSearch'
).
val
());
{
if
(
match
!=
null
)
myArray
.
push
(
match
[
1
]
?
match
[
1
]
:
match
[
0
]);
{
console
.
log
(
myArray
);
myArray
.
push
(
match
[
1
]
?
match
[
1
]
:
match
[
0
]);
}
}
}
while
(
match
!=
null
);
}
while
(
match
!=
null
);
myRegExpArr
[
0
]
=
new
RegExp
(
myArray
[
0
]);
myRegExpArr
[
0
]
=
new
RegExp
(
myArray
[
0
]);
for
(
var
i
=
1
;
i
<
myArray
.
length
;
i
++
){
for
(
var
i
=
1
;
i
<
myArray
.
length
;
i
++
){
if
(
myArray
[
i
]
==
"OR"
||
myArray
[
i
]
==
"or"
){
if
(
myArray
[
i
]
==
"OR"
||
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"
||
myArray
[
i
-
1
]
==
"or"
){
if
(
myArray
[
i
-
1
]
==
"OR"
||
myArray
[
i
-
1
]
==
"or"
){
myQuery
+=
' || ('
;
myQuery
+=
' || ('
;
}
else
{
myQuery
+=
' && ('
;
}
}
else
{
}
else
{
myQuery
+=
' && ('
;
if
(
myArray
[
i
-
1
]
==
"OR"
||
myArray
[
i
-
1
]
==
"or"
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
1
));
myQuery
+=
' || ( myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText)'
;
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
1
));
myQuery
+=
' && ( myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText)'
;
}
}
}
}
else
{
}
else
if
(
myArray
[
i
].
charAt
(
myArray
[
i
].
length
-
1
)
==
")"
||
myArray
[
i
]
==
")"
){
if
(
myArray
[
i
-
1
]
==
"OR"
||
myArray
[
i
-
1
]
==
"or"
){
if
(
myArray
[
i
]
==
")"
){
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
1
));
myQuery
+=
' )'
;
myQuery
+=
' || ( myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText)'
;
}
else
{
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
1
));
if
(
myArray
[
i
-
1
]
==
"OR"
||
myArray
[
i
-
1
]
==
"or"
){
myQuery
+=
' && ( myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText)'
;
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
-
1
));
myQuery
+=
' || myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText) )'
;
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
0
,
-
1
));
myQuery
+=
' && myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText) )'
;
}
}
}
}
}
else
if
(
myArray
[
i
].
charAt
(
myArray
[
i
].
length
-
1
)
==
")"
||
myArray
[
i
]
==
")"
){
if
(
myArray
[
i
]
==
")"
){
myQuery
+=
' )'
;
}
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
]
.
slice
(
-
1
)
);
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
]
.
slice
(
0
,
-
1
)
);
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
]);
myQuery
+=
' && myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText)
)'
;
myQuery
+=
' && myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText)
'
;
}
}
}
}
}
else
{
if
(
myArray
[
i
-
1
]
==
"OR"
||
myArray
[
i
-
1
]
==
"or"
){
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)'
;
}
}
}
}
for
(
var
nIndex
=
0
;
nIndex
<
contentPage
.
length
;
nIndex
++
)
{
for
(
var
nIndex
=
0
;
nIndex
<
contentPage
.
length
;
nIndex
++
)
{
if
(
eval
(
myQuery
))
{
if
(
eval
(
myQuery
))
{
//searchResult.push(contentPage[nIndex]);
//searchResult.push(contentPage[nIndex]);
sPageNo
.
push
(
contentPage
[
nIndex
]);
sPageNo
.
push
(
contentPage
[
nIndex
]);
}
}
}
}
catch
(
error
){
alert
(
'正しくない検索です'
);
return
;
}
}
if
(
sPageNo
.
length
>
0
)
{
if
(
sPageNo
.
length
>
0
)
{
...
...
abvw/js/contentview_Events.js
View file @
c58e05a5
//名前空間用のオブジェクトを用意する
//名前空間用のオブジェクトを用意する
var
CONTENTVIEW_EVENTS
=
{};
var
CONTENTVIEW_EVENTS
=
{};
CONTENTVIEW_EVENTS
.
click
=
true
;
/* add memo click */
/* add memo click */
CONTENTVIEW_EVENTS
.
handleAddMemo
=
function
(
event
)
{
CONTENTVIEW_EVENTS
.
handleAddMemo
=
function
(
event
)
{
...
@@ -255,12 +256,26 @@ CONTENTVIEW_EVENTS.closeCopyTextBox = function() {
...
@@ -255,12 +256,26 @@ CONTENTVIEW_EVENTS.closeCopyTextBox = function() {
$
(
"#overlay"
).
hide
();
$
(
"#overlay"
).
hide
();
};
};
CONTENTVIEW_EVENTS
.
overClick
=
function
()
{
if
(
CONTENTVIEW_EVENTS
.
click
)
{
CONTENTVIEW_EVENTS
.
click
=
!
CONTENTVIEW_EVENTS
.
click
;
// prevent clicking for 2 sec
setTimeout
(
function
()
{
CONTENTVIEW_EVENTS
.
click
=
true
;
},
1000
)
return
false
;
}
else
{
return
true
;
}
}
/*event click show dialog search*/
/*event click show dialog search*/
CONTENTVIEW_EVENTS
.
showListSearchResult
=
function
()
{
CONTENTVIEW_EVENTS
.
showListSearchResult
=
function
()
{
$
(
'#txtSearch'
).
keydown
(
function
(
e
)
{
$
(
'#txtSearch'
).
keydown
(
function
(
e
)
{
if
(
e
.
keyCode
==
13
)
{
if
(
e
.
keyCode
==
13
)
{
if
(
CONTENT
SEARCH
.
overClick
()){
if
(
CONTENT
VIEW_EVENTS
.
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