From d35f13caffb4b67d7d66fc3017c9cd43cc5e2895 Mon Sep 17 00:00:00 2001 From: ken Date: Wed, 19 Aug 2026 19:57:41 +0800 Subject: [PATCH] update --- assets/javascripts/app.js | 48 ++++++++++++++++++- .../stylesheets/template/base/_variables.scss | 4 +- .../template/modules/announcement.scss | 4 ++ .../template/modules/web_resource.scss | 2 +- modules/ad_banner/_ad_banner_widget7.html.erb | 17 ++++--- modules/announcement/_annc_widget2.html.erb | 40 ++++++++-------- modules/archive/archive_index12.html.erb | 3 +- modules/archive/archive_index17.html.erb | 3 +- modules/archive/archive_index2.html.erb | 3 +- modules/archive/archive_index3.html.erb | 3 +- modules/archive/archive_index4.html.erb | 3 +- modules/archive/archive_index6.html.erb | 3 +- modules/custom_announcement/show.html.erb | 2 +- modules/video_pro/_video_pro_widget1.html.erb | 2 +- modules/video_pro/_video_pro_widget2.html.erb | 2 +- modules/video_pro/_video_pro_widget3.html.erb | 2 +- modules/video_pro/_video_pro_widget4.html.erb | 2 +- modules/video_pro/_video_pro_widget5.html.erb | 2 +- modules/video_pro/_video_pro_widget6.html.erb | 2 +- modules/video_pro/_video_pro_widget7.html.erb | 37 +++++++------- modules/video_pro/video_pro_index1.html.erb | 2 +- modules/video_pro/video_pro_index2.html.erb | 2 +- .../video_pro/video_pro_index2_tag.html.erb | 2 +- modules/video_pro/video_pro_index3.html.erb | 2 +- modules/video_pro/video_pro_index4.html.erb | 2 +- .../video_pro_index_post_agency1.html.erb | 2 +- 26 files changed, 121 insertions(+), 75 deletions(-) diff --git a/assets/javascripts/app.js b/assets/javascripts/app.js index 3bd51b5..c6c4940 100644 --- a/assets/javascripts/app.js +++ b/assets/javascripts/app.js @@ -933,7 +933,7 @@ $(function(){ $(this).append('網路資源標題'); } }); - $('input').each(function() { + $('input.input-search, .search-container input, .search-box input, #search input').each(function() { var $this = $(this); if (!$this.attr('title') || $this.attr('title').trim() === '') { $this.attr('title', '網內搜尋'); @@ -2149,6 +2149,50 @@ $(function() { // 預設 aria-expanded 為 false $(".searchbtn2").attr("aria-expanded", "false"); }); + // ✅ searchbtn2 Tab 鍵聚焦時自動展開 .searchbox + $(document).ready(function() { + function fixSearchbtn2FocusA11y() { + setTimeout(function() { + $('.searchbtn2').on('focus', function() { + var $searchbox = $('.searchbox'); + + // ✅ 只在收合狀態時才展開,不影響已展開的狀態 + if (!$searchbox.is(':visible')) { + $searchbox.slideDown(300, function() { + // ✅ 同步更新 aria-expanded(與原本 click 邏輯一致) + $('.searchbtn2').attr('aria-expanded', 'true'); + // ✅ 同步加上 ken-click2(與原本 click 邏輯一致) + $('.searchbtn2').closest('.ken-click').addClass('ken-click2'); + }); + } + }); + }, 500); + } + + fixSearchbtn2FocusA11y(); + }); + // ✅ searchbtn2 Tab 鍵聚焦時自動展開 .searchbox + $(document).ready(function() { + function fixSearchbtn2FocusA11y() { + setTimeout(function() { + $('.searchbtn2').on('focus', function() { + var $searchbox = $('.searchbox'); + + // ✅ 只在收合狀態時才展開,不影響已展開的狀態 + if (!$searchbox.is(':visible')) { + $searchbox.slideDown(300, function() { + // ✅ 同步更新 aria-expanded(與原本 click 邏輯一致) + $('.searchbtn2').attr('aria-expanded', 'true'); + // ✅ 同步加上 ken-click2(與原本 click 邏輯一致) + $('.searchbtn2').closest('.ken-click').addClass('ken-click2'); + }); + } + }); + }, 500); + } + + fixSearchbtn2FocusA11y(); + }); // 強制保持全站search展開 $(document).ready(function () { @@ -3260,7 +3304,7 @@ function fixSortLinkA11y() { }); } function fixSearchInputA11y() { - $('input[type="search"], input[type="text"]').each(function () { + $('input[type="search"], input.input-search, .search-container input, .search-box input').each(function () { var $input = $(this); // 已有對應 label 就跳過 diff --git a/assets/stylesheets/template/base/_variables.scss b/assets/stylesheets/template/base/_variables.scss index 8d32a68..d517aa4 100644 --- a/assets/stylesheets/template/base/_variables.scss +++ b/assets/stylesheets/template/base/_variables.scss @@ -16,10 +16,10 @@ $theme-red: #d20001; $theme-blue: #003d7e; $theme-color-main: #333333; -$theme-color-second:#8d50f7; +$theme-color-second:#7b3ee5; $theme-color-third: #123fd3; $theme-color-green: #123fd3; -$theme-color-hover:#8d50f7; +$theme-color-hover:#7b3ee5; // Font stacks $main-font: "Noto Sans TC", sans-serif; diff --git a/assets/stylesheets/template/modules/announcement.scss b/assets/stylesheets/template/modules/announcement.scss index 9a30441..7ae56f6 100644 --- a/assets/stylesheets/template/modules/announcement.scss +++ b/assets/stylesheets/template/modules/announcement.scss @@ -251,6 +251,10 @@ a.w-annc__more.btn.btn-primary.pull-right{ // Widget-2 .widget-announcement-2 { + .widget-title-a-inner{ + display: block; + padding: 0.2em; + } // @media(min-width: 768px){ // .col-sm-4{ // width: 33.33333333%; diff --git a/assets/stylesheets/template/modules/web_resource.scss b/assets/stylesheets/template/modules/web_resource.scss index b0c66bc..31d11ec 100644 --- a/assets/stylesheets/template/modules/web_resource.scss +++ b/assets/stylesheets/template/modules/web_resource.scss @@ -507,7 +507,7 @@ .index-context { display: inline-block; // margin: 0 0 0.625em 2em; - color: darken($theme-gray-light, 20%); + color: #707070; } } diff --git a/modules/ad_banner/_ad_banner_widget7.html.erb b/modules/ad_banner/_ad_banner_widget7.html.erb index 74d5fa5..484a93d 100644 --- a/modules/ad_banner/_ad_banner_widget7.html.erb +++ b/modules/ad_banner/_ad_banner_widget7.html.erb @@ -32,13 +32,16 @@ -