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
180fc1ea
Commit
180fc1ea
authored
Mar 30, 2021
by
Takatoshi Miura
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
アーカイブdb連携中
parent
9225ef32
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
90 additions
and
90 deletions
+90
-90
public_new/archive.html
+9
-1
public_new/archive_detail.html
+9
-2
public_new/js/chat-db.js
+34
-5
public_new/js/chat-ui.js
+38
-82
No files found.
public_new/archive.html
View file @
180fc1ea
...
...
@@ -16,7 +16,7 @@
<script>
window
.
addEventListener
(
'DOMContentLoaded'
,
function
()
{
CHAT_
UI
.
refreshArchiveScreen
();
CHAT_
DB
.
callGetArchiveList
();
});
</script>
</head>
...
...
@@ -133,5 +133,13 @@
<
/a
>
<
/li
>
</script>
<script>
let
CHAT_SERVER_URL
=
''
;
let
CMS_SERVER_URL
=
''
;
let
ASSET_PATH
=
'./'
;
let
PLATFORM
=
''
;
let
IS_MOBILE
=
true
;
let
IS_ONLINE
=
false
;
</script>
</body>
</html>
public_new/archive_detail.html
View file @
180fc1ea
...
...
@@ -20,7 +20,7 @@
var
urlSearch
=
location
.
search
.
substring
(
1
).
split
(
'&'
);
var
kv
=
urlSearch
[
0
].
split
(
'='
);
urlPrm
[
kv
[
0
]]
=
kv
[
1
];
CHAT_
UI
.
refreshArchiveDetailScreen
(
urlPrm
.
archiveId
);
CHAT_
DB
.
callGetArchiveDetail
(
urlPrm
.
archiveId
);
});
</script>
</head>
...
...
@@ -179,6 +179,13 @@
<
/div
>
<
/div
>
</script>
<script>
let
CHAT_SERVER_URL
=
''
;
let
CMS_SERVER_URL
=
''
;
let
ASSET_PATH
=
'./'
;
let
PLATFORM
=
''
;
let
IS_MOBILE
=
true
;
let
IS_ONLINE
=
false
;
</script>
</body>
</html>
public_new/js/chat-db.js
View file @
180fc1ea
...
...
@@ -106,10 +106,23 @@ CHAT_DB.getGroupByName = function(groupName) {
};
// アーカイブ一覧
CHAT_DB
.
getArchiveList
=
function
()
{
var
iosArchiveList
;
getIosArchiveList
=
function
(
archiveList
)
{
iosArchiveList
=
archiveList
;
CHAT_UI
.
refreshArchiveScreen
();
};
CHAT_DB
.
callGetArchiveList
=
function
()
{
if
(
CHAT_UTIL
.
isIOS
())
{
// String形式をJsonに変更してReturn
iosArchiveList
=
""
;
webkit
.
messageHandlers
.
getArchiveList
.
postMessage
();
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
CHAT_UI
.
refreshArchiveScreen
();
}
};
CHAT_DB
.
getArchiveList
=
function
()
{
if
(
CHAT_UTIL
.
isIOS
())
{
return
JSON
.
parse
(
iosArchiveList
);
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
// TODO
...
...
@@ -126,16 +139,32 @@ CHAT_DB.updateArchiveList = function() {
CHAT_DB
.
getArchiveByName
=
function
(
archiveName
)
{
if
(
CHAT_UTIL
.
isIOS
())
{
// TODO IOS処理
webkit
.
messageHandlers
.
getArchiveByName
.
postMessage
({
archiveName
});
return
JSON
.
parse
();
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
// TODO
}
};
// アーカイブ詳細
CHAT_DB
.
getArchiveDetail
=
function
(
archiveId
)
{
var
iosArchiveDetail
;
CHAT_DB
.
getIosArchiveDetail
=
function
(
archiveDetail
)
{
iosArchiveDetail
=
archiveDetail
;
CHAT_DB
.
callGetArchiveDetail
(
archiveDetail
.
archiveId
);
};
CHAT_DB
.
callGetArchiveDetail
=
function
(
archiveId
)
{
if
(
CHAT_UTIL
.
isIOS
())
{
iosArchiveDetail
=
""
;
webkit
.
messageHandlers
.
getArchiveDetail
.
postMessage
({
archiveId
});
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
CHAT_UI
.
refreshArchiveDetailScreen
(
archiveId
);
}
};
CHAT_DB
.
getArchiveDetail
=
function
()
{
if
(
CHAT_UTIL
.
isIOS
())
{
// TODO IOS処理
return
JSON
.
parse
(
iosArchiveDetail
);
}
else
if
(
CHAT_UTIL
.
isAndroid
())
{
// TODO
}
...
...
public_new/js/chat-ui.js
View file @
180fc1ea
...
...
@@ -1389,83 +1389,41 @@ CHAT_UI.refreshArchiveScreen = function() {
// アーカイブの様式を読み込む
const
archiveTemplate
=
$
(
'#archive-template'
).
html
();
// アーカイブ一覧取得
if
(
IS_ONLINE
==
'true'
)
{
CHAT_DB
.
updateArchiveList
();
}
// if (IS_ONLINE == 'true') {
// CHAT_DB.updateArchiveList();
// }
// // アーカイブ一覧取得&表示
// var archiveList = CHAT_DB.getArchiveList();
// 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)).on('click', function() {
// });
// $('#archiveList').append(obj);
// });
/*** デバック用 ****************************************************************************/
var
archiveList
=
[
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
];
archiveList
.
forEach
(
function
()
{
// ローカルDBのデータを表示
var
archiveList
=
CHAT_DB
.
getArchiveList
();
archiveList
.
forEach
(
function
(
archive
)
{
var
typeImage
=
""
;
// データ1個目
switch
(
0
)
{
case
0
:
// 画像
switch
(
archive
.
archiveType
)
{
case
0
:
// 画像
typeImage
=
"icon/icon_collabo_picture.png"
;
break
;
case
1
:
// 動画
break
;
case
1
:
// 動画
typeImage
=
"icon/icon_collabo_videocam.png"
;
break
;
case
2
:
// 音声
break
;
case
2
:
// 音声
typeImage
=
"icon/icon_collabo_headset.png"
;
break
;
case
3
:
// 文書
break
;
case
3
:
// 文書
typeImage
=
"icon/icon_collabo_document.png"
;
break
;
default
:
// その他
break
;
default
:
// その他
typeImage
=
""
;
}
let
html
=
Mustache
.
render
(
archiveTemplate
,
{
archiveId
:
1
,
fileName
:
"ファイル名"
,
insertDate
:
"2021/03/03 16:14"
,
}
let
html
=
Mustache
.
render
(
archiveTemplate
,
{
archiveId
:
archive
.
archiveId
,
fileName
:
archive
.
archiveName
,
insertDate
:
archive
.
archiveDate
,
typeImage
:
typeImage
});
let
obj
=
$
(
jQuery
.
parseHTML
(
html
)).
on
(
'click'
,
function
()
{
});
$
(
'#archiveList'
).
append
(
obj
);
});
/*** デバック用終了 ****************************************************************************/
});
let
obj
=
$
(
jQuery
.
parseHTML
(
html
)).
on
(
'click'
,
function
()
{
});
$
(
'#archiveList'
).
append
(
obj
);
});
// loadingIndicatorを非表示
CHAT_UI
.
dismissLoadingIndicator
();
...
...
@@ -1483,24 +1441,24 @@ CHAT_UI.refreshArchiveDetailScreen = function(archiveId) {
// アーカイブ詳細の様式を読み込む
const
archiveDetailTemplate
=
$
(
'#archive-detail-template'
).
html
();
//
if (IS_ONLINE == 'true') {
//
CHAT_DB.updateArchiveDetail(archiveId);
// //
}
if
(
IS_ONLINE
==
'true'
)
{
CHAT_DB
.
updateArchiveDetail
(
archiveId
);
}
//
//
アーカイブ詳細取得
//
var archive = CHAT_DB.getArchiveDetail(archiveId);
// アーカイブ詳細取得
var
archive
=
CHAT_DB
.
getArchiveDetail
(
archiveId
);
// // チャットルーム情報を取得
//
var roomId = archive.roomId;
//
var roomInfo = CHAT_DB.getChatRoomInfo(roomId);
var
roomId
=
archive
.
roomId
;
var
roomInfo
=
CHAT_DB
.
getChatRoomInfo
(
roomId
);
//
//
アーカイブ情報を表示
// アーカイブ情報を表示
// let html = Mustache.render(archiveDetailTemplate, {
// fileName: archive.archiveName,
// insertDate: archive.archiveDate,
// chatRoomName: roomInfo.chatRoomName,
// profileImage: "",
// userName:
archive.
userName
// userName: userName
// });
// アーカイブ情報を表示
...
...
@@ -1517,8 +1475,7 @@ CHAT_UI.refreshArchiveDetailScreen = function(archiveId) {
$
(
'#archiveDetail'
).
append
(
obj
);
// プレイヤーの切り替え
// switch(archive.archiveType) {
switch
(
archiveId
)
{
switch
(
archive
.
archiveType
)
{
case
"0"
:
// 画像
$
(
'#archive_player'
).
prepend
(
'<img class="archive_player" src="https://img01.suumo.com/front/gazo/chumon/220/67/main/10646700010021p01.jpg" />'
);
break
;
...
...
@@ -1540,8 +1497,7 @@ CHAT_UI.refreshArchiveDetailScreen = function(archiveId) {
const
archiveUserTemplate
=
$
(
'#archive-user-template'
).
html
();
// 参加ユーザ情報を表示
// let attendUserList = archive.attendUserId;
let
attendUserList
=
[
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
];
let
attendUserList
=
archive
.
attendUserIds
;
attendUserList
.
forEach
(
function
(
user
)
{
// TODO ユーザIDからユーザ情報を取得
var
html
=
Mustache
.
render
(
archiveUserTemplate
,
{
...
...
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