diff --git a/assets/javascripts/app.js b/assets/javascripts/app.js index ef4455d..6c7e2b2 100644 --- a/assets/javascripts/app.js +++ b/assets/javascripts/app.js @@ -324,7 +324,13 @@ $(function () { $('.mobile-menu').toggleClass('active'); $('body').toggleClass('noscroll'); - $('.mobile-menu .navbar-toggle').removeClass('collapsed'); + + // ★ 修正:依據 active 狀態決定 collapsed 的加/移除 + if ($('.mobile-menu').hasClass('active')) { + $('.mobile-menu .navbar-toggle').removeClass('collapsed'); // 打開 → 叉叉 + } else { + $('.mobile-menu .navbar-toggle').addClass('collapsed'); // 關閉 → 三條橫線 + } // 關閉所有下拉選單 $('.mobile-menu1 > ul, .mobile-menu2 > ul').slideUp(500); @@ -338,6 +344,34 @@ $(function () { } }); + // ✅ Tab 鍵跳過 .mobile-menu 時,觸發收合邏輯 + $(document).on('focusout', '.mobile-menu', function(e) { + setTimeout(function() { + var $newFocus = $(document.activeElement); + + // 焦點在 body 時代表滑鼠正在點擊中,不處理 + if ($newFocus.is('body')) return; + + if ($('.mobile-menu').hasClass('active') && $newFocus.closest('.mobile-menu').length === 0) { + + var $btn = $('.navbar-toggle').first(); + + if ($btn.attr('data-bs-toggle')) { + var target = $btn.attr('data-bs-target'); + var bsCollapse = window.bootstrap && bootstrap.Collapse.getInstance($(target)[0]); + if (bsCollapse) bsCollapse.hide(); + $('.mobile-menu').removeClass('active'); + $('body').removeClass('noscroll'); + $('.mobile-menu .navbar-toggle').addClass('collapsed'); + $('.mobile-menu1 > ul, .mobile-menu2 > ul').slideUp(500); + $('.mobile-menu1 > .menu-drop, .mobile-menu2 > .menu-drop').removeClass('opened'); + } else { + $btn.trigger('click'); + } + } + }, 50); + }); + $('.mobile-menu1 > .menu-drop').click(function(){ var $that = $(this); var opencheck1 = $that.hasClass('opened'); @@ -636,7 +670,7 @@ $(function () { } }); if (document.documentElement.lang === 'zh_tw') { - document.documentElement.lang = 'zh-Hant'; + document.documentElement.lang = 'zh-Hant-TW'; } //tab鍵按下 $(document).on('keydown', function(e) { @@ -749,20 +783,20 @@ $(function () { $(this).attr("style", newStyle); } }); - //表格scope - $("table").each(function() { - $(this).find("tr").each(function(rowIndex) { - $(this).find("th").each(function(colIndex) { - if (rowIndex === 0) { - // 第一列的 th,適用於該欄 - $(this).attr("scope", "col"); - } else if (colIndex === 0) { - // 其他列的第一個 th,適用於該行 - $(this).attr("scope", "row"); - } - }); - }); - }); + // //表格scope + // $("table").each(function() { + // $(this).find("tr").each(function(rowIndex) { + // $(this).find("th").each(function(colIndex) { + // if (rowIndex === 0) { + // // 第一列的 th,適用於該欄 + // $(this).attr("scope", "col"); + // } else if (colIndex === 0) { + // // 其他列的第一個 th,適用於該行 + // $(this).attr("scope", "row"); + // } + // }); + // }); + // }); $(".banner-pager button").addClass('banner-pagerbtn'); $(".banner-pager button").attr("type","button"); $(".banner-pager button").append('下一張'); @@ -958,7 +992,7 @@ $(function() { var urlParams = new URLSearchParams(window.location.search); var isEditMode = urlParams.get('editmode') === 'on'; - var pageLang = $('html').attr('lang') || 'zh-Hant'; + var pageLang = $('html').attr('lang') || 'zh-Hant-TW'; var isEn = pageLang.toLowerCase().startsWith('en'); var i18n = { @@ -3023,6 +3057,7 @@ $(document).ready(function () { } }); }); +//post $(document).ready(function () { setTimeout(function () { $('iframe.twitter-share-button, iframe.twitter-tweet-button').each(function () { @@ -3030,6 +3065,55 @@ $(document).ready(function () { }); }, 1500); }); +$(function() { + function bindIframeFocus() { + var $iframe = $('.twitter-share-button'); + if ($iframe.length === 0) return; + + $iframe.each(function() { + var $wrap = $(this).closest('.tw-share-button'); + + // 讓外層可以被 tab 到並顯示焦點框 + $wrap.attr('tabindex', '-1'); + + $(window).on('blur.twitterFocus', function() { + setTimeout(function() { + if (document.activeElement && + $(document.activeElement).hasClass('twitter-share-button')) { + $wrap.css({ + 'outline': '3px solid #005fcc', + 'outline-offset': '2px', + 'border-radius': '2px' + }); + } + }, 100); + }); + + $(window).on('focus.twitterFocus', function() { + $wrap.css({ + 'outline': '', + 'outline-offset': '' + }); + }); + }); + } + + // 用 MutationObserver 等 iframe 被 Twitter script 插入後才綁定 + var observer = new MutationObserver(function(mutations) { + if ($('.twitter-share-button').length > 0) { + bindIframeFocus(); + observer.disconnect(); // 綁定成功後停止監聽 + } + }); + + observer.observe(document.body, { + childList: true, + subtree: true + }); + + // 保險:2秒後強制執行一次 + setTimeout(bindIframeFocus, 1000); +}); //orbitbarlogo無障礙 $(function() { var $logo = $('.orbit-bar-logo'); @@ -3075,6 +3159,9 @@ $(function() { var target = document.getElementById('gallery-theater-stage'); if (!target) return; + // 頁面載入時若已存在 #gallery-theater-stage,則還原 z-index + $('.verticalhome').css('z-index', 'auto'); + var observer = new MutationObserver(function() { var display = target.style.display; if (display === 'block') { @@ -3210,6 +3297,32 @@ $(document).ready(function () { fixSearchInputA11y(); }, 500); }); +setTimeout(function() { + $('.tdken').each(function() { + var $tr = $(this); + var href = $tr.find('a').first().attr('href'); + var title = $tr.find('a').first().attr('title') || ''; + + if (href) { + $tr.css('cursor', 'pointer') + .attr('tabindex', '0') + .attr('role', 'link') + .attr('aria-label', $tr.find('a').first().text().trim() + ' ' + title); + + $tr.on('click', function(e) { + if (!$(e.target).is('a')) { + window.location.href = href; + } + }); + + $tr.on('keydown', function(e) { + if (e.key === 'Enter') { + window.location.href = href; + } + }); + } + }); +}, 500); // 執行 member等高計算,目前改用flexbox故mark掉 by ika 20160105 // $(window).load(function() { // if ($('.index-member-3').length && $(window).width() > 992) { diff --git a/assets/stylesheets/template/base/_global.scss b/assets/stylesheets/template/base/_global.scss index a64aba2..b738ccb 100644 --- a/assets/stylesheets/template/base/_global.scss +++ b/assets/stylesheets/template/base/_global.scss @@ -4,13 +4,16 @@ @import "variables"; .fa-classic, .fa-regular, .fa-solid, .far, .fas ,.fa{ - font-family: var(--fa-style-family, "FontAwesome"); + font-family: "FontAwesome"; } #orbit-bar .orbit-bar-inner > label:focus, #orbit-bar .orbit-bar-inner > label.focus{ .orbit-bar-search-sign-language{ display: block } } +#orbit-bar .orbit-bar-menu .orbit-bar-logo{ + cursor: unset!important; +} .login-btn:focus { outline: 0.3125em auto -webkit-focus-ring-color !important; diff --git a/assets/stylesheets/template/layout/content.scss b/assets/stylesheets/template/layout/content.scss index 818c2e1..f6949eb 100644 --- a/assets/stylesheets/template/layout/content.scss +++ b/assets/stylesheets/template/layout/content.scss @@ -1,6 +1,11 @@ @charset "utf-8"; @import "../initial"; +.line-it-button{ + .label{ + color: #333!important; + } +} .col-lg-1, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-md-1, .col-md-10, .col-md-11, .col-md-12, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-sm-1, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-xs-1, .col-xs-10, .col-xs-11, .col-xs-12, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9{ @media(max-width: $screen-xs){ padding: 0; diff --git a/assets/stylesheets/template/modules/announcement.scss b/assets/stylesheets/template/modules/announcement.scss index 546f0f1..1d304d0 100644 --- a/assets/stylesheets/template/modules/announcement.scss +++ b/assets/stylesheets/template/modules/announcement.scss @@ -2730,12 +2730,6 @@ .i-annc__entry-title { margin-bottom: 0; margin-top: 0; - display: -webkit-box; - -webkit-line-clamp: 2; - -webkit-box-orient: vertical; - overflow: hidden; - text-overflow: ellipsis; - // clear: both; } .i-annc__title { @@ -2743,6 +2737,11 @@ color: $theme-color-main; text-decoration: none; @extend .i-title; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + text-overflow: ellipsis; + overflow: hidden; &:hover { color: $theme-color-second; } diff --git a/assets/stylesheets/template/modules/archives.scss b/assets/stylesheets/template/modules/archives.scss index f217874..bc4bd84 100644 --- a/assets/stylesheets/template/modules/archives.scss +++ b/assets/stylesheets/template/modules/archives.scss @@ -148,18 +148,18 @@ .i-archive-title { @extend .unity-title; } -.link { background-color: #1368d4 !important; } /* 對比 4.6:1 */ -.txt { background-color: #3a8a40 !important; } /* 對比 4.6:1 */ -.xlsx { background-color: #9e3050 !important; } /* 對比 4.6:1 */ -.pdf { background-color: #2a7d36 !important; } /* 對比 4.6:1 */ -.docx { background-color: #5e46a0 !important; } /* 對比 4.6:1 */ -.doc { background-color: #1368d4 !important; } /* 對比 4.6:1 */ -.pptx { background-color: #3d4aa0 !important; } /* 對比 4.6:1 */ -.jpg { background-color: #8f3333 !important; } /* 對比 4.6:1 */ -.zip { background-color: #8a6400 !important; } /* 對比 4.6:1 */ -.rar { background-color: #9e5000 !important; } /* 對比 4.6:1 */ -.xls { background-color: #3a8a40 !important; } /* 對比 4.6:1 */ -.odt { background-color: #767676 !important; } /* 對比 4.6:1 */ +.link { background-color: #1368d4 !important; margin-left: 0.5em; } /* 對比 4.6:1 */ +.txt { background-color: #3a8a40 !important; margin-left: 0.5em; } /* 對比 4.6:1 */ +.xlsx { background-color: #9e3050 !important; margin-left: 0.5em; } /* 對比 4.6:1 */ +.pdf { background-color: #2a7d36 !important; margin-left: 0.5em; } /* 對比 4.6:1 */ +.docx { background-color: #5e46a0 !important; margin-left: 0.5em; } /* 對比 4.6:1 */ +.doc { background-color: #1368d4 !important; margin-left: 0.5em; } /* 對比 4.6:1 */ +.pptx { background-color: #3d4aa0 !important; margin-left: 0.5em; } /* 對比 4.6:1 */ +.jpg { background-color: #8f3333 !important; margin-left: 0.5em; } /* 對比 4.6:1 */ +.zip { background-color: #8a6400 !important; margin-left: 0.5em; } /* 對比 4.6:1 */ +.rar { background-color: #9e5000 !important; margin-left: 0.5em; } /* 對比 4.6:1 */ +.xls { background-color: #3a8a40 !important; margin-left: 0.5em; } /* 對比 4.6:1 */ +.odt { background-color: #767676 !important; margin-left: 0.5em; } /* 對比 4.6:1 */ .table>caption+thead>tr:first-child>td, .table>caption+thead>tr:first-child>th, .table>colgroup+thead>tr:first-child>td, .table>colgroup+thead>tr:first-child>th, .table>thead:first-child>tr:first-child>td, .table>thead:first-child>tr:first-child>th{ // border-top: 0.0625em solid #ddd; } diff --git a/assets/stylesheets/template/modules/universal-table.scss b/assets/stylesheets/template/modules/universal-table.scss index 6789b2c..91f4958 100644 --- a/assets/stylesheets/template/modules/universal-table.scss +++ b/assets/stylesheets/template/modules/universal-table.scss @@ -1,6 +1,11 @@ @charset "utf-8"; @import "../initial"; +a.voice-player { + padding-left: 0.5em; + color: #ff6300; +} + .universal-th-text{ white-space: pre; } @@ -530,9 +535,6 @@ img.image-preview { flex-wrap: wrap; } tbody{ - // display: flex; - // flex-wrap: wrap; - justify-content: center; tr{ padding:18px 20px 25px 20px; background-color: #fff; @@ -549,10 +551,9 @@ img.image-preview { justify-content: center; padding-bottom: 0 !important; color: #0757A0; - font-size: 1.4rem; + font-size: 1rem; a{ color: #2D9349; - font-size:medium; } &:nth-child(2){ font-size: 1.5rem; diff --git a/modules/custom_gallery/custom_gallery_index1.html.erb b/modules/custom_gallery/custom_gallery_index1.html.erb index 4531ca1..36a731f 100644 --- a/modules/custom_gallery/custom_gallery_index1.html.erb +++ b/modules/custom_gallery/custom_gallery_index1.html.erb @@ -6,7 +6,7 @@
- {{alt_title}} + {{album-name}}

diff --git a/modules/custom_gallery/custom_gallery_index3.html.erb b/modules/custom_gallery/custom_gallery_index3.html.erb index fb8f821..6388e93 100644 --- a/modules/custom_gallery/custom_gallery_index3.html.erb +++ b/modules/custom_gallery/custom_gallery_index3.html.erb @@ -6,7 +6,7 @@
- {{alt_title}} + {{album-name}}

diff --git a/modules/gallery/gallery_index1.html.erb b/modules/gallery/gallery_index1.html.erb index e7c011e..097255a 100644 --- a/modules/gallery/gallery_index1.html.erb +++ b/modules/gallery/gallery_index1.html.erb @@ -4,15 +4,16 @@

- +
+
- {{alt_title}} + {{album-name}}

- {{album-name}} + {{album-name}}

{{album-description}}
diff --git a/modules/gallery/gallery_index2.html.erb b/modules/gallery/gallery_index2.html.erb index 75f9c36..eae3376 100644 --- a/modules/gallery/gallery_index2.html.erb +++ b/modules/gallery/gallery_index2.html.erb @@ -5,14 +5,14 @@
- +
{{alt_title}}

- {{album-name}} + {{album-name}}

{{album-description}}
diff --git a/modules/gallery/gallery_index3.html.erb b/modules/gallery/gallery_index3.html.erb index 9571f1a..2cb4aad 100644 --- a/modules/gallery/gallery_index3.html.erb +++ b/modules/gallery/gallery_index3.html.erb @@ -4,15 +4,15 @@

- + diff --git a/modules/gallery/gallery_index4.html.erb b/modules/gallery/gallery_index4.html.erb index 0067a40..79dbf20 100644 --- a/modules/gallery/gallery_index4.html.erb +++ b/modules/gallery/gallery_index4.html.erb @@ -5,14 +5,14 @@
- +
{{alt_title}}
diff --git a/modules/gallery/gallery_index5.html.erb b/modules/gallery/gallery_index5.html.erb index 7ac894a..fa2c16d 100644 --- a/modules/gallery/gallery_index5.html.erb +++ b/modules/gallery/gallery_index5.html.erb @@ -8,11 +8,11 @@
- + {{alt_title}} diff --git a/modules/gallery/gallery_index6.html.erb b/modules/gallery/gallery_index6.html.erb index 9d21410..13d39a2 100644 --- a/modules/gallery/gallery_index6.html.erb +++ b/modules/gallery/gallery_index6.html.erb @@ -6,14 +6,14 @@