Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
chat_webview
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
abookCommunication
chat_webview
Commits
f92daabd
Commit
f92daabd
authored
Mar 31, 2021
by
Takatoshi Miura
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db連携
parent
180fc1ea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
37 deletions
+61
-37
public_new/js/archive.js
+42
-36
public_new/js/chat-db.js
+19
-1
No files found.
public_new/js/archive.js
View file @
f92daabd
// 名前空間
var
ARCHIVE_UI
=
{};
$
(
function
()
{
// アーカイブ検索
$
(
'#archive .search_form input[type="search"]'
).
keyup
(
function
(){
...
...
@@ -8,43 +11,46 @@ $(function() {
return
;
}
// 検索
var
archiveList
=
CHAT_DB
.
getArchiveByName
(
keyword
);
var
archiveTemplate
;
$
.
get
({
url
:
"./template/template_archive_list.html"
,
async
:
false
}
,
function
(
text
)
{
archiveTemplate
=
text
;
});
// 検索結果を表示
CHAT_DB
.
callGetArchiveByName
(
keyword
);
});
});
archiveList
.
forEach
(
function
(
archive
)
{
var
typeImage
=
""
;
switch
(
archive
.
archiveType
)
{
case
0
:
// 画像
typeImage
=
"icon/icon_collabo_picture.png"
;
break
;
case
1
:
// 動画
typeImage
=
"icon/icon_collabo_videocam.png"
;
break
;
case
2
:
// 音声
typeImage
=
"icon/icon_collabo_headset.png"
;
break
;
case
3
:
// 文書
typeImage
=
"icon/icon_collabo_document.png"
;
break
;
default
:
// その他
typeImage
=
""
;
}
ARCHIVE_UI
.
refreshSearchScreen
=
function
(
keyword
)
{
var
archiveList
=
CHAT_DB
.
getArchiveByName
(
keyword
);
var
archiveTemplate
;
$
.
get
({
url
:
"./template/template_archive_list.html"
,
async
:
false
}
,
function
(
text
)
{
archiveTemplate
=
text
;
});
let
html
=
Mustache
.
render
(
archiveTemplate
,
{
archiveId
:
archive
.
archiveId
,
fileName
:
archive
.
archiveName
,
insertDate
:
archive
.
archiveDate
,
typeImage
:
typeImage
});
let
obj
=
jQuery
.
parseHTML
(
html
);
$
(
'.overlay_src_msg'
).
append
(
obj
);
});
archiveList
.
forEach
(
function
(
archive
)
{
var
typeImage
=
""
;
switch
(
archive
.
archiveType
)
{
case
0
:
// 画像
typeImage
=
"icon/icon_collabo_picture.png"
;
break
;
case
1
:
// 動画
typeImage
=
"icon/icon_collabo_videocam.png"
;
break
;
case
2
:
// 音声
typeImage
=
"icon/icon_collabo_headset.png"
;
break
;
case
3
:
// 文書
typeImage
=
"icon/icon_collabo_document.png"
;
break
;
default
:
// その他
typeImage
=
""
;
}
let
html
=
Mustache
.
render
(
archiveTemplate
,
{
archiveId
:
archive
.
archiveId
,
fileName
:
archive
.
archiveName
,
insertDate
:
archive
.
archiveDate
,
typeImage
:
typeImage
});
let
obj
=
jQuery
.
parseHTML
(
html
);
$
(
'.overlay_src_msg'
).
append
(
obj
);
});
}
)
;
};
public_new/js/chat-db.js
View file @
f92daabd
...
...
@@ -137,9 +137,27 @@ CHAT_DB.updateArchiveList = function() {
}
};
// アーカイブ一覧検索
var
iosSearchArchiveList
;
var
searchWord
;
getIosSearchArchiveList
=
function
(
archiveList
)
{
iosSearchArchiveList
=
archiveList
;
ARCHIVE_UI
.
refreshSearchScreen
(
searchWord
);
};
CHAT_DB
.
callGetArchiveByName
=
function
(
keyword
)
{
if
(
CHAT_UTIL
.
isIOS
())
{
iosSearchArchiveList
=
""
;
searchWord
=
keyword
;
webkit
.
messageHandlers
.
getArchiveByName
.
postMessage
({
keyword
});
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
ARCHIVE_UI
.
refreshSearchScreen
(
keyword
);
}
};
CHAT_DB
.
getArchiveByName
=
function
(
archiveName
)
{
if
(
CHAT_UTIL
.
isIOS
())
{
webkit
.
messageHandlers
.
getArchiveByName
.
postMessage
({
archiveName
});
return
JSON
.
parse
();
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
// TODO
...
...
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