Có lỗi xảy ra trong quá trình xử lý biểu mẫu.
Java method "jdk.proxy153.$Proxy836.getArticle(long, String)" threw an exception when invoked on jdk.proxy153.$Proxy836 object "com.liferay.journal.service.impl.JournalArticleLocalServiceImpl@1e820823"; see cause exception in the Java stack trace.
----
FTL stack trace ("~" means nesting-related):
- Failed at: #assign journalArticle = JournalArtic... [in template "29795641980326#20120#811184" at line 3, column 1]
----
1<#assign AssetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService") />
2<#assign JournalArticleLocalService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") />
3<#assign journalArticle = JournalArticleLocalService.getArticle(getterUtil.getLong(groupId),.vars['reserved-article-id'].data) />
4<#assign categories = AssetCategoryLocalService.getCategories("com.liferay.journal.model.JournalArticle", journalArticle.getResourcePrimKey()) />
5<div class="content-tags">
6<ul class="tags-wrap">
7<#if categories?has_content>
8 <#list categories as category>
9 <#assign categoryURL = renderResponse.createRenderURL()
10 categoryId = category.getCategoryId()?string
11 />
12 ${categoryURL.setParameter("resetCur", "true")}
13 ${categoryURL.setParameter("categoryId", category.getCategoryId()?string)}
14 <li>
15 <a title="${category.getName()}" href="/w/${.vars["reserved-article-url-title"].data}/-/categories/${category.getCategoryId()}">${category.getName()}</a> ${category?has_next?then(' ', '')}
16 </li>
17 </#list>
18</#if>
19
20</ul>
21</div>
22
23<#setting locale="vi_VN">
24<#if .vars["reserved-article-display-date"]??>
25 <#assign date = .vars["reserved-article-display-date"].data?date("EEE, dd MMM yyyy hh:mm:ss zzz")?string("dd/MM/yyyy")>
26<#else>
27 <#assign date =.vars["reserved-article-create-date"].data?date("EEE, dd MMM yyyy hh:mm:ss zzz")?string("dd/MM/yyyy")>
28</#if>
29
30<div id="print-content">
31<style>
32#print-content img{margin: 0 auto;}
33a{color: #292d32;}
34.side-bar-height {
35 max-height: 3159.5px;
36 }
37
38 .singular-sidebar {
39 position: absolute;
40 margin-top: 100px;
41 left: -60px;
42 }
43
44 .btn-font {
45 padding: 8px;
46 background: #fff;
47 border: 1px solid #dfe0e3;
48 box-sizing: border-box;
49 border-radius: 100px;
50 display: block;
51 text-align: center;
52 }
53
54 .btn-font span {
55 display: flex;
56 }
57 .btn-font .font {
58 margin: 10px 0;
59 align-items: center;
60 justify-content: center;
61 }
62
63 .singular-footer .social-pin {
64 display: flex;
65 flex-direction: row-reverse;
66 align-items: flex-end;
67 width: 100%;
68 margin-top: 22px;
69 margin-bottom: 22px;
70 position: static
71 }
72
73 .singular-footer .social-pin li {
74 flex: 2
75 }
76
77 .singular-footer .social-pin li:first-child {
78 flex: 1
79 }
80
81 .singular-footer .social-pin li:nth-child(6) {
82 flex: 14
83 }
84
85 .singular-footer .social-pin li.line::before {
86 content: none
87 }
88
89 .singular-footer .social-pin .link .tooltiptext {
90 left: 0;
91 margin-left: -78px;
92 height: 34px;
93 top: 2px;
94 display: flex;
95 justify-content: center;
96 align-items: center
97 }
98
99 .singular-footer .social-pin .link .tooltiptext:after {
100 left: 63px;
101 transform: rotate(48deg)
102 }
103
104 .cpanel-action {
105 margin: 0 auto;
106 padding: 0;
107 list-style: none;
108 position: fixed;
109 top: 250px;
110 }
111
112 .cpanel-action li:not(:first-of-type) {
113 margin: 8px 0 0
114 }
115
116 .cpanel-action li.line::before {
117 content: "";
118 display: block;
119 width: 32px;
120 margin: 0 auto;
121 padding-top: 8px;
122 border-top: 1px solid #e3e6e8
123 }
124
125 .cpanel-action li.save {
126 width: 40px;
127 height: 40px;
128 margin-top: 18px
129 }
130
131 .cpanel-action li.save.comment-empty_saved {
132 margin-top: 8px
133 }
134
135 .cpanel-action li.save.comment-empty_saved span {
136 margin: 0
137 }
138
139 .cpanel-item {
140 width: 40px;
141 height: 40px;
142 display: flex;
143 align-items: center;
144 justify-content: center;
145 border: 0;
146 padding: 0;
147 border-radius: 50%;
148 cursor: pointer;
149 position: relative;
150 color: #fff;
151 font-size: 28px;
152 transition: all .3s
153 }
154
155 .cpanel-item:active {
156 transform: translateY(4px)
157 }
158
159 .cpanel-item:active svg {
160 background: #eee none
161 }
162
163 .cpanel-item:active:hover {
164 box-shadow: none
165 }
166
167 .cpanel-item.save {
168 margin-top: 18px
169 }
170
171 .cpanel-item svg {
172 background: #fff none;
173 border: 1px solid #e4e4e4;
174 border-radius: 100px
175 }
176
177 .cpanel-item:hover {
178 box-shadow: 0 0 8px 8px rgba(0,0,0,.05)
179 }
180
181 .cpanel-item.link {
182 position: relative
183 }
184
185 .cpanel-item.link .tooltiptext {
186 width: 70px;
187 background: #fff none;
188 color: #000;
189 text-align: center;
190 border-radius: 6px;
191 padding: 5px 0;
192 position: absolute;
193 z-index: 1;
194 top: 0;
195 left: 105px;
196 margin-left: -60px;
197 font-size: 14px;
198 border: 2px solid #ccc;
199 font-weight: 400
200 }
201
202 .cpanel-item.link .tooltiptext:after {
203 content: "";
204 display: block;
205 position: absolute;
206 border-style: solid;
207 border-color: #ccc;
208 border-width: 2px 2px 0 0;
209 width: 10px;
210 height: 10px;
211 top: 10px;
212 left: -6px;
213 transform: rotate(-137deg)
214 }
215
216 .cpanel-item.comment {
217 background-color: transparent;
218 color: #999;
219 font-size: 35px
220 }
221
222 .cpanel-item.comment span {
223 height: 16px;
224 padding: 1px 4px;
225 background: #e7f0eb;
226 border-radius: 4px;
227 color: #0f6c32;
228 display: flex;
229 align-items: center;
230 justify-content: center;
231 position: absolute;
232 bottom: -10px;
233 text-indent: 0;
234 font-size: 11px;
235 font-family: "Inter",-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue","Arial","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol",sans-serif;
236 line-height: 140%;
237 font-weight: 600;
238 z-index: 1
239 }
240
241 .cpanel-item.bookmark {
242 background-color: transparent;
243 color: #999;
244 font-size: 35px
245 }
246
247 .cpanel-item.donate {
248 font-size: 28px
249 }
250
251 .cpanel-item.donate:hover {
252 background: #1a7900 none
253 }
254 .woK3sep4ykUXzIebVRTv {
255 background-image: url(https://cdnweb.dantri.com.vn/dist/654561c72dd30d1107f3.svg);
256 background-repeat: no-repeat;
257 background-size: cover;
258 display: flex;
259 justify-content: center;
260 align-items: center;
261 width: 18px;
262 height: 18px;
263 flex-shrink: 0;
264 border: none;
265 }
266 .MXHPvY_upC4YgT_Z3MLn {
267 background: #fff none;
268 border: 1px solid #e4e4e4;
269 border-radius: 100px;
270 width: 40px;
271 height: 40px;
272 display: flex;
273 align-items: center;
274 justify-content: center;
275 padding: 0;
276 cursor: pointer;
277 position: relative;
278 color: #fff;
279 font-size: 28px;
280 transition: all .3s;
281 }
282 .title-page {
283 font-size: 24px;
284 line-height: 35px;
285 font-weight: 600;
286 color: #222;
287 font-family: "Inter",-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue","Arial","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol",sans-serif
288 }
289 .flex-author-collection {
290 margin-top: 12px;
291 display: flex;
292 justify-content: space-between;
293 align-items: center
294 }
295
296 .flex-author-collection .author-wrap {
297 margin: 0
298 }
299
300 .flex-author-collection .collections-item__tag {
301 display: inline-block;
302 height: 32px
303 }
304
305 .flex-author-collection .collections-item__tag img {
306 height: 100%;
307 -o-object-fit: contain;
308 object-fit: contain
309 }
310 .author-wrap {
311 margin: 12px 0 0;
312 display: flex;
313 align-items: center
314 }
315
316 .author-avatar {
317 margin: 0 5px 0 0;
318 display: flex;
319 align-items: center
320 }
321
322 .author-avatar__picture {
323 display: block;
324 width: 32px;
325 height: 32px;
326 position: relative;
327 overflow: hidden;
328 border-radius: 50%;
329 order: 3
330 }
331
332 .author-avatar__picture img {
333 position: absolute;
334 top: 50%;
335 left: 50%;
336 transform: translate(-50%,-50%);
337 max-height: 100%
338 }
339
340 .author-avatar__picture:not(:last-child) {
341 margin-left: -12px
342 }
343
344 .author-avatar__picture:nth-child(2) {
345 order: 2
346 }
347
348 .author-avatar__picture:nth-child(3) {
349 order: 1
350 }
351
352 .author-meta {
353 display: flex;
354 align-items: center
355 }
356
357 .author-name {
358 font-family: "Inter",-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue","Arial","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol",sans-serif;
359 font-weight: 500;
360 font-size: 14px;
361 line-height: 20px
362 }
363
364 .author-name b {
365 font-weight: 600
366 }
367
368 .author-name a {
369 color: #222
370 }
371
372 .author-name.multi {
373 position: relative
374 }
375
376 .author-name.multi>b {
377 display: flex;
378 align-items: center;
379 cursor: pointer
380 }
381
382 .author-name.multi>b svg {
383 position: relative;
384 top: 1px
385 }
386
387 .author-name.multi:hover .author-list {
388 visibility: visible;
389 opacity: 1;
390 top: 35px
391 }
392
393 .author-position {
394 margin: 6px 0 0;
395 color: gray
396 }
397
398 .author-time {
399 margin: 0 0 0 8px;
400 display: flex;
401 align-items: center;
402 font-size: 14px;
403 line-height: 20px;
404 color: #a0a4a8
405 }
406
407 .author-time::before {
408 content: "";
409 width: 4px;
410 height: 4px;
411 display: block;
412 border-radius: 50%;
413 background: #222 none;
414 position: relative;
415 margin: 0 8px 0 0
416 }
417.tags-wrap {
418 padding: 0;
419 list-style: none
420 }
421
422 .tags-wrap.mt-30 {
423 margin-top: 20px
424 }
425
426 .tags-wrap::after {
427 content: "";
428 display: block;
429 clear: both
430 }
431
432 .tags-wrap li {
433 float: left;
434 font-family: "Inter",-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue","Arial","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol",sans-serif;
435 line-height: 18px;
436 margin: 10px 10px 0 0
437 }
438
439 .tags-wrap li:last-of-type {
440 margin-right: 0
441 }
442
443 .tags-wrap li.label {
444 color: #333;
445 line-height: 26px;
446 border: none;
447 font-size: 14px;
448 }
449
450 .tags-wrap li.label b {
451 font-weight: 600
452 }
453
454 .tags-wrap li a {
455 display: block;
456 padding: 4px 12px;
457 color: #666;
458 background: #f1f5f9 none;
459 border-radius: 13px;
460 font-weight: 500
461 }
462
463 .tags-wrap li a:hover {
464 background: var(--btn-link-hover-color) none;
465 color: #fff
466 }
467
468 .audio-player .toggle-play {
469 width: 30px;
470 height: 30px;
471 display: flex;
472 justify-content: center;
473 align-items: center;
474 cursor: pointer;
475 font-size: 20px;
476 color: #957F3F;
477 transition: all 0.3s;
478 border-left: none;
479 }
480
481 .audio_player_wrap {
482 display: flex;
483 align-items: center;
484 justify-content: space-between;
485 flex-wrap: wrap;
486 margin: 6px 0 0 0px;
487}
488
489.audio_player_wrap .date {
490 width: 95px;
491 font-size: 11px;
492 color: #9e9e9e;
493}
494
495.audio_player_wrap .post-view {
496 width: auto;
497 margin: 0;
498 padding: 0;
499 display: flex;
500 list-style: none;
501}
502
503.audio_player_wrap .audio-player {
504 width: 100%;
505}
506
507.audio_player_wrap .post-view li {
508 padding-left: 10px;
509}
510
511.audio_player_wrap .post-view li * {
512 font-size: 12px;
513 color: #000;
514}
515
516.audio_player_wrap .audio-player .controls {
517 display: flex;
518 align-items: center;
519 justify-content: space-between;
520 padding: 4px 13px;
521 background: #e7e7e7;
522}
523
524.toggle-play {
525 border-left: 10px solid #0072bc;
526 border-top: 7px solid transparent;
527 border-bottom: 7px solid transparent;
528 cursor: pointer;
529}
530
531.audio-player .time {
532 width: 54px;
533 padding: 0 2px;
534 text-align: center;
535 display: flex;
536 align-items: center;
537 justify-content: center;
538 font-size: 10px;
539 color: #010100;
540 font-family: 'Helvetica', sans-serif;
541}
542
543.audio-player .name {
544 width: 150px;
545 height: 18px;
546 background: #fff;
547 position: relative;
548 padding: 0 12px 0 6px;
549 display: flex;
550 align-items: center;
551}
552
553#type_voice_active {
554 font-size: 9px;
555 font-weight: 700;
556}
557
558.audio-player .name:after {
559 content: "";
560 border-top: 3px solid;
561 border-left: 3px solid transparent;
562 border-right: 3px solid transparent;
563 position: absolute;
564 right: 4px;
565 top: 7px;
566}
567
568#box_list_voice {
569 list-style: none;
570 margin: 0;
571 visibility: hidden;
572 opacity: 0;
573 position: absolute;
574 left: 0;
575 top: 105%;
576 padding: 7px;
577 width: max-content;
578 border-radius: 5px;
579 box-shadow: 0 5px 12px rgba(0, 0, 0, 0.3);
580 background: #fff;
581}
582
583
584.audio-player .name:hover #box_list_voice{
585 visibility: visible;
586 opacity: 1;
587}
588
589#box_list_voice a {
590 font-size: 11px;
591 color: #000;
592}
593
594.audio-player .audio-timeline {
595 width: 100%;
596 margin-right: 12px;
597 background-color: #fff;
598}
599
600.audio-player .audio-timeline .audio-progress {
601 height: 4px;
602 background-color: #957F3F;
603}
604
605 .audio-player .toggle-play:hover {
606 background: #ddd;
607 }
608
609 .audio-player .toggle-play i {
610 transition: transform 0.3s;
611 }
612
613 .audio-player .toggle-play.playing i {
614 transform: scale(1.2); /* Phóng to biểu tượng khi đang phát */
615 }
616
617
618 .audio-timeline {
619 cursor: pointer;
620 }
621
622 .audio-timeline .audio-progress {
623 height: 100%;
624 background: #957F3F;
625 width: 0;
626 transition: width 0.2s ease;
627 }
628 .singular-sapo {
629 margin: 6px 0 18px 0;
630 font-size: 16px;
631 line-height: 30px;
632 color: #333;
633 font-style: italic;
634 font-family: "Arial", "Noto Serif", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", serif;
635 font-weight: 400;
636}
637.article-content{text-align: justify;}
638</style>
639
640<div class="audio_player_wrap">
641 <div class="audio-player">
642 <div class="controls">
643 <div class="toggle-play"><i class="fas fa-play"></i></div>
644 <div class="time">
645 <div class="current">0:00</div>
646 <div class="divider">/</div>
647 <div class="length">0:00</div>
648 </div>
649 <div class="audio-timeline">
650 <div class="audio-progress"></div>
651 </div>
652 <div class="name">
653 <span id="type_voice_active">Giọng Nam</span>
654 <ul id="box_list_voice" class="box_list_voice">
655
656 <li>
657 <a href="#">Giọng Nam</a>
658 </li>
659 <li>
660 <a href="#">Giọng Nữ</a>
661 </li>
662
663 </ul>
664 </div>
665 </div>
666 </div>
667 </div>
668</br>
669<div class="article-content">
670<#if (AnhNoiBat.getData())?? && AnhNoiBat.getData() != "">
671 <img alt="${AnhNoiBat.getAttribute("alt")}" data-fileentryid="${AnhNoiBat.getAttribute("fileEntryId")}" src="${AnhNoiBat.getData()}" />
672 <p style="text-align: center;">
673 <em>${AnhNoiBat.getAttribute("alt")}</em>
674 </p>
675</br>
676</#if>
677${content.getData()}
678</div>
679</div>
680
681
682<div class="singular-sidebar side-bar-height" data-module="social-pin">
683 <ul class="cpanel-action social-pin ">
684 <li>
685 <a href="javascript:;" title="Tăng cỡ chữ" class="btn-font">
686 <span class="plus">
687 <svg width="22" height="23" viewBox="0 0 22 23" fill="none" xmlns="http://www.w3.org/2000/svg">
688 <rect x="0.5" y="0.996155" width="21" height="21" rx="10.5" fill="white"></rect>
689 <path d="M13.9923 12.0339H11.5756V14.5518H10.4116V12.0339H8.00757V10.9458H10.4116V8.44054H11.5756V10.9458H13.9923V12.0339Z" fill="black"></path>
690 <rect x="0.5" y="0.996155" width="21" height="21" rx="10.5" stroke="#DFE0E3"></rect>
691 </svg>
692
693 </span>
694 <span class="font" "="">
695 aA
696 </span>
697 <span class="minus" "="">
698 <svg width="22" height="23" viewBox="0 0 22 23" fill="none" xmlns="http://www.w3.org/2000/svg">
699 <rect x="0.5" y="0.996124" width="21" height="21" rx="10.5" fill="white"></rect>
700 <path d="M12.9233 10.9141V12.0781H9.0769V10.9141H12.9233Z" fill="black"></path>
701 <rect x="0.5" y="0.996124" width="21" height="21" rx="10.5" stroke="#DFE0E3"></rect>
702 </svg>
703
704 </span>
705 </a>
706 </li>
707 <li>
708 <a class="cpanel-item facebook" target="_blank" href="https://www.facebook.com/sharer.php?u=https://sbv.tinhvan.com/w/${.vars["reserved-article-url-title"].data}" rel="nofollow" title="Chia sẻ bài viết lên facebook">
709 <svg width="40" height="40" fill="none" xmlns="http://www.w3.org/2000/svg">
710 <path d="M21.125 16.3v2.9h2.925c.225 0 .337.2.337.4l-.45 1.9c0 .1-.225.2-.337.2h-2.475V29H17.75v-7.2h-1.912c-.225 0-.338-.1-.338-.3v-1.9c0-.2.113-.3.338-.3h1.912V16c0-1.7 1.462-3 3.375-3h3.038c.224 0 .337.1.337.3v2.4c0 .2-.113.3-.337.3h-2.7c-.226 0-.338.1-.338.3z" fill="#292D32"></path>
711 </svg>
712 </a>
713 </li>
714 <li>
715 <a class="cpanel-item twitter" href="https://twitter.com/intent/tweet?text=https://sbv.tinhvan.com/w/${.vars["reserved-article-url-title"].data}" target="_blank" rel="nofollow" title="Chia sẻ bài viết lên twitter">
716 <svg width="40" height="40" fill="none" xmlns="http://www.w3.org/2000/svg">
717 <path d="M29.5 15.5c-.675.3-1.35.4-2.137.5.787-.4 1.35-1 1.575-1.8-.675.4-1.463.6-2.363.8-.675-.6-1.688-1-2.7-1-1.913 0-3.6 1.5-3.6 3.3 0 .3 0 .5.113.7-3.038-.1-5.85-1.4-7.65-3.4-.338.5-.45 1-.45 1.7 0 1.1.675 2.1 1.687 2.7-.563 0-1.125-.2-1.688-.4 0 1.6 1.238 2.9 2.925 3.2-.337.1-.675.1-1.012.1-.225 0-.45 0-.675-.1.45 1.3 1.8 2.3 3.487 2.3-1.237.9-2.812 1.4-4.612 1.4h-.9c1.688.9 3.6 1.5 5.625 1.5 6.75 0 10.462-5 10.462-9.3v-.4c.788-.5 1.463-1.1 1.913-1.8z" fill="#292D32" stroke="#292D32" stroke-linejoin="round"></path>
718 </svg>
719 </a>
720 </li>
721 <li>
722 <a class="cpanel-item linkedin" target="_blank" href="https://www.linkedin.com/sharing/share-offsite/?url=http://sbv.tinhvan.com/w/${.vars["reserved-article-url-title"].data}" rel="nofollow" title="Chia sẻ bài viết lên linkedin">
723 <svg width="40" height="40" fill="none" xmlns="http://www.w3.org/2000/svg">
724 <g clip-path="url(#IconLinkedin_svg__prefix__clip0_752_6605)">
725 <path d="M27.8 12H13.2c-.4 0-.7.3-.7.7v14.7c0 .3.3.6.7.6h14.7c.4 0 .7-.3.7-.7V12.7c-.1-.4-.4-.7-.8-.7zM17.2 25.6h-2.3V18h2.4v7.6h-.1zM16.1 17c-.8 0-1.4-.7-1.4-1.4 0-.8.6-1.4 1.4-1.4.8 0 1.4.6 1.4 1.4-.1.7-.7 1.4-1.4 1.4zm10 8.6h-2.4v-3.7c0-.9 0-2-1.2-2s-1.4 1-1.4 2v3.8h-2.4V18H21v1c.3-.6 1.1-1.2 2.2-1.2 2.4 0 2.8 1.6 2.8 3.6v4.2h.1z" fill="#292D32"></path>
726 </g>
727 </svg>
728 </a>
729 </li>
730 <li class="zalo-share-button" data-href="https://sbv.tinhvan.com/w/${.vars["reserved-article-url-title"].data}" data-oaid="408045471040429277" data-layout="3" data-color="blue" data-customize="true">
731 <button class="cpanel-item zalo" title="Chia sẻ bài viết lên zalo" data-track-content="" data-content-name="article-actions" data-content-piece="article-actions-zalo" data-content-target="https://sbv.tinhvan.com/w/${.vars["reserved-article-url-title"].data}">
732 <svg width="40" height="40" fill="none" xmlns="http://www.w3.org/2000/svg">
733 <g clip-path="url(#IconZalo_svg__a)">
734 <path fill-rule="evenodd" clip-rule="evenodd" d="M20.68 17.52v-.456h1.368v6.418h-.782a.585.585 0 0 1-.585-.581 3.334 3.334 0 0 1-5.301-2.69 3.334 3.334 0 0 1 5.3-2.69zM15.026 15v.208c0 .388-.052.705-.305 1.077l-.03.035a7.62 7.62 0 0 0-.246.288l-4.39 5.51h4.97v.78a.585.585 0 0 1-.585.584H8v-.367c0-.45.112-.652.253-.861l4.68-5.792H8.194V15h6.83zm8.681 8.482a.488.488 0 0 1-.487-.487V15h1.463v8.482h-.976zm5.304-6.644a3.357 3.357 0 1 1 0 6.713 3.357 3.357 0 0 1 0-6.713zm-10.297 5.333a1.96 1.96 0 1 0 0-3.92 1.96 1.96 0 1 0 0 3.92zm10.297-.003a1.975 1.975 0 1 0-.001-3.95 1.975 1.975 0 0 0 0 3.95z" fill="#292D32"></path>
735 </g>
736 <defs>
737 <clipPath id="IconZalo_svg__a">
738 <path fill="#fff" transform="translate(8 15)" d="M0 0h25v9H0z"></path>
739 </clipPath>
740 </defs>
741 </svg>
742 </button>
743 </li>
744 <li>
745 <button type="button" class="cpanel-item link" onclick="copyLink('https://sbv.tinhvan.com/w/${.vars["reserved-article-url-title"].data}')" title="Copy">
746 <svg width="40" height="40" fill="none" xmlns="http://www.w3.org/2000/svg">
747 <g clip-path="url(#IconLinking_svg__prefix__clip0_608_611)" fill="#292D32">
748 <path d="M16.5 28c-1.2 0-2.3-.5-3.2-1.3-1.8-1.8-1.8-4.6 0-6.4l.7-.7 1.4 1.4-.7.7c-1 1-1 2.6 0 3.6s2.6 1 3.6 0l3-3c1-1 1-2.6 0-3.6l-.7-.7 1.4-1.4.7.7c1.8 1.8 1.8 4.6 0 6.4l-3 3c-.8.8-2 1.3-3.2 1.3z"></path>
749 <path d="m18 23.4-.7-.7c-1.8-1.8-1.8-4.6 0-6.4l3-3c.9-.9 2-1.3 3.2-1.3 1.2 0 2.3.5 3.2 1.3 1.8 1.8 1.8 4.6 0 6.4l-.7.7-1.4-1.4.7-.7c1-1 1-2.6 0-3.6s-2.6-1-3.6 0l-3 3c-1 1-1 2.6 0 3.6l.7.7-1.4 1.4z"></path>
750 </g>
751 </svg>
752 </button>
753 </li>
754 <li class="line">
755 <a type="button" href="#p_p_id_com_liferay_comment_page_comments_web_portlet_PageCommentsPortlet_" class="cpanel-item comment" title="Bình luận">
756 <svg width="40" height="40" fill="none" xmlns="http://www.w3.org/2000/svg">
757 <path d="M17.583 25.833h-.416c-3.334 0-5-.833-5-5v-4.166c0-3.334 1.666-5 5-5h6.666c3.334 0 5 1.666 5 5v4.166c0 3.334-1.666 5-5 5h-.416a.845.845 0 0 0-.667.334l-1.25 1.666c-.55.734-1.45.734-2 0l-1.25-1.666c-.133-.184-.442-.334-.667-.334z" stroke="#292D32" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>
758 <path d="M16.333 16.667h8.334m-8.334 4.166h5" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
759 </svg>
760 <span class="x-comments"></span>
761 </a>
762 </li>
763 <!-- <li class="save ">
764 <button class="saved-article-20230824031513522 vLPsOJ4TxOzrC0g8QrVd MXHPvY_upC4YgT_Z3MLn ">
765 <span class="woK3sep4ykUXzIebVRTv"></span>
766 </button>
767 </li> -->
768 <li>
769 <button id="ic_print" rel="nofollow" onclick="javascript:;" class="cpanel-item print" title="In">
770 <svg width="40" height="40" fill="none" xmlns="http://www.w3.org/2000/svg">
771 <path d="M16.542 15.833h7.916v-1.666c0-1.667-.625-2.5-2.5-2.5h-2.916c-1.875 0-2.5.833-2.5 2.5v1.666z" stroke="#292D32" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>
772 <path d="M28 18.333V22.5c0 1.667-.833 2.5-2.5 2.5v-2h-10v2c-1.667 0-2.5-.833-2.5-2.5v-4.167c0-1.666.833-2.5 2.5-2.5h10c1.667 0 2.5.834 2.5 2.5zM25.5 23h-10m.833-3.833h2.5" stroke="#292D32" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>
773 <path d="M25.5 23v2.857c0 1.429-1.25 2.143-3.75 2.143h-2.5c-2.5 0-3.75-.714-3.75-2.143V23h10z" stroke="#292D32" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>
774 </svg>
775 </button>
776 </li>
777 <li>
778 <button onclick="history.back()" class="cpanel-item back">
779 <svg width="40" height="40" fill="none" xmlns="http://www.w3.org/2000/svg">
780 <path d="M18.475 14.942 13.417 20l5.058 5.058M27.583 20H13.558" stroke="#292D32" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>
781 </svg>
782 </button>
783 </li>
784 </ul>
785</div>
786
787
788<div class="singular-footer" data-module="social-pin">
789 <ul class="cpanel-action social-pin hidden">
790 <li>
791 <a class="cpanel-item facebook" target="_blank" href="https://www.facebook.com/sharer.php?u=https://sbv.tinhvan.com/w/${.vars["reserved-article-url-title"].data}" data-track-content="" data-content-name="article-actions" data-content-piece="article-actions-facebook" data-content-target="/w/${.vars["reserved-article-url-title"].data}" rel="nofollow" title="Chia sẻ bài viết lên facebook">
792 <svg width="40" height="40" fill="none" xmlns="http://www.w3.org/2000/svg">
793 <path d="M21.125 16.3v2.9h2.925c.225 0 .337.2.337.4l-.45 1.9c0 .1-.225.2-.337.2h-2.475V29H17.75v-7.2h-1.912c-.225 0-.338-.1-.338-.3v-1.9c0-.2.113-.3.338-.3h1.912V16c0-1.7 1.462-3 3.375-3h3.038c.224 0 .337.1.337.3v2.4c0 .2-.113.3-.337.3h-2.7c-.226 0-.338.1-.338.3z" fill="#292D32"></path>
794 </svg>
795 </a>
796 </li>
797 <li>
798 <a class="cpanel-item twitter" href="https://twitter.com/intent/tweet?text=https://sbv.tinhvan.com/w/${.vars["reserved-article-url-title"].data}" target="_blank" data-track-content="" data-content-name="article-actions" data-content-piece="article-actions-twitter" data-content-target="/w/${.vars["reserved-article-url-title"].data}" rel="nofollow" title="Chia sẻ bài viết lên twitter">
799 <svg width="40" height="40" fill="none" xmlns="http://www.w3.org/2000/svg">
800 <path d="M29.5 15.5c-.675.3-1.35.4-2.137.5.787-.4 1.35-1 1.575-1.8-.675.4-1.463.6-2.363.8-.675-.6-1.688-1-2.7-1-1.913 0-3.6 1.5-3.6 3.3 0 .3 0 .5.113.7-3.038-.1-5.85-1.4-7.65-3.4-.338.5-.45 1-.45 1.7 0 1.1.675 2.1 1.687 2.7-.563 0-1.125-.2-1.688-.4 0 1.6 1.238 2.9 2.925 3.2-.337.1-.675.1-1.012.1-.225 0-.45 0-.675-.1.45 1.3 1.8 2.3 3.487 2.3-1.237.9-2.812 1.4-4.612 1.4h-.9c1.688.9 3.6 1.5 5.625 1.5 6.75 0 10.462-5 10.462-9.3v-.4c.788-.5 1.463-1.1 1.913-1.8z" fill="#292D32" stroke="#292D32" stroke-linejoin="round"></path>
801 </svg>
802 </a>
803 </li>
804 <li>
805 <a class="cpanel-item linkedin" target="_blank" href="https://www.linkedin.com/sharing/share-offsite/?url=https://sbv.tinhvan.com/w/${.vars["reserved-article-url-title"].data}" data-track-content="" data-content-name="article-actions" data-content-piece="article-actions-linkedin" data-content-target="/w/${.vars["reserved-article-url-title"].data}" rel="nofollow" title="Chia sẻ bài viết lên linkedin">
806 <svg width="40" height="40" fill="none" xmlns="http://www.w3.org/2000/svg">
807 <g clip-path="url(#IconLinkedin_svg__prefix__clip0_752_6605)">
808 <path d="M27.8 12H13.2c-.4 0-.7.3-.7.7v14.7c0 .3.3.6.7.6h14.7c.4 0 .7-.3.7-.7V12.7c-.1-.4-.4-.7-.8-.7zM17.2 25.6h-2.3V18h2.4v7.6h-.1zM16.1 17c-.8 0-1.4-.7-1.4-1.4 0-.8.6-1.4 1.4-1.4.8 0 1.4.6 1.4 1.4-.1.7-.7 1.4-1.4 1.4zm10 8.6h-2.4v-3.7c0-.9 0-2-1.2-2s-1.4 1-1.4 2v3.8h-2.4V18H21v1c.3-.6 1.1-1.2 2.2-1.2 2.4 0 2.8 1.6 2.8 3.6v4.2h.1z" fill="#292D32"></path>
809 </g>
810 </svg>
811 </a>
812 </li>
813 <li class="zalo-share-button" data-href="https://sbv.tinhvan.com/w/${.vars["reserved-article-url-title"].data}" data-oaid="408045471040429277" data-layout="3" data-color="blue" data-customize="true">
814 <button class="cpanel-item zalo" title="Chia sẻ bài viết lên zalo" data-track-content="" data-content-name="article-actions" data-content-piece="article-actions-zalo" data-content-target="https://sbv.tinhvan.com/w/${.vars["reserved-article-url-title"].data}">
815 <svg width="40" height="40" fill="none" xmlns="http://www.w3.org/2000/svg">
816 <g clip-path="url(#IconZalo_svg__a)">
817 <path fill-rule="evenodd" clip-rule="evenodd" d="M20.68 17.52v-.456h1.368v6.418h-.782a.585.585 0 0 1-.585-.581 3.334 3.334 0 0 1-5.301-2.69 3.334 3.334 0 0 1 5.3-2.69zM15.026 15v.208c0 .388-.052.705-.305 1.077l-.03.035a7.62 7.62 0 0 0-.246.288l-4.39 5.51h4.97v.78a.585.585 0 0 1-.585.584H8v-.367c0-.45.112-.652.253-.861l4.68-5.792H8.194V15h6.83zm8.681 8.482a.488.488 0 0 1-.487-.487V15h1.463v8.482h-.976zm5.304-6.644a3.357 3.357 0 1 1 0 6.713 3.357 3.357 0 0 1 0-6.713zm-10.297 5.333a1.96 1.96 0 1 0 0-3.92 1.96 1.96 0 1 0 0 3.92zm10.297-.003a1.975 1.975 0 1 0-.001-3.95 1.975 1.975 0 0 0 0 3.95z" fill="#292D32"></path>
818 </g>
819 <defs>
820 <clipPath id="IconZalo_svg__a">
821 <path fill="#fff" transform="translate(8 15)" d="M0 0h25v9H0z"></path>
822 </clipPath>
823 </defs>
824 </svg>
825 </button>
826 </li>
827 <li>
828 <button type="button" class="cpanel-item link" onclick="copyLink('https://sbv.tinhvan.com/w/${.vars["reserved-article-url-title"].data}')" title="Copy">
829 <svg width="40" height="40" fill="none" xmlns="http://www.w3.org/2000/svg">
830 <g clip-path="url(#IconLinking_svg__prefix__clip0_608_611)" fill="#292D32">
831 <path d="M16.5 28c-1.2 0-2.3-.5-3.2-1.3-1.8-1.8-1.8-4.6 0-6.4l.7-.7 1.4 1.4-.7.7c-1 1-1 2.6 0 3.6s2.6 1 3.6 0l3-3c1-1 1-2.6 0-3.6l-.7-.7 1.4-1.4.7.7c1.8 1.8 1.8 4.6 0 6.4l-3 3c-.8.8-2 1.3-3.2 1.3z"></path>
832 <path d="m18 23.4-.7-.7c-1.8-1.8-1.8-4.6 0-6.4l3-3c.9-.9 2-1.3 3.2-1.3 1.2 0 2.3.5 3.2 1.3 1.8 1.8 1.8 4.6 0 6.4l-.7.7-1.4-1.4.7-.7c1-1 1-2.6 0-3.6s-2.6-1-3.6 0l-3 3c-1 1-1 2.6 0 3.6l.7.7-1.4 1.4z"></path>
833 </g>
834 </svg>
835 </button>
836 </li>
837 <li class="line">
838 <a type="button" href="#p_p_id_com_liferay_comment_page_comments_web_portlet_PageCommentsPortlet_" class="cpanel-item comment" title="Bình luận">
839 <svg width="40" height="40" fill="none" xmlns="http://www.w3.org/2000/svg">
840 <path d="M17.583 25.833h-.416c-3.334 0-5-.833-5-5v-4.166c0-3.334 1.666-5 5-5h6.666c3.334 0 5 1.666 5 5v4.166c0 3.334-1.666 5-5 5h-.416a.845.845 0 0 0-.667.334l-1.25 1.666c-.55.734-1.45.734-2 0l-1.25-1.666c-.133-.184-.442-.334-.667-.334z" stroke="#292D32" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>
841 <path d="M16.333 16.667h8.334m-8.334 4.166h5" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
842 </svg>
843 <span class="x-comments"></span>
844 </a>
845 </li>
846 <li>
847 <button id="ic_print2" rel="nofollow" onclick="javascript:;" class="cpanel-item print" title="In">
848 <svg width="40" height="40" fill="none" xmlns="http://www.w3.org/2000/svg">
849 <path d="M16.542 15.833h7.916v-1.666c0-1.667-.625-2.5-2.5-2.5h-2.916c-1.875 0-2.5.833-2.5 2.5v1.666z" stroke="#292D32" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>
850 <path d="M28 18.333V22.5c0 1.667-.833 2.5-2.5 2.5v-2h-10v2c-1.667 0-2.5-.833-2.5-2.5v-4.167c0-1.666.833-2.5 2.5-2.5h10c1.667 0 2.5.834 2.5 2.5zM25.5 23h-10m.833-3.833h2.5" stroke="#292D32" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>
851 <path d="M25.5 23v2.857c0 1.429-1.25 2.143-3.75 2.143h-2.5c-2.5 0-3.75-.714-3.75-2.143V23h10z" stroke="#292D32" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>
852 </svg>
853 </button>
854 </li>
855 <li>
856 <button onclick="history.back()" class="cpanel-item back">
857 <svg width="40" height="40" fill="none" xmlns="http://www.w3.org/2000/svg">
858 <path d="M18.475 14.942 13.417 20l5.058 5.058M27.583 20H13.558" stroke="#292D32" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"></path>
859 </svg>
860 </button>
861 </li>
862 </ul>
863</div>
864
865<div class="content-tags">
866<ul class="tags-wrap mt-30">
867 <#if categories?has_content>
868 <li class="label"><b><@liferay.language key="categories" />:</b></li>
869 <#list categories as category>
870 <#assign categoryURL = renderResponse.createRenderURL()
871 categoryId = category.getCategoryId()?string
872 />
873 ${categoryURL.setParameter("resetCur", "true")}
874 ${categoryURL.setParameter("categoryId", category.getCategoryId()?string)}
875 <li>
876 <a title="${category.getName()}" href="/w/${.vars["reserved-article-url-title"].data}/-/categories/${category.getCategoryId()}">${category.getName()}</a> ${category?has_next?then(' ', '')}
877 </li>
878 </#list>
879</#if>
880</ul>
881</div>
882
883<#assign tags = stringUtil.split(.vars["reserved-article-asset-tag-names"].data,",")>
884<#if tags?size gte 1>
885<div class="content-tags">
886<ul class="tags-wrap">
887 <li class="label"><b><@liferay.language key="keywords" />:</b></li>
888 <#list tags as tag>
889 <li>
890 <a
891 title="${tag}"
892 href="/w/${.vars["reserved-article-url-title"].data}/-/tag/${tag}"
893 data-content-name="article-tags"
894 data-content-piece="article-tags-position_1"
895 data-content-target="/w/${.vars["reserved-article-url-title"].data}/-/tag/${tag}?assetEntryId=${.vars["reserved-article-id"].data}"
896 data-track-content=""
897 >
898 ${tag}
899 </a>
900 </li>
901 </#list>
902</ul>
903</div>
904</#if>
905<script>
906 $(document).ready(function() {
907 var xComments = [];
908 var yourArray = [];
909 $(".add-comment .show .panel-body .text-secondary.text-uppercase strong").each(function(){
910 if($.trim($(this).text()).length > 0) {
911 if($(this).text().substring(0, 1)!='T'){
912xComments.push($(this).text().substring(0, 1)); }
913else{ xComments.push('0'); }
914 }
915 });
916
917 $(".x-comments").each(function(){
918 $(this).text(xComments[0]);
919 });
920
921 $(".x-comments").text(xComments[0]);
922
923 var images = $(".article-content picture");
924
925 if (images.length <= 0) {
926 images = $(".article-content img, .article-content figure img, .article-content .document img");
927 }
928
929images.each(function(){
930 var imageSource;
931 var image= $(this);
932 if (image.is('picture')) {
933 var sources = image.find('source');
934 sources.each(function() {
935 var mediaQuery = $(this).attr('media');
936 if (window.matchMedia(mediaQuery).matches) {
937 imageSource = $(this).attr('srcset');
938 return false;
939 }
940 });
941 } else {
942 imageSource = image.attr('src');
943 }
944
945 if (!imageSource) {
946 imageSource = image.find('img').attr('src');
947 }
948
949 image.wrap(function() {
950 var dataCaption = $(this).next().text();
951 if (!dataCaption || dataCaption.length === 0) {
952 dataCaption = $(this).parent().next().text().trim();
953 }
954 if (!dataCaption || dataCaption.length === 0) {
955 dataCaption = $(this).parent().parent().next().text().trim();
956 }
957 return '<a data-fancybox="gallery" data-src="' + imageSource + '" data-caption="' + dataCaption + '"/>';
958 });
959});
960 /* Fancybox.bind('[data-fancybox="gallery"]', {
961 //
962 });*/
963
964 var baseFont = 14;
965 function fontchange(n) {
966 baseFont += n;
967 $(".article-content p").css("font-size", baseFont + "px");
968 savecookie("fontsize", baseFont)
969 }
970
971 function fontdefault() {
972 $(".article-content p").css("font-size", "14px");
973 savecookie("fontsize", 14);
974 }
975
976 function getcookie(n) {
977 var t;
978 return (t = new RegExp("(?:^|; )" + encodeURIComponent(n) + "=([^;]*)").exec(document.cookie)) ? t[1] : null;
979 }
980
981 function savecookie(n, t) {
982 var i = new Date, r;
983 i.setTime(i.getTime() + 31536e6);
984 r = "; expires=" + i.toGMTString();
985 document.cookie = n + "=" + t + r + "; path=/;";
986 }
987
988 if ($('.btn-font').length > 0) {
989 $('.plus').off('click').on('click', function () {
990 fontchange(1);
991 });
992 $('.minus').off('click').on('click', function () {
993 fontchange(-1);
994 });
995 $('.font').off('click').on('click', function () {
996 fontdefault();
997 });
998 }
999
1000 function printDiv(divName){
1001
1002 var printContents = document.getElementById(divName).innerHTML;
1003 var originalContents = document.body.innerHTML;
1004
1005 document.body.innerHTML = printContents;
1006
1007 window.print();
1008
1009 document.body.innerHTML = originalContents;
1010 }
1011
1012 function copyLink(link) {
1013 $(".link").append('<span class="tooltiptext">Đã copy</span>');
1014 const unsecuredCopyToClipboard = (text) => {
1015 const textArea = document.createElement("textarea");
1016 textArea.value=text;
1017 document.body.appendChild(textArea);
1018 textArea.select();
1019 try {
1020 document.execCommand('copy');
1021 } catch(err) {
1022 console.error('Unable to copy to clipboard', err);
1023 }
1024 document.body.removeChild(textArea);
1025 };
1026
1027 if (window.isSecureContext && navigator.clipboard) {
1028 navigator.clipboard.writeText(link);
1029 } else {
1030 unsecuredCopyToClipboard(link);
1031 }
1032
1033 setTimeout(function() {
1034 $(".tooltiptext").remove();
1035 }, 3000);
1036 }
1037
1038 function isOnScreen(){
1039 var curPos = $('.singular-footer').offset();
1040 var curTop = curPos.top - $(window).scrollTop();
1041 var screenHeight = $(window).height();
1042 if (curTop < screenHeight) {
1043 $('.singular-sidebar').hide();
1044 } else {
1045 $('.singular-sidebar').show();
1046 }
1047 }
1048
1049 window.onscroll = isOnScreen;
1050
1051 //Start xử lý nút đọc nội dung
1052 const playButton = document.querySelector(".toggle-play");
1053 const playIcon = playButton.querySelector("i");
1054 const voicesList = document.querySelectorAll("#box_list_voice li a");
1055 const activeVoiceLabel = document.querySelector("#type_voice_active");
1056 const currentTimeDisplay = document.querySelector(".time .current");
1057 const totalTimeDisplay = document.querySelector(".time .length");
1058 const timeline = document.querySelector(".audio-timeline");
1059 const progress = document.querySelector(".audio-progress");
1060 let selectedVoice = "Vietnamese Male";
1061
1062 let isPlaying = false;
1063 let intervalId;
1064 let elapsedSeconds = 0;
1065 let estimatedLength = 0;
1066
1067 // Kiểm tra giọng đọc hợp lệ
1068 function validateVoice() {
1069 const voices = responsiveVoice.getVoices();
1070 const validVoice = voices.find(v => v.name === selectedVoice);
1071 if (!validVoice) {
1072 console.warn("Giọng đọc không hợp lệ:", selectedVoice);
1073 selectedVoice = "Vietnamese Female"; // Giọng mặc định nếu không tìm thấy
1074 }
1075 }
1076
1077 // Lấy nội dung từ class entry_body, xóa .post_social
1078 function getCleanContent() {
1079 const entryBodyElement = document.querySelector(".article-content").cloneNode(true);
1080 return entryBodyElement.innerText.replace("\n","").trim(); // Lấy nội dung sau khi xóa
1081 }
1082
1083 // Tính tổng thời gian dự kiến
1084 function calculateEstimatedLength(content) {
1085 const totalWords = content.split(/\s+/).length; // Đếm số từ
1086 return Math.ceil(totalWords / 3.33); // Thời gian đọc (giây) với tốc độ ~3.33 từ/giây
1087 }
1088
1089 // Định dạng thời gian thành mm:ss
1090 function formatTime(seconds) {
1091 const mins = Math.floor(seconds / 60);
1092 const secs = seconds % 60;
1093 return mins + ":" + (secs < 10 ? "0" : "") + secs;
1094 }
1095
1096 // Cập nhật thanh timeline
1097 function updateProgress() {
1098 const percentage = (elapsedSeconds / estimatedLength) * 100;
1099 progress.style.width = percentage + "%";
1100 }
1101
1102 // Gán sự kiện cho nút play/pause
1103 playButton.addEventListener("click", function () {
1104 const cleanContent = getCleanContent(); // Lấy nội dung đã loại bỏ post_social
1105 estimatedLength = calculateEstimatedLength(cleanContent);
1106 totalTimeDisplay.textContent = formatTime(estimatedLength);
1107
1108 validateVoice();
1109
1110 if (!cleanContent) {
1111
1112 alert("Không có nội dung để đọc!");
1113
1114 return;
1115 }
1116
1117 if (isPlaying) {
1118 responsiveVoice.cancel();
1119 isPlaying = false;
1120 playIcon.classList.remove("fa-pause");
1121 playIcon.classList.add("fa-play");
1122 clearInterval(intervalId); // Dừng bộ đếm thời gian
1123 } else {
1124 responsiveVoice.speak(cleanContent, selectedVoice, {
1125 onend: function () {
1126 isPlaying = false;
1127 playIcon.classList.remove("fa-pause");
1128 playIcon.classList.add("fa-play");
1129 clearInterval(intervalId);
1130 elapsedSeconds = 0;
1131 currentTimeDisplay.textContent = formatTime(0);
1132 progress.style.width = "0%";
1133 },
1134 onerror: function (e) {
1135 console.error("Lỗi phát âm thanh:", e);
1136 alert("Không thể phát âm thanh. Vui lòng kiểm tra lại.");
1137 }
1138 });
1139 isPlaying = true;
1140 playIcon.classList.remove("fa-play");
1141 playIcon.classList.add("fa-pause");
1142
1143 // Bắt đầu bộ đếm thời gian
1144 elapsedSeconds = 0; // Đặt lại thời gian bắt đầu
1145 intervalId = setInterval(function () {
1146 if (elapsedSeconds < estimatedLength) {
1147 elapsedSeconds++;
1148 currentTimeDisplay.textContent = formatTime(elapsedSeconds);
1149 updateProgress(); // Cập nhật thanh tiến trình
1150 } else {
1151 clearInterval(intervalId); // Dừng khi đạt tổng thời lượng
1152 }
1153 }, 1000);
1154 }
1155 });
1156
1157 // Tua hoặc quay lại trong thanh timeline
1158 timeline.addEventListener("click", function (e) {
1159 const timelineWidth = timeline.offsetWidth;
1160 const clickX = e.offsetX;
1161 const newTime = (clickX / timelineWidth) * estimatedLength;
1162 elapsedSeconds = Math.floor(newTime);
1163 currentTimeDisplay.textContent = formatTime(elapsedSeconds);
1164 updateProgress();
1165
1166 // Nếu đang phát, cập nhật lại giọng nói từ thời điểm mới
1167 if (isPlaying) {
1168 responsiveVoice.cancel();
1169 const remainingContent = getRemainingContent(getCleanContent(), elapsedSeconds, estimatedLength);
1170 responsiveVoice.speak(remainingContent, selectedVoice);
1171 }
1172 });
1173
1174 // Hàm lấy nội dung từ thời điểm tua
1175 function getRemainingContent(content, elapsed, total) {
1176 const totalWords = content.split(/\s+/).length;
1177 const startWord = Math.floor((elapsed / total) * totalWords);
1178 return content.split(/\s+/).slice(startWord).join(" ");
1179 }
1180
1181 // Gán sự kiện thay đổi giọng đọc
1182 voicesList.forEach(function (voiceItem) {
1183 voiceItem.addEventListener("click", function () {
1184 const voiceName = voiceItem.textContent.trim();
1185
1186 // Chuyển đổi giọng đọc dựa trên tên giọng
1187 switch (voiceName) {
1188
1189 case "Giọng Nam":
1190 selectedVoice = "Vietnamese Male";
1191 break;
1192 case "Giọng Nữ":
1193 selectedVoice = "Vietnamese Female";
1194 break;
1195
1196 }
1197
1198 // Cập nhật nhãn hiển thị
1199 activeVoiceLabel.textContent = voiceName;
1200 });
1201 });
1202 //End xử lý nút đọc nội dung
1203
1204 //Start xử lý nút in trang
1205 const printButton = document.querySelector("#ic_print");
1206
1207 printButton.addEventListener("click", function (e) {
1208 e.preventDefault(); // Ngăn hành vi mặc định
1209debugger
1210 // Lấy HTML của <head> (tất cả <link> và <style>)
1211 const headHTML = document.head.outerHTML;
1212 // Lấy nội dung của class .main
1213 const mainContentElement = document.querySelector("#print-content").cloneNode(true);
1214
1215 // Xóa các phần tử không cần in
1216 const audioPlayerWrap = mainContentElement.querySelector(".audio_player_wrap");
1217 if (audioPlayerWrap) audioPlayerWrap.remove(); // Xóa audio_player_wrap
1218
1219 // Lưu nội dung gốc của trang
1220 const originalContent = document.body.innerHTML;
1221
1222 // Thay thế toàn bộ nội dung body bằng nội dung .main đã xử lý
1223 document.body.innerHTML = mainContentElement.innerHTML;
1224
1225 // Gọi hàm in
1226 window.print();
1227
1228 // Khôi phục lại nội dung gốc
1229 document.body.innerHTML = originalContent;
1230
1231 // Đảm bảo script được chạy lại sau khi khôi phục
1232 window.location.reload();
1233 });
1234
1235 const printButton2 = document.querySelector("#ic_print2");
1236
1237 printButton2.addEventListener("click", function (e) {
1238 e.preventDefault(); // Ngăn hành vi mặc định
1239
1240 // Lấy nội dung của class .main
1241 const mainContentElement = document.querySelector("#print-content").cloneNode(true);
1242
1243 // Xóa các phần tử không cần in
1244 const audioPlayerWrap = mainContentElement.querySelector(".audio_player_wrap");
1245 const postSocial = mainContentElement.querySelector(".post_social");
1246 const post_relate = mainContentElement.querySelector(".post_relate");
1247 const Danh_sach_comment = mainContentElement.querySelector("#Danh-sach-comment");
1248 const Danh_sach_ratting = mainContentElement.querySelector("#Danh-sach-ratting");
1249 if (audioPlayerWrap) audioPlayerWrap.remove(); // Xóa audio_player_wrap
1250 if (postSocial) postSocial.remove(); // Xóa post_social
1251 if (post_relate) post_relate.remove(); // Xóa post_relate
1252 if (Danh_sach_comment) Danh_sach_comment.remove(); // Xóa Danh_sach_comment
1253 if (Danh_sach_ratting) Danh_sach_ratting.remove(); // Xóa Danh_sach_ratting
1254
1255 // Lưu nội dung gốc của trang
1256 const originalContent = document.body.innerHTML;
1257
1258 // Thay thế toàn bộ nội dung body bằng nội dung .main đã xử lý
1259 document.body.innerHTML = mainContentElement.innerHTML;
1260
1261 // Gọi hàm in
1262 window.print();
1263
1264 // Khôi phục lại nội dung gốc
1265 document.body.innerHTML = originalContent;
1266
1267 // Đảm bảo script được chạy lại sau khi khôi phục
1268 window.location.reload();
1269 });
1270
1271 //End xử lý nút In trang
1272 });
1273</script>