Unified components and observable structure
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 292 KiB After Width: | Height: | Size: 291 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.8 KiB |
2
material/assets/javascripts/bundle.9330522f.min.js
vendored
Normal file
1
material/assets/javascripts/bundle.9330522f.min.js.map
Normal file
7560
material/assets/javascripts/bundle.js
Normal file
1
material/assets/javascripts/bundle.js.map
Normal file
1
material/assets/javascripts/vendor.31a2e7b9.min.js.map
Normal file
@ -1,10 +1,10 @@
|
||||
{
|
||||
"assets/javascripts/bundle.js": "assets/javascripts/bundle.8ceb0d66.min.js",
|
||||
"assets/javascripts/bundle.js.map": "assets/javascripts/bundle.8ceb0d66.min.js.map",
|
||||
"assets/javascripts/vendor.js": "assets/javascripts/vendor.000c9aa0.min.js",
|
||||
"assets/javascripts/vendor.js.map": "assets/javascripts/vendor.000c9aa0.min.js.map",
|
||||
"assets/javascripts/worker/search.js": "assets/javascripts/worker/search.926ffd9e.min.js",
|
||||
"assets/javascripts/worker/search.js.map": "assets/javascripts/worker/search.926ffd9e.min.js.map",
|
||||
"assets/stylesheets/main.css": "assets/stylesheets/main.c05f2dae.min.css",
|
||||
"assets/stylesheets/palette.css": "assets/stylesheets/palette.f5f04e6f.min.css"
|
||||
"assets/javascripts/bundle.js": "assets/javascripts/bundle.js",
|
||||
"assets/javascripts/bundle.js.map": "assets/javascripts/bundle.js.map",
|
||||
"assets/javascripts/vendor.js": "assets/javascripts/vendor.js",
|
||||
"assets/javascripts/vendor.js.map": "assets/javascripts/vendor.js.map",
|
||||
"assets/javascripts/worker/search.js": "assets/javascripts/worker/search.js",
|
||||
"assets/javascripts/worker/search.js.map": "assets/javascripts/worker/search.js.map",
|
||||
"assets/stylesheets/main.css": "assets/stylesheets/main.css",
|
||||
"assets/stylesheets/palette.css": "assets/stylesheets/palette.css"
|
||||
}
|
1
material/assets/stylesheets/main.14bb5ffa.min.css
vendored
Normal file
2940
material/assets/stylesheets/main.css
Normal file
@ -2,7 +2,6 @@
|
||||
This file was automatically generated - do not edit
|
||||
-#}
|
||||
{% import "partials/language.html" as lang with context %}
|
||||
{% set feature = config.theme.feature %}
|
||||
{% set palette = config.theme.palette %}
|
||||
{% set font = config.theme.font %}
|
||||
<!doctype html>
|
||||
@ -43,7 +42,7 @@
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% block styles %}
|
||||
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.c05f2dae.min.css' | url }}">
|
||||
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.14bb5ffa.min.css' | url }}">
|
||||
{% if palette.primary or palette.accent %}
|
||||
<link rel="stylesheet" href="{{ 'assets/stylesheets/palette.f5f04e6f.min.css' | url }}">
|
||||
{% endif %}
|
||||
@ -79,18 +78,20 @@
|
||||
{% endblock %}
|
||||
{% block extrahead %}{% endblock %}
|
||||
</head>
|
||||
{% set direction = config.theme.direction | default(lang.t('direction')) %}
|
||||
{% if palette.primary or palette.accent %}
|
||||
{% set primary = palette.primary | replace(" ", "-") | lower %}
|
||||
{% set accent = palette.accent | replace(" ", "-") | lower %}
|
||||
<body dir="{{ lang.t('direction') }}" data-md-color-primary="{{ primary }}" data-md-color-accent="{{ accent }}">
|
||||
<body dir="{{ direction }}" data-md-color-primary="{{ primary }}" data-md-color-accent="{{ accent }}">
|
||||
{% else %}
|
||||
<body dir="{{ lang.t('direction') }}">
|
||||
<body dir="{{ direction }}">
|
||||
{% endif %}
|
||||
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
||||
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
||||
<label class="md-overlay" for="__drawer"></label>
|
||||
{% if page.toc | first is defined %}
|
||||
<a href="{{ (page.toc | first).url }}" class="md-skip">
|
||||
{% set skip = page.toc | first %}
|
||||
<a href="{{ skip.url | url }}" class="md-skip" data-md-component="skip">
|
||||
{{ lang.t('skip.link.title') }}
|
||||
</a>
|
||||
{% endif %}
|
||||
@ -111,7 +112,7 @@
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% block tabs %}
|
||||
{% if feature.tabs %}
|
||||
{% if "tabs" in config.theme.features %}
|
||||
{% include "partials/tabs.html" %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@ -147,40 +148,19 @@
|
||||
{% endif %}
|
||||
{% block source %}
|
||||
{% if page and page.meta and page.meta.source %}
|
||||
{% set repo = config.repo_url %}
|
||||
{% if repo | last == "/" %}
|
||||
{% set repo = repo[:-1] %}
|
||||
{% endif %}
|
||||
{% set path = page.meta.path | default([""]) %}
|
||||
{% set file = page.meta.source %}
|
||||
{% set repo_icon = config.extra.repo_icon | default(
|
||||
"fontawesome/brands/git-alt"
|
||||
) %}
|
||||
<a href="{{ [repo, path, page.meta.source] | join('/') }}" title="{{ file }}" class="md-content__button md-icon">
|
||||
{{ lang.t("meta.source") }}
|
||||
{% include ".icons/" ~ repo_icon ~ ".svg" %}
|
||||
</a>
|
||||
{% include "partials/source-link.html" %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% if not "\x3ch1" in page.content %}
|
||||
<h1>{{ page.title | default(config.site_name, true)}}</h1>
|
||||
{% endif %}
|
||||
{{ page.content }}
|
||||
{% if page and page.meta and (
|
||||
page.meta.git_revision_date_localized or
|
||||
{% if page and page.meta %}
|
||||
{% if page.meta.git_revision_date_localized or
|
||||
page.meta.revision_date
|
||||
) %}
|
||||
{% set label = lang.t("source.revision.date") %}
|
||||
<hr>
|
||||
<div class="md-source-date">
|
||||
<small>
|
||||
{% if page.meta.git_revision_date_localized %}
|
||||
{{ label }}: {{ page.meta.git_revision_date_localized }}
|
||||
{% elif page.meta.revision_date %}
|
||||
{{ label }}: {{ page.meta.revision_date }}
|
||||
%}
|
||||
{% include "partials/source-date.html" %}
|
||||
{% endif %}
|
||||
</small>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% block disqus %}
|
||||
@ -194,21 +174,23 @@
|
||||
{% include "partials/footer.html" %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% block config %}
|
||||
<script>var __config={}</script>
|
||||
{% endblock %}
|
||||
{% block scripts %}
|
||||
<script src="{{ 'assets/javascripts/vendor.000c9aa0.min.js' | url }}"></script>
|
||||
<script src="{{ 'assets/javascripts/bundle.8ceb0d66.min.js' | url }}"></script>
|
||||
<script src="{{ 'assets/javascripts/vendor.31a2e7b9.min.js' | url }}"></script>
|
||||
<script src="{{ 'assets/javascripts/bundle.9330522f.min.js' | url }}"></script>
|
||||
{%- set translations = {} -%}
|
||||
{%- for key in [
|
||||
"clipboard.copy",
|
||||
"clipboard.copied",
|
||||
"search.language",
|
||||
"search.pipeline.stopwords",
|
||||
"search.pipeline.trimmer",
|
||||
"search.config.lang",
|
||||
"search.config.pipeline",
|
||||
"search.config.separator",
|
||||
"search.result.placeholder",
|
||||
"search.result.none",
|
||||
"search.result.one",
|
||||
"search.result.other",
|
||||
"search.tokenizer"
|
||||
"search.result.other"
|
||||
] -%}
|
||||
{%- set _ = translations.update({ key: lang.t(key) }) -%}
|
||||
{%- endfor -%}
|
||||
@ -216,15 +198,15 @@
|
||||
{{ translations | tojson }}
|
||||
</script>
|
||||
<script>
|
||||
app = initialize({
|
||||
__material = initialize(Object.assign({
|
||||
url: {
|
||||
base: "{{ base_url }}",
|
||||
worker: {
|
||||
search: "{{ 'assets/javascripts/worker/search.926ffd9e.min.js' | url }}"
|
||||
},
|
||||
feature: {
|
||||
instant: {{ "true" if feature and feature.instant else "false" }}
|
||||
search: "{{ 'assets/javascripts/worker/search.edc88caf.min.js' | url }}"
|
||||
}
|
||||
});
|
||||
},
|
||||
features: {{ config.theme.features | tojson }}
|
||||
}, __config))
|
||||
</script>
|
||||
{% for path in config["extra_javascript"] %}
|
||||
<script src="{{ path | url }}"></script>
|
||||
|
@ -26,15 +26,7 @@ direction:
|
||||
|
||||
# Feature flags for functionality that alters behavior significantly, and thus
|
||||
# may be a matter of taste
|
||||
feature:
|
||||
|
||||
# Another layer on top of the main navigation for larger screens in the form
|
||||
# of tabs, especially useful for larger documentation projects
|
||||
tabs: false
|
||||
|
||||
# Instant loading will instruct the application to intercept all internal
|
||||
# links, load and inject the HTML into the page and rebind all handlers
|
||||
instant: false
|
||||
features: []
|
||||
|
||||
# Sets the primary and accent color palettes as defined in the Material Design
|
||||
# documentation - possible values can be looked up in the getting started guide
|
||||
@ -61,10 +53,10 @@ font:
|
||||
icon:
|
||||
|
||||
# Shown if no logo is set
|
||||
logo: .icons/material/book-open-variant
|
||||
logo: material/library
|
||||
|
||||
# Repository icon
|
||||
repo: .icons/fontawesome/git-alt
|
||||
repo: fontawesome/brands/git-alt
|
||||
|
||||
# Favicon to be rendered
|
||||
favicon: assets/images/favicon.png
|
||||
|
@ -1,9 +1,8 @@
|
||||
{#-
|
||||
This file was automatically generated - do not edit
|
||||
-#}
|
||||
{% set feature = config.theme.feature %}
|
||||
{% set class = "md-hero" %}
|
||||
{% if not feature.tabs %}
|
||||
{% if "tabs" not in config.theme.features %}
|
||||
{% set class = "md-hero md-hero--expand" %}
|
||||
{% endif %}
|
||||
<div class="{{ class }}" data-md-component="hero">
|
||||
|
@ -3,6 +3,4 @@
|
||||
-#}
|
||||
{% import "partials/language/" + config.theme.language + ".html" as lang %}
|
||||
{% import "partials/language/en.html" as fallback %}
|
||||
{% macro t(key) %}{{ {
|
||||
"direction": config.theme.direction
|
||||
}[key] or lang.t(key) or fallback.t(key) }}{% endmacro %}
|
||||
{% macro t(key) %}{{ lang.t(key) | default(fallback.t(key)) }}{% endmacro %}
|
||||
|
@ -10,7 +10,7 @@
|
||||
"footer.next": "Volgende",
|
||||
"meta.comments": "Kommentaar",
|
||||
"meta.source": "Bron",
|
||||
"search.language": "nl",
|
||||
"search.config.lang": "nl",
|
||||
"search.placeholder": "Soek",
|
||||
"search.result.placeholder": "Tik om te begin soek",
|
||||
"search.result.none": "Geen ooreenstemmende dokumente",
|
||||
|
@ -11,9 +11,7 @@
|
||||
"footer.next": "التالية",
|
||||
"meta.comments": "التعليقات",
|
||||
"meta.source": "المصدر",
|
||||
"search.language": "",
|
||||
"search.pipeline.stopwords": false,
|
||||
"search.pipeline.trimmer": false,
|
||||
"search.config.pipeline": "",
|
||||
"search.placeholder": "بحث",
|
||||
"search.result.placeholder": "اكتب لبدء البحث",
|
||||
"search.result.none": "لا توجد نتائج",
|
||||
|
@ -10,7 +10,6 @@
|
||||
"footer.next": "Següent",
|
||||
"meta.comments": "Comentaris",
|
||||
"meta.source": "Codi font",
|
||||
"search.language": "",
|
||||
"search.placeholder": "Cerca",
|
||||
"search.result.placeholder": "Escriu per a començar a cercar",
|
||||
"search.result.none": "Cap document coincideix",
|
||||
|
@ -10,7 +10,7 @@
|
||||
"footer.next": "Další",
|
||||
"meta.comments": "Komentáře",
|
||||
"meta.source": "Zdroj",
|
||||
"search.language": "ro",
|
||||
"search.config.lang": "ro",
|
||||
"search.placeholder": "Hledat",
|
||||
"search.result.placeholder": "Pište co se má vyhledat",
|
||||
"search.result.none": "Nenalezeny žádné dokumenty",
|
||||
|
@ -10,7 +10,7 @@
|
||||
"footer.next": "Næste",
|
||||
"meta.comments": "Kommentarer",
|
||||
"meta.source": "Kilde",
|
||||
"search.language": "da",
|
||||
"search.config.lang": "da",
|
||||
"search.placeholder": "Søg",
|
||||
"search.result.placeholder": "Indtast søgeord",
|
||||
"search.result.none": "Ingen resultater fundet",
|
||||
|
@ -10,7 +10,7 @@
|
||||
"footer.next": "Weiter",
|
||||
"meta.comments": "Kommentare",
|
||||
"meta.source": "Quellcode",
|
||||
"search.language": "de",
|
||||
"search.config.lang": "de",
|
||||
"search.placeholder": "Suche",
|
||||
"search.result.placeholder": "Suchbegriff eingeben",
|
||||
"search.result.none": "Keine Suchergebnisse",
|
||||
|
@ -11,15 +11,14 @@
|
||||
"footer.next": "Next",
|
||||
"meta.comments": "Comments",
|
||||
"meta.source": "Source",
|
||||
"search.language": "en",
|
||||
"search.pipeline.stopwords": true,
|
||||
"search.pipeline.trimmer": true,
|
||||
"search.config.lang": "en",
|
||||
"search.config.pipeline": "trimmer, stopWordFilter",
|
||||
"search.config.separator": "[\s\-]+",
|
||||
"search.placeholder": "Search",
|
||||
"search.result.placeholder": "Type to start searching",
|
||||
"search.result.none": "No matching documents",
|
||||
"search.result.one": "1 matching document",
|
||||
"search.result.other": "# matching documents",
|
||||
"search.tokenizer": "[\s\-]+",
|
||||
"skip.link.title": "Skip to content",
|
||||
"source.link.title": "Go to repository",
|
||||
"source.revision.date": "Last update",
|
||||
|
@ -10,7 +10,7 @@
|
||||
"footer.next": "Siguiente",
|
||||
"meta.comments": "Comentarios",
|
||||
"meta.source": "Fuente",
|
||||
"search.language": "es",
|
||||
"search.config.lang": "es",
|
||||
"search.placeholder": "Búsqueda",
|
||||
"search.result.placeholder": "Teclee para comenzar búsqueda",
|
||||
"search.result.none": "No se encontraron documentos",
|
||||
|
@ -10,9 +10,7 @@
|
||||
"footer.next": "Järgmine",
|
||||
"meta.comments": "Kommentaarid",
|
||||
"meta.source": "Lähtekood",
|
||||
"search.language": "",
|
||||
"search.pipeline.stopwords": false,
|
||||
"search.pipeline.trimmer": false,
|
||||
"search.config.pipeline": "",
|
||||
"search.placeholder": "Otsi",
|
||||
"search.result.placeholder": "Otsimiseks kirjuta siia",
|
||||
"search.result.none": "Otsingule ei leitud ühtegi vastet",
|
||||
|
@ -11,9 +11,7 @@
|
||||
"footer.next": "بعدی",
|
||||
"meta.comments": "نظرات",
|
||||
"meta.source": "منبع",
|
||||
"search.language": "",
|
||||
"search.pipeline.stopwords": false,
|
||||
"search.pipeline.trimmer": false,
|
||||
"search.config.pipeline": "",
|
||||
"search.placeholder": "جستجو",
|
||||
"search.result.placeholder": "برای شروع جستجو تایپ کنید",
|
||||
"search.result.none": "سندی یافت نشد",
|
||||
|
@ -10,7 +10,7 @@
|
||||
"footer.next": "Seuraava",
|
||||
"meta.comments": "Kommentit",
|
||||
"meta.source": "Lähdekodi",
|
||||
"search.language": "fi",
|
||||
"search.config.lang": "fi",
|
||||
"search.placeholder": "Hae",
|
||||
"search.result.placeholder": "Kirjoita aloittaaksesi haun",
|
||||
"search.result.none": "Ei täsmääviä dokumentteja",
|
||||
|
@ -10,12 +10,13 @@
|
||||
"footer.next": "Suivant",
|
||||
"meta.comments": "Commentaires",
|
||||
"meta.source": "Source",
|
||||
"search.language": "fr",
|
||||
"search.config.lang": "fr",
|
||||
"search.placeholder": "Rechercher",
|
||||
"search.result.placeholder": "Taper pour démarrer la recherche",
|
||||
"search.result.none": "Aucun document trouvé",
|
||||
"search.result.one": "1 document trouvé",
|
||||
"search.result.other": "# documents trouvés",
|
||||
"skip.link.title": "Aller au contenu",
|
||||
"source.link.title": "Aller au dépôt",
|
||||
"source.revision.date": "Dernière mise à jour",
|
||||
"toc.title": "Table des matières"
|
||||
|
@ -10,7 +10,7 @@
|
||||
"footer.next": "Seguinte",
|
||||
"meta.comments": "Comentarios",
|
||||
"meta.source": "Fonte",
|
||||
"search.language": "es",
|
||||
"search.config.lang": "es",
|
||||
"search.placeholder": "Busca",
|
||||
"search.result.placeholder": "Insira un termo",
|
||||
"search.result.none": "Sen resultados",
|
||||
|
@ -10,9 +10,7 @@
|
||||
"footer.next": "Προηγούμενη",
|
||||
"meta.comments": "Σχόλια",
|
||||
"meta.source": "Πηγή",
|
||||
"search.language": "",
|
||||
"search.pipeline.stopwords": false,
|
||||
"search.pipeline.trimmer": false,
|
||||
"search.config.pipeline": "",
|
||||
"search.placeholder": "Αναζήτηση",
|
||||
"search.result.placeholder": "Πληκτρολογήστε για να αρχίσει η αναζήτηση",
|
||||
"search.result.none": "Δε βρέθηκαν αντίστοιχα αρχεία",
|
||||
|
@ -11,9 +11,7 @@
|
||||
"footer.next": "הַבָּא",
|
||||
"meta.comments": "הערות",
|
||||
"meta.source": "מָקוֹר",
|
||||
"search.language": "",
|
||||
"search.pipeline.stopwords": false,
|
||||
"search.pipeline.trimmer": false,
|
||||
"search.config.pipeline": "",
|
||||
"search.placeholder": "לחפש",
|
||||
"search.result.placeholder": "הקלד כדי להתחיל לחפש",
|
||||
"search.result.none": "אין מסמכים תואמים",
|
||||
|
@ -10,9 +10,7 @@
|
||||
"footer.next": "आगामी",
|
||||
"meta.comments": "टिप्पणियाँ",
|
||||
"meta.source": "स्रोत",
|
||||
"search.language": "",
|
||||
"search.pipeline.stopwords": false,
|
||||
"search.pipeline.trimmer": false,
|
||||
"search.config.pipeline": "",
|
||||
"search.placeholder": "खोज",
|
||||
"search.result.placeholder": "खोज शुरू करने के लिए टाइप करें",
|
||||
"search.result.none": "कोई मिलान डॉक्यूमेंट नहीं",
|
||||
|
@ -10,9 +10,7 @@
|
||||
"footer.next": "Sljedeće",
|
||||
"meta.comments": "Komentari",
|
||||
"meta.source": "Izvor",
|
||||
"search.language": "",
|
||||
"search.pipeline.stopwords": false,
|
||||
"search.pipeline.trimmer": false,
|
||||
"search.config.pipeline": "",
|
||||
"search.placeholder": "Pretraživanje",
|
||||
"search.result.placeholder": "Unesite pojam pretraživanja",
|
||||
"search.result.none": "Ništa nije pronađeno",
|
||||
|
@ -10,7 +10,7 @@
|
||||
"footer.next": "Következő",
|
||||
"meta.comments": "Hozzászólások",
|
||||
"meta.source": "Forrás",
|
||||
"search.language": "hu",
|
||||
"search.config.lang": "hu",
|
||||
"search.placeholder": "Keresés",
|
||||
"search.result.placeholder": "Kereséshez írj ide valamit",
|
||||
"search.result.none": "Nincs találat",
|
||||
|
@ -10,9 +10,7 @@
|
||||
"footer.next": "Selanjutnya",
|
||||
"meta.comments": "Komentar",
|
||||
"meta.source": "Sumber",
|
||||
"search.language": "",
|
||||
"search.pipeline.stopwords": false,
|
||||
"search.pipeline.trimmer": false,
|
||||
"search.config.pipeline": "",
|
||||
"search.placeholder": "Cari",
|
||||
"search.result.placeholder": "Ketik untuk mulai pencarian",
|
||||
"search.result.none": "Tidak ada dokumen yang sesuai",
|
||||
|
@ -10,7 +10,7 @@
|
||||
"footer.next": "Prossimo",
|
||||
"meta.comments": "Commenti",
|
||||
"meta.source": "Sorgente",
|
||||
"search.language": "it",
|
||||
"search.config.lang": "it",
|
||||
"search.placeholder": "Cerca",
|
||||
"search.result.placeholder": "Scrivi per iniziare a cercare",
|
||||
"search.result.none": "Nessun documento trovato",
|
||||
|
@ -10,13 +10,13 @@
|
||||
"footer.next": "次",
|
||||
"meta.comments": "コメント",
|
||||
"meta.source": "ソース",
|
||||
"search.language": "ja",
|
||||
"search.config.lang": "ja",
|
||||
"search.config.separator": "[\s\- 、。,.]+",
|
||||
"search.placeholder": "検索",
|
||||
"search.result.placeholder": "検索キーワードを入力してください",
|
||||
"search.result.none": "何も見つかりませんでした",
|
||||
"search.result.one": "1件見つかりました",
|
||||
"search.result.other": "#件見つかりました",
|
||||
"search.tokenizer": "[\s\- 、。,.]+",
|
||||
"source.link.title": "リポジトリへ",
|
||||
"source.revision.date": "最終更新日",
|
||||
"toc.title": "目次"
|
||||
|
@ -10,7 +10,7 @@
|
||||
"footer.next": "다음",
|
||||
"meta.comments": "댓글",
|
||||
"meta.source": "출처",
|
||||
"search.language": "ja",
|
||||
"search.config.lang": "ja",
|
||||
"search.placeholder": "검색",
|
||||
"search.result.placeholder": "검색어를 입력하세요",
|
||||
"search.result.none": "검색어와 일치하는 문서가 없습니다",
|
||||
|
@ -10,7 +10,7 @@
|
||||
"footer.next": "Volgende",
|
||||
"meta.comments": "Reacties",
|
||||
"meta.source": "Bron",
|
||||
"search.language": "nl",
|
||||
"search.config.lang": "nl",
|
||||
"search.placeholder": "Zoeken",
|
||||
"search.result.placeholder": "Typ om te beginnen met zoeken",
|
||||
"search.result.none": "Geen overeenkomende documenten",
|
||||
|
@ -10,7 +10,7 @@
|
||||
"footer.next": "Neste",
|
||||
"meta.comments": "Kommentarar",
|
||||
"meta.source": "Kjelde",
|
||||
"search.language": "no",
|
||||
"search.config.lang": "no",
|
||||
"search.placeholder": "Søk",
|
||||
"search.result.placeholder": "Skriv søkeord",
|
||||
"search.result.none": "Ingen treff",
|
||||
|
@ -10,7 +10,7 @@
|
||||
"footer.next": "Neste",
|
||||
"meta.comments": "Kommentarer",
|
||||
"meta.source": "Kilde",
|
||||
"search.language": "no",
|
||||
"search.config.lang": "no",
|
||||
"search.placeholder": "Søk",
|
||||
"search.result.placeholder": "Skriv søkeord",
|
||||
"search.result.none": "Ingen treff",
|
||||
|
@ -10,9 +10,7 @@
|
||||
"footer.next": "Następna strona",
|
||||
"meta.comments": "Komentarze",
|
||||
"meta.source": "Kod źródłowy",
|
||||
"search.language": "",
|
||||
"search.pipeline.stopwords": false,
|
||||
"search.pipeline.trimmer": false,
|
||||
"search.config.pipeline": "",
|
||||
"search.placeholder": "Szukaj",
|
||||
"search.result.placeholder": "Zacznij pisać, aby szukać",
|
||||
"search.result.none": "Brak wyników wyszukiwania",
|
||||
|
@ -10,7 +10,7 @@
|
||||
"footer.next": "Próximo",
|
||||
"meta.comments": "Comentários",
|
||||
"meta.source": "Fonte",
|
||||
"search.language": "pt",
|
||||
"search.config.lang": "pt",
|
||||
"search.placeholder": "Buscar",
|
||||
"search.result.placeholder": "Digite para iniciar a busca",
|
||||
"search.result.none": "Nenhum resultado encontrado",
|
||||
|
@ -10,7 +10,7 @@
|
||||
"footer.next": "Următor",
|
||||
"meta.comments": "Comentarii",
|
||||
"meta.source": "Sursă",
|
||||
"search.language": "ro",
|
||||
"search.config.lang": "ro",
|
||||
"search.placeholder": "Căutare",
|
||||
"search.result.placeholder": "Tastează pentru a începe căutarea",
|
||||
"search.result.none": "Nu a fost găsit niciun document",
|
||||
|
@ -10,7 +10,7 @@
|
||||
"footer.next": "Вперед",
|
||||
"meta.comments": "Комментарии",
|
||||
"meta.source": "Исходный код",
|
||||
"search.language": "ru",
|
||||
"search.config.lang": "ru",
|
||||
"search.placeholder": "Поиск",
|
||||
"search.result.placeholder": "Начните печатать для поиска",
|
||||
"search.result.none": "Совпадений не найдено",
|
||||
|
@ -10,7 +10,7 @@
|
||||
"footer.next": "Sledeće",
|
||||
"meta.comments": "Komentari",
|
||||
"meta.source": "Izvor",
|
||||
"search.language": "ro",
|
||||
"search.config.lang": "ro",
|
||||
"search.placeholder": "Pretraga",
|
||||
"search.result.placeholder": "Unesite pojam pretrage",
|
||||
"search.result.none": "Ništa nije pronađeno",
|
||||
|
@ -10,7 +10,6 @@
|
||||
"footer.next": "Naslednja stran",
|
||||
"meta.comments": "Komentarji",
|
||||
"meta.source": "Izvorna koda",
|
||||
"search.language": "",
|
||||
"search.placeholder": "Išči",
|
||||
"search.result.placeholder": "Vpiši iskalni niz",
|
||||
"search.result.none": "Ni zadetkov",
|
||||
|
@ -10,7 +10,6 @@
|
||||
"footer.next": "Ďalej",
|
||||
"meta.comments": "Komentáre",
|
||||
"meta.source": "Zdroj",
|
||||
"search.language": "",
|
||||
"search.placeholder": "Hľadať",
|
||||
"search.result.placeholder": "Pre vyhľadávanie začni písať",
|
||||
"search.result.none": "Žiadne vyhovujúce dokumenty",
|
||||
|
@ -10,9 +10,7 @@
|
||||
"footer.next": "Следеће",
|
||||
"meta.comments": "Коментари",
|
||||
"meta.source": "Извор",
|
||||
"search.language": "",
|
||||
"search.pipeline.stopwords": false,
|
||||
"search.pipeline.trimmer": false,
|
||||
"search.config.pipeline": "",
|
||||
"search.placeholder": "Претрага",
|
||||
"search.result.placeholder": "Унесите појам претраге",
|
||||
"search.result.none": "Нису пронађени документи",
|
||||
|
@ -10,7 +10,7 @@
|
||||
"footer.next": "Nästa",
|
||||
"meta.comments": "Kommentarer",
|
||||
"meta.source": "Källa",
|
||||
"search.language": "sv",
|
||||
"search.config.lang": "sv",
|
||||
"search.placeholder": "Sök",
|
||||
"search.result.placeholder": "Skriv sökord",
|
||||
"search.result.none": "Inga sökresultat",
|
||||
|
@ -10,13 +10,11 @@
|
||||
"footer.next": "ต่อไป",
|
||||
"meta.comments": "ความคิดเห็น",
|
||||
"meta.source": "แหล่งที่มา",
|
||||
"search.language": "th",
|
||||
"search.placeholder": "ค้นหา",
|
||||
"search.result.placeholder": "พิมพ์เพื่อเริ่มค้นหา",
|
||||
"search.result.none": "ไม่พบเอกสารที่ตรงกัน",
|
||||
"search.result.one": "พบเอกสารที่ตรงกัน",
|
||||
"search.result.other": "พบ # เอกสารที่ตรงกัน",
|
||||
"search.tokenizer": "[\s\-]+",
|
||||
"skip.link.title": "ข้ามไปที่เนื้อหา",
|
||||
"source.link.title": "ไปที่ Repository",
|
||||
"toc.title": "สารบัญ"
|
||||
|
@ -10,12 +10,13 @@
|
||||
"footer.next": "Sonraki",
|
||||
"meta.comments": "Yorumlar",
|
||||
"meta.source": "Kaynak",
|
||||
"search.language": "tr",
|
||||
"search.config.lang": "tr",
|
||||
"search.placeholder": "Ara",
|
||||
"search.result.placeholder": "Aramaya başlamak için yazın",
|
||||
"search.result.none": "Eşleşen doküman bulunamadı",
|
||||
"search.result.one": "1 doküman bulundu",
|
||||
"search.result.other": "# doküman bulundu",
|
||||
"skip.link.title": "Ana içeriğe geç",
|
||||
"source.link.title": "Depoya git",
|
||||
"source.revision.date": "Son Güncelleme",
|
||||
"toc.title": "İçindekiler"
|
||||
|
@ -10,7 +10,7 @@
|
||||
"footer.next": "Вперед",
|
||||
"meta.comments": "Коментарі",
|
||||
"meta.source": "Вихідний код",
|
||||
"search.language": "ru",
|
||||
"search.config.lang": "ru",
|
||||
"search.placeholder": "Пошук",
|
||||
"search.result.placeholder": "Розпочніть писати для пошуку",
|
||||
"search.result.none": "Збігів не знайдено",
|
||||
|
@ -10,13 +10,13 @@
|
||||
"footer.next": "下一頁",
|
||||
"meta.comments": "評論",
|
||||
"meta.source": "來源",
|
||||
"search.language": "ja",
|
||||
"search.config.lang": "ja",
|
||||
"search.config.separator": "[\,\。]+",
|
||||
"search.placeholder": "搜尋",
|
||||
"search.result.placeholder": "鍵入以開始檢索",
|
||||
"search.result.none": "沒有找到符合條件的結果",
|
||||
"search.result.one": "找到 1 个符合條件的結果",
|
||||
"search.result.other": "# 個符合條件的結果",
|
||||
"search.tokenizer": "[\,\。]+",
|
||||
"skip.link.title": "跳轉至",
|
||||
"source.link.title": "前往 Github 倉庫",
|
||||
"source.revision.date": "最後更新",
|
||||
|
@ -10,13 +10,13 @@
|
||||
"footer.next": "下一頁",
|
||||
"meta.comments": "留言",
|
||||
"meta.source": "來源",
|
||||
"search.language": "ja",
|
||||
"search.config.lang": "ja",
|
||||
"search.config.separator": "[\,\。]+",
|
||||
"search.placeholder": "搜尋",
|
||||
"search.result.placeholder": "打字進行搜尋",
|
||||
"search.result.none": "沒有符合的項目",
|
||||
"search.result.one": "找到 1 個符合的項目",
|
||||
"search.result.other": "找到 # 個符合的項目",
|
||||
"search.tokenizer": "[\,\。]+",
|
||||
"skip.link.title": "跳轉到",
|
||||
"source.link.title": "前往倉庫",
|
||||
"toc.title": "本頁目錄"
|
||||
|
@ -10,13 +10,13 @@
|
||||
"footer.next": "下一页",
|
||||
"meta.comments": "评论",
|
||||
"meta.source": "来源",
|
||||
"search.language": "ja",
|
||||
"search.config.lang": "ja",
|
||||
"search.config.separator": "[\,\。]+",
|
||||
"search.placeholder": "搜索",
|
||||
"search.result.placeholder": "键入以开始搜索",
|
||||
"search.result.none": "没有找到符合条件的结果",
|
||||
"search.result.one": "找到 1 个符合条件的结果",
|
||||
"search.result.other": "# 个符合条件的结果",
|
||||
"search.tokenizer": "[\,\。]+",
|
||||
"skip.link.title": "跳转至",
|
||||
"source.link.title": "前往 Github 仓库",
|
||||
"source.revision.date": "最后更新",
|
||||
|
@ -4,10 +4,10 @@
|
||||
<nav class="md-nav md-nav--primary" data-md-level="0">
|
||||
<label class="md-nav__title" for="__drawer">
|
||||
<a href="{{ config.site_url | default(nav.homepage.url, true) | url }}" title="{{ config.site_name }}" aria-label="{{ config.site_name }}" class="md-nav__button md-logo">
|
||||
{% if config.theme.logo.icon %}
|
||||
{% include ".icons/" ~ config.theme.logo.icon ~ ".svg" %}
|
||||
{% else %}
|
||||
{% if config.theme.logo %}
|
||||
<img src="{{ config.theme.logo | url }}" alt="logo">
|
||||
{% else %}
|
||||
{% include ".icons/" ~ config.theme.icon.logo ~ ".svg" %}
|
||||
{% endif %}
|
||||
</a>
|
||||
{{ config.site_name }}
|
||||
|
15
material/partials/source-date.html
Normal file
@ -0,0 +1,15 @@
|
||||
{#-
|
||||
This file was automatically generated - do not edit
|
||||
-#}
|
||||
{% import "partials/language.html" as lang with context %}
|
||||
{% set label = lang.t("source.revision.date") %}
|
||||
<hr>
|
||||
<div class="md-source-date">
|
||||
<small>
|
||||
{% if page.meta.git_revision_date_localized %}
|
||||
{{ label }}: {{ page.meta.git_revision_date_localized }}
|
||||
{% elif page.meta.revision_date %}
|
||||
{{ label }}: {{ page.meta.revision_date }}
|
||||
{% endif %}
|
||||
</small>
|
||||
</div>
|
17
material/partials/source-link.html
Normal file
@ -0,0 +1,17 @@
|
||||
{#-
|
||||
This file was automatically generated - do not edit
|
||||
-#}
|
||||
{% import "partials/language.html" as lang with context %}
|
||||
{% set repo = config.repo_url %}
|
||||
{% if repo | last == "/" %}
|
||||
{% set repo = repo[:-1] %}
|
||||
{% endif %}
|
||||
{% set path = page.meta.path | default([""]) %}
|
||||
{% set file = page.meta.source %}
|
||||
{% set repo_icon = config.extra.repo_icon | default(
|
||||
"fontawesome/brands/git-alt"
|
||||
) %}
|
||||
<a href="{{ [repo, path, page.meta.source] | join('/') }}" title="{{ file }}" class="md-content__button md-icon">
|
||||
{{ lang.t("meta.source") }}
|
||||
{% include ".icons/" ~ repo_icon ~ ".svg" %}
|
||||
</a>
|
@ -3,11 +3,11 @@
|
||||
-#}
|
||||
{% import "partials/language.html" as lang with context %}
|
||||
<nav class="md-nav md-nav--secondary">
|
||||
{% set toc_ = page.toc %}
|
||||
{% if toc_ | first is defined and "\x3ch1 id=" in page.content %}
|
||||
{% set toc_ = (toc_ | first).children %}
|
||||
{% set toc = page.toc %}
|
||||
{% if toc | first is defined and "\x3ch1 id=" in page.content %}
|
||||
{% set toc = (toc | first).children %}
|
||||
{% endif %}
|
||||
{% if toc_ | first is defined %}
|
||||
{% if toc | first is defined %}
|
||||
<label class="md-nav__title" for="__toc">
|
||||
<span class="md-nav__icon md-icon">
|
||||
{% include ".icons/material/arrow-left.svg" %}
|
||||
@ -15,7 +15,7 @@
|
||||
{{ lang.t("toc.title") }}
|
||||
</label>
|
||||
<ul class="md-nav__list" data-md-scrollfix>
|
||||
{% for toc_item in toc_ %}
|
||||
{% for toc_item in toc %}
|
||||
{% include "partials/toc-item.html" %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
@ -19,7 +19,7 @@
|
||||
# IN THE SOFTWARE.
|
||||
|
||||
# Direct dependencies
|
||||
mkdocs>=1.0
|
||||
mkdocs>=1.1
|
||||
Pygments>=2.4
|
||||
markdown>=3.2
|
||||
pymdown-extensions>=7.0b2
|
||||
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.8 KiB |
@ -60,7 +60,7 @@ interface WatchOptions {
|
||||
*
|
||||
* @param options - Options
|
||||
*
|
||||
* @return Document switch observable
|
||||
* @return Document observable
|
||||
*/
|
||||
export function watchDocumentSwitch(
|
||||
{ location$ }: WatchOptions
|
@ -64,7 +64,7 @@ export function getElementOrThrow<T extends HTMLElement>(
|
||||
/**
|
||||
* Retrieve the currently active element
|
||||
*
|
||||
* @return Element
|
||||
* @return Element or nothing
|
||||
*/
|
||||
export function getActiveElement(): HTMLElement | undefined {
|
||||
return document.activeElement instanceof HTMLElement
|
@ -34,11 +34,9 @@ import { getActiveElement } from "../_"
|
||||
*
|
||||
* @param el - Element
|
||||
* @param value - Whether the element should be focused
|
||||
*
|
||||
* @return Element offset
|
||||
*/
|
||||
export function setElementFocus(
|
||||
el: HTMLElement, value: boolean = true
|
||||
el: HTMLElement, value: boolean = true
|
||||
): void {
|
||||
if (value)
|
||||
el.focus()
|
@ -25,5 +25,6 @@ export * from "./element"
|
||||
export * from "./keyboard"
|
||||
export * from "./location"
|
||||
export * from "./media"
|
||||
export * from "./toggle"
|
||||
export * from "./viewport"
|
||||
export * from "./worker"
|
@ -46,7 +46,7 @@ export interface Key {
|
||||
*
|
||||
* @return Test result
|
||||
*/
|
||||
export function isSusceptibleToKeyboard(el: HTMLElement) {
|
||||
export function isSusceptibleToKeyboard(el: HTMLElement): boolean {
|
||||
switch (el.tagName) {
|
||||
|
||||
/* Form elements */
|
@ -51,6 +51,40 @@ export function setLocation(url: URL): void {
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Check whether a URL is an internal link or a file (except `.html`)
|
||||
*
|
||||
* @param url - URL or HTML anchor element
|
||||
* @param ref - Reference URL
|
||||
*
|
||||
* @return Test result
|
||||
*/
|
||||
export function isLocationInternal(
|
||||
url: URL | HTMLAnchorElement,
|
||||
ref: URL | Location = location
|
||||
): boolean {
|
||||
return url.host === ref.host
|
||||
&& /^(?:\/[\w-]+)*(?:\/?|\.html)$/i.test(url.pathname)
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether a URL is an anchor link on the current page
|
||||
*
|
||||
* @param url - URL or HTML anchor element
|
||||
* @param ref - Reference URL
|
||||
*
|
||||
* @return Test result
|
||||
*/
|
||||
export function isLocationAnchor(
|
||||
url: URL | HTMLAnchorElement,
|
||||
ref: URL | Location = location
|
||||
): boolean {
|
||||
return url.pathname === ref.pathname
|
||||
&& url.hash.length > 0
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Watch location
|
||||
*
|
@ -36,6 +36,22 @@ export function getLocationHash(): string {
|
||||
return location.hash.substring(1)
|
||||
}
|
||||
|
||||
/**
|
||||
* Set location hash
|
||||
*
|
||||
* Setting a new fragment identifier via `location.hash` will have no effect
|
||||
* if the value doesn't change. However, when a new fragment identifier is set,
|
||||
* we want the browser to target the respective element at all times, which is
|
||||
* why we use this dirty little trick.
|
||||
*
|
||||
* @param hash - Location hash
|
||||
*/
|
||||
export function setLocationHash(hash: string): void {
|
||||
const el = document.createElement("a")
|
||||
el.href = hash
|
||||
el.click()
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
@ -20,17 +20,10 @@
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import { NEVER, Observable, fromEvent, of } from "rxjs"
|
||||
import {
|
||||
distinctUntilChanged,
|
||||
map,
|
||||
shareReplay,
|
||||
startWith,
|
||||
switchMap,
|
||||
take
|
||||
} from "rxjs/operators"
|
||||
import { Observable, fromEvent } from "rxjs"
|
||||
import { map, startWith } from "rxjs/operators"
|
||||
|
||||
import { getElement } from "../agent"
|
||||
import { getElementOrThrow } from "../element"
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* Types
|
||||
@ -43,92 +36,33 @@ export type Toggle =
|
||||
| "drawer" /* Toggle for drawer */
|
||||
| "search" /* Toggle for search */
|
||||
|
||||
/**
|
||||
* Toggle map
|
||||
*/
|
||||
export type ToggleMap = {
|
||||
[P in Toggle]?: HTMLInputElement
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* Helper types
|
||||
* ------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Watch options
|
||||
*/
|
||||
interface WatchOptions {
|
||||
document$: Observable<Document> /* Document observable */
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* Data
|
||||
* ------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Toggle map observable
|
||||
* Toggle map
|
||||
*/
|
||||
let toggles$: Observable<ToggleMap>
|
||||
const toggles: Record<Toggle, HTMLInputElement> = {
|
||||
drawer: getElementOrThrow(`[data-md-toggle=drawer]`),
|
||||
search: getElementOrThrow(`[data-md-toggle=search]`)
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* Functions
|
||||
* ------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Setup bindings to toggles with given names
|
||||
* Retrieve the value of a toggle
|
||||
*
|
||||
* @param names - Toggle names
|
||||
* @param options - Options
|
||||
* @param name - Toggle
|
||||
*
|
||||
* @return Toggle value
|
||||
*/
|
||||
export function setupToggles(
|
||||
names: Toggle[], { document$ }: WatchOptions
|
||||
): void {
|
||||
toggles$ = document$
|
||||
.pipe(
|
||||
|
||||
/* Ignore document switches */
|
||||
take(1),
|
||||
|
||||
/* Build toggle map */
|
||||
map(document => names.reduce<ToggleMap>((toggles, name) => {
|
||||
const el = getElement(`[data-md-toggle=${name}]`, document)
|
||||
return {
|
||||
...toggles,
|
||||
...typeof el !== "undefined" ? { [name]: el } : {}
|
||||
}
|
||||
}, {})),
|
||||
|
||||
/* Convert to hot observable */
|
||||
shareReplay(1)
|
||||
)
|
||||
export function getToggle(name: Toggle): boolean {
|
||||
return toggles[name].checked
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a toggle
|
||||
*
|
||||
* The returned observable will only re-emit if the element changed, i.e. if
|
||||
* it was replaced from a document which was switched to.
|
||||
*
|
||||
* @param name - Toggle name
|
||||
*
|
||||
* @return Element observable
|
||||
*/
|
||||
export function useToggle(
|
||||
name: Toggle
|
||||
): Observable<HTMLInputElement> {
|
||||
return toggles$
|
||||
.pipe(
|
||||
switchMap(toggles => (
|
||||
typeof toggles[name] !== "undefined"
|
||||
? of(toggles[name]!)
|
||||
: NEVER
|
||||
)),
|
||||
distinctUntilChanged()
|
||||
)
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Set toggle
|
||||
*
|
||||
@ -137,14 +71,12 @@ export function useToggle(
|
||||
* used `CustomEvent` to programmatically change the value of a toggle, but this
|
||||
* is a much simpler and cleaner solution which doesn't require a polyfill.
|
||||
*
|
||||
* @param el - Toggle element
|
||||
* @param name - Toggle
|
||||
* @param value - Toggle value
|
||||
*/
|
||||
export function setToggle(
|
||||
el: HTMLInputElement, value: boolean
|
||||
): void {
|
||||
if (el.checked !== value)
|
||||
el.click()
|
||||
export function setToggle(name: Toggle, value: boolean): void {
|
||||
if (toggles[name].checked !== value)
|
||||
toggles[name].click()
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
@ -152,13 +84,12 @@ export function setToggle(
|
||||
/**
|
||||
* Watch toggle
|
||||
*
|
||||
* @param el - Toggle element
|
||||
* @param name - Toggle
|
||||
*
|
||||
* @return Toggle observable
|
||||
* @return Toggle value observable
|
||||
*/
|
||||
export function watchToggle(
|
||||
el: HTMLInputElement
|
||||
): Observable<boolean> {
|
||||
export function watchToggle(name: Toggle): Observable<boolean> {
|
||||
const el = toggles[name]
|
||||
return fromEvent(el, "change")
|
||||
.pipe(
|
||||
map(() => el.checked),
|
@ -27,7 +27,8 @@ import {
|
||||
shareReplay
|
||||
} from "rxjs/operators"
|
||||
|
||||
import { Header } from "../../../header"
|
||||
import { Header } from "components"
|
||||
|
||||
import {
|
||||
ViewportOffset,
|
||||
watchViewportOffset
|
||||
@ -54,9 +55,9 @@ export interface Viewport {
|
||||
* ------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Watch relative options
|
||||
* Watch at options
|
||||
*/
|
||||
interface WatchRelativeOptions {
|
||||
interface WatchAtOptions {
|
||||
header$: Observable<Header> /* Header observable */
|
||||
viewport$: Observable<Viewport> /* Viewport observable */
|
||||
}
|
||||
@ -90,7 +91,7 @@ export function watchViewport(): Observable<Viewport> {
|
||||
* @return Viewport observable
|
||||
*/
|
||||
export function watchViewportAt(
|
||||
el: HTMLElement, { header$, viewport$ }: WatchRelativeOptions
|
||||
el: HTMLElement, { header$, viewport$ }: WatchAtOptions
|
||||
): Observable<Viewport> {
|
||||
const offset$ = viewport$
|
||||
.pipe(
|
@ -29,7 +29,7 @@ import {
|
||||
switchMap
|
||||
} from "rxjs/operators"
|
||||
|
||||
import { getElement } from "observables"
|
||||
import { getElement } from "browser"
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* Types
|
||||
|
@ -35,11 +35,13 @@ import {
|
||||
Viewport,
|
||||
getElement,
|
||||
watchViewportAt
|
||||
} from "observables"
|
||||
} from "browser"
|
||||
|
||||
import { useComponent } from "../../_"
|
||||
import { paintHeaderType } from "../paint"
|
||||
import { watchHeader } from "../watch"
|
||||
import {
|
||||
applyHeaderType,
|
||||
watchHeader
|
||||
} from "../react"
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* Types
|
||||
@ -104,7 +106,7 @@ export function mountHeader(
|
||||
return y >= hx.offsetHeight ? "page" : "site"
|
||||
}),
|
||||
distinctUntilChanged(),
|
||||
paintHeaderType(title)
|
||||
applyHeaderType(title)
|
||||
)
|
||||
),
|
||||
startWith<HeaderType>("site")
|
||||
|
@ -21,6 +21,5 @@
|
||||
*/
|
||||
|
||||
export * from "./_"
|
||||
export * from "./apply"
|
||||
export * from "./paint"
|
||||
export * from "./watch"
|
||||
export * from "./react"
|
||||
export * from "./set"
|
||||
|
@ -1,63 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
* deal in the Software without restriction, including without limitation the
|
||||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
* sell copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import {
|
||||
MonoTypeOperatorFunction,
|
||||
animationFrameScheduler,
|
||||
pipe
|
||||
} from "rxjs"
|
||||
import { finalize, observeOn, tap } from "rxjs/operators"
|
||||
|
||||
import { HeaderType } from "../_"
|
||||
import {
|
||||
resetHeaderTitleActive,
|
||||
setHeaderTitleActive
|
||||
} from "../apply"
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* Functions
|
||||
* ------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Paint header title type
|
||||
*
|
||||
* @param el - Header title element
|
||||
*
|
||||
* @return Operator function
|
||||
*/
|
||||
export function paintHeaderType(
|
||||
el: HTMLElement
|
||||
): MonoTypeOperatorFunction<HeaderType> {
|
||||
return pipe(
|
||||
|
||||
/* Defer repaint to next animation frame */
|
||||
observeOn(animationFrameScheduler),
|
||||
tap(type => {
|
||||
setHeaderTitleActive(el, type === "page")
|
||||
}),
|
||||
|
||||
/* Reset on complete or error */
|
||||
finalize(() => {
|
||||
resetHeaderTitleActive(el)
|
||||
})
|
||||
)
|
||||
}
|
@ -20,12 +20,28 @@
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import { Observable, of } from "rxjs"
|
||||
import { distinctUntilKeyChanged, switchMap } from "rxjs/operators"
|
||||
import {
|
||||
MonoTypeOperatorFunction,
|
||||
Observable,
|
||||
animationFrameScheduler,
|
||||
of,
|
||||
pipe
|
||||
} from "rxjs"
|
||||
import {
|
||||
distinctUntilKeyChanged,
|
||||
finalize,
|
||||
observeOn,
|
||||
switchMap,
|
||||
tap
|
||||
} from "rxjs/operators"
|
||||
|
||||
import { Viewport } from "observables"
|
||||
import { Viewport } from "browser"
|
||||
|
||||
import { Header } from "../_"
|
||||
import { Header, HeaderType } from "../_"
|
||||
import {
|
||||
resetHeaderTitleActive,
|
||||
setHeaderTitleActive
|
||||
} from "../set"
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* Helper types
|
||||
@ -72,3 +88,30 @@ export function watchHeader(
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Apply header title type
|
||||
*
|
||||
* @param el - Header title element
|
||||
*
|
||||
* @return Operator function
|
||||
*/
|
||||
export function applyHeaderType(
|
||||
el: HTMLElement
|
||||
): MonoTypeOperatorFunction<HeaderType> {
|
||||
return pipe(
|
||||
|
||||
/* Defer repaint to next animation frame */
|
||||
observeOn(animationFrameScheduler),
|
||||
tap(type => {
|
||||
setHeaderTitleActive(el, type === "page")
|
||||
}),
|
||||
|
||||
/* Reset on complete or error */
|
||||
finalize(() => {
|
||||
resetHeaderTitleActive(el)
|
||||
})
|
||||
)
|
||||
}
|
@ -23,10 +23,10 @@
|
||||
import { Observable, OperatorFunction, pipe } from "rxjs"
|
||||
import { distinctUntilChanged, map, switchMap } from "rxjs/operators"
|
||||
|
||||
import { Viewport, watchViewportAt } from "observables"
|
||||
import { Viewport, watchViewportAt } from "browser"
|
||||
|
||||
import { Header } from "../../header"
|
||||
import { paintHero } from "../paint"
|
||||
import { applyHero } from "../react"
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* Types
|
||||
@ -70,7 +70,7 @@ export function mountHero(
|
||||
.pipe(
|
||||
map(({ offset: { y } }) => ({ hidden: y >= 20 })),
|
||||
distinctUntilChanged(),
|
||||
paintHero(el)
|
||||
applyHero(el)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
@ -21,5 +21,5 @@
|
||||
*/
|
||||
|
||||
export * from "./_"
|
||||
export * from "./apply"
|
||||
export * from "./paint"
|
||||
export * from "./react"
|
||||
export * from "./set"
|
||||
|
@ -31,20 +31,20 @@ import { Hero } from "../_"
|
||||
import {
|
||||
resetHeroHidden,
|
||||
setHeroHidden
|
||||
} from "../apply"
|
||||
} from "../set"
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* Functions
|
||||
* ------------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
* Paint hero
|
||||
* Apply hero
|
||||
*
|
||||
* @param el - Hero element
|
||||
*
|
||||
* @return Operator function
|
||||
*/
|
||||
export function paintHero(
|
||||
export function applyHero(
|
||||
el: HTMLElement
|
||||
): MonoTypeOperatorFunction<Hero> {
|
||||
return pipe(
|
@ -23,12 +23,14 @@
|
||||
import { Observable, OperatorFunction, Subject, pipe } from "rxjs"
|
||||
import { distinctUntilKeyChanged, switchMap, tap } from "rxjs/operators"
|
||||
|
||||
import { Viewport } from "observables"
|
||||
import { Viewport } from "browser"
|
||||
|
||||
import { useComponent } from "../../_"
|
||||
import { Header } from "../../header"
|
||||
import { paintHeaderShadow } from "../paint"
|
||||
import { watchMain } from "../watch"
|
||||
import {
|
||||
applyHeaderShadow,
|
||||
watchMain
|
||||
} from "../react"
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* Types
|
||||
@ -82,7 +84,7 @@ export function mountMain(
|
||||
switchMap(header => main$
|
||||
.pipe(
|
||||
distinctUntilKeyChanged("active"),
|
||||
paintHeaderShadow(header)
|
||||
applyHeaderShadow(header)
|
||||
)
|
||||
)
|
||||
)
|
||||
|