1console.log('custom.js loaded'); 2 3jQuery(document).ready(function ($) { 4 var video = $('#video'); 5 var audio = $('.audio'); 6 var playButton = $('.play-button'); 7 var endScreen = $('.end-screen'); // çµäºæã«è¡¨ç¤ºããã¨ãªã¢ 8 var resumeButton = $('.resume-video'); // éä¸ã§åæ¢ããå ´åã®åçãã¿ã³ 9 var replayButton = $('.replay-video'); // åç»çµäºå¾ã®ãããä¸åº¦è¦ãããã¿ã³ 10 11 // åæç¶æ 12 playButton.show(); 13 endScreen.removeClass('show'); // display: flex; ã«ããã¯ã©ã¹ 14 resumeButton.hide(); 15 replayButton.hide(); 16 video.removeAttr('controls'); 17 18 // åçã»åæ¢ã®åãæ¿ãå¦ç 19 function toggleVideoPlayback() { 20 if (video.get(0).paused) { 21 video.get(0).play(); 22 playButton.fadeOut(); 23 video.attr('controls', 'controls'); 24 endScreen.removeClass('show'); // é表示 25 resumeButton.hide(); 26 replayButton.hide(); 27 hideControlsAfterDelay(); 28 } else { 29 video.get(0).pause(); 30 // playButton.fadeIn(); 31 video.removeAttr('controls'); 32 endScreen.addClass('show'); // 表示 33 resumeButton.fadeIn(); 34 } 35 } 36 37 // ãã¿ã³ or åç»ã¯ãªãã¯ã§åçã»åæ¢ 38 playButton.on('click touchstart', toggleVideoPlayback); 39 video.on('click touchstart', toggleVideoPlayback); 40 41 // åç»çµäºæã«ã次ã®åç»ã¸ããã¿ã³ã¨ãããä¸åº¦è¦ãããã¿ã³ã表示 42 video.on('ended', function () { 43 playButton.fadeIn(); 44 video.removeAttr('controls'); 45 endScreen.addClass('show'); // 表示 46 resumeButton.hide(); 47 replayButton.fadeIn(); // ãããä¸åº¦è¦ãããã¿ã³ 48 49 // ä¿®æ£ï¼ãã®videoè¦ç´ ã®è¦ª.main-videoã«ã¯ã©ã¹ãä»ä¸ 50 if (window.innerWidth <= 900) { 51 $(this).closest('.main-video').addClass('end-screen-active'); 52 } 53 }); 54 55 // ãç¶ããåçããããã¿ã³ 56 resumeButton.on('click touchstart', function () { 57 video.get(0).play(); 58 playButton.fadeOut(); 59 endScreen.removeClass('show'); 60 resumeButton.hide(); 61 replayButton.hide(); 62 video.attr('controls', 'controls'); 63 hideControlsAfterDelay(); 64 65 // ä¿®æ£ï¼ãã®videoè¦ç´ ã®è¦ª.main-videoããã¯ã©ã¹ãåé¤ 66 if (window.innerWidth <= 900) { 67 video.closest('.main-video').removeClass('end-screen-active'); 68 } 69 }); 70 71 // ãããä¸åº¦è¦ãããã¿ã³ 72 replayButton.on('click touchstart', function () { 73 video.get(0).currentTime = 0; 74 video.get(0).play(); 75 playButton.fadeOut(); 76 endScreen.removeClass('show'); 77 replayButton.hide(); 78 video.attr('controls', 'contrsols'); 79 hideControlsAfterDelay(); 80 81 // ä¿®æ£ï¼ãã®videoè¦ç´ ã®è¦ª.main-videoããã¯ã©ã¹ãåé¤ 82 if (window.innerWidth <= 900) { 83 video.closest('.main-video').removeClass('end-screen-active'); 84 } 85 }); 86 87 // ä¸å®æéå¾ã«ã³ã³ããã¼ã«ãã¼ãé表示 88 function hideControlsAfterDelay() { 89 setTimeout(function () { 90 if (!video.get(0).paused) { 91 video.removeAttr('controls'); 92 } 93 }, 3000); 94 } 95}); 96 97 98 99// JQuery(document).addEventListener('DOMContentLoaded', function () { 100document.addEventListener('DOMContentLoaded', function () { 101 // Toggle Mobile Navigation 102 const menuToggle = document.querySelector('.menu-toggle'); 103 const navMenu = document.querySelector('.nav-menu'); 104 105 if (menuToggle && navMenu) { 106 menuToggle.addEventListener('click', function () { 107 navMenu.classList.toggle('active'); 108 }); 109 } 110 111 // Like Button Functionality 112 const likeButtons = document.querySelectorAll('.like-button'); 113 likeButtons.forEach(button => { 114 button.addEventListener('click', function () { 115 const videoId = this.dataset.videoId; 116 alert('Liked video with ID: ' + videoId); 117 }); 118 });
119 120 // Scroll to Top 121 const scrollToTopBtn = document.querySelector('.scroll-to-top'); 122 if (scrollToTopBtn) { 123 scrollToTopBtn.addEventListener('click', function () { 124 window.scrollTo({ 125 top: 0, 126 behavior: 'smooth' 127 }); 128 }); 129 } 130}); 131 132 133jQuery(document).ready(function($) { 134 // Enterã®ã¿ã§éä¿¡ãShift+Enterã§æ¹è¡ 135 $(document).on('keydown', '.comment-form textarea', function(e) { 136 if (e.key === 'Enter' && !e.shiftKey) { 137 e.preventDefault(); 138 $(this).closest('form').submit(); 139 } 140 }); 141 142 // ã³ã¡ã³ããã©ã¼ã ã®Ajaxéä¿¡ 143 $(document).on('submit', '.comment-form', function(e) { 144 e.preventDefault(); 145 var $form = $(this); 146 var formData = $form.serialize(); 147 148 $.ajax({ 149 url: $form.attr('action'), 150 type: 'POST', 151 data: formData + '&action=ajax_comment', 152 success: function(response) { 153 // ã³ã¡ã³ããªã¹ããååå¾ãã¦å·®ãæ¿ã 154 $.get(window.location.href, function(html) { 155 var $newComments = $(html).find('.comment-list'); 156 $('.comment-list').replaceWith($newComments); 157 // ãã©ã¼ã ã®textareaãã¯ãªã¢ 158 $form.find('textarea').val(''); 159 // ã³ã¡ã³ããªã¹ããä¸çªä¸ã¾ã§ã¹ã¯ãã¼ã«ï¼é å»¶ãããï¼ 160 setTimeout(function() { 161 var $commentList = $('.comment-list'); 162 if ($commentList.length) { 163 $commentList.scrollTop($commentList[0].scrollHeight); 164 } 165 }, 100); 166 }); 167 }, 168 error: function() { 169 alert('ã³ã¡ã³ãéä¿¡ã«å¤±æãã¾ããã'); 170 } 171 }); 172 }); 173 174 // ãã¼ã¸èªã¿è¾¼ã¿æãã³ã¡ã³ããªã¹ããä¸çªä¸ã¾ã§ã¹ã¯ãã¼ã«ï¼é å»¶ãããï¼ 175 setTimeout(function() { 176 var $commentList = $('.comment-list'); 177 if ($commentList.length) { 178 $commentList.scrollTop($commentList[0].scrollHeight); 179 } 180 }, 100); 181}); 182 183$.get(window.location.href, function(html) { 184 var $newComments = $(html).find('.comment-list'); 185 if ($('.comment-list').length) { 186 // æ¢åãªã¹ããããã°å·®ãæ¿ã 187 $('.comment-list').replaceWith($newComments); 188 } else { 189 // ãªããã°ãã³ã¡ã³ããªã¹ãããã©ã¼ã ã®ç´åã«æ¿å ¥ 190 $('.comment-form').before($newComments); 191 } 192 // ãã©ã¼ã ã®textareaãã¯ãªã¢ 193 $form.find('textarea').val(''); 194 // ã³ã¡ã³ããªã¹ããä¸çªä¸ã¾ã§ã¹ã¯ãã¼ã«ï¼é å»¶ãããï¼ 195 setTimeout(function() { 196 var $commentList = $('.comment-list'); 197 if ($commentList.length) { 198 $commentList.scrollTop($commentList[0].scrollHeight); 199 } 200 }, 100); 201}); 202 203
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.