From 03059824873f17828775ed37066272977e0c8c19 Mon Sep 17 00:00:00 2001 From: palewire Date: Sat, 20 Nov 2021 10:39:54 -0800 Subject: [PATCH 1/6] meta specific accessibility fixes --- _includes/documentation.html | 2 +- _layouts/default.html | 2 +- _layouts/page_md.html | 2 +- css/cardlist.css | 2 +- events.md | 2 +- hub.md | 1 + js/bootstrap.js | 339 ++++++++++++++++++++--------------- js/bootstrap.min.js | 10 +- 8 files changed, 208 insertions(+), 152 deletions(-) diff --git a/_includes/documentation.html b/_includes/documentation.html index f8043567..282a9f4b 100644 --- a/_includes/documentation.html +++ b/_includes/documentation.html @@ -6,7 +6,7 @@
-

{{card[0]}}

+

{{card[0]}}

    diff --git a/_layouts/default.html b/_layouts/default.html index d68a37bc..be88b0e8 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -1,5 +1,5 @@ - + {% include head.html %} diff --git a/_layouts/page_md.html b/_layouts/page_md.html index a6ce470e..86a4c95c 100644 --- a/_layouts/page_md.html +++ b/_layouts/page_md.html @@ -4,7 +4,7 @@
    {% if page.title_image %} - + {% else %}

    {{ page.title }}

    {% endif %} diff --git a/css/cardlist.css b/css/cardlist.css index a6510916..d64919f7 100755 --- a/css/cardlist.css +++ b/css/cardlist.css @@ -27,7 +27,7 @@ border-top-right-radius: 2px; } -.card-heading h4 { +.card-heading h2 { font-size: 1.6em; } diff --git a/events.md b/events.md index 173cc815..035590e4 100644 --- a/events.md +++ b/events.md @@ -13,7 +13,7 @@ This page is for in person, one-of-a-kind events, for community engagement, see This is a calendar of regular online events. It might not be exhaustive. - + See [this page](https://jupyter.readthedocs.io/en/latest/community/content-community.html#jupyter-wide-meetings) for diff --git a/hub.md b/hub.md index 330647a6..dac8401e 100644 --- a/hub.md +++ b/hub.md @@ -2,6 +2,7 @@ layout: page_md title: JupyterHub title_image: assets/hublogo.svg +title_image_alt: JupyterHub logo tagline: A multi-user version of the notebook designed for companies, classrooms and research labs navbar_jupytercon: true cfp: true diff --git a/js/bootstrap.js b/js/bootstrap.js index a60cc180..8a2e99a5 100755 --- a/js/bootstrap.js +++ b/js/bootstrap.js @@ -1,7 +1,7 @@ /*! - * Bootstrap v3.3.4 (https://getbootstrap.com) - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * Bootstrap v3.3.7 (http://getbootstrap.com) + * Copyright 2011-2016 Twitter, Inc. + * Licensed under the MIT license */ if (typeof jQuery === 'undefined') { @@ -11,29 +11,24 @@ if (typeof jQuery === 'undefined') { +function ($) { 'use strict'; var version = $.fn.jquery.split(' ')[0].split('.') - if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1)) { - throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher') + if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 3)) { + throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4') } }(jQuery); /* ======================================================================== - * Bootstrap: transition.js v3.3.4 - * https://getbootstrap.com/javascript/#transitions + * Bootstrap: transition.js v3.3.7 + * http://getbootstrap.com/javascript/#transitions * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. + * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ -if($('.navbar').length > 0){ - $(window).on("scroll load resize", function(){ - checkScroll(); - }); -} +function ($) { 'use strict'; - // CSS TRANSITION SUPPORT (Shoutout: https://www.modernizr.com/) + // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) // ============================================================ function transitionEnd() { @@ -55,7 +50,7 @@ if($('.navbar').length > 0){ return false // explicit for ie8 ( ._.) } - // https://blog.alexmaccaw.com/css-transitions + // http://blog.alexmaccaw.com/css-transitions $.fn.emulateTransitionEnd = function (duration) { var called = false var $el = this @@ -82,10 +77,10 @@ if($('.navbar').length > 0){ }(jQuery); /* ======================================================================== - * Bootstrap: alert.js v3.3.4 - * https://getbootstrap.com/javascript/#alerts + * Bootstrap: alert.js v3.3.7 + * http://getbootstrap.com/javascript/#alerts * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. + * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ @@ -101,7 +96,7 @@ if($('.navbar').length > 0){ $(el).on('click', dismiss, this.close) } - Alert.VERSION = '3.3.4' + Alert.VERSION = '3.3.7' Alert.TRANSITION_DURATION = 150 @@ -114,7 +109,7 @@ if($('.navbar').length > 0){ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 } - var $parent = $(selector) + var $parent = $(selector === '#' ? [] : selector) if (e) e.preventDefault() @@ -177,10 +172,10 @@ if($('.navbar').length > 0){ }(jQuery); /* ======================================================================== - * Bootstrap: button.js v3.3.4 - * https://getbootstrap.com/javascript/#buttons + * Bootstrap: button.js v3.3.7 + * http://getbootstrap.com/javascript/#buttons * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. + * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ @@ -197,7 +192,7 @@ if($('.navbar').length > 0){ this.isLoading = false } - Button.VERSION = '3.3.4' + Button.VERSION = '3.3.7' Button.DEFAULTS = { loadingText: 'loading...' @@ -209,7 +204,7 @@ if($('.navbar').length > 0){ var val = $el.is('input') ? 'val' : 'html' var data = $el.data() - state = state + 'Text' + state += 'Text' if (data.resetText == null) $el.data('resetText', $el[val]()) @@ -219,10 +214,10 @@ if($('.navbar').length > 0){ if (state == 'loadingText') { this.isLoading = true - $el.addClass(d).attr(d, d) + $el.addClass(d).attr(d, d).prop(d, true) } else if (this.isLoading) { this.isLoading = false - $el.removeClass(d).removeAttr(d) + $el.removeClass(d).removeAttr(d).prop(d, false) } }, this), 0) } @@ -234,15 +229,19 @@ if($('.navbar').length > 0){ if ($parent.length) { var $input = this.$element.find('input') if ($input.prop('type') == 'radio') { - if ($input.prop('checked') && this.$element.hasClass('active')) changed = false - else $parent.find('.active').removeClass('active') + if ($input.prop('checked')) changed = false + $parent.find('.active').removeClass('active') + this.$element.addClass('active') + } else if ($input.prop('type') == 'checkbox') { + if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false + this.$element.toggleClass('active') } - if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change') + $input.prop('checked', this.$element.hasClass('active')) + if (changed) $input.trigger('change') } else { this.$element.attr('aria-pressed', !this.$element.hasClass('active')) + this.$element.toggleClass('active') } - - if (changed) this.$element.toggleClass('active') } @@ -282,10 +281,15 @@ if($('.navbar').length > 0){ $(document) .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) { - var $btn = $(e.target) - if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') + var $btn = $(e.target).closest('.btn') Plugin.call($btn, 'toggle') - e.preventDefault() + if (!($(e.target).is('input[type="radio"], input[type="checkbox"]'))) { + // Prevent double click on radios, and the double selections (so cancellation) on checkboxes + e.preventDefault() + // The target component still receive the focus + if ($btn.is('input,button')) $btn.trigger('focus') + else $btn.find('input:visible,button:visible').first().trigger('focus') + } }) .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) { $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type)) @@ -294,10 +298,10 @@ if($('.navbar').length > 0){ }(jQuery); /* ======================================================================== - * Bootstrap: carousel.js v3.3.4 - * https://getbootstrap.com/javascript/#carousel + * Bootstrap: carousel.js v3.3.7 + * http://getbootstrap.com/javascript/#carousel * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. + * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ @@ -325,7 +329,7 @@ if($('.navbar').length > 0){ .on('mouseleave.bs.carousel', $.proxy(this.cycle, this)) } - Carousel.VERSION = '3.3.4' + Carousel.VERSION = '3.3.7' Carousel.TRANSITION_DURATION = 600 @@ -532,13 +536,14 @@ if($('.navbar').length > 0){ }(jQuery); /* ======================================================================== - * Bootstrap: collapse.js v3.3.4 - * https://getbootstrap.com/javascript/#collapse + * Bootstrap: collapse.js v3.3.7 + * http://getbootstrap.com/javascript/#collapse * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. + * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ +/* jshint latedef: false */ +function ($) { 'use strict'; @@ -562,7 +567,7 @@ if($('.navbar').length > 0){ if (this.options.toggle) this.toggle() } - Collapse.VERSION = '3.3.4' + Collapse.VERSION = '3.3.7' Collapse.TRANSITION_DURATION = 350 @@ -744,10 +749,10 @@ if($('.navbar').length > 0){ }(jQuery); /* ======================================================================== - * Bootstrap: dropdown.js v3.3.4 - * https://getbootstrap.com/javascript/#dropdowns + * Bootstrap: dropdown.js v3.3.7 + * http://getbootstrap.com/javascript/#dropdowns * ======================================================================== - * Copyright 2011-2015 Twitter, Inc. + * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ @@ -764,7 +769,41 @@ if($('.navbar').length > 0){ $(element).on('click.bs.dropdown', this.toggle) } - Dropdown.VERSION = '3.3.4' + Dropdown.VERSION = '3.3.7' + + function getParent($this) { + var selector = $this.attr('data-target') + + if (!selector) { + selector = $this.attr('href') + selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 + } + + var $parent = selector && $(selector) + + return $parent && $parent.length ? $parent : $this.parent() + } + + function clearMenus(e) { + if (e && e.which === 3) return + $(backdrop).remove() + $(toggle).each(function () { + var $this = $(this) + var $parent = getParent($this) + var relatedTarget = { relatedTarget: this } + + if (!$parent.hasClass('open')) return + + if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return + + $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget)) + + if (e.isDefaultPrevented()) return + + $this.attr('aria-expanded', 'false') + $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget)) + }) + } Dropdown.prototype.toggle = function (e) { var $this = $(this) @@ -779,7 +818,10 @@ if($('.navbar').length > 0){ if (!isActive) { if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { // if mobile we use a backdrop because click events don't delegate - $('