<!doctype html>
<html lang="en">

<head>
  <!-- Required meta tags -->
  <meta charset="utf-8">
  <meta name="viewport"
    content="width=device-width, initial-scale=1, shrink-to-fit=no, maximum-scale=1, user-scalable=0">
  <title>LiveTaskyell</title>
  <link rel="stylesheet" href="./css/notosansjp.css">
  <link href="./fontawesome/css/all.css" rel="stylesheet">
  <link rel="stylesheet" href="./css/bootstrap.min.css">
  <link rel="stylesheet" href="./css/common.css">
  <link rel="stylesheet" href="./css/archive.css">
  <link rel="stylesheet" href="./css/loading.css">
  <link rel="stylesheet" href="./css/footer.css">
  <link rel="stylesheet" href="./css/font-awesome.css">

</head>
<script>
    var archiveId;
    window.addEventListener('DOMContentLoaded', function(){
      var urlPrm = new Object;
      var urlSearch = location.search.substring(1).split('&');
      var kv = urlSearch[0].split('=');
      urlPrm[kv[0]]=kv[1];
      archiveId = urlPrm.archiveId
      if (typeof(android) != "undefined") {
      } else {
        CHAT_UI.refreshArchiveDetailScreen(urlPrm.archiveId);
      }
    });
  </script>

<body>
  <!-- ナビメニュー -->
  <nav>
    <div class="row h-100 align-items-center">
      <div class="col-4 pr-0">
        <div class="nav-item">
          <div class="nav_prev">
            <a href="archive.html"><span style="font-size: 15px;">アーカイブ</span></a>
          </div>
        </div>
      </div>
      <div class="col-4 p-0">
        <div class="nav-item p-0">
          <h1 class="nav-ttl ttl_detail">詳細</h1>
        </div>
      </div>
      <div class="col-4 pl-0">
        <div class="nav-item text-right">
        </div>
      </div><!-- .col -->
    </div><!-- .row -->
  </nav><!-- nav -->

  <!-- コンテンツ -->
  <main id="archive">
    <div class="archive_detail" id="archiveDetail">
    </div>
  </main>

  <!-- ローディング -->
  <div id="userProfileModal"></div>

  <script src="./js/libs/jquery-3.3.1.min.js"></script>
  <script src="./js/libs/moment.js"></script>
  <script src="./js/libs/locale/ko.js" charset="UTF-8"></script>
  <script src="./js/libs/locale/ja.js" charset="UTF-8"></script>
  <script src="./js/libs/mustache.min.js"></script>
  <script src="./js/libs/bootstrap.min.js"></script>
  <script src="./js/libs/jquery.mark.min.js"></script>
  <script src="./js/archive.js"></script>
  <script src="./js/common.js"></script>
  <script src="./js/language.js"></script>
  <script src="./js/language_ko.js" charset="UTF-8"></script>
  <script src="./js/language_ja.js" charset="UTF-8"></script>
  <script src="./js/language_en.js" charset="UTF-8"></script>
  <script src="./js/constant.js"></script>
  <script src="./js/chat.js"></script>
  <script src="./js/chat-ui.js"></script>
  <script src="./js/chat-util.js"></script>
  <script src="./js/chat-db.js"></script>

  <script id="archive-detail-template" type="text/template">
    <div id="archive_player" class="player">
    </div>
    <div class="archive_detail_desc">
      <div class="archive_detail_fl_nm item">
        <h2 class="ttl" id="archiveFileName">FileName</h2>
        <span>{{fileName}}</span>
      </div>
      <div class="archive_detail_sv_date item">
        <h2 class="ttl" id="archiveInsertDate">InsertDate</h2>
        <span>{{insertDate}}</span>
      </div>
      <div class="archive_detail_room_nm item">
        <h2 class="ttl" id="archiveRoomName">ChatRoomName</h2>
        <span class="archive_chat_room">{{chatRoomName}}</span>
        <button id="joinChatRoom">
          <img src="icon/icon_join_room.png" alt="">
        </button>
      </div>
      <div class="archive_detail_sv_user item">
        <h2 class="ttl" id="archiveSaveUser">SaveUser</h2>
        <div class="d-flex flex-row">
          <div class="d-flex flex-column">
            <img src="{{profileImage}}" alt="プロフィール画像"   onclick="CHAT_UI.makeNameCard({{userId}})" >
            <p>{{userName}}</p>
          </div>
        </div>
      </div>
      <div class="archive_detail_user_list item">
        <h2 class="ttl" id="archiveAttendUser">AttendUser</h2>
        <ul class="d-flex flex-row" id="attendUser">
        </ul>
      </div>
    </div>
  </script>

  <script id="archive-user-template" type="text/template">
    <li class="archive_user">
      <img src="{{profileImage}}" alt="">
      <p>{{userName}}</p>
    </li>
  </script>
  
  <script id="archive-namecard-template" type="text/template">
    <div class="modal fade profile_modal" id="userNameCard" tabindex="-1" role="dialog" aria-labelledby="userNameCard" aria-hidden="true">
      <div class="modal-dialog modal-dialog-centered" role="document">
        <div class="modal-content">
          <div class="modal-header border-0">
            <div class="profile_desc d-flex flex-row">
              <img src="{{profileImage}}" onError="this.src='./img/noImage.png'"/>
              <div class="profile_name"><span>{{name}}</span></div>
            </div>
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
              <span aria-hidden="true">&times;</span>
            </button>
          </div>
          <div class="modal-body">
            {{#groupPathList}}
            <li style="display: block;">・{{.}}</li>
            {{/groupPathList}}
          </div>
          <div class="modal-footer border-0 justify-content-center">
            {{#isFavorite}}
            <button type="button" class="border-0 bg_navy" onclick="CHAT_UI.removeFavoriteUser({{shopMemberId}})">
              <div class="d-flex flex-column">
                <div class="img_wrap">
                  <img src="icon/icon_profile_favorite.png" alt="お気に入り">
                </div>
                <span>お気に入り解除</span>
              </div>
            </button>
            {{/isFavorite}}
            {{^isFavorite}}
            <button type="button" class="border-0 bg_navy" onclick="CHAT_UI.insertFavoriteUser({{shopMemberId}})">
              <div class="d-flex flex-column">
                <div class="img_wrap">
                  <img src="icon/icon_profile_favorite_white.png" alt="お気に入り">
                </div>
                <span>お気に入り登録</span>
              </div>
            </button>
            {{/isFavorite}}
            <button type="button" class="border-0 bg_green" >
              <div class="d-flex flex-column">
                <div class="img_wrap">
                  <img src="icon/icon_profile_phone.png" alt="通話">
                </div>
                <span>通話</span>
              </div>
            </button>
            <button type="button" class="border-0 bg_blue">
              <div class="d-flex flex-column">
                <div class="img_wrap">
                  <img src="icon/icon_profile_chat.png" alt="チャット">
                </div>
                <span>チャット</span>
              </div>
            </button>
          </div>
        </div>
      </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;

    if (typeof(android) != "undefined") {
      android.getLoginParameter();
      android.getGlobalParameter();
    } else {
      webkit.messageHandlers.loginInfoRequestMessageHandlerId.postMessage({});
      webkit.messageHandlers.getGlobalParameter.postMessage({});
    }

    function getGlobalParam(chatServerUrl, cmsServerUrl, platform, isMobile, isOnline) {
      CHAT_SERVER_URL = chatServerUrl;
      CMS_SERVER_URL = cmsServerUrl;
      PLATFORM = platform;
      IS_MOBILE = isMobile;
      IS_ONLINE = isOnline;
      CHAT_UI.refreshArchiveDetailScreen(archiveId);
    };
  </script>
</body>

</html>