diff --git a/assets/javascripts/app.js b/assets/javascripts/app.js index b13e404..3bd51b5 100644 --- a/assets/javascripts/app.js +++ b/assets/javascripts/app.js @@ -715,7 +715,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) { @@ -828,20 +828,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('下一張'); @@ -1037,7 +1037,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 = { @@ -1126,8 +1126,7 @@ $(function() { currentTitle.includes('Open in new window') || currentTitle.includes('/uploads/'); - // 修正後:只有在沒有原始 title 時才清空 - if (!hasOriginalTitle && (currentTitle.startsWith('/') || currentTitle.includes('?'))) { + if (currentTitle.startsWith('/') || currentTitle.includes('?')) { currentTitle = ""; } @@ -3101,11 +3100,111 @@ $(document).ready(function() { } }); }); +//post +$(document).ready(function () { + setTimeout(function () { + $('iframe.twitter-share-button, iframe.twitter-tweet-button').each(function () { + $(this).attr('title', '分享至 X 在新視窗開啟'); + }); + }, 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'); + var $inner = $logo.contents().not('p'); + + var $span = $('').addClass('orbit-bar-logo').append($inner); + $logo.replaceWith($span); +}); +//orbitbar登入無障礙 +$(function() { + var $loginWindow = $('.login-window'); + var $checkbox = $('#open-orbit-login'); + + // login-window 顯示時,焦點移到 label.close + $checkbox.on('change', function() { + if ($(this).is(':checked')) { + setTimeout(function() { + $('.login-window .login-header label.close').focus(); + }, 50); + } + }); + + // login-window 失去焦點時,關閉並還原焦點 + $loginWindow.on('focusout', function() { + var $thisWindow = $(this); + setTimeout(function() { + // document.hasFocus() 為 false 代表焦點移到瀏覽器外(開發者工具、右鍵選單等),不關閉 + if (!document.hasFocus()) return; + + if (!$thisWindow.is(':focus-within') && $checkbox.is(':checked')) { + $(".orbit-bar-logo").one("focusin", function() { + if (window.orbit_login_button) { + window.orbit_login_button.focus(); + } + }); + $checkbox.click(); + } + }, 500); + }); +}); //gallery層級問題 $(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') { @@ -3204,5 +3303,96 @@ $(document).ready(function () { fixSearchInputA11y(); }, 500); }); +//會員tab邏輯 +$(document).ready(function () { + setTimeout(function () { + $('.dtr-control').removeAttr('tabindex'); + }, 500); +}); +function fixTabKeyboardNav() { + setTimeout(function () { + var $tablist = $('.member-plugins[role="tablist"]'); + var $tabs = $tablist.find('a[role="tab"]'); + + // 初始化 roving tabindex 和 aria-selected + $tabs.each(function (i) { + var $tab = $(this); + var isActive = $tab.closest('li').hasClass('active'); + $tab.attr({ + 'tabindex': isActive ? '0' : '-1', + 'aria-selected': isActive ? 'true' : 'false' + }); + }); + + // 方向鍵切換頁籤 + $tabs.on('keydown', function (e) { + var $current = $(this); + var currentIndex = $tabs.index($current); + var $target; + + if (e.keyCode === 39 || e.keyCode === 40) { + // 右鍵或下鍵:下一個 + e.preventDefault(); + $target = $tabs.eq((currentIndex + 1) % $tabs.length); + } else if (e.keyCode === 37 || e.keyCode === 38) { + // 左鍵或上鍵:上一個 + e.preventDefault(); + $target = $tabs.eq((currentIndex - 1 + $tabs.length) % $tabs.length); + } else if (e.keyCode === 36) { + // Home:第一個 + e.preventDefault(); + $target = $tabs.first(); + } else if (e.keyCode === 35) { + // End:最後一個 + e.preventDefault(); + $target = $tabs.last(); + } else { + return; + } + + // 更新 roving tabindex 和 aria-selected + $tabs.attr({ 'tabindex': '-1', 'aria-selected': 'false' }); + $target.attr({ 'tabindex': '0', 'aria-selected': 'true' }); + $target.focus().trigger('click'); + }); + + // 點擊頁籤時同步更新狀態 + $tabs.on('click', function () { + $tabs.attr({ 'tabindex': '-1', 'aria-selected': 'false' }); + $(this).attr({ 'tabindex': '0', 'aria-selected': 'true' }); + }); + + }, 500); +} +$(document).ready(function () { + fixTabKeyboardNav(); +}); +function removeBareUrlLinks() { + setTimeout(function() { + $('#table0_wrapper td a').each(function() { + var $a = $(this); + var text = $a.text().trim(); + + if (/^https?:\/\//i.test(text)) { + $a.replaceWith(text); + } + }); + }, 500); +} +$(document).ready(function() { + removeBareUrlLinks(); +}); +//麵包屑無障礙 +$(document).ready(function () { + $('.widget-breadcrumb .breadcrumb li:last-child a').attr('aria-current', 'page'); + + // 若尚未有 nav 包住,自動加上 + $('.widget-breadcrumb .breadcrumb').each(function () { + if (!$(this).closest('nav').length) { + $(this).wrap(''); + } + }); +}); + }(jQuery, window)); diff --git a/assets/stylesheets/template/base/_global.scss b/assets/stylesheets/template/base/_global.scss index a9e66b3..18109cd 100644 --- a/assets/stylesheets/template/base/_global.scss +++ b/assets/stylesheets/template/base/_global.scss @@ -8,6 +8,9 @@ display: block } } +#orbit-bar .orbit-bar-menu .orbit-bar-logo{ + cursor: unset!important; +} .orbit-bar-search-sign-language{ @media(max-width:767px){ diff --git a/assets/stylesheets/template/base/_variables.scss b/assets/stylesheets/template/base/_variables.scss index 935d9ca..8d32a68 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:#7e3cf1; +$theme-color-second:#8d50f7; $theme-color-third: #123fd3; $theme-color-green: #123fd3; -$theme-color-hover:#7e3cf1; +$theme-color-hover:#8d50f7; // Font stacks $main-font: "Noto Sans TC", sans-serif; diff --git a/assets/stylesheets/template/modules/menu.scss b/assets/stylesheets/template/modules/menu.scss index fe4b650..88fb386 100644 --- a/assets/stylesheets/template/modules/menu.scss +++ b/assets/stylesheets/template/modules/menu.scss @@ -107,7 +107,7 @@ min-width: 100%; -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); - background-color:#010522; + background-color:#000214; -webkit-transition: all .3s ease; -moz-transition: all .3s ease; -ms-transition: all .3s ease; @@ -481,9 +481,11 @@ & > a { display: block; font-family: $main-font; - color:#fff; font-weight: 500; font-weight: bold; + @media(min-width:769px){ + color:#fff; + } } &:hover { a{ diff --git a/home/index.html.erb b/home/index.html.erb index 91b6d01..057480d 100644 --- a/home/index.html.erb +++ b/home/index.html.erb @@ -60,13 +60,6 @@ -
-
-
- NATIONAL FORMOSA UNIVERSITY -
-
-
diff --git a/modules/announcement/annc_index17.html.erb b/modules/announcement/annc_index17.html.erb index dcf66e3..fde6db4 100644 --- a/modules/announcement/annc_index17.html.erb +++ b/modules/announcement/annc_index17.html.erb @@ -1,5 +1,5 @@
-

{{page-title}}

+

{{page-title}}

diff --git a/modules/announcement/annc_index7.html.erb b/modules/announcement/annc_index7.html.erb index 8dfc394..3a374b2 100644 --- a/modules/announcement/annc_index7.html.erb +++ b/modules/announcement/annc_index7.html.erb @@ -2,9 +2,9 @@

{{page-title}}

diff --git a/modules/custom_announcement/annc_index10.html.erb b/modules/custom_announcement/annc_index10.html.erb index c589b43..51842aa 100644 --- a/modules/custom_announcement/annc_index10.html.erb +++ b/modules/custom_announcement/annc_index10.html.erb @@ -1,5 +1,5 @@
-

{{page-title}}

+

{{page-title}}

diff --git a/modules/custom_announcement/annc_index14.html.erb b/modules/custom_announcement/annc_index14.html.erb index f80ca3b..1ca91ac 100644 --- a/modules/custom_announcement/annc_index14.html.erb +++ b/modules/custom_announcement/annc_index14.html.erb @@ -1,5 +1,5 @@
-

{{page-title}}

+

{{page-title}}

diff --git a/modules/custom_announcement/annc_index15.html.erb b/modules/custom_announcement/annc_index15.html.erb index 3eb9a05..0318ffd 100644 --- a/modules/custom_announcement/annc_index15.html.erb +++ b/modules/custom_announcement/annc_index15.html.erb @@ -1,5 +1,5 @@
-

{{page-title}}

+

{{page-title}}

diff --git a/modules/custom_announcement/annc_index16.html.erb b/modules/custom_announcement/annc_index16.html.erb index d282496..0e5dd3a 100644 --- a/modules/custom_announcement/annc_index16.html.erb +++ b/modules/custom_announcement/annc_index16.html.erb @@ -1,5 +1,5 @@
-

{{page-title}}

+

{{page-title}}

diff --git a/modules/custom_announcement/annc_index17.html.erb b/modules/custom_announcement/annc_index17.html.erb index 0e35310..ccf9c36 100644 --- a/modules/custom_announcement/annc_index17.html.erb +++ b/modules/custom_announcement/annc_index17.html.erb @@ -1,5 +1,5 @@
-

{{page-title}}

+

{{page-title}}

diff --git a/modules/custom_announcement/annc_index2.html.erb b/modules/custom_announcement/annc_index2.html.erb index 864061e..a215572 100644 --- a/modules/custom_announcement/annc_index2.html.erb +++ b/modules/custom_announcement/annc_index2.html.erb @@ -1,5 +1,5 @@
-

{{page-title}}

+

{{page-title}}

diff --git a/modules/custom_announcement/annc_index3.html.erb b/modules/custom_announcement/annc_index3.html.erb index b69e56f..0c3a074 100644 --- a/modules/custom_announcement/annc_index3.html.erb +++ b/modules/custom_announcement/annc_index3.html.erb @@ -1,5 +1,5 @@
-

{{page-title}}

+

{{page-title}}

diff --git a/modules/custom_announcement/annc_index4.html.erb b/modules/custom_announcement/annc_index4.html.erb index e95aa94..cce25ee 100644 --- a/modules/custom_announcement/annc_index4.html.erb +++ b/modules/custom_announcement/annc_index4.html.erb @@ -1,5 +1,5 @@
-

{{page-title}}

+

{{page-title}}

diff --git a/modules/custom_announcement/annc_index5.html.erb b/modules/custom_announcement/annc_index5.html.erb index d0614d0..2655d91 100644 --- a/modules/custom_announcement/annc_index5.html.erb +++ b/modules/custom_announcement/annc_index5.html.erb @@ -1,5 +1,5 @@
-

{{page-title}}

+

{{page-title}}

  • diff --git a/modules/custom_announcement/annc_index6.html.erb b/modules/custom_announcement/annc_index6.html.erb index 4e29e2a..351e0a5 100644 --- a/modules/custom_announcement/annc_index6.html.erb +++ b/modules/custom_announcement/annc_index6.html.erb @@ -1,5 +1,5 @@
    -

    {{page-title}}

    +

    {{page-title}}

    • diff --git a/modules/custom_announcement/annc_index8.html.erb b/modules/custom_announcement/annc_index8.html.erb index b4e0462..ef802a2 100644 --- a/modules/custom_announcement/annc_index8.html.erb +++ b/modules/custom_announcement/annc_index8.html.erb @@ -1,5 +1,5 @@
      -

      {{page-title}}

      +

      {{page-title}}

      • diff --git a/modules/custom_announcement/annc_index9.html.erb b/modules/custom_announcement/annc_index9.html.erb index dd09135..fb03634 100644 --- a/modules/custom_announcement/annc_index9.html.erb +++ b/modules/custom_announcement/annc_index9.html.erb @@ -1,5 +1,5 @@
        -

        {{page-title}}

        +

        {{page-title}}

        • diff --git a/modules/custom_gallery/custom_gallery_index2.html.erb b/modules/custom_gallery/custom_gallery_index2.html.erb index dceb6f4..02b6e61 100644 --- a/modules/custom_gallery/custom_gallery_index2.html.erb +++ b/modules/custom_gallery/custom_gallery_index2.html.erb @@ -6,7 +6,7 @@
          - {{alt_title}} + {{album-name}}

          diff --git a/modules/custom_gallery/custom_gallery_index4.html.erb b/modules/custom_gallery/custom_gallery_index4.html.erb index 8e69c37..a937910 100644 --- a/modules/custom_gallery/custom_gallery_index4.html.erb +++ b/modules/custom_gallery/custom_gallery_index4.html.erb @@ -6,7 +6,7 @@
          - {{alt_title}} + {{album-name}}

          diff --git a/modules/event_news_mod/event_news_index13.html.erb b/modules/event_news_mod/event_news_index13.html.erb index b678add..33e93b7 100644 --- a/modules/event_news_mod/event_news_index13.html.erb +++ b/modules/event_news_mod/event_news_index13.html.erb @@ -1,5 +1,5 @@
          -

          {{page-title}}

          +

          {{page-title}}

diff --git a/modules/gallery/gallery_index1.html.erb b/modules/gallery/gallery_index1.html.erb index e7c011e..e69b6f2 100644 --- a/modules/gallery/gallery_index1.html.erb +++ b/modules/gallery/gallery_index1.html.erb @@ -4,15 +4,15 @@
-
+
- {{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 6d8f174..4775f73 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-name}}

{{album-description}}
diff --git a/modules/gallery/gallery_index3.html.erb b/modules/gallery/gallery_index3.html.erb index 9571f1a..763dea4 100644 --- a/modules/gallery/gallery_index3.html.erb +++ b/modules/gallery/gallery_index3.html.erb @@ -4,7 +4,7 @@
- +
diff --git a/modules/gallery/gallery_index4.html.erb b/modules/gallery/gallery_index4.html.erb index 0067a40..1fd261b 100644 --- a/modules/gallery/gallery_index4.html.erb +++ b/modules/gallery/gallery_index4.html.erb @@ -5,14 +5,14 @@
- +
- {{alt_title}} + {{album-name}}
diff --git a/modules/gallery/gallery_index5.html.erb b/modules/gallery/gallery_index5.html.erb index 7ccc955..80626db 100644 --- a/modules/gallery/gallery_index5.html.erb +++ b/modules/gallery/gallery_index5.html.erb @@ -5,7 +5,7 @@
- +
{{alt_title}} diff --git a/modules/gallery/gallery_index6.html.erb b/modules/gallery/gallery_index6.html.erb index 9d21410..b304765 100644 --- a/modules/gallery/gallery_index6.html.erb +++ b/modules/gallery/gallery_index6.html.erb @@ -6,14 +6,14 @@
diff --git a/modules/gallery/gallery_index7.html.erb b/modules/gallery/gallery_index7.html.erb index 20a0ef1..ef580f5 100644 --- a/modules/gallery/gallery_index7.html.erb +++ b/modules/gallery/gallery_index7.html.erb @@ -4,7 +4,7 @@
- +
{{alt_title}} @@ -12,7 +12,7 @@

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

{{album-description}}
diff --git a/modules/gallery/gallery_index8.html.erb b/modules/gallery/gallery_index8.html.erb index 4f65ef4..051245d 100644 --- a/modules/gallery/gallery_index8.html.erb +++ b/modules/gallery/gallery_index8.html.erb @@ -4,15 +4,15 @@
- +
- {{alt_title}} + {{album-name}}
diff --git a/modules/web_resource/_web_res_widget1.html.erb b/modules/web_resource/_web_res_widget1.html.erb index 12c2bf3..8197648 100644 --- a/modules/web_resource/_web_res_widget1.html.erb +++ b/modules/web_resource/_web_res_widget1.html.erb @@ -4,7 +4,7 @@