mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2026-07-25 07:12:44 -04:00
Upgraded dependencies
This commit is contained in:
@@ -74,7 +74,7 @@ function initialize(config) { // eslint-disable-line func-style
|
||||
/* Create button with message container */
|
||||
const button = (
|
||||
<button class="md-clipboard" title="Copy to clipboard"
|
||||
data-clipboard-target={`#${id} pre, #${id} code`}>
|
||||
data-clipboard-target={`#${id} pre, #${id} code`}>
|
||||
<span class="md-clipboard__message"></span>
|
||||
</button>
|
||||
)
|
||||
@@ -136,8 +136,8 @@ function initialize(config) { // eslint-disable-line func-style
|
||||
new Material.Event.Listener(window, [
|
||||
"scroll", "resize", "orientationchange"
|
||||
], new Material.Header.Shadow(
|
||||
"[data-md-component=container]",
|
||||
"[data-md-component=header]")))
|
||||
"[data-md-component=container]",
|
||||
"[data-md-component=header]")))
|
||||
|
||||
/* Component: tabs visibility toggle */
|
||||
if (document.querySelector("[data-md-component=tabs]"))
|
||||
@@ -150,8 +150,8 @@ function initialize(config) { // eslint-disable-line func-style
|
||||
new Material.Event.Listener(window, [
|
||||
"scroll", "resize", "orientationchange"
|
||||
], new Material.Sidebar.Position(
|
||||
"[data-md-component=navigation]",
|
||||
"[data-md-component=header]")))
|
||||
"[data-md-component=navigation]",
|
||||
"[data-md-component=header]")))
|
||||
|
||||
/* Component: sidebar with table of contents (missing on 404 page) */
|
||||
if (document.querySelector("[data-md-component=toc]"))
|
||||
@@ -159,8 +159,8 @@ function initialize(config) { // eslint-disable-line func-style
|
||||
new Material.Event.Listener(window, [
|
||||
"scroll", "resize", "orientationchange"
|
||||
], new Material.Sidebar.Position(
|
||||
"[data-md-component=toc]",
|
||||
"[data-md-component=header]")))
|
||||
"[data-md-component=toc]",
|
||||
"[data-md-component=header]")))
|
||||
|
||||
/* Component: link blurring for table of contents */
|
||||
new Material.Event.MatchMedia("(min-width: 960px)",
|
||||
@@ -180,7 +180,7 @@ function initialize(config) { // eslint-disable-line func-style
|
||||
new Material.Event.MatchMedia("(max-width: 1219px)",
|
||||
new Material.Event.Listener(
|
||||
"[data-md-component=navigation] [data-md-toggle]", "change",
|
||||
new Material.Nav.Scrolling("[data-md-component=navigation] nav")))
|
||||
new Material.Nav.Scrolling("[data-md-component=navigation] nav")))
|
||||
|
||||
/* Component: search body lock for mobile */
|
||||
new Material.Event.MatchMedia("(max-width: 959px)",
|
||||
@@ -191,16 +191,16 @@ function initialize(config) { // eslint-disable-line func-style
|
||||
new Material.Event.Listener("[data-md-component=query]", [
|
||||
"focus", "keyup", "change"
|
||||
], new Material.Search.Result("[data-md-component=result]", () => {
|
||||
return fetch(`${config.url.base}/mkdocs/search_index.json`, {
|
||||
credentials: "same-origin"
|
||||
}).then(response => response.json())
|
||||
.then(data => {
|
||||
return data.docs.map(doc => {
|
||||
doc.location = config.url.base + doc.location
|
||||
return doc
|
||||
return fetch(`${config.url.base}/mkdocs/search_index.json`, {
|
||||
credentials: "same-origin"
|
||||
}).then(response => response.json())
|
||||
.then(data => {
|
||||
return data.docs.map(doc => {
|
||||
doc.location = config.url.base + doc.location
|
||||
return doc
|
||||
})
|
||||
})
|
||||
})
|
||||
})).listen()
|
||||
})).listen()
|
||||
|
||||
/* Listener: close drawer when anchor links are clicked */
|
||||
new Material.Event.MatchMedia("(max-width: 959px)",
|
||||
|
||||
@@ -220,7 +220,7 @@ export default class Result {
|
||||
this.list_.appendChild(
|
||||
<li class="md-search-result__item">
|
||||
<a href={doc.location} title={doc.title}
|
||||
class="md-search-result__link">
|
||||
class="md-search-result__link">
|
||||
<article class="md-search-result__article
|
||||
md-search-result__article--document">
|
||||
<h1 class="md-search-result__title">
|
||||
@@ -236,7 +236,7 @@ export default class Result {
|
||||
const section = this.docs_.get(item.ref)
|
||||
return (
|
||||
<a href={section.location} title={section.title}
|
||||
class="md-search-result__link" data-md-rel="anchor">
|
||||
class="md-search-result__link" data-md-rel="anchor">
|
||||
<article class="md-search-result__article">
|
||||
<h1 class="md-search-result__title">
|
||||
{{ __html: section.title.replace(match, highlight) }}
|
||||
@@ -244,7 +244,7 @@ export default class Result {
|
||||
{section.text.length ?
|
||||
<p class="md-search-result__teaser">
|
||||
{{ __html: this.truncate_(
|
||||
section.text.replace(match, highlight), 400)
|
||||
section.text.replace(match, highlight), 400)
|
||||
}}
|
||||
</p> : {}}
|
||||
</article>
|
||||
|
||||
@@ -42,7 +42,7 @@ export default class GitHub extends Abstract {
|
||||
|
||||
/* Extract user (and repository name) from URL, as we have to query for all
|
||||
repositories, to omit 404 errors for private repositories */
|
||||
const matches = /^.+github\.com\/([^\/]+)\/?([^\/]+)?.*$/
|
||||
const matches = /^.+github\.com\/([^/]+)\/?([^/]+)?.*$/
|
||||
.exec(this.base_)
|
||||
if (matches && matches.length === 3) {
|
||||
const [, user, name] = matches
|
||||
|
||||
Reference in New Issue
Block a user