update
This commit is contained in:
parent
2d33b209d3
commit
b62934a8a0
|
|
@ -2240,6 +2240,14 @@ $(document).ready(function() {
|
|||
// if($('.show-announcement').hasClass('show-announcement')) {
|
||||
// $('.').css('', '');
|
||||
// }
|
||||
$(function() {
|
||||
var $headerNav = $('.header-nav');
|
||||
$headerNav.contents().each(function() {
|
||||
if (this.nodeType === 3 && this.nodeValue.trim() === '|') {
|
||||
$(this).remove();
|
||||
}
|
||||
});
|
||||
});
|
||||
$('a').each(function () {
|
||||
const $a = $(this);
|
||||
|
||||
|
|
@ -2345,7 +2353,7 @@ $(document).ready(function() {
|
|||
if ($(window).width() <769) {
|
||||
$('.modules-menu-level-0').after($('.header-nav'));
|
||||
}else{
|
||||
$('.navbar-header').before($('.header-nav'));
|
||||
$('.navbar-header').after($('.header-nav'));
|
||||
};
|
||||
$('.sitemenu-vertical .sitemenu-dropdown-toggle').click(function(){
|
||||
$('.sitemenu-vertical .dropdown-menu').slideToggle();
|
||||
|
|
@ -2413,7 +2421,7 @@ $(document).ready(function() {
|
|||
|
||||
$('.modules-menu-level-0').after($('.header-nav'));
|
||||
}else{
|
||||
$('.navbar-header').before($('.header-nav'));
|
||||
$('.navbar-header').after($('.header-nav'));
|
||||
};
|
||||
|
||||
if ($(window).width() > 821) {
|
||||
|
|
@ -3280,7 +3288,114 @@ $(document).ready(function () {
|
|||
// 比 fixAccessibilityAll 的 800ms 晚,確保最後執行
|
||||
setTimeout(fixGalleryViewLinkA11y, 2000);
|
||||
});
|
||||
function fixTicketHistoryStatusA11y() {
|
||||
var $form = $('#check_history_form');
|
||||
if (!$form.length) return;
|
||||
|
||||
// 建立 role=status 播報區(若不存在)
|
||||
if (!$('#ticket-history-result-status').length) {
|
||||
$form.after('<div id="ticket-history-result-status" role="status" aria-live="polite" aria-atomic="true" class="visually-hidden"></div>');
|
||||
}
|
||||
|
||||
var $statusBox = $('#ticket-history-result-status');
|
||||
|
||||
// MutationObserver 監聽 #history_area 的變化
|
||||
var $historyArea = $('#history_area');
|
||||
if (!$historyArea.length) return;
|
||||
|
||||
var observer = new MutationObserver(function () {
|
||||
var $noRecord = $historyArea.find('span.translation_missing');
|
||||
if ($noRecord.length) {
|
||||
// 取得文字(顯示文字或 title 屬性)
|
||||
var msg = $noRecord.text().trim() || $noRecord.attr('title') || 'No History Records';
|
||||
|
||||
// 把訊息寫入 role=status 區塊觸發播報
|
||||
$statusBox.text('').text(msg);
|
||||
|
||||
// 同時在 span 上加 role=status(雙保險)
|
||||
if ($noRecord.attr('role') !== 'status') {
|
||||
$noRecord.attr('role', 'status').attr('aria-live', 'polite').attr('aria-atomic', 'true');
|
||||
}
|
||||
} else {
|
||||
// 有查到結果時清空播報區
|
||||
$statusBox.text('');
|
||||
}
|
||||
});
|
||||
|
||||
observer.observe($historyArea[0], {
|
||||
childList: true,
|
||||
subtree: true
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
setTimeout(fixTicketHistoryStatusA11y, 500);
|
||||
});
|
||||
$(function() {
|
||||
function fixSitemenuLinkA11y() {
|
||||
setTimeout(function() {
|
||||
$('.sitemenu-list.level-1 .sitemenu-link.level-1').each(function() {
|
||||
var $a = $(this);
|
||||
var href = $a.attr('href') || '';
|
||||
|
||||
if (!href.includes('#collapse')) return;
|
||||
|
||||
var collapseId = href.split('#')[1];
|
||||
var $target = $('#' + collapseId);
|
||||
var linkText = $a.text().replace(/\s+/g, ' ').trim();
|
||||
var isExpanded = $target.hasClass('in') || $target.attr('aria-expanded') === 'true';
|
||||
|
||||
$a.attr('title', linkText + ',' + (isExpanded ? '點擊收合內容' : '點擊展開內容'));
|
||||
$a.attr('aria-expanded', isExpanded ? 'true' : 'false');
|
||||
$a.attr('aria-controls', collapseId);
|
||||
// ✅ 新增:補上 role="button",讓螢幕閱讀器播報為按鈕而非連結
|
||||
$a.attr('role', 'button');
|
||||
});
|
||||
|
||||
$('.sitemenu-list.level-1 .sitemenu-link.level-1').on('click', function() {
|
||||
var $a = $(this);
|
||||
var href = $a.attr('href') || '';
|
||||
if (!href.includes('#collapse')) return;
|
||||
|
||||
var collapseId = href.split('#')[1];
|
||||
var $target = $('#' + collapseId);
|
||||
var linkText = $a.text().replace(/\s+/g, ' ').trim();
|
||||
|
||||
setTimeout(function() {
|
||||
var isExpanded = $target.hasClass('in');
|
||||
$a.attr('aria-expanded', isExpanded ? 'true' : 'false');
|
||||
$a.attr('title', linkText + ',' + (isExpanded ? '點擊收合內容' : '點擊展開內容'));
|
||||
}, 400);
|
||||
});
|
||||
|
||||
// ✅ 同步處理右側主內容區的展開收合按鈕
|
||||
$('#index-archive-group .panel-title a[data-toggle="collapse"]').each(function() {
|
||||
var $a = $(this);
|
||||
var linkText = $a.text().replace(/\s+/g, ' ').trim();
|
||||
var isExpanded = $a.attr('aria-expanded') === 'true';
|
||||
|
||||
// ✅ 移除「在本視窗開啟」,改為展開/收合說明
|
||||
$a.attr('title', linkText + ',' + (isExpanded ? '點擊收合內容' : '點擊展開內容'));
|
||||
// ✅ 補上 role="button"
|
||||
$a.attr('role', 'button');
|
||||
});
|
||||
|
||||
// ✅ 右側按鈕點擊後同步更新 title
|
||||
$('#index-archive-group .panel-title a[data-toggle="collapse"]').on('click', function() {
|
||||
var $a = $(this);
|
||||
var linkText = $a.text().replace(/\s+/g, ' ').trim();
|
||||
|
||||
setTimeout(function() {
|
||||
var isExpanded = $a.attr('aria-expanded') === 'true';
|
||||
$a.attr('title', linkText + ',' + (isExpanded ? '點擊收合內容' : '點擊展開內容'));
|
||||
}, 400);
|
||||
});
|
||||
|
||||
}, 500);
|
||||
}
|
||||
|
||||
fixSitemenuLinkA11y();
|
||||
});
|
||||
// 執行 member等高計算,目前改用flexbox故mark掉 by ika 20160105
|
||||
// $(window).load(function() {
|
||||
// if ($('.index-member-3').length && $(window).width() > 992) {
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
right: 0;
|
||||
width: 29%;
|
||||
padding-top:5em!important;
|
||||
top:0;
|
||||
}
|
||||
ul{
|
||||
padding: 0;
|
||||
|
|
|
|||
|
|
@ -21,10 +21,7 @@
|
|||
|
||||
<div class="outdropdowns kenjohn ">
|
||||
<div class="dropdowns container">
|
||||
<div class="header-nav no-print">
|
||||
<a id="accesskey_top" accesskey="U" title="accesskey top" href="#" title="Toolbar">:::</a>
|
||||
{{header-data}}
|
||||
</div>
|
||||
|
||||
<div class=" navbar-header">
|
||||
<a title="{{site_title_1}}" class="navbar-brand" href="{{home_link_1}}"><img class="site-logo" src="{{logo_url_1}}" alt="site-logo"></a>
|
||||
<script>$(document).ready(function(){var url =$('.site-logo').eq(0).attr('src');if(url == "/assets/default-site-logo.png"){$('.navbar-brand').eq(0).remove();};if($('.navbar-brand').length == 2){$('.site-logo').css('height','auto')};$('.site-logo').eq(0).css('margin-right',0);$('.navbar-brand').css('padding-right',0)})</script>
|
||||
|
|
@ -35,7 +32,11 @@
|
|||
<span class="icon-bar icon-bar-middle"></span>
|
||||
<span class="icon-bar icon-bar-bottom"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="header-nav no-print">
|
||||
<a id="accesskey_top" accesskey="U" title="accesskey top" href="#" title="Toolbar">:::</a>
|
||||
{{header-data}}
|
||||
</div>
|
||||
<div class="collapse navbar-collapse modules-menu" id="layout-navigation">
|
||||
<a id="accesskey_menu" title="accesskey menu" accesskey="M" href="#" title="Main menu">:::</a>
|
||||
<%= render_menu %>
|
||||
|
|
|
|||
Loading…
Reference in New Issue