diff --git a/assets/javascripts/app.js b/assets/javascripts/app.js index 0281a90..3172ef3 100644 --- a/assets/javascripts/app.js +++ b/assets/javascripts/app.js @@ -1,6 +1,36 @@ ;(function($, win, undefined) { // ECMAScript 5 嚴格模式 'use strict'; + $(function() { + var $signLanguageBox = $('.orbit-bar-search-sign-language'); + var $headerNav = $('.header-nav'); + var $target = $('.header-nav [accesskey="U"], .header-nav [accesskey="W"]'); + + // 移除 color: inherit !important + $target.each(function() { + $(this)[0].style.removeProperty('color'); + }); + + function handleNavMove() { + var windowWidth = window.innerWidth; + + if (windowWidth > 768) { + if ($signLanguageBox.length && $signLanguageBox.find('[accesskey="U"], [accesskey="W"]').length === 0) { + $signLanguageBox.prepend($target); + } + } else { + if ($headerNav.length && $headerNav.find('[accesskey="U"], [accesskey="W"]').length === 0) { + $headerNav.append($target); + } + } + } + + handleNavMove(); + + $(window).on('resize', function() { + handleNavMove(); + }); + }); //blockquote移動 $(function() { // 1. 定義變數,減少重複選取 DOM 的效能消耗 @@ -716,7 +746,7 @@ } }); if (document.documentElement.lang === 'zh_tw') { - document.documentElement.lang = 'zh-Hant'; + document.documentElement.lang = 'zh-Hant-TW'; } //tab鍵按下 $(document).on('keydown', function(e) { @@ -829,20 +859,20 @@ $(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('下一張'); @@ -886,6 +916,14 @@ $(document).ready(function() { removeEmptyTitles(); }); + + // $(".w-annc__img-wrap a").each(function () { + // var $this = $(this); + // // 確保 內沒有文字節點 (避免重複添加) + // if ($this.text().trim() === "") { + // $this.append('公告圖片'); + // } + // }); $(".widget-link__widget-title").each(function () { if ($(this).text().trim() === "") { $(this).append('公告標題'); @@ -954,7 +992,7 @@ var isLinkImage = $parentA.length > 0 && $parentA.text().replace(/\u00a0/g, '').trim() === ""; // --- 1. 處理「裝飾性圖片」標註 --- - if (currentAlt === "announcement image" || currentAlt === "裝飾圖片" || currentTitle === "裝飾圖片") { + if (currentAlt === "announcement image" || currentAlt === "裝飾圖片" || currentTitle === "裝飾圖片" || currentAlt === "這是一張圖片" || currentTitle === "這是一張圖片") { $img.attr('alt', ''); $img.removeAttr('title'); return; @@ -1030,7 +1068,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 = { @@ -1239,7 +1277,8 @@ $(function() { fixAccessibilityAll(); }, 800); }); - //圖示新增sr-only + + $(function() { function smartFixIcons() { var isEn = $('html').attr('lang') === 'en'; @@ -1373,8 +1412,8 @@ $(function() { if($('.w-ba-banner__slide a').eq(i).attr('target') == "") $('.w-ba-banner__slide a').eq(i).removeAttr('target'); }; - // 幫無標題之iframe加上title - for(var i=0;i<$('iframe').length;i++) + // 幫無標題之iframe加上title + for(var i=0;i<$('iframe').length;i++) if($('iframe').eq(i).attr('title')=="" || $('iframe').eq(i).attr('title')== undefined ){ if($('iframe').eq(i).attr('src').search('facebook') != -1 ) $('iframe').eq(i).attr('title','facebook'); @@ -1467,14 +1506,13 @@ $(function() { var selectedText = $(this).text().trim(); $(this).find('span').text(selectedText + '(已選取)'); }); - //jPlayer 控制項無障礙標籤補強 $(function() { - /** - * jPlayer 控制項無障礙標籤補強 - * 1. 修正重複且無意義的 title="按鈕" - * 2. 解決鍵盤焦點無法進入隱藏介面的問題 - */ - function fixJPlayerAccessibility() { + /** + * jPlayer 控制項無障礙標籤補強 + * 1. 修正重複且無意義的 title="按鈕" + * 2. 解決鍵盤焦點無法進入隱藏介面的問題 + */ + function fixJPlayerAccessibility() { var $playerContainer = $('#jp_container_video_file'); // --- A. 修正按鈕標題 (解決語義問題) --- @@ -1528,7 +1566,7 @@ $(function() { } `) .appendTo("head"); - } + } // 執行補強(設定延遲確保 jPlayer 已生成 DOM) setTimeout(fixJPlayerAccessibility, 500); @@ -1660,24 +1698,53 @@ $(function() { //公告頁籤無障礙 $(function() { function fixTabLinearOrder() { - // 只處理內部含有 .tab_nav 的 .w-annc var $targetAnnc = $('.w-annc').filter(function() { return $(this).find('.tab_nav').length > 0; }); - // 若頁面上沒有符合條件的 .w-annc,直接離開 if ($targetAnnc.length === 0) return; var $tabs = $targetAnnc.find('.filter_tab'); var $anncList = $targetAnnc.find('.w-annc__list'); - // --- 1. 順向遊走:標籤 -> 對應內容 --- - $tabs.on('keydown', function(e) { - if (e.which === 9 && !e.shiftKey) { - var category = $(this).data('category'); - var $scope = $(this).closest('.w-annc'); // 限定在同一個 .w-annc - var $visibleItems = $scope.find('.w-annc__item[data-category="' + category + '"]:visible'); + // 智慧判斷:偵測 filter_tab 用哪個屬性來分類 + // 優先用 data-tags(若有值),否則用 data-category + function getTabKey($tab) { + var tags = $tab.data('tags'); + if (tags && tags !== '') return { attr: 'data-tags', value: tags }; + var category = $tab.data('category'); + if (category && category !== '') return { attr: 'data-category', value: category }; + return null; + } + // 根據 key 找對應的可見 w-annc__item + function getVisibleItems($scope, key) { + if (!key) return $(); + return $scope.find('.w-annc__item[' + key.attr + '="' + key.value + '"]:visible'); + } + + // 根據 w-annc__item 反查對應的 filter_tab + function getTabFromItem($item, $scope) { + var tags = $item.data('tags'); + if (tags && tags !== '') { + var $tab = $scope.find('.filter_tab[data-tags="' + tags + '"]'); + if ($tab.length) return $tab; + } + var category = $item.data('category'); + if (category && category !== '') { + var $tab = $scope.find('.filter_tab[data-category="' + category + '"]'); + if ($tab.length) return $tab; + } + return $(); + } + + $tabs.on('keydown', function(e) { + var $scope = $(this).closest('.w-annc'); + var key = getTabKey($(this)); + + // 順向 Tab:頁籤 -> 對應內容第一個連結 + if (e.which === 9 && !e.shiftKey) { + var $visibleItems = getVisibleItems($scope, key); if ($visibleItems.length > 0) { var $firstLink = $visibleItems.find('a').first(); if ($firstLink.length > 0) { @@ -1686,30 +1753,62 @@ $(function() { } } } - if (e.which === 13 || e.which === 32) { - e.preventDefault(); - $(this).click(); - } - }); - - // --- 2. 反向遊走:內容 -> 對應標籤 --- - $anncList.on('keydown', '.w-annc__item a', function(e) { - var $currentLink = $(this); - var $currentItem = $currentLink.closest('.w-annc__item'); - var $scope = $currentLink.closest('.w-annc'); // 限定在同一個 .w-annc - var category = $currentItem.data('category'); - var $visibleItems = $scope.find('.w-annc__item[data-category="' + category + '"]:visible'); + // 反向 Shift+Tab:頁籤 -> 上一個頁籤的內容最後一個連結 if (e.which === 9 && e.shiftKey) { - if ($currentLink.is($visibleItems.find('a').first())) { - e.preventDefault(); - $scope.find('.filter_tab[data-category="' + category + '"]').focus(); + var $prevTab = $(this).prev('.filter_tab'); + if ($prevTab.length > 0) { + var prevKey = getTabKey($prevTab); + $prevTab.click(); + + var $prevItems = getVisibleItems($scope, prevKey); + var $lastLink = $prevItems.find('a').last(); + + if ($lastLink.length > 0) { + e.preventDefault(); + $lastLink.focus(); + } } } + // Enter / Space:切換頁籤並移焦點到內容第一個連結 + if (e.which === 13 || e.which === 32) { + e.preventDefault(); + $(this).click(); + + var $visibleItems = getVisibleItems($scope, key); + var $firstLink = $visibleItems.find('a').first(); + if ($firstLink.length > 0) { + setTimeout(function() { $firstLink.focus(); }, 50); + } + } + }); + + // 反向遊走:內容 -> 對應標籤;Tab 到最後一個連結跳下一個頁籤 + $anncList.on('keydown', '.w-annc__item a', function(e) { + var $currentLink = $(this); + var $currentItem = $currentLink.closest('.w-annc__item'); + var $scope = $currentLink.closest('.w-annc'); + + // 找出當前 item 對應的 filter_tab + var $currentTab = getTabFromItem($currentItem, $scope); + if (!$currentTab.length) return; + + // 找出同類別的所有可見 item + var key = getTabKey($currentTab); + var $visibleItems = getVisibleItems($scope, key); + + // Shift+Tab:若是第一個連結,跳回對應頁籤 + if (e.which === 9 && e.shiftKey) { + if ($currentLink.is($visibleItems.find('a').first())) { + e.preventDefault(); + $currentTab.focus(); + } + } + + // Tab:若是最後一個連結,跳到下一個頁籤並切換 if (e.which === 9 && !e.shiftKey) { if ($currentLink.is($visibleItems.find('a').last())) { - var $currentTab = $scope.find('.filter_tab[data-category="' + category + '"]'); var $nextTab = $currentTab.next('.filter_tab'); if ($nextTab.length > 0) { e.preventDefault(); @@ -1719,112 +1818,99 @@ $(function() { } } }); + } - // --- 3. 反向遊走:標籤 -> 上一個標籤的內容最後一個連結 --- - $tabs.on('keydown', function(e) { - if (e.which === 9 && e.shiftKey) { - var $scope = $(this).closest('.w-annc'); // 限定在同一個 .w-annc - var $prevTab = $(this).prev('.filter_tab'); - if ($prevTab.length > 0) { - var prevCategory = $prevTab.data('category'); - $prevTab.click(); + setTimeout(fixTabLinearOrder, 500); + }); - var $prevItems = $scope.find('.w-annc__item[data-category="' + prevCategory + '"]:visible'); - var $lastLink = $prevItems.find('a').last(); + //頁籤無障礙 + $(function () { + function fixTabAccessibility() { - if ($lastLink.length > 0) { + // 各自獨立處理每組 .tab_nav,避免多組時跨區塊操作問題 + $('.tab_nav').each(function() { + var $tabNav = $(this); + var $tabs = $tabNav.find('li'); + + // --- 1. 初始化結構語意 --- + $tabNav.attr('role', 'tablist'); + + $tabs.each(function () { + var $this = $(this); + var isActive = $this.hasClass('active'); + + $this.attr({ + 'role': 'tab', + 'aria-selected': isActive ? 'true' : 'false', + 'tabindex': isActive ? '0' : '-1' + }); + + var tabName = $this.text().trim(); + $this.attr('title', '切換至 ' + tabName); + }); + + // --- 2. 點擊事件:更新 aria-selected 與 tabindex --- + $tabs.on('click', function () { + var $clickedTab = $(this); + + $tabs.attr('aria-selected', 'false').attr('tabindex', '-1'); + $clickedTab.attr('aria-selected', 'true').attr('tabindex', '0'); + }); + + // --- 3. 鍵盤操作補強 --- + $tabs.on('keydown', function (e) { + var $current = $(this); + var currentIndex = $tabs.index($current); + var lastIndex = $tabs.length - 1; + var $target = null; + + switch (e.which) { + case 13: // Enter + case 32: // Space e.preventDefault(); - $lastLink.focus(); - } + $current.trigger('click'); + break; + + case 37: // ← 左方向鍵:移到前一個頁籤 + case 38: // ↑ 上方向鍵 + e.preventDefault(); + $target = currentIndex > 0 + ? $tabs.eq(currentIndex - 1) + : $tabs.eq(lastIndex); + break; + + case 39: // → 右方向鍵:移到下一個頁籤 + case 40: // ↓ 下方向鍵 + e.preventDefault(); + $target = currentIndex < lastIndex + ? $tabs.eq(currentIndex + 1) + : $tabs.eq(0); + break; + + case 36: // Home:跳到第一個頁籤 + e.preventDefault(); + $target = $tabs.eq(0); + break; + + case 35: // End:跳到最後一個頁籤 + e.preventDefault(); + $target = $tabs.eq(lastIndex); + break; } - } + + // 移動焦點並觸發點擊切換 + if ($target && $target.length) { + $tabs.attr('tabindex', '-1'); + $target.attr('tabindex', '0').focus().trigger('click'); + } + }); }); } - fixTabLinearOrder(); + setTimeout(fixTabAccessibility, 500); }); - //頁籤無障礙 - $(function () { - function fixTabAccessibility() { - var $tabNav = $('.tab_nav'); - var $tabs = $tabNav.find('li'); // ✅ 你的 HTML 是 li,不是 .filter_tab - // --- 1. 初始化結構語意 --- - $tabNav.attr('role', 'tablist'); - $tabs.each(function () { - var $this = $(this); - var isActive = $this.hasClass('active'); - - $this.attr({ - 'role': 'tab', - 'aria-selected': isActive ? 'true' : 'false', - 'tabindex': isActive ? '0' : '-1' // ✅ 只有 active 的可以被 Tab 聚焦 - }); - - var tabName = $this.text().trim(); - $this.attr('title', '切換至 ' + tabName); - }); - - // --- 2. 點擊事件:更新 aria-selected 與 tabindex --- - $tabs.on('click', function () { - var $clickedTab = $(this); - - $tabs.attr('aria-selected', 'false').attr('tabindex', '-1'); - $clickedTab.attr('aria-selected', 'true').attr('tabindex', '0'); - }); - - // --- 3. 鍵盤操作補強 --- - $tabs.on('keydown', function (e) { - var $current = $(this); - var currentIndex = $tabs.index($current); - var lastIndex = $tabs.length - 1; - var $target = null; - - switch (e.which) { - case 13: // Enter - case 32: // Space - e.preventDefault(); - $current.trigger('click'); - break; - - case 37: // ← 左方向鍵:移到前一個頁籤 - case 38: // ↑ 上方向鍵 - e.preventDefault(); - $target = currentIndex > 0 - ? $tabs.eq(currentIndex - 1) - : $tabs.eq(lastIndex); // 到底了就循環到最後一個 - break; - - case 39: // → 右方向鍵:移到下一個頁籤 - case 40: // ↓ 下方向鍵 - e.preventDefault(); - $target = currentIndex < lastIndex - ? $tabs.eq(currentIndex + 1) - : $tabs.eq(0); // 到底了就循環到第一個 - break; - - case 36: // Home:跳到第一個頁籤 - e.preventDefault(); - $target = $tabs.eq(0); - break; - - case 35: // End:跳到最後一個頁籤 - e.preventDefault(); - $target = $tabs.eq(lastIndex); - break; - } - - // 移動焦點並觸發點擊切換 - if ($target && $target.length) { - $tabs.attr('tabindex', '-1'); - $target.attr('tabindex', '0').focus().trigger('click'); - } - }); - } - - setTimeout(fixTabAccessibility, 500); - }); //移除 accesskey="W" 之後的 | 符號 $(function() { function removeSeparatorAfterAccesskeyW() { @@ -1849,6 +1935,12 @@ $(function() { if ($('#language-li').is(':empty') || $('#language-li').html().trim() === '') { $('#language-li').remove(); }; + $('.header-nav').each(function() { + const cleaned = $(this).text().replace(/[\s|]/g, ''); + if (cleaned === '') { + $(this).remove(); + } + }); } forFreeGo(); @@ -2432,243 +2524,277 @@ $(function() { init(); }); -//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; +// 1. OrbitBar 基礎與搜尋選單邏輯 +$(document).ready(function() { + const isEn = document.documentElement.lang === 'en'; + const $orbitLabel = $('label[for="open-orbit-nav"]'); + const $searchArea = $('.orbit-bar-search-sign-language'); + const $firstInput = $('#q'); // 搜尋框通常是選單內第一個獲焦元素 - $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(); // 綁定成功後停止監聽 + // 初始化屬性 + if (isEn) { + $orbitLabel.attr({ title: 'Site search and language menu', 'aria-label': 'Site search and language menu' }); + } else { + $orbitLabel.attr({ title: '全站搜尋及語言切換選單', 'aria-label': '全站搜尋及語言切換選單' }); } - }); + $orbitLabel.attr({ 'role': 'button', 'aria-haspopup': 'true', 'aria-expanded': 'false', 'tabindex': '0' }); - observer.observe(document.body, { - childList: true, - subtree: true - }); + // --- 【修正重點 1】處理 Label 的焦點與按鍵行為 --- + $orbitLabel.on('focusin', function(e) { + var relatedTarget = e.relatedTarget; + // 如果是從選單內部退回來的 (Shift+Tab) + if (relatedTarget && ($searchArea.find(relatedTarget).length > 0)) { + $searchArea.removeClass('show'); + $(this).attr('aria-expanded', 'false'); + } else { + // 正向進入 + $searchArea.addClass('show'); + $(this).attr('aria-expanded', 'true'); + } + }); - // 保險:2秒後強制執行一次 - setTimeout(bindIframeFocus, 1000); + // 強制偵測:在 Label 上按下 Shift+Tab 代表要離開這整塊,立即收合 + $orbitLabel.on('keydown', function(e) { + if (e.shiftKey && e.keyCode === 9) { // Shift + Tab + $searchArea.removeClass('show'); + $searchArea.find('ul').removeClass('show'); + $(this).attr('aria-expanded', 'false'); + } + }); + + // --- 【修正重點 2】處理選單內第一個元素的 Shift+Tab --- + $firstInput.on('keydown', function(e) { + if (e.shiftKey && e.keyCode === 9) { // 在第一個輸入框按 Shift + Tab + // 讓它自然回到 Label,Label 的 focusin 會接手處理收合 + // 這裡不做額外動作,交給上面的 focusin 邏輯 + } + }); + + // --- 【修正重點 3】處理離開大區塊(往後 Tab)的狀態清除 --- + $searchArea.on('focusout', function() { + var $thisArea = $(this); + setTimeout(function() { + if (!$thisArea.is(':focus-within') && !$(document.activeElement).is($orbitLabel)) { + $thisArea.removeClass('show'); + $thisArea.find('ul').removeClass('show'); + $orbitLabel.attr('aria-expanded', 'false'); + $('#languagebutton').attr('aria-expanded', 'false'); + } + }, 150); + }); + + // 點擊行為 + $orbitLabel.on('click', function() { + var isOpen = $searchArea.hasClass('show'); + $searchArea.toggleClass('show', !isOpen); + $(this).attr('aria-expanded', !isOpen); + }); + + // RWD 位置搬移 + function moveSearch() { + if ($(window).width() < 767) { + $searchArea.insertAfter('label[for="open-orbit-nav"]'); + } else { + $searchArea.appendTo('.orbit-bar-inner'); + } + } + moveSearch(); + $(window).resize(moveSearch); }); - // 1. OrbitBar 基礎與搜尋選單邏輯 - $(document).ready(function() { - const isEn = document.documentElement.lang === 'en'; - const $orbitLabel = $('label[for="open-orbit-nav"]'); - const $searchArea = $('.orbit-bar-search-sign-language'); - const $firstInput = $('#q'); // 搜尋框通常是選單內第一個獲焦元素 - // 初始化屬性 - if (isEn) { - $orbitLabel.attr({ title: 'Site search and language menu', 'aria-label': 'Site search and language menu' }); - } else { - $orbitLabel.attr({ title: '全站搜尋及語言切換選單', 'aria-label': '全站搜尋及語言切換選單' }); - } - $orbitLabel.attr({ 'role': 'button', 'aria-haspopup': 'true', 'aria-expanded': 'false', 'tabindex': '0' }); +// 2. 語言按鈕與手機版選單補強 +$(function() { + function fixLanguageA11y() { + var isEn = document.documentElement.lang === 'en'; + var correctTitle = isEn ? 'Open language menu' : '在本視窗開啟語言選單'; + var $desktopBtn = $('#languagebutton'); + var $langLi = $('#language-li'); + var $langUl = $('#language-li ul'); - // --- 【修正重點 1】處理 Label 的焦點與按鍵行為 --- - $orbitLabel.on('focusin', function(e) { - var relatedTarget = e.relatedTarget; - // 如果是從選單內部退回來的 (Shift+Tab) - if (relatedTarget && ($searchArea.find(relatedTarget).length > 0)) { - $searchArea.removeClass('show'); - $(this).attr('aria-expanded', 'false'); - } else { - // 正向進入 - $searchArea.addClass('show'); - $(this).attr('aria-expanded', 'true'); - } - }); + // ============================================= + // ✅ 新增 GN1210101E:繁體中文 li 補上可聚焦 + // 桌面版 + 手機版都處理 + // ============================================= + var $activeLis = $langUl.find('li.active') + .add($('#language-li-ul').find('li.active')); - // 強制偵測:在 Label 上按下 Shift+Tab 代表要離開這整塊,立即收合 - $orbitLabel.on('keydown', function(e) { - if (e.shiftKey && e.keyCode === 9) { // Shift + Tab - $searchArea.removeClass('show'); - $searchArea.find('ul').removeClass('show'); - $(this).attr('aria-expanded', 'false'); - } - }); + $activeLis.each(function() { + var $li = $(this); + if ($li.find('a, button').length === 0) { + var activeText = $li.text().trim(); + $li.html( + '' + + activeText + + '' + ); + } + }); - // --- 【修正重點 2】處理選單內第一個元素的 Shift+Tab --- - $firstInput.on('keydown', function(e) { - if (e.shiftKey && e.keyCode === 9) { // 在第一個輸入框按 Shift + Tab - // 讓它自然回到 Label,Label 的 focusin 會接手處理收合 - // 這裡不做額外動作,交給上面的 focusin 邏輯 - } - }); + // ============================================= + // Desktop 語言按鈕 + // ============================================= + if ($desktopBtn.length > 0) { + $desktopBtn.attr({ + 'aria-expanded': 'false', + 'role': 'button', + 'aria-haspopup': 'true', + 'title': correctTitle + }); + $desktopBtn.removeAttr('aria-label'); - // --- 【修正重點 3】處理離開大區塊(往後 Tab)的狀態清除 --- - $searchArea.on('focusout', function() { - var $thisArea = $(this); - setTimeout(function() { - if (!$thisArea.is(':focus-within') && !$(document.activeElement).is($orbitLabel)) { - $thisArea.removeClass('show'); - $thisArea.find('ul').removeClass('show'); - $orbitLabel.attr('aria-expanded', 'false'); - $('#languagebutton').attr('aria-expanded', 'false'); - } - }, 150); - }); + function openLangMenu() { + $langUl.addClass('show'); + $desktopBtn.attr('aria-expanded', 'true'); + $('.orbit-bar-search-sign-language').addClass('show'); + } + function closeLangMenu() { + $langUl.removeClass('show'); + $desktopBtn.attr('aria-expanded', 'false'); + } - // 點擊行為 - $orbitLabel.on('click', function() { - var isOpen = $searchArea.hasClass('show'); - $searchArea.toggleClass('show', !isOpen); - $(this).attr('aria-expanded', !isOpen); - }); + // 原有:focus 展開 + $desktopBtn.on('focus', function() { + openLangMenu(); + }); - // RWD 位置搬移 - function moveSearch() { - if ($(window).width() < 767) { - $searchArea.insertAfter('label[for="open-orbit-nav"]'); - } else { - $searchArea.appendTo('.orbit-bar-inner'); - } - } - moveSearch(); - $(window).resize(moveSearch); - }); - // 2. 語言按鈕與手機版選單補強 - $(function() { - function fixLanguageA11y() { - var $desktopBtn = $('#languagebutton'); - if ($desktopBtn.length > 0) { - $desktopBtn.attr({ 'aria-expanded': 'false', 'role': 'button', 'aria-haspopup': 'true' }); - $desktopBtn.on('focus', function() { - $(this).closest('#language-li').find('ul').addClass('show'); - $(this).attr('aria-expanded', 'true'); - $('.orbit-bar-search-sign-language').addClass('show'); - }); - } + // ✅ 新增 GN1210100E:Enter / Space 切換、Escape 收合 + $desktopBtn.on('keydown', function(e) { + if (e.which === 13 || e.which === 32) { + e.preventDefault(); + $langUl.hasClass('show') ? closeLangMenu() : openLangMenu(); + } + if (e.which === 27) { + closeLangMenu(); + $desktopBtn.focus(); + } + }); - var $mobileBtn = $('.mobile-button'); - if ($mobileBtn.length > 0) { - $mobileBtn.attr({ 'role': 'button', 'tabindex': '0', 'aria-haspopup': 'true', 'aria-expanded': 'false' }); - $mobileBtn.on('focus', function() { - $(this).closest('li').find('ul').addClass('show'); - $(this).attr('aria-expanded', 'true'); - }); - $mobileBtn.on('keydown', function(e) { - if (e.which === 13 || e.which === 32) { - e.preventDefault(); - var $ul = $(this).closest('li').find('ul'); - $ul.toggleClass('show'); - $(this).attr('aria-expanded', $ul.hasClass('show') ? 'true' : 'false'); - } - }); - $('#language-li-ul').on('focusout', function() { - var $container = $(this); - setTimeout(function() { - if (!$container.is(':focus-within')) { - $container.find('ul').removeClass('show'); - $mobileBtn.attr('aria-expanded', 'false'); - } - }, 150); - }); - } + // 原有:click 切換 + $desktopBtn.on('click', function(e) { + e.preventDefault(); + $langUl.hasClass('show') ? closeLangMenu() : openLangMenu(); + }); - // 強制鎖定 Title - var target = document.getElementById('languagebutton'); - if (target) { - var isEn = document.documentElement.lang === 'en'; - var correctTitle = isEn ? 'Open language menu' : '在本視窗開啟語言選單'; - var observer = new MutationObserver(function() { - if (target.getAttribute('title') !== correctTitle) target.setAttribute('title', correctTitle); - }); - observer.observe(target, { attributes: true }); - } - } - setTimeout(fixLanguageA11y, 600); - }); - // rwd左上選單無障礙 - $(function() { - /** - * 修正:當焦點離開整個區塊(含語言選單最後一項)時,關閉大選單 - */ - function fixSearchMenuFocusOut() { - var $searchArea = $('.orbit-bar-search-sign-language'); - var $orbitLabel = $('label[for="open-orbit-nav"]'); - var $langBtn = $('#languagebutton'); + // ✅ 新增:選單內 Escape 跳回按鈕 + $langUl.find('a').on('keydown', function(e) { + if (e.which === 27) { + e.preventDefault(); + closeLangMenu(); + $desktopBtn.focus(); + } + }); - // 使用 focusout 監聽整個搜尋/語言區域 - $searchArea.on('focusout', function(e) { - // 關鍵:使用 setTimeout 讓 document.activeElement 抓到下一個獲焦元素 - setTimeout(function() { - // 如果目前的焦點不在 $searchArea 裡面,也不是回到觸發的 $orbitLabel 上 - if (!$searchArea.is(':focus-within') && !$(document.activeElement).is($orbitLabel)) { - - // 1. 移除大區塊顯示 - $searchArea.removeClass('show'); - - // 2. 移除子層語言選單顯示 - $searchArea.find('ul').removeClass('show'); - - // 3. 狀態重置為「折疊」供語音報讀 - $orbitLabel.attr('aria-expanded', 'false'); - $langBtn.attr('aria-expanded', 'false'); - } - }, 50); - }); + // 原有:焦點離開整個 language-li 時收合 + $langLi.on('focusout', function() { + var $container = $(this); + setTimeout(function() { + if (!$container.is(':focus-within')) { + closeLangMenu(); + } + }, 150); + }); + } - // 桌面版 Language 按鈕特殊處理:焦點移入時 - $langBtn.on('focus', function() { - // 確保父層搜尋區塊是顯示的 (針對從別處直接 tab 過來的情況) - $searchArea.addClass('show'); - $(this).attr('aria-expanded', 'true'); - }); + // ============================================= + // 手機版選單補強(原有邏輯完整保留) + // ============================================= + var $mobileBtn = $('.mobile-button'); + if ($mobileBtn.length > 0) { + $mobileBtn.attr({ 'role': 'button', 'tabindex': '0', 'aria-haspopup': 'true', 'aria-expanded': 'false' }); + $mobileBtn.on('focus', function() { + $(this).closest('li').find('ul').addClass('show'); + $(this).attr('aria-expanded', 'true'); + }); + $mobileBtn.on('keydown', function(e) { + if (e.which === 13 || e.which === 32) { + e.preventDefault(); + var $ul = $(this).closest('li').find('ul'); + $ul.toggleClass('show'); + $(this).attr('aria-expanded', $ul.hasClass('show') ? 'true' : 'false'); + } + }); + $('#language-li-ul').on('focusout', function() { + var $container = $(this); + setTimeout(function() { + if (!$container.is(':focus-within')) { + $container.find('ul').removeClass('show'); + $mobileBtn.attr('aria-expanded', 'false'); + } + }, 150); + }); + } - // 針對手機版 mobile-button (span) 同理處理 - $('.mobile-button').on('focusout', function() { - var $mobileParent = $('#language-li-ul'); - setTimeout(function() { - if (!$mobileParent.is(':focus-within')) { - $mobileParent.find('ul').removeClass('show'); - $('.mobile-button').attr('aria-expanded', 'false'); - } - }, 50); - }); - } + // ============================================= + // 原有:MutationObserver 強制鎖定 title + // ============================================= + var target = document.getElementById('languagebutton'); + if (target) { + var observer = new MutationObserver(function() { + if (target.getAttribute('title') !== correctTitle) { + target.setAttribute('title', correctTitle); + } + }); + observer.observe(target, { attributes: true, attributeFilter: ['title'] }); + } + } + + setTimeout(fixLanguageA11y, 600); +}); +// rwd左上選單無障礙 +$(function() { + /** + * 修正:當焦點離開整個區塊(含語言選單最後一項)時,關閉大選單 + */ + function fixSearchMenuFocusOut() { + var $searchArea = $('.orbit-bar-search-sign-language'); + var $orbitLabel = $('label[for="open-orbit-nav"]'); + var $langBtn = $('#languagebutton'); + + // 使用 focusout 監聽整個搜尋/語言區域 + $searchArea.on('focusout', function(e) { + // 關鍵:使用 setTimeout 讓 document.activeElement 抓到下一個獲焦元素 + setTimeout(function() { + // 如果目前的焦點不在 $searchArea 裡面,也不是回到觸發的 $orbitLabel 上 + if (!$searchArea.is(':focus-within') && !$(document.activeElement).is($orbitLabel)) { + + // 1. 移除大區塊顯示 + $searchArea.removeClass('show'); + + // 2. 移除子層語言選單顯示 + $searchArea.find('ul').removeClass('show'); + + // 3. 狀態重置為「折疊」供語音報讀 + $orbitLabel.attr('aria-expanded', 'false'); + $langBtn.attr('aria-expanded', 'false'); + } + }, 50); + }); + + // 桌面版 Language 按鈕特殊處理:焦點移入時 + $langBtn.on('focus', function() { + // 確保父層搜尋區塊是顯示的 (針對從別處直接 tab 過來的情況) + $searchArea.addClass('show'); + $(this).attr('aria-expanded', 'true'); + }); + + // 針對手機版 mobile-button (span) 同理處理 + $('.mobile-button').on('focusout', function() { + var $mobileParent = $('#language-li-ul'); + setTimeout(function() { + if (!$mobileParent.is(':focus-within')) { + $mobileParent.find('ul').removeClass('show'); + $('.mobile-button').attr('aria-expanded', 'false'); + } + }, 50); + }); + } + + setTimeout(fixSearchMenuFocusOut, 600); +}); - setTimeout(fixSearchMenuFocusOut, 600); - }); //萬用表格查詢按鈕翻中英 $(document).ready(function () { const lang = $('html').attr('lang'); @@ -2946,13 +3072,6 @@ $(document).ready(function() { // 執行修復功能 fixVideoPosterAlt(); }); -$(document).ready(function () { - setTimeout(function () { - $('iframe.twitter-share-button, iframe.twitter-tweet-button').each(function () { - $(this).attr('title', '分享至 X 在新視窗開啟'); - }); - }, 1500); -}); //網站導覽換icon // $(document).ready(function() { // $('a[href="/zh_tw/sitemap"]').html(''); @@ -2984,6 +3103,19 @@ $(function () { }); }); }); +function fixCarouselBtnA11y() { + setTimeout(function () { + $('.carousel_images .prev-button').attr('aria-label', '上一張').removeAttr('aria-hidden'); + $('.carousel_images .next-button').attr('aria-label', '下一張').removeAttr('aria-hidden'); + + $('.carousel_images .w-ba-banner ~ div .button-mid').remove(); + }, 500); +} +$(document).ready(function () { + setTimeout(function () { + $('.dtr-control').removeAttr('tabindex'); + }, 500); +}); //cycle2無障礙 $(document).ready(function() { // 取得頁面上所有的 Cycle2 輪播圖 @@ -2993,7 +3125,7 @@ $(document).ready(function() { * 核心無障礙狀態刷新函式 */ function refreshCycleA11y($el) { - var $items = $el.find('.w-annc__item, .widget-link__item, [class*="cycle-slide"]'); + var $items = $el.find('.w-annc__item, .widget-link__item, [class*="cycle-slide"], .widget-pic'); $items.each(function() { var $slide = $(this); @@ -3106,6 +3238,103 @@ $(document).ready(function() { }, 500); }); }); +//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'); @@ -3163,74 +3392,165 @@ $(document).ready(function() { }); }); -//cycle2無障礙 -// $(document).ready(function() { -// var $allSlideshows = $('.cycle-slideshow'); +//萬用表格無障礙 +function fixSortLinkA11y() { + $('a').filter(function () { + return $(this).find('.universal-th-icon').length > 0; + }).each(function () { + var $link = $(this); -// function refreshCycleA11y($el) { -// var $items = $el.find('.w-annc__item'); + // === Step 1: 移除 display:none 的 span === + $link.find('span').each(function () { + if ($(this).css('display') === 'none' || $(this).attr('style') && $(this).attr('style').indexOf('display: none') !== -1) { + $(this).remove(); + } + }); -// $items.each(function() { -// var $slide = $(this); + // === Step 2: 取得 aria-label === + var ariaLabel = $link.attr('aria-label') || ''; -// if ($slide.hasClass('cycle-slide-active')) { -// $slide.attr({ -// 'aria-hidden': 'false', -// 'tabindex': '0' -// }); -// $slide.find('a, button, input, [tabindex]').attr('tabindex', '0'); -// } else { -// $slide.attr({ -// 'aria-hidden': 'true', -// 'tabindex': '-1' -// }); -// $slide.find('a, button, input, [tabindex]').attr('tabindex', '-1'); -// } -// }); + // 若 aria-label 空白或含未替換模板變數,從旁邊 .universal-th-text 補 + if (!ariaLabel || ariaLabel.indexOf('{{') !== -1) { + var $th = $link.closest('th, div[class*="col-"]'); + var colName = $th.find('.universal-th-text').text().trim(); + ariaLabel = colName ? '重新排序' + colName : '排序'; + $link.attr('aria-label', ariaLabel); + } -// var $container = $el.closest('.w-annc'); -// var $prevBtn = $container.find('.btn-left'); + // === Step 3: 補上 title 屬性 === + if (!$link.attr('title')) { + $link.attr('title', ariaLabel + '(在本視窗開啟)'); + } -// $el.find('.cycle-slide-active a, .cycle-slide-active button').first() -// .off('keydown.a11y').on('keydown.a11y', function(e) { -// if (e.keyCode === 9 && e.shiftKey) { -// if ($prevBtn.length) { -// e.preventDefault(); -// $prevBtn.focus(); -// } -// } -// }); -// } + // === Step 4: 確保圖示有 aria-hidden === + $link.find('.universal-th-icon').attr('aria-hidden', 'true'); -// $(document).on('keydown', '.btn-right, .btn-left', function(e) { -// if (e.keyCode === 13) { -// var $btn = $(this); -// var $el = $btn.closest('.w-annc').find('.cycle-slideshow'); + // === Step 5: 補上 visually-hidden 連結文字 === + if ($link.find('.visually-hidden').length === 0) { + $link.append('' + ariaLabel + ''); + } + }); +} +function fixSearchInputA11y() { + $('input[type="search"], input[type="text"]').each(function () { + var $input = $(this); -// $el.one('cycle-after', function() { -// // 延長等待時間,確保 Cycle2 已將所有可見項目加上 cycle-slide-active -// setTimeout(function() { -// refreshCycleA11y($el); -// $btn.focus(); -// }, 300); -// }); -// } -// }); + // 已有對應 label 就跳過 + var inputId = $input.attr('id'); + if (inputId && $('label[for="' + inputId + '"]').length) return; -// // cycle-after 事件也延長等待時間 -// $allSlideshows.on('cycle-initialized cycle-after', function() { -// var $this = $(this); -// setTimeout(function() { -// refreshCycleA11y($this); -// }, 300); -// }); + // 已有 aria-label / aria-labelledby / title 就跳過 + if ($input.attr('aria-label') || $input.attr('aria-labelledby') || $input.attr('title')) return; + + // 從 placeholder 取得說明文字 + var placeholder = $input.attr('placeholder') || ''; + + // 從最近的 th 或欄位標題取得欄位名稱 + var colName = ''; + var $th = $input.closest('th, div[class*="col-"]'); + if ($th.length) { + colName = $th.find('.universal-th-text').text().trim(); + } + + // 組合標籤文字 + var label = ''; + if (colName && placeholder) { + label = colName + '搜尋'; + } else if (colName) { + label = colName + '搜尋'; + } else if (placeholder) { + label = placeholder; + } else { + label = '搜尋關鍵字'; + } + + $input.attr('aria-label', label); + $input.attr('title', label); + }); +} +$(document).ready(function () { + setTimeout(function () { + fixSortLinkA11y(); + fixSearchInputA11y(); + }, 500); +}); +//a無障礙空連結 +function removeHiddenContentLinks() { + // 若網址含有 editmode=on 則不執行 + if (window.location.href.indexOf('editmode=on') !== -1) return; + + $('a').each(function () { + var $link = $(this); + + // 若連結本身是 display:none,直接移除 + if ($link.css('display') === 'none') { + $link.remove(); + return; + } + + // 若連結內有子元素,且全部都是 display:none + var $children = $link.children(); + if ($children.length > 0) { + var allHidden = $children.toArray().every(function (child) { + return $(child).css('display') === 'none'; + }); + if (allHidden) { + $link.remove(); + } + } + }); +} +$(document).ready(function () { + setTimeout(removeHiddenContentLinks, 500); +}); +$(document).ready(function () { + if ($('.orbit-bar-search-sign-language').length > 1) { + $('.orbit-bar-search-sign-language').not(':first').remove(); + } + // 1. 先移除 main-content 裡面的重複 orbit-bar + $('#main-content #orbit-bar').remove(); + $('.main-content #orbit-bar').remove(); + + // 2. 移除多餘的 orbit-bar-title(保留第一個) + if ($('.orbit-bar-title').length > 1) { + $('.orbit-bar-title').not(':first').remove(); + } + + // 3. resize 時也防止累積 + $(window).off('resize.orbitbar').on('resize.orbitbar', function () { + if ($('.orbit-bar-title').length > 1) { + $('.orbit-bar-title').not(':first').remove(); + } + }); + +}); +setTimeout(function() { + + // 1. 先移除 main-content 裡面的重複 orbit-bar + $('#main-content #orbit-bar').remove(); + $('.main-content #orbit-bar').remove(); + + // 2. 移除多餘的 orbit-bar-title(保留第一個) + if ($('.orbit-bar-title').length > 1) { + $('.orbit-bar-title').not(':first').remove(); + } + + // 3. resize 時也防止累積 + $(window).off('resize.orbitbar').on('resize.orbitbar', function() { + if ($('.orbit-bar-title').length > 1) { + $('.orbit-bar-title').not(':first').remove(); + } + }); + + // 4. 移除 orbit-bar-logo 裡面重複的 img + $('.orbit-bar-logo').each(function() { + $(this).find('img').not(':first').remove(); + }); + if ($('.orbit-bar-search-sign-language').length > 1) { + $('.orbit-bar-search-sign-language').not(':first').remove(); + } + +}, 600); -// $allSlideshows.each(function() { -// var $this = $(this); -// setTimeout(function() { -// refreshCycleA11y($this); -// }, 500); -// }); -// }); }(jQuery, window)); diff --git a/assets/stylesheets/template/base/_accesskey.scss b/assets/stylesheets/template/base/_accesskey.scss index f08f664..c6cd8cd 100644 --- a/assets/stylesheets/template/base/_accesskey.scss +++ b/assets/stylesheets/template/base/_accesskey.scss @@ -7,10 +7,11 @@ a[accesskey] { } #orbit-bar a[accesskey] { - color: #666666 !important; + color: #fff; margin-left: 0; position: relative; &:hover { color: #ffffff !important; } } + \ No newline at end of file diff --git a/assets/stylesheets/template/base/_global.scss b/assets/stylesheets/template/base/_global.scss index 5d5f6b3..af1b877 100644 --- a/assets/stylesheets/template/base/_global.scss +++ b/assets/stylesheets/template/base/_global.scss @@ -3,12 +3,60 @@ @import "../initial"; @import "variables"; +.fa-classic, .fa-regular, .fa-solid, .far, .fas ,.fa{ + font-family: var(--fa-style-family, "FontAwesome")!important; +} #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; + transition: all 0.2s ease-in-out!important; +} +.orbit-bar-inner{ + li.active { + @media(min-width:768px){ + padding: 0 !important; + } + } +} +// label[for="open-orbit-login"] { +// @media(max-width:768px){ +// display: none!important; +// } +// } +[accesskey="U"],[accesskey="W"]{ + @media(max-width:768px){ + color: #666!important; + } +} +.orbit-bar-inner{ + [accesskey="U"]{ + height: 40px; + display: inline-block!important; + line-height: 40px; + float: left; + @media(min-width:769px){ + color: #fff!important; + } + } + [accesskey="W"]{ + height: 40px; + display: inline-block!important; + line-height: 40px; + float: left; + color: #fff!important; + @media(min-width:769px){ + color: #fff!important; + } + } +} .orbit-bar-search-sign-language{ @media(max-width:767px){ position: absolute !important; @@ -33,9 +81,6 @@ body #orbit-bar .orbit-bar-search-sign-language #search input[type="search"]{ #orbit-bar .orbit-bar-inner > ul > li > ul li{ list-style: none!important; } -li{ - list-style: disc; -} html { font-size: 100%; } diff --git a/assets/stylesheets/template/layout/bo5.scss b/assets/stylesheets/template/layout/bo5.scss index dfaa2ed..c407107 100644 --- a/assets/stylesheets/template/layout/bo5.scss +++ b/assets/stylesheets/template/layout/bo5.scss @@ -214,9 +214,12 @@ a { border-color: #ddd } -.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>a.hover-class,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover,.pagination>.active>span.hover-class { - z-index: 3; +.pagination > .active > a{ color: #fff; +} +.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>a.hover-class,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover,.pagination>.active>span.hover-class { + z-index: 3; + color: #333; cursor: default; } diff --git a/assets/stylesheets/template/layout/content.scss b/assets/stylesheets/template/layout/content.scss index 58cf670..70689be 100644 --- a/assets/stylesheets/template/layout/content.scss +++ b/assets/stylesheets/template/layout/content.scss @@ -201,4 +201,15 @@ .rotated{ transform: rotate(180deg); +} +.sign-up{ + input{ + height:2em!important; + } + .btn-group { + margin-left: 5px !important; + } + .btn-primary:hover{ + color: #14324f!important; + } } \ No newline at end of file diff --git a/assets/stylesheets/template/layout/header.scss b/assets/stylesheets/template/layout/header.scss index 55ef136..96f265a 100644 --- a/assets/stylesheets/template/layout/header.scss +++ b/assets/stylesheets/template/layout/header.scss @@ -254,11 +254,11 @@ a[href="/en/sitemap"]{ .site-logo { margin-right: 0.5em; float: left; - height: 60px; + height: 70px; padding-right: 0.5em; width: auto!important; @media(min-width: 1024px){ - height: 60px; + height: 70px; } @media(max-width: $screen-xs){ height: 45px; diff --git a/assets/stylesheets/template/modules/ad_banner.scss b/assets/stylesheets/template/modules/ad_banner.scss index ae5c900..8ec186e 100644 --- a/assets/stylesheets/template/modules/ad_banner.scss +++ b/assets/stylesheets/template/modules/ad_banner.scss @@ -450,7 +450,7 @@ ul.button-mid{ a i { font-size: 0.75em; } } } - @media(max-width: $screen-sm -1) { + @media(max-width: $screen-sm) { ul.button-mid.next-button, ul.button-mid.prev-button{ top: 35%; transform: translateY(-35%); @@ -462,6 +462,7 @@ ul.button-mid{ // Widget 7 .ba-banner-widget-7 { position: relative; + overflow: hidden; @media(min-width:1024px){ display: flex; flex-direction: row-reverse; diff --git a/assets/stylesheets/template/modules/gallery.scss b/assets/stylesheets/template/modules/gallery.scss index 52eebb4..b58af48 100644 --- a/assets/stylesheets/template/modules/gallery.scss +++ b/assets/stylesheets/template/modules/gallery.scss @@ -563,6 +563,15 @@ } } } + &.index8{ + .index-content-inner img{ + padding: 0; + border: 0; + } + .index-part{ + padding: 1em 0; + } + } } .show-gallery { diff --git a/assets/stylesheets/template/modules/video.scss b/assets/stylesheets/template/modules/video.scss index addbdb6..05b4a2d 100644 --- a/assets/stylesheets/template/modules/video.scss +++ b/assets/stylesheets/template/modules/video.scss @@ -1,6 +1,10 @@ @charset "utf-8"; @import "../initial"; +.video_snapshot_wrap { + position: relative; + padding: 0.2em; +} .video_tablist a{ margin: 0.25em; } diff --git a/assets/stylesheets/template/template.scss b/assets/stylesheets/template/template.scss index 8eaca71..b2d77c2 100644 --- a/assets/stylesheets/template/template.scss +++ b/assets/stylesheets/template/template.scss @@ -97,7 +97,7 @@ input:hover { } @media (min-width: $screen-lg) { - max-width:1280px; + max-width:1400px; padding: 0; } } diff --git a/modules/ad_banner/_ad_banner_widget3.html.erb b/modules/ad_banner/_ad_banner_widget3.html.erb index ca78f9d..fc1d671 100644 --- a/modules/ad_banner/_ad_banner_widget3.html.erb +++ b/modules/ad_banner/_ad_banner_widget3.html.erb @@ -27,16 +27,9 @@ - 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_widget0.html.erb b/modules/gallery/_gallery_widget0.html.erb index 30083b0..1b5947e 100644 --- a/modules/gallery/_gallery_widget0.html.erb +++ b/modules/gallery/_gallery_widget0.html.erb @@ -22,9 +22,9 @@ src="{{thumb-src}}" alt="{{alt_title}}" > + {{link_text}}
- {{link_text}} diff --git a/modules/gallery/_gallery_widget1.5.html.erb b/modules/gallery/_gallery_widget1.5.html.erb index 30083b0..1b5947e 100644 --- a/modules/gallery/_gallery_widget1.5.html.erb +++ b/modules/gallery/_gallery_widget1.5.html.erb @@ -22,9 +22,9 @@ src="{{thumb-src}}" alt="{{alt_title}}" > + {{link_text}}
- {{link_text}} diff --git a/modules/gallery/_gallery_widget1.html.erb b/modules/gallery/_gallery_widget1.html.erb index 4a222ec..806cb1a 100644 --- a/modules/gallery/_gallery_widget1.html.erb +++ b/modules/gallery/_gallery_widget1.html.erb @@ -21,9 +21,10 @@ src="{{thumb-src}}" alt="{{alt_title}}" > + {{link_text}}
- {{link_text}} + diff --git a/modules/gallery/_gallery_widget2.html.erb b/modules/gallery/_gallery_widget2.html.erb index a799bdc..9f7b77f 100644 --- a/modules/gallery/_gallery_widget2.html.erb +++ b/modules/gallery/_gallery_widget2.html.erb @@ -13,10 +13,11 @@ alt="{{alt_title}}" > - +
{{image_description}}
+ {{link_text}}
- {{link_text}} + diff --git a/modules/gallery/_gallery_widget6.html.erb b/modules/gallery/_gallery_widget6.html.erb index 2e71ba0..8b3367a 100644 --- a/modules/gallery/_gallery_widget6.html.erb +++ b/modules/gallery/_gallery_widget6.html.erb @@ -21,9 +21,10 @@ src="{{thumb-src}}" alt="{{alt_title}}" > + {{link_text}}
- {{link_text}} + diff --git a/modules/gallery/_gallery_widget7.html.erb b/modules/gallery/_gallery_widget7.html.erb index 89c8d93..59015a4 100644 --- a/modules/gallery/_gallery_widget7.html.erb +++ b/modules/gallery/_gallery_widget7.html.erb @@ -28,12 +28,11 @@ src="{{thumb-src}}" alt="{{alt_title}}" > +
{{image_description}}
+ {{link_text}}
- -
{{image_description}}
-
- {{link_text}} + diff --git a/modules/gallery/gallery_index1.html.erb b/modules/gallery/gallery_index1.html.erb index e7c011e..05944b3 100644 --- a/modules/gallery/gallery_index1.html.erb +++ b/modules/gallery/gallery_index1.html.erb @@ -4,20 +4,20 @@
-
+
- {{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..72855f8 100644 --- a/modules/gallery/gallery_index2.html.erb +++ b/modules/gallery/gallery_index2.html.erb @@ -5,18 +5,15 @@
- +
- {{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..53240ff 100644 --- a/modules/gallery/gallery_index3.html.erb +++ b/modules/gallery/gallery_index3.html.erb @@ -4,19 +4,16 @@
- +
{{alt_title}}
-
-
-

- {{album-name}} -

+
+

{{album-name}}

+
-
- +
diff --git a/modules/gallery/gallery_index4.html.erb b/modules/gallery/gallery_index4.html.erb index 0067a40..565d191 100644 --- a/modules/gallery/gallery_index4.html.erb +++ b/modules/gallery/gallery_index4.html.erb @@ -5,17 +5,14 @@ diff --git a/modules/gallery/gallery_index5.html.erb b/modules/gallery/gallery_index5.html.erb index 7ccc955..cb36dde 100644 --- a/modules/gallery/gallery_index5.html.erb +++ b/modules/gallery/gallery_index5.html.erb @@ -5,7 +5,7 @@ diff --git a/modules/gallery/gallery_index6.html.erb b/modules/gallery/gallery_index6.html.erb index 9d21410..a435d02 100644 --- a/modules/gallery/gallery_index6.html.erb +++ b/modules/gallery/gallery_index6.html.erb @@ -6,18 +6,15 @@ diff --git a/modules/gallery/gallery_index7.html.erb b/modules/gallery/gallery_index7.html.erb index 20a0ef1..d632572 100644 --- a/modules/gallery/gallery_index7.html.erb +++ b/modules/gallery/gallery_index7.html.erb @@ -4,20 +4,17 @@
- +
{{alt_title}}
-
-

- {{album-name}} -

+

{{album-name}}

{{album-description}}
+
-
diff --git a/modules/gallery/gallery_index8.html.erb b/modules/gallery/gallery_index8.html.erb index 4f65ef4..0d95d3a 100644 --- a/modules/gallery/gallery_index8.html.erb +++ b/modules/gallery/gallery_index8.html.erb @@ -4,20 +4,16 @@
- +
- {{alt_title}} + {{album-name}}
-
-

- {{album-name}} -

- +

{{album-name}}

+
-
diff --git a/modules/gallery/show.html.erb b/modules/gallery/show.html.erb index 62d89b0..96dbae8 100644 --- a/modules/gallery/show.html.erb +++ b/modules/gallery/show.html.erb @@ -26,4 +26,17 @@ width:100%; } } - \ No newline at end of file + + \ No newline at end of file diff --git a/modules/video_pro/video_pro_index2_tag.html.erb b/modules/video_pro/video_pro_index2_tag.html.erb index 78c4a30..0693fa1 100644 --- a/modules/video_pro/video_pro_index2_tag.html.erb +++ b/modules/video_pro/video_pro_index2_tag.html.erb @@ -124,7 +124,7 @@ padding: 10px 0; text-align: center; background-color: #8d681e; - color: #fff; + color: #333; text-decoration: none; font-size: 120%; } diff --git a/modules/video_pro/video_pro_index4.html.erb b/modules/video_pro/video_pro_index4.html.erb index a9159e8..f3038a5 100644 --- a/modules/video_pro/video_pro_index4.html.erb +++ b/modules/video_pro/video_pro_index4.html.erb @@ -13,8 +13,8 @@
{{video_tag}}
{{video_postdate}}
- - +
{{video_title}}
+
{{video_desc}}
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 @@