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
3557e19b
Commit
3557e19b
authored
Oct 16, 2020
by
Kim Eunchul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#39714 andやor検索(ウェブ版text検索及び200文字制限、重複クリック防止)
parent
e5b6abae
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
105 additions
and
2 deletions
+105
-2
abvw/js/contentsearch.js
+25
-0
abvw/js/contentview.js
+65
-1
abvw/js/contentview_Events.js
+4
-0
abvw/js/header.js
+11
-1
No files found.
abvw/js/contentsearch.js
View file @
3557e19b
...
...
@@ -19,6 +19,7 @@ CONTENTSEARCH.totalPage;
CONTENTSEARCH
.
chkSearchTextEmpty
=
false
;
CONTENTSEARCH
.
noRecordFlg
=
false
;
CONTENTSEARCH
.
home_isMove
=
false
;
CONTENTSEARCH
.
click
=
true
;
// スクロール復帰
CONTENTSEARCH
.
scrollTop
=
0
;
...
...
@@ -1036,6 +1037,15 @@ CONTENTSEARCH.searchEventButtonFunction = function() {
var
offset
=
0
;
var
limit
=
CONTENTSEARCH
.
returnNumberDispRecordForList
();
if
(
searchText
.
length
>
200
){
alert
(
'200字以下のテキストを入力してください'
);
return
;
}
if
(
CONTENTSEARCH
.
overClick
()){
return
;
}
if
(
content
==
'checked'
)
{
searchDivision
=
$
(
'#searchbox-content'
).
val
();
}
...
...
@@ -1066,6 +1076,21 @@ CONTENTSEARCH.searchEventButtonFunction = function() {
CONTENTSEARCH
.
renderContent
(
sid
,
searchText
,
searchDivision
,
sortType
,
sortOrder
,
offset
,
limit
,
genreId
,
groupId
);
};
CONTENTSEARCH
.
overClick
=
function
()
{
if
(
CONTENTSEARCH
.
click
)
{
CONTENTSEARCH
.
click
=
!
CONTENTSEARCH
.
click
;
// prevent clicking for 2 sec
setTimeout
(
function
()
{
CONTENTSEARCH
.
click
=
true
;
},
1000
)
return
false
;
}
else
{
return
true
;
}
}
// Render User view date
CONTENTSEARCH
.
renderViewDate
=
function
(
id
,
readingContentIds
)
{
for
(
var
i
=
0
;
i
<
readingContentIds
.
length
;
i
++
)
{
...
...
abvw/js/contentview.js
View file @
3557e19b
...
...
@@ -729,6 +729,12 @@ CONTENTVIEW.searchHandle = function() {
var
w
=
$
(
"#main"
).
width
()
-
$
(
".hdRcolumn"
).
width
();
var
pos
=
[
w
,
CONTENTVIEW
.
marginY
];
if
(
$
(
'#txtSearch'
).
val
().
length
>
200
){
alert
(
'200字以下のテキストを入力してください'
);
return
;
}
if
(
$
(
'#txtSearch'
).
val
()
!=
''
)
{
var
dataStored
=
CONTENTVIEW_GENERAL
.
arrThumbnailsLoaded
;
var
contentPage
=
CONTENTVIEW_GENERAL
.
dataWebContentPage
.
pages
;
...
...
@@ -737,8 +743,66 @@ CONTENTVIEW.searchHandle = function() {
var
lstPageNo
=
[];
var
isExistData
=
false
;
//seperate string
var
myRegexp
=
/
[^\s
"
]
+|"
([^
"
]
*
)
"/gi
;
var
myArray
=
[];
var
myQuery
=
'myRegExpArr[0].test(contentPage[nIndex].pageText)'
;
var
myRegExpArr
=
[];
do
{
var
match
=
myRegexp
.
exec
(
$
(
'#txtSearch'
).
val
());
if
(
match
!=
null
)
{
myArray
.
push
(
match
[
1
]
?
match
[
1
]
:
match
[
0
]);
console
.
log
(
myArray
);
}
}
while
(
match
!=
null
);
myRegExpArr
[
0
]
=
new
RegExp
(
myArray
[
0
]);
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
+=
' || ( myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText)'
;
}
else
{
myRegExpArr
[
i
]
=
new
RegExp
(
myArray
[
i
].
slice
(
1
));
myQuery
+=
' && ( myRegExpArr['
+
i
+
'].test(contentPage[nIndex].pageText)'
;
}
}
}
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
+=
' || 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
-
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
++
)
{
if
(
myRegExp
.
test
(
contentPage
[
nIndex
].
pageText
))
{
if
(
eval
(
myQuery
))
{
//searchResult.push(contentPage[nIndex]);
sPageNo
.
push
(
contentPage
[
nIndex
]);
}
...
...
abvw/js/contentview_Events.js
View file @
3557e19b
...
...
@@ -260,6 +260,10 @@ CONTENTVIEW_EVENTS.closeCopyTextBox = function() {
CONTENTVIEW_EVENTS
.
showListSearchResult
=
function
()
{
$
(
'#txtSearch'
).
keydown
(
function
(
e
)
{
if
(
e
.
keyCode
==
13
)
{
if
(
CONTENTSEARCH
.
overClick
()){
return
;
}
CONTENTVIEW
.
searchHandle
();
/* display dialog overlay */
...
...
abvw/js/header.js
View file @
3557e19b
...
...
@@ -247,7 +247,17 @@ HEADER.searchHeaderButtonFunction = function(){
var
body
=
$
(
'#searchbox-body'
).
attr
(
'checked'
);
var
searchDivision
;
var
searchText
=
$
(
'#searchbox-key'
).
val
();
var
searchText
=
$
(
'#searchbox-key'
).
val
();
if
(
searchText
.
length
>
200
){
alert
(
'200字以下のテキストを入力してください'
);
return
;
}
if
(
CONTENTSEARCH
.
overClick
()){
return
;
}
if
(
content
==
'checked'
)
{
searchDivision
=
$
(
'#searchbox-content'
).
val
();
...
...
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