Przeglądaj źródła

Merge branch 'master' of http://git.choozmo.com:3000/choozmo/AI_Anchor_2

ming 3 lat temu
rodzic
commit
51289fbf92

+ 1 - 25
api/static/script_util.js

@@ -480,28 +480,4 @@ function renderimgBlock(i) {
   imguploadlabel.textContent = '上傳檔案';
   imgInputs.appendChild(imguploadlabel);
   $('.img_uploader').on('change', prepareUpload);
-}
-
-
-$('.owl-carousel').owlCarousel({
-  loop: true,
-  margin: 10,
-  nav: false,
-  mouseDrag: true,
-  touchDrag: true,
-  smartSpeed: 1000,
-  autoplay: true,
-  autoplayTimeout: 8000,
-  autoplayHoverPause: false,
-  responsive: {
-    0: {
-      items: 1
-    },
-    600: {
-      items: 2
-    },
-    1000: {
-      items: 4
-    }
-  }
-})
+}

+ 2 - 2
api/static/script_util_copy.js

@@ -2,7 +2,7 @@ checkRoute();
 
 let userBasics = JSON.parse(localStorage.getItem('user_profile')) || [];
 if(userBasics !== []){
-  $('.userName').html(`<h2 class="user-name text-white mt-4 fw-bold">Hello,${userBasics.user_info.userName}</h2>`);
+  $('.userName').html(`<h2 class="user-name text-white mt-4 fw-bold">Hi ${userBasics.user_info.userName}</h2>`);
 }
 
 function checkRoute() {
@@ -23,7 +23,7 @@ function checkRoute() {
       window.location.replace("login.html");
     }
     var userName='';
-    userName+=' <h2 class="user-name text-white mt-4 fw-bold">Hello,'+res.data.user_info.userName+'</h2>';
+    userName+=' <h2 class="user-name text-white mt-4 fw-bold">Hi '+res.data.user_info.userName+'</h2>';
     $('.userName').html(userName);
   }).catch(err => {
     console.log(err);

+ 1 - 1
html/index_eng.html

@@ -31,7 +31,7 @@
         <div class="collapse navbar-collapse" id="navbarSupportedContent">
             <ul class="navbar-nav ms-auto mb-2 mb-lg-0">
                 <li class="nav-item">
-                    <a class="nav-link active" aria-current="page" href="pricing.html">Early Bird Plan</a>
+                    <a class="nav-link active" aria-current="page" href="pricing.html">Pricing</a>
                 </li>
                 <li class="nav-item">
                     <a class="nav-link active btn-login" aria-current="page" href="login.html">Login</a>

+ 6 - 1
html/login.html

@@ -123,11 +123,16 @@
                                 </div>
                                 <div class="d-flex justify-content-center">
                                     <p set-lan="html:newHere">還沒有帳號?</p>
-                                    <a class="ms-1" set-lan="html:goRegister" href="register.html">註冊</a>
+                                    <a class="ms-2" set-lan="html:goRegister" href="register.html">註冊</a> 
+                                    <p class="mx-2"> / </p>
+                                    <a set-lan="html:forgotPsd" href="reset_pwd_email.html">忘記密碼</a>
                                 </div>
                                 <div class="d-flex justify-content-center">
                                     <button id="btn_login" set-lan="html:login_link">立即登入</button>
                                 </div>
+                                <div class="mt-3 d-flex justify-content-center">
+                                    
+                                </div>
                         </div>
                         <!-- <div class="tab-pane fade p-lg-3" id="register" role="tabpanel" aria-labelledby="register-tab">
                             <form>

+ 24 - 0
html/make_video.html

@@ -302,6 +302,30 @@
     <script type="text/javascript" src="static/lan.js"></script>
     <script src="static/script_util.js"></script>
     <script src="static/common.js"></script>
+<script>
+$('.owl-carousel').owlCarousel({
+  loop: true,
+  margin: 10,
+  nav: false,
+  mouseDrag: true,
+  touchDrag: true,
+  smartSpeed: 1000,
+  autoplay: true,
+  autoplayTimeout: 8000,
+  autoplayHoverPause: false,
+  responsive: {
+    0: {
+      items: 1
+    },
+    600: {
+      items: 2
+    },
+    1000: {
+      items: 4
+    }
+  }
+});
+</script>
 </body>
 
 </html>

+ 24 - 0
html/make_video_long.html

@@ -291,6 +291,30 @@
     <script src="static/script_util.js"></script>
     <script type="text/javascript" src="static/lan.js"></script>
     <script src="static/common.js"></script>
+<script>
+$('.owl-carousel').owlCarousel({
+    loop: true,
+    margin: 10,
+    nav: false,
+    mouseDrag: true,
+    touchDrag: true,
+    smartSpeed: 1000,
+    autoplay: true,
+    autoplayTimeout: 8000,
+    autoplayHoverPause: false,
+    responsive: {
+        0: {
+            items: 1
+        },
+        600: {
+            items: 2
+        },
+        1000: {
+            items: 4
+        }
+    }
+});
+</script>
 </body>
 
 </html>

+ 24 - 0
html/make_video_slide.html

@@ -273,6 +273,30 @@
     <script src="static/script_slides.js"></script>
     <script type="text/javascript" src="static/lan.js"></script>
     <script src="static/common.js"></script>
+<script>
+$('.owl-carousel').owlCarousel({
+    loop: true,
+    margin: 10,
+    nav: false,
+    mouseDrag: true,
+    touchDrag: true,
+    smartSpeed: 1000,
+    autoplay: true,
+    autoplayTimeout: 8000,
+    autoplayHoverPause: false,
+    responsive: {
+        0: {
+            items: 1
+        },
+        600: {
+            items: 2
+        },
+        1000: {
+            items: 4
+        }
+    }
+});
+</script>
 </body>
 
 </html>

+ 43 - 3
html/pricing.html

@@ -51,14 +51,12 @@
                     <li class="nav-item">
                         <a class="nav-link active btn-login" aria-current="page" href="login.html" set-lan="html:login">登入</a>
                     </li>
-                    <!-- 
                     <li class="nav-item">
-                        <a class="nav-link btn-userProfile" aria-current="page" href="user_profile.html" set-lan="html:user_profile">會員資料</a>
+                        <a class="nav-link btn-userProfile" aria-current="page" href="user_profile2.html" set-lan="html:user_profile">會員資料</a>
                     </li>
                     <li class="nav-item">
                         <a class="nav-link btn-logout" aria-current="page" set-lan="html:logout">登出</a>
                     </li>
-                    -->
                 </ul>
             </div>
         </div>
@@ -156,6 +154,48 @@
     <script src="static/owl.carousel.min.js"></script>
     <script type="text/javascript" src="static/lan.js"></script>
     <script src="static/common.js"></script>
+    <script>
+        const btnLoginPage = document.querySelector('.btn-login');
+        const btnUserProfile = document.querySelector('.btn-userProfile');
+        const btnLogout = document.querySelector('.btn-logout');
+        function get_jwt_token(){
+            if(!document.cookie) {
+                return
+            }
+            jwt_raw = document.cookie.split(';').filter(s=>s.includes('jwt_token'))[0]
+            return jwt_raw.split('=')[1]
+        }
+        function checkRoute() {
+            let jwt_token = get_jwt_token();
+            if(jwt_token == undefined) {
+                btnLoginPage.style.display = 'block';
+                btnLogout.style.display = 'none';
+                btnUserProfile.style.display = 'none';
+                return;
+            }
+            axios({
+                method: 'post',
+                url: 'https://www.choozmo.com:8887/user_profile',
+                headers: { 
+                    'accept': 'text/html',
+                    'Authorization': `Bearer ${jwt_token}`
+                }
+            }).then(res => {
+                console.log(res.data);
+                if(res.status !== 200) {
+                    btnLoginPage.style.display = 'block';
+                    btnLogout.style.display = 'none';
+                    btnUserProfile.style.display = 'none';
+                }
+                btnLoginPage.style.display = 'none';
+                btnLogout.style.display = 'block';
+                btnUserProfile.style.display = 'block';
+            }).catch(err => {
+                console.log(err);
+            });
+        }
+        checkRoute();
+    </script>
 </body>
 
 </html>

+ 1 - 1
html/reset_pwd_email.html

@@ -110,7 +110,7 @@
     <div class="content ms-auto">
       <form id="msform">
         <fieldset id='imgSrc'>
-          <h3 class="fs-subtitle" style="display: inline-block;">email</h3><br/>
+          <h3 class="fs-subtitle" style="display: inline-block;">Email</h3><br/>
           <input type="text" id='in_email' name='m1' class='imgsrc imgsrc1' value="" placeholder="" /><br/>
         
           <input id="checker" type="button" class="sender action-button" value="送出" set-lan="value:submit" />

+ 2 - 2
html/script_eng.js

@@ -2,7 +2,7 @@ checkRoute();
 
 let userBasics = JSON.parse(localStorage.getItem('user_profile')) || [];
 if(userBasics !== []){
-  $('.userName').html(`<h2 class="user-name text-white mt-4 fw-bold">Hello,${userBasics.user_info.userName}</h2>`);
+  $('.userName').html(`<h2 class="user-name text-white mt-4 fw-bold">Hi ${userBasics.user_info.userName}</h2>`);
 }
 
 
@@ -24,7 +24,7 @@ function checkRoute() {
       window.location.replace("login.html");
     }
     var userName='';
-    userName+=' <h2 class="user-name text-white mt-4 fw-bold">Hello,'+res.data.user_info.userName+'</h2>';
+    userName+=' <h2 class="user-name text-white mt-4 fw-bold">Hi '+res.data.user_info.userName+'</h2>';
     $('.userName').html(userName);
   }).catch(err => {
     console.log(err);

+ 1 - 1
html/script_profiles.js

@@ -14,7 +14,7 @@ let userBasics = JSON.parse(localStorage.getItem('user_profile')) || [];
 
 function checkLocal() {
   if(userBasics.length == 0){ return };
-  $('.userName').html(`<h2 class="user-name text-white mt-4 fw-bold">Hello,${userBasics.user_info.userName}</h2>`);
+  $('.userName').html(`<h2 class="user-name text-white mt-4 fw-bold">Hi ${userBasics.user_info.userName}</h2>`);
 }
 
 checkLocal()

+ 3 - 1
html/static/lan.js

@@ -89,6 +89,7 @@ var zh = {
     "username": "帳號/用戶名稱",
     "password": "密碼",
     "resetPsd": "更改密碼",
+    "forgotPsd": "忘記密碼",
     "details": "查看詳情",
     "refill": "我要加值",
     "Createsthtoday": "今天要做甚麼影片呢?",
@@ -169,8 +170,9 @@ var en = {
     "left": "Left",
     "sec": "Sec",
     "username": "User Name",
-    "password": "password",
+    "password": "Password",
     "resetPsd": "Reset Password",
+    "forgotPsd": "Forgot Password",
     "details": "Details",
     "refill": "Refill",
     "Createsthtoday": "Create something today!",

+ 2 - 2
html/static/script_slides.js

@@ -2,7 +2,7 @@ checkRoute();
 
 let userBasics = JSON.parse(localStorage.getItem('user_profile')) || [];
 if(userBasics !== []){
-  $('.userName').html(`<h2 class="user-name text-white mt-4 fw-bold">Hello,${userBasics.user_info.userName}</h2>`);
+  $('.userName').html(`<h2 class="user-name text-white mt-4 fw-bold">Hi ${userBasics.user_info.userName}</h2>`);
 }
 
 function checkRoute() {
@@ -23,7 +23,7 @@ function checkRoute() {
       window.location.replace("login.html");
     }
     var userName='';
-    userName+=' <h2 class="user-name text-white mt-4 fw-bold">Hello,'+res.data.user_info.userName+'</h2>';
+    userName+=' <h2 class="user-name text-white mt-4 fw-bold">Hi '+res.data.user_info.userName+'</h2>';
     $('.userName').html(userName);
   }).catch(err => {
     console.log(err);

+ 14 - 7
html/static/script_util.js

@@ -2,7 +2,7 @@ checkRoute();
 
 let userBasics = JSON.parse(localStorage.getItem('user_profile')) || [];
 if(userBasics !== []){
-  $('.userName').html(`<h2 class="user-name text-white mt-4 fw-bold">Hello,${userBasics.user_info.userName}</h2>`);
+  $('.userName').html(`<h2 class="user-name text-white mt-4 fw-bold">Hi ${userBasics.user_info.userName}</h2>`);
 }
 
 function checkRoute() {
@@ -287,11 +287,11 @@ $("#send_slide").click(function () {
   xhr.onreadystatechange = function () {
     if (xhr.readyState === 4) {
       let title = "資料已送出";
-        let text = '資料已傳送,請耐心等候';
-        if (lang == 'en') { // 英文版訊息
-          title = "Submitted Successfully!";
-          text = 'We are working on your video. You will get notfication in line group when your video is done.';
-        }
+      let text = '資料已傳送,請耐心等候';
+      if (lang == 'en') { // 英文版訊息
+        title = "Submitted Successfully!";
+        text = 'We are working on your video. You will get notfication in line group when your video is done.';
+      }
       Swal.fire({
         title: title,
         icon: 'success',
@@ -648,7 +648,14 @@ $('.owl-carousel').owlCarousel({
 });
 
 $('.draft-btn').click(() => {
-  $('.draft-btn').text('Loading...');
+  let text = '儲存中...';
+
+  if (lang == 'en') {
+    text = 'Saving...';
+  }
+
+  $('.draft-btn').text(text);
+
   let jwt_token = get_jwt_token();
   let avatar = $('.avatar').val();
   let name_title = $('.title_new').val();

+ 2 - 5
html/user_profile2.html

@@ -55,9 +55,6 @@
                             <li class="nav-item">
                                 <a class="nav-link active btn-login text-white" aria-current="page" href="login.html" set-lan="html:login">登入</a>
                             </li>
-                            <li class="nav-item">
-                                <a class="nav-link btn-userProfile text-white" aria-current="page" href="user_profile.html" set-lan="html:user_profile">會員資料</a>
-                            </li>
                             <li class="nav-item text-white">
                                 <a class="nav-link btn-logout text-white" aria-current="page" set-lan="html:logout">登出</a>
                             </li>
@@ -131,8 +128,8 @@
                     <div class="information">
                         <div class="row px-0 mx-0 mt-4">
                             <div style="letter-spacing: 3px;" class="col-lg-4">
-                                <p class="text-end" set-lan="html:username">帳號/用戶名稱:</p>
-                                <P class="text-end" set-lan="html:password">密碼:</P>
+                                <p class="text-end"><span set-lan="html:username">帳號/用戶名稱</span> : </p>
+                                <P class="text-end"><span set-lan="html:password">密碼</span> : </P>
                                 <p class="text-end">Email:</p>
                             </div>
                             <div class="userinf col-lg-8">