From 2340791f2f3d1487f79b6eefc6dd617424e552ea Mon Sep 17 00:00:00 2001 From: Kevin Abel <kevin.abel.0@gmail.com> Date: Tue, 22 Apr 2014 14:58:42 -0500 Subject: [PATCH] Fix a11y issues with color and Google provided markup. --- www/js/search.js | 17 +++++++++++++++-- www/less/search.less | 12 ++++++++---- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/www/js/search.js b/www/js/search.js index d34bf67..312e91c 100644 --- a/www/js/search.js +++ b/www/js/search.js @@ -146,8 +146,18 @@ } }, queryComplete = function(control) { - $(control.root).closest(resultSel).addClass(actCls).end() - .closest(googleSel).slideDown(); + var $root = $(control.root); + + // a11y patching + $('img.gs-image', $root).each(function() { + if (!this.alt) { + this.alt = $(this).closest('.gsc-table-result').find('.gs-title').first().text(); + } + }); + $('img.gcsc-branding-img-noclear', $root).attr('alt', 'Googleâ„¢'); + + $root.closest(resultSel).addClass(actCls); + $root.closest(googleSel).slideDown(); }, fullQuery = function(q, track) { if (track !== false) { @@ -225,6 +235,9 @@ localSearch.draw(localResults, drawOp); } + // a11y patch Google search box + $('form.gsc-search-box').remove(); + // setup the tab-like result filters $('li:first-child', $resTabs).addClass(selCls); $($resTabs).on('click', 'li', function(e) { diff --git a/www/less/search.less b/www/less/search.less index e06929d..e956191 100644 --- a/www/less/search.less +++ b/www/less/search.less @@ -311,6 +311,10 @@ form .input-group { display: block; border: 0; } + + .on-campus-dialing { + color: @light-neutral; + } } // Google Styles @@ -339,14 +343,14 @@ form .input-group { } a.gs-visibleUrl, .gs-visibleUrl { - color: #897b42; + color: @light-neutral; } } .gsc-result-info { font-style: italic; margin: 0 0 10px; - color: #897b42; + color: @ui08; } .gsc-results { @@ -370,7 +374,7 @@ form .input-group { .gsc-cursor-current-page { font-weight: normal; - color: @ui07; + color: @ui08; border: 0; } } @@ -386,7 +390,7 @@ td.gcsc-branding-text { div.gcsc-branding-text { text-align: left; - color: @ui07; + color: @ui08; } } -- GitLab