mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 01:33:04 +00:00
browser: remove IE11 errors #452
This commit is contained in:
parent
7722748432
commit
5b9389fde2
7 changed files with 25 additions and 17 deletions
|
@ -28,7 +28,7 @@ This document shows you what's new in the latest release. For a detailed list of
|
||||||
<script src="{{"js/jquery.min.js"| relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
<script src="{{"js/jquery.min.js"| relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" defer></script>
|
||||||
````
|
````
|
||||||
|
|
||||||
- {{% badge style="note" title=" " %}}Change{{% /badge %}} In the effort to comply with WCAG standards, the implementation of the [`expand` shortcode]({{% relref "shortcodes/expand" %}}) was changed. The functionality of the new implementation does not work with old browsers (Internet Explorer 11).
|
- {{% badge style="note" title=" " %}}Change{{% /badge %}} In the effort to comply with WCAG standards, the implementation of the [`expand` shortcode]({{% relref "shortcodes/expand" %}}) was changed. While Internet Explorer 11 has issues in displaying it, the functionality still works.
|
||||||
|
|
||||||
- {{% badge style="note" title=" " %}}Change{{% /badge %}} The JavaScript code for handling image lightboxes (provided by [Featherlight](https://noelboss.github.io/featherlight)) was replaced by a CSS-only solution.
|
- {{% badge style="note" title=" " %}}Change{{% /badge %}} The JavaScript code for handling image lightboxes (provided by [Featherlight](https://noelboss.github.io/featherlight)) was replaced by a CSS-only solution.
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ The `expand` shortcode displays an expandable/collapsible section of text.
|
||||||
{{% expand title="Expand me..." %}}Thank you!{{% /expand %}}
|
{{% expand title="Expand me..." %}}Thank you!{{% /expand %}}
|
||||||
|
|
||||||
{{% notice note %}}
|
{{% notice note %}}
|
||||||
This only works in modern browsers.
|
This only works in modern browsers flawlessly. While Internet Explorer 11 has issues in displaying it, the functionality still works.
|
||||||
{{% /notice %}}
|
{{% /notice %}}
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
|
@ -72,7 +72,7 @@
|
||||||
<span class="nav nav-next"><i class="fa fa-chevron-right fa-fw"></i></span>
|
<span class="nav nav-next"><i class="fa fa-chevron-right fa-fw"></i></span>
|
||||||
{{- else }}
|
{{- else }}
|
||||||
{{- with ($.Scratch.Get "relearnNextPage") }}
|
{{- with ($.Scratch.Get "relearnNextPage") }}
|
||||||
<a class="nav nav-next" href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}" title="{{.Title}} (🡒)"><i class="fas fa-chevron-right fa-fw"></i></a>
|
<a class="nav nav-next topbar-link" href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}" title="{{.Title}} (🡒)"><i class="fas fa-chevron-right fa-fw"></i></a>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
</div>
|
</div>
|
||||||
|
@ -81,18 +81,18 @@
|
||||||
<span class="nav nav-prev"><i class="fa fa-chevron-left fa-fw"></i></span>
|
<span class="nav nav-prev"><i class="fa fa-chevron-left fa-fw"></i></span>
|
||||||
{{- else if or (ne $outputFormat "html") (eq .Page.Kind "taxonomy") (eq .Page.Kind "term") (not (and $ispublished ($.Scratch.Get "relearnPrevPage"))) }}
|
{{- else if or (ne $outputFormat "html") (eq .Page.Kind "taxonomy") (eq .Page.Kind "term") (not (and $ispublished ($.Scratch.Get "relearnPrevPage"))) }}
|
||||||
{{- with .Site.Home }}
|
{{- with .Site.Home }}
|
||||||
<a class="nav nav-prev" href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}" title="{{.Title}} (🡐)"><i class="fas fa-chevron-left fa-fw"></i></a>
|
<a class="nav nav-prev topbar-link" href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}" title="{{.Title}} (🡐)"><i class="fas fa-chevron-left fa-fw"></i></a>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
{{- with ($.Scratch.Get "relearnPrevPage") }}
|
{{- with ($.Scratch.Get "relearnPrevPage") }}
|
||||||
<a class="nav nav-prev" href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}" title="{{.Title}} (🡐)"><i class="fas fa-chevron-left fa-fw"></i></a>
|
<a class="nav nav-prev topbar-link" href="{{ partial "relLangPrettyUglyURL.hugo" (dict "to" .) }}" title="{{.Title}} (🡐)"><i class="fas fa-chevron-left fa-fw"></i></a>
|
||||||
{{- end}}
|
{{- end}}
|
||||||
{{- end}}
|
{{- end}}
|
||||||
</div>
|
</div>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with and (eq $outputFormat "html") (.OutputFormats.Get "PRINT") }}
|
{{- with and (eq $outputFormat "html") (.OutputFormats.Get "PRINT") }}
|
||||||
<div id="top-print-link">
|
<div id="top-print-link">
|
||||||
<a class="print-link" title='{{ T "Print-this-chapter" }} (CTRL+ALT+p)' href="{{ .RelPermalink }}">
|
<a class="print-link topbar-link" title='{{ T "Print-this-chapter" }} (CTRL+ALT+p)' href="{{ .RelPermalink }}">
|
||||||
<i class="fas fa-print fa-fw"></i>
|
<i class="fas fa-print fa-fw"></i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -100,7 +100,7 @@
|
||||||
{{- if and (eq $outputFormat "html") .Site.Params.editURL $File }}
|
{{- if and (eq $outputFormat "html") .Site.Params.editURL $File }}
|
||||||
{{- with $File.Path }}
|
{{- with $File.Path }}
|
||||||
<div id="top-github-link">
|
<div id="top-github-link">
|
||||||
<a class="github-link" title='{{ T "Edit-this-page" }} (CTRL+ALT+w)' href="{{ $Site.Params.editURL }}{{ strings.TrimLeft "/" (replace $File.Dir "\\" "/") }}{{ $File.LogicalName }}" target="_blank">
|
<a class="github-link topbar-link" title='{{ T "Edit-this-page" }} (CTRL+ALT+w)' href="{{ $Site.Params.editURL }}{{ strings.TrimLeft "/" (replace $File.Dir "\\" "/") }}{{ $File.LogicalName }}" target="_blank">
|
||||||
<i class="fas fa-pen fa-fw"></i>
|
<i class="fas fa-pen fa-fw"></i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -112,7 +112,7 @@
|
||||||
{{- $toc := and $hastoc (not $currentDisableToc) (eq $outputFormat "html") }}
|
{{- $toc := and $hastoc (not $currentDisableToc) (eq $outputFormat "html") }}
|
||||||
<div id="breadcrumbs">
|
<div id="breadcrumbs">
|
||||||
<span id="sidebar-toggle-span">
|
<span id="sidebar-toggle-span">
|
||||||
<a href="#" id="sidebar-toggle" title='{{ T "Navigation-toggle" }} (CTRL+ALT+n)'><i class="fas fa-bars fa-fw"></i></a>
|
<a href="#" id="sidebar-toggle" class="topbar-link" title='{{ T "Navigation-toggle" }} (CTRL+ALT+n)'><i class="fas fa-bars fa-fw"></i></a>
|
||||||
</span>
|
</span>
|
||||||
{{- if $toc }}
|
{{- if $toc }}
|
||||||
<span id="toc-menu" title='{{ T "Toc-toggle" }} (CTRL+ALT+t)'><i class="fas fa-list-alt fa-fw"></i></span>
|
<span id="toc-menu" title='{{ T "Toc-toggle" }} (CTRL+ALT+t)'><i class="fas fa-list-alt fa-fw"></i></span>
|
||||||
|
|
|
@ -35,12 +35,12 @@
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- $id := partial "make-random-md5.hugo" }}
|
{{- $id := partial "make-random-md5.hugo" }}
|
||||||
{{- if $lightbox }}
|
{{- if $lightbox }}
|
||||||
<a href="#image-{{ $id }}">
|
<a class="lightbox-link" href="#image-{{ $id }}">
|
||||||
{{- end }}
|
{{- end }}
|
||||||
<img src="{{ $url | safeURL }}" alt="{{ $alt }}"{{ with $title }} title="{{ . }}"{{ end }}{{ if len ($classes) }} class="{{ delimit $classes " " }}"{{ end }} style="height: {{ $height }}; width: {{ $width }};" loading="lazy">
|
<img src="{{ $url | safeURL }}" alt="{{ $alt }}"{{ with $title }} title="{{ . }}"{{ end }}{{ if len ($classes) }} class="{{ delimit $classes " " }}"{{ end }} style="height: {{ $height }}; width: {{ $width }};" loading="lazy">
|
||||||
{{- if $lightbox }}
|
{{- if $lightbox }}
|
||||||
</a>
|
</a>
|
||||||
<a href="javascript:history.back();" class="lightbox" id="image-{{ $id }}">
|
<a href="javascript:history.back();" class="lightbox" id="image-{{ $id }}">
|
||||||
<img src="{{ $url | safeURL }}" alt="{{ $alt }}"{{ with $title }} title="{{ . }}"{{ end }}loading="lazy">
|
<img class="lightbox-image" src="{{ $url | safeURL }}" alt="{{ $alt }}"{{ with $title }} title="{{ . }}"{{ end }}loading="lazy">
|
||||||
</a>
|
</a>
|
||||||
{{- end }}
|
{{- end }}
|
|
@ -313,7 +313,7 @@ dd {
|
||||||
z-index: 70;
|
z-index: 70;
|
||||||
}
|
}
|
||||||
|
|
||||||
#body img,
|
#body img:not(.lightbox-image),
|
||||||
#body img.center,
|
#body img.center,
|
||||||
#body .video-container {
|
#body .video-container {
|
||||||
display: block;
|
display: block;
|
||||||
|
|
|
@ -382,7 +382,7 @@ function initCodeClipboard(){
|
||||||
var span = document.createElement( 'span' );
|
var span = document.createElement( 'span' );
|
||||||
span.classList.add( 'copy-to-clipboard' );
|
span.classList.add( 'copy-to-clipboard' );
|
||||||
span.appendChild( clone );
|
span.appendChild( clone );
|
||||||
code.replaceWith( span );
|
parent.replaceChild( span, code );
|
||||||
code = clone;
|
code = clone;
|
||||||
}
|
}
|
||||||
var button = document.createElement( 'span' );
|
var button = document.createElement( 'span' );
|
||||||
|
@ -394,7 +394,7 @@ function initCodeClipboard(){
|
||||||
this.removeAttribute( 'aria-label' );
|
this.removeAttribute( 'aria-label' );
|
||||||
this.classList.remove( 'tooltipped', 'tooltipped-w', 'tooltipped-se', 'tooltipped-sw' );
|
this.classList.remove( 'tooltipped', 'tooltipped-w', 'tooltipped-se', 'tooltipped-sw' );
|
||||||
});
|
});
|
||||||
code.after( button );
|
parent.insertBefore( button, code.nextSibling );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -816,12 +816,12 @@ function scrollToFragment() {
|
||||||
|
|
||||||
function mark() {
|
function mark() {
|
||||||
// mark some additional stuff as searchable
|
// mark some additional stuff as searchable
|
||||||
var topbarLinks = document.querySelectorAll( '#topbar a:not(:has(img)):not(.btn)' );
|
var topbarLinks = document.querySelectorAll( '#topbar a:not(.topbar-link):not(.btn)' );
|
||||||
for( var i = 0; i < topbarLinks.length; i++ ){
|
for( var i = 0; i < topbarLinks.length; i++ ){
|
||||||
topbarLinks[i].classList.add( 'highlight' );
|
topbarLinks[i].classList.add( 'highlight' );
|
||||||
}
|
}
|
||||||
|
|
||||||
var bodyInnerLinks = document.querySelectorAll( '#body-inner a:not(:has(img)):not(.btn):not(.lightbox):not(a[rel="footnote"])' );
|
var bodyInnerLinks = document.querySelectorAll( '#body-inner a:not(.lightbox-link):not(.btn):not(.lightbox):not(a[rel="footnote"])' );
|
||||||
for( var i = 0; i < bodyInnerLinks.length; i++ ){
|
for( var i = 0; i < bodyInnerLinks.length; i++ ){
|
||||||
bodyInnerLinks[i].classList.add( 'highlight' );
|
bodyInnerLinks[i].classList.add( 'highlight' );
|
||||||
}
|
}
|
||||||
|
@ -992,13 +992,18 @@ function initSearch() {
|
||||||
e.addEventListener( 'keydown', function( event ){
|
e.addEventListener( 'keydown', function( event ){
|
||||||
if( event.key == 'Escape' ){
|
if( event.key == 'Escape' ){
|
||||||
var input = event.target;
|
var input = event.target;
|
||||||
|
var search = sessionStorage.getItem( baseUriFull+'search-value' );
|
||||||
|
if( !search || !search.length ){
|
||||||
input.blur();
|
input.blur();
|
||||||
|
}
|
||||||
searchInputHandler( '' );
|
searchInputHandler( '' );
|
||||||
inputs.forEach( function( e ){
|
inputs.forEach( function( e ){
|
||||||
e.value = '';
|
e.value = '';
|
||||||
});
|
});
|
||||||
|
if( !search || !search.length ){
|
||||||
documentFocus();
|
documentFocus();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
e.addEventListener( 'input', function( event ){
|
e.addEventListener( 'input', function( event ){
|
||||||
var input = event.target;
|
var input = event.target;
|
||||||
|
|
|
@ -19,6 +19,9 @@ if(!Array.prototype.find){Array.prototype.find=function(predicate){if(this===nul
|
||||||
|
|
||||||
Array.from||(Array.from=function(){var r;try{r=Symbol.iterator?Symbol.iterator:"Symbol(Symbol.iterator)"}catch(t){r="Symbol(Symbol.iterator)"}var t=Object.prototype.toString,n=function(r){return"function"==typeof r||"[object Function]"===t.call(r)},o=Math.pow(2,53)-1,e=function(r){var t=function(r){var t=Number(r);return isNaN(t)?0:0!==t&&isFinite(t)?(t>0?1:-1)*Math.floor(Math.abs(t)):t}(r);return Math.min(Math.max(t,0),o)},a=function(t,n){var o=t&&n[r]();return function(r){return t?o.next():n[r]}},i=function(r,t,n,o,e,a){for(var i=0;i<n||e;){var u=o(i),f=e?u.value:u;if(e&&u.done)return t;t[i]=a?void 0===r?a(f,i):a.call(r,f,i):f,i+=1}if(e)throw new TypeError("Array.from: provided arrayLike or iterator has length more then 2 ** 52 - 1");return t.length=n,t};return function(t){var o=this,u=Object(t),f=n(u[r]);if(null==t&&!f)throw new TypeError("Array.from requires an array-like object or iterator - not null or undefined");var l,c=arguments.length>1?arguments[1]:void 0;if(void 0!==c){if(!n(c))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(l=arguments[2])}var y=e(u.length),h=n(o)?Object(new o(y)):new Array(y);return i(l,h,y,a(f,u),f,c)}}());
|
Array.from||(Array.from=function(){var r;try{r=Symbol.iterator?Symbol.iterator:"Symbol(Symbol.iterator)"}catch(t){r="Symbol(Symbol.iterator)"}var t=Object.prototype.toString,n=function(r){return"function"==typeof r||"[object Function]"===t.call(r)},o=Math.pow(2,53)-1,e=function(r){var t=function(r){var t=Number(r);return isNaN(t)?0:0!==t&&isFinite(t)?(t>0?1:-1)*Math.floor(Math.abs(t)):t}(r);return Math.min(Math.max(t,0),o)},a=function(t,n){var o=t&&n[r]();return function(r){return t?o.next():n[r]}},i=function(r,t,n,o,e,a){for(var i=0;i<n||e;){var u=o(i),f=e?u.value:u;if(e&&u.done)return t;t[i]=a?void 0===r?a(f,i):a.call(r,f,i):f,i+=1}if(e)throw new TypeError("Array.from: provided arrayLike or iterator has length more then 2 ** 52 - 1");return t.length=n,t};return function(t){var o=this,u=Object(t),f=n(u[r]);if(null==t&&!f)throw new TypeError("Array.from requires an array-like object or iterator - not null or undefined");var l,c=arguments.length>1?arguments[1]:void 0;if(void 0!==c){if(!n(c))throw new TypeError("Array.from: when provided, the second argument must be a function");arguments.length>2&&(l=arguments[2])}var y=e(u.length),h=n(o)?Object(new o(y)):new Array(y);return i(l,h,y,a(f,u),f,c)}}());
|
||||||
|
|
||||||
|
const ElementPrototype=window.Element.prototype;
|
||||||
|
if(typeof ElementPrototype.matches!=='function'){ElementPrototype.matches=ElementPrototype.msMatchesSelector||ElementPrototype.mozMatchesSelector||ElementPrototype.webkitMatchesSelector||function matches(selector){let element=this;const elements=(element.document||element.ownerDocument).querySelectorAll(selector);let index=0;while(elements[index]&&elements[index]!==element){index+=1}return Boolean(elements[index])}}if(typeof ElementPrototype.closest!=='function'){ElementPrototype.closest=function closest(selector){let element=this;while(element&&element.nodeType===1){if(element.matches(selector)){return element}element=element.parentNode}return null}}
|
||||||
|
|
||||||
function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
||||||
|
|
||||||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
||||||
|
|
Loading…
Reference in a new issue