Add files to repos
This commit is contained in:
1
themes/tabi/static/custom_subset.css
Normal file
1
themes/tabi/static/custom_subset.css
Normal file
File diff suppressed because one or more lines are too long
119
themes/tabi/static/feed_style.xsl
Normal file
119
themes/tabi/static/feed_style.xsl
Normal file
@@ -0,0 +1,119 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom" xmlns:tabi="https://github.com/welpo/tabi">
|
||||
<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
|
||||
<xsl:template match="/">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
||||
<xsl:attribute name="data-theme">
|
||||
<xsl:value-of select="/atom:feed/tabi:metadata/tabi:default_theme"/>
|
||||
</xsl:attribute>
|
||||
<head>
|
||||
<title>
|
||||
<xsl:value-of select="/atom:feed/atom:title"/> • Feed
|
||||
</title>
|
||||
<meta charset="utf-8"/>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<xsl:variable name="baseUrl" select="/atom:feed/tabi:metadata/tabi:base_url"/>
|
||||
<link rel="stylesheet" href="{$baseUrl}/main.css"/>
|
||||
<link rel="stylesheet" href="{/atom:feed/atom:link[@rel='extra-stylesheet']/@href}" />
|
||||
|
||||
</head>
|
||||
<body dir="auto">
|
||||
<div class="content">
|
||||
<main>
|
||||
<div class="info-box">
|
||||
<!-- This block replaces the text "About Feeds" with a hyperlink in the translated string -->
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains(/atom:feed/tabi:metadata/tabi:about_feeds, 'About Feeds')">
|
||||
<xsl:value-of select="substring-before(/atom:feed/tabi:metadata/tabi:about_feeds, 'About Feeds')"/>
|
||||
<a href="https://aboutfeeds.com/" target="_blank">About Feeds</a>
|
||||
<xsl:value-of select="substring-after(/atom:feed/tabi:metadata/tabi:about_feeds, 'About Feeds')"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="/atom:feed/tabi:metadata/tabi:about_feeds"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</div>
|
||||
<section id="banner-home-subtitle">
|
||||
<div class="padding-top home-title">
|
||||
<xsl:value-of select="/atom:feed/atom:title"/>
|
||||
</div>
|
||||
<p>
|
||||
<xsl:value-of select="/atom:feed/atom:subtitle"/>
|
||||
</p>
|
||||
<a class="readmore">
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="/atom:feed/atom:link[@rel='alternate']/@href"/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="/atom:feed/tabi:metadata/tabi:visit_the_site" />
|
||||
<xsl:if test="/atom:feed/tabi:metadata/tabi:current_section != /atom:feed/atom:title">
|
||||
<xsl:text>: </xsl:text>
|
||||
<xsl:value-of select="/atom:feed/tabi:metadata/tabi:current_section" />
|
||||
</xsl:if>
|
||||
<span class="arrow"> →</span>
|
||||
</a>
|
||||
<p></p>
|
||||
</section>
|
||||
<div class="padding-top listing-title bottom-divider">
|
||||
<h1><xsl:value-of select="/atom:feed/tabi:metadata/tabi:recent_posts" /></h1>
|
||||
</div>
|
||||
<xsl:variable name="post_listing_date" select="/atom:feed/tabi:metadata/tabi:post_listing_date"/>
|
||||
<div class="bloglist-container">
|
||||
<xsl:for-each select="/atom:feed/atom:entry">
|
||||
<section class="bloglist-meta bottom-divider">
|
||||
<ul>
|
||||
<xsl:variable name="show_date" select="$post_listing_date = 'date' or $post_listing_date = 'both'"/>
|
||||
<xsl:variable name="show_updated" select="$post_listing_date = 'updated' or $post_listing_date = 'both'"/>
|
||||
|
||||
<xsl:if test="$show_date">
|
||||
<li class="date">
|
||||
<xsl:value-of select="substring(atom:published, 0, 11)"/>
|
||||
</li>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:if test="$show_date and $show_updated">
|
||||
<li class="mobile-only">
|
||||
<xsl:value-of select="/atom:feed/tabi:metadata/tabi:separator"/>
|
||||
</li>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:if test="$show_updated">
|
||||
<li class="date">
|
||||
<xsl:variable name="update_string" select="/atom:feed/tabi:metadata/tabi:last_updated_on"/>
|
||||
<xsl:variable name="update_date" select="substring(atom:updated, 0, 11)"/>
|
||||
<xsl:value-of select="substring-before($update_string, '$DATE')"/>
|
||||
<xsl:value-of select="$update_date"/>
|
||||
<xsl:value-of select="substring-after($update_string, '$DATE')"/>
|
||||
</li>
|
||||
</xsl:if>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="bloglist-content bottom-divider">
|
||||
<div>
|
||||
<div class="bloglist-title">
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="atom:link/@href"/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="atom:title"/>
|
||||
</a>
|
||||
</div>
|
||||
<div class="description">
|
||||
<xsl:value-of select="atom:summary"/>
|
||||
</div>
|
||||
<a class="readmore" href="">
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="atom:link/@href"/>
|
||||
</xsl:attribute>
|
||||
</a>
|
||||
</div>
|
||||
</section>
|
||||
</xsl:for-each>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
BIN
themes/tabi/static/fonts/CascadiaCode-SemiLight.woff2
Normal file
BIN
themes/tabi/static/fonts/CascadiaCode-SemiLight.woff2
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/Inter4.woff2
Normal file
BIN
themes/tabi/static/fonts/Inter4.woff2
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_AMS-Regular.ttf
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_AMS-Regular.ttf
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_AMS-Regular.woff
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_AMS-Regular.woff
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_AMS-Regular.woff2
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_AMS-Regular.woff2
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Caligraphic-Bold.ttf
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Caligraphic-Bold.ttf
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Caligraphic-Bold.woff
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Caligraphic-Bold.woff
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Caligraphic-Bold.woff2
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Caligraphic-Bold.woff2
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Caligraphic-Regular.ttf
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Caligraphic-Regular.ttf
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Caligraphic-Regular.woff
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Caligraphic-Regular.woff
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Caligraphic-Regular.woff2
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Caligraphic-Regular.woff2
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Fraktur-Bold.ttf
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Fraktur-Bold.ttf
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Fraktur-Bold.woff
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Fraktur-Bold.woff
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Fraktur-Bold.woff2
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Fraktur-Bold.woff2
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Fraktur-Regular.ttf
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Fraktur-Regular.ttf
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Fraktur-Regular.woff
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Fraktur-Regular.woff
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Fraktur-Regular.woff2
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Fraktur-Regular.woff2
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Main-Bold.ttf
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Main-Bold.ttf
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Main-Bold.woff
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Main-Bold.woff
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Main-Bold.woff2
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Main-Bold.woff2
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Main-BoldItalic.ttf
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Main-BoldItalic.ttf
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Main-BoldItalic.woff
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Main-BoldItalic.woff
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Main-BoldItalic.woff2
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Main-BoldItalic.woff2
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Main-Italic.ttf
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Main-Italic.ttf
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Main-Italic.woff
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Main-Italic.woff
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Main-Italic.woff2
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Main-Italic.woff2
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Main-Regular.ttf
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Main-Regular.ttf
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Main-Regular.woff
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Main-Regular.woff
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Main-Regular.woff2
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Main-Regular.woff2
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Math-BoldItalic.ttf
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Math-BoldItalic.ttf
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Math-BoldItalic.woff
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Math-BoldItalic.woff
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Math-BoldItalic.woff2
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Math-BoldItalic.woff2
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Math-Italic.ttf
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Math-Italic.ttf
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Math-Italic.woff
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Math-Italic.woff
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Math-Italic.woff2
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Math-Italic.woff2
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_SansSerif-Bold.ttf
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_SansSerif-Bold.ttf
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_SansSerif-Bold.woff
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_SansSerif-Bold.woff
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_SansSerif-Bold.woff2
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_SansSerif-Bold.woff2
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_SansSerif-Italic.ttf
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_SansSerif-Italic.ttf
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_SansSerif-Italic.woff
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_SansSerif-Italic.woff
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_SansSerif-Italic.woff2
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_SansSerif-Italic.woff2
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_SansSerif-Regular.ttf
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_SansSerif-Regular.ttf
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_SansSerif-Regular.woff
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_SansSerif-Regular.woff
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_SansSerif-Regular.woff2
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_SansSerif-Regular.woff2
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Script-Regular.ttf
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Script-Regular.ttf
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Script-Regular.woff
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Script-Regular.woff
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Script-Regular.woff2
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Script-Regular.woff2
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Size1-Regular.ttf
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Size1-Regular.ttf
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Size1-Regular.woff
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Size1-Regular.woff
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Size1-Regular.woff2
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Size1-Regular.woff2
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Size2-Regular.ttf
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Size2-Regular.ttf
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Size2-Regular.woff
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Size2-Regular.woff
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Size2-Regular.woff2
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Size2-Regular.woff2
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Size3-Regular.ttf
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Size3-Regular.ttf
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Size3-Regular.woff
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Size3-Regular.woff
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Size3-Regular.woff2
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Size3-Regular.woff2
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Size4-Regular.ttf
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Size4-Regular.ttf
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Size4-Regular.woff
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Size4-Regular.woff
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Size4-Regular.woff2
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Size4-Regular.woff2
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Typewriter-Regular.ttf
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Typewriter-Regular.ttf
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Typewriter-Regular.woff
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Typewriter-Regular.woff
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Typewriter-Regular.woff2
Normal file
BIN
themes/tabi/static/fonts/KaTeX/KaTeX_Typewriter-Regular.woff2
Normal file
Binary file not shown.
1922
themes/tabi/static/fonts/Phosphor.woff2
Normal file
1922
themes/tabi/static/fonts/Phosphor.woff2
Normal file
File diff suppressed because one or more lines are too long
BIN
themes/tabi/static/fonts/SourceSerif4Variable-Roman.ttf.woff2
Normal file
BIN
themes/tabi/static/fonts/SourceSerif4Variable-Roman.ttf.woff2
Normal file
Binary file not shown.
BIN
themes/tabi/static/fonts/roboto-condensed-light.woff2
Normal file
BIN
themes/tabi/static/fonts/roboto-condensed-light.woff2
Normal file
Binary file not shown.
BIN
themes/tabi/static/img/avator.webp
Normal file
BIN
themes/tabi/static/img/avator.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
BIN
themes/tabi/static/img/main.webp
Normal file
BIN
themes/tabi/static/img/main.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
BIN
themes/tabi/static/img/seedling1.png
Normal file
BIN
themes/tabi/static/img/seedling1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
BIN
themes/tabi/static/img/zloy.png
Normal file
BIN
themes/tabi/static/img/zloy.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
BIN
themes/tabi/static/img/zloy.webp
Normal file
BIN
themes/tabi/static/img/zloy.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
1
themes/tabi/static/inter_subset_en.css
Normal file
1
themes/tabi/static/inter_subset_en.css
Normal file
File diff suppressed because one or more lines are too long
1
themes/tabi/static/inter_subset_es.css
Normal file
1
themes/tabi/static/inter_subset_es.css
Normal file
File diff suppressed because one or more lines are too long
375
themes/tabi/static/isso.css
Normal file
375
themes/tabi/static/isso.css
Normal file
@@ -0,0 +1,375 @@
|
||||
/* ========================================================================== */
|
||||
/* Generic styling */
|
||||
/* ========================================================================== */
|
||||
#isso-thread * {
|
||||
/* Reset */
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* ========================================================================== */
|
||||
/* Thread heading area */
|
||||
/* ========================================================================== */
|
||||
#isso-thread {
|
||||
margin: 0 auto;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
color: var(--text-color);
|
||||
font-size: 0.9em;
|
||||
font-family: var(--sans-serif-font);
|
||||
}
|
||||
|
||||
h4.isso-thread-heading {
|
||||
padding-bottom: 0.2em;
|
||||
color: var(--text-color);
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.isso-feedlink {
|
||||
float: inline-end;
|
||||
padding-inline-start: 1em;
|
||||
}
|
||||
|
||||
.isso-feedlink a {
|
||||
vertical-align: bottom;
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
/* ========================================================================== */
|
||||
/* Comments */
|
||||
/* ========================================================================== */
|
||||
|
||||
.isso-comment {
|
||||
margin: 0 auto;
|
||||
max-width: 68em;
|
||||
}
|
||||
|
||||
.isso-preview .isso-comment {
|
||||
margin: 0;
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.isso-comment:not(:first-of-type),
|
||||
.isso-follow-up .isso-comment {
|
||||
margin-block-end: 0.5em;
|
||||
border-top: 1px solid var(--divider-color);
|
||||
}
|
||||
|
||||
.isso-avatar {
|
||||
display: block;
|
||||
float: inline-start;
|
||||
margin: 0.95em 0.95em 0;
|
||||
}
|
||||
|
||||
.isso-avatar svg {
|
||||
border: 1px solid var(--divider-color);
|
||||
border-radius: 3px;
|
||||
width: 100%;
|
||||
max-width: 48px;
|
||||
height: 100%;
|
||||
max-height: 48px;
|
||||
}
|
||||
|
||||
.isso-text-wrapper {
|
||||
display: block;
|
||||
padding: 0.3em;
|
||||
}
|
||||
|
||||
.isso-follow-up {
|
||||
padding-inline-start: calc(7% + 20px);
|
||||
}
|
||||
|
||||
.isso-comment-footer {
|
||||
font-size: 0.95em;
|
||||
}
|
||||
|
||||
.isso-comment-header {
|
||||
font-size: 0.85em;
|
||||
}
|
||||
|
||||
.isso-comment-header a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* Only for comment header, spacer between up-/downvote should have no padding */
|
||||
.isso-comment-header .isso-spacer {
|
||||
padding-inline: 6px;
|
||||
}
|
||||
|
||||
.isso-spacer,
|
||||
.isso-permalink,
|
||||
.isso-note,
|
||||
.isso-parent {
|
||||
color: var(--meta-color);
|
||||
font-weight: normal;
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
.isso-permalink:hover,
|
||||
.isso-note:hover,
|
||||
.isso-parent:hover {
|
||||
color: var(--hover-color);
|
||||
}
|
||||
|
||||
.isso-note {
|
||||
float: inline-end;
|
||||
}
|
||||
|
||||
.isso-author {
|
||||
color: var(--text-color);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.isso-page-author-suffix {
|
||||
color: var(--text-color-high-contrast);
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* Style author comments and replies */
|
||||
.isso-is-page-author>.isso-text-wrapper {
|
||||
background-color: var(--bg-1);
|
||||
}
|
||||
|
||||
.isso-textarea,
|
||||
.isso-preview {
|
||||
background-color: var(--bg-2);
|
||||
padding: 10px;
|
||||
width: 100%;
|
||||
color: var(--text-color);
|
||||
font-size: 0.8em;
|
||||
font-family: var(--sans-serif-font);
|
||||
}
|
||||
|
||||
.isso-text p {
|
||||
margin-top: -0.4em;
|
||||
}
|
||||
|
||||
.isso-text p:last-child {
|
||||
margin-block-end: 0.2em;
|
||||
}
|
||||
|
||||
.isso-text h1,
|
||||
.isso-text h2,
|
||||
.isso-text h3,
|
||||
.isso-text h4,
|
||||
.isso-text h5,
|
||||
.isso-text h6 {
|
||||
font-weight: bold;
|
||||
font-size: 130%;
|
||||
}
|
||||
|
||||
.isso-comment-footer {
|
||||
clear: left;
|
||||
color: var(--meta-color);
|
||||
font-size: 0.80em;
|
||||
}
|
||||
|
||||
.isso-feedlink,
|
||||
.isso-comment-footer a {
|
||||
margin: 0.4em;
|
||||
padding: 0.1em;
|
||||
font-weight: bold;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.isso-comment-footer .isso-votes {
|
||||
color: var(--meta-color);
|
||||
}
|
||||
|
||||
.isso-upvote svg,
|
||||
.isso-downvote svg {
|
||||
position: relative;
|
||||
top: .2em;
|
||||
}
|
||||
|
||||
.isso-upvote:hover svg,
|
||||
.isso-downvote:hover svg {
|
||||
fill: var(--hover-color);
|
||||
}
|
||||
|
||||
/* Reply postbox under existing comment */
|
||||
.isso-comment .isso-postbox {
|
||||
margin-top: 0.8em;
|
||||
}
|
||||
|
||||
.isso-comment.isso-no-votes>*>.isso-comment-footer .isso-votes {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* ========================================================================== */
|
||||
/* Postbox */
|
||||
/* ========================================================================== */
|
||||
.isso-postbox {
|
||||
clear: right;
|
||||
margin: 0 auto 2em;
|
||||
}
|
||||
|
||||
.isso-form-wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.isso-textarea,
|
||||
.isso-preview {
|
||||
margin-top: 0.2em;
|
||||
border: 1px solid var(--divider-color);
|
||||
border-radius: 5px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.isso-textarea {
|
||||
outline: 0;
|
||||
width: 100%;
|
||||
resize: none;
|
||||
}
|
||||
|
||||
.isso-form-wrapper input[type=checkbox] {
|
||||
position: relative;
|
||||
bottom: 1px;
|
||||
vertical-align: middle;
|
||||
margin-inline-end: 0;
|
||||
}
|
||||
|
||||
.isso-notification-section {
|
||||
display: none;
|
||||
padding-top: .3em;
|
||||
padding-bottom: 10px;
|
||||
font-size: 0.90em;
|
||||
}
|
||||
|
||||
.isso-auth-section {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.isso-input-wrapper,
|
||||
.isso-post-action {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
margin: 0 auto;
|
||||
max-width: 35%;
|
||||
font-size: 0.8em;
|
||||
font-family: var(--sans-serif-font);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.isso-input-wrapper {
|
||||
margin-inline-end: 0.5em;
|
||||
}
|
||||
|
||||
.isso-input-wrapper input,
|
||||
.isso-post-action input {
|
||||
margin-top: auto;
|
||||
}
|
||||
|
||||
.isso-input-wrapper label {
|
||||
display: inline-block;
|
||||
margin-top: auto;
|
||||
height: auto;
|
||||
line-height: 1.4em;
|
||||
}
|
||||
|
||||
.isso-input-wrapper input {
|
||||
border: 1px solid var(--divider-color);
|
||||
border-radius: 5px;
|
||||
background-color: var(--bg-2);
|
||||
padding: 0.3em;
|
||||
width: 100%;
|
||||
color: var(--text-color);
|
||||
line-height: 1.2em;
|
||||
font-family: var(--sans-serif-font);
|
||||
}
|
||||
|
||||
.isso-post-action input {
|
||||
cursor: pointer;
|
||||
margin: 0.1em;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
background-color: var(--primary-color);
|
||||
padding-inline: 1em;
|
||||
padding-block: 0.6em;
|
||||
color: var(--background-color);
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
.isso-post-action {
|
||||
display: block;
|
||||
align-self: flex-end;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.isso-post-action>input:hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
/* ========================================================================== */
|
||||
/* Postbox (preview mode) */
|
||||
/* ========================================================================== */
|
||||
.isso-preview,
|
||||
.isso-post-action input[name="edit"],
|
||||
.isso-postbox.isso-preview-mode>.isso-form-wrapper input[name="preview"],
|
||||
.isso-postbox.isso-preview-mode>.isso-form-wrapper .isso-textarea {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.isso-postbox.isso-preview-mode>.isso-form-wrapper .isso-preview {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.isso-postbox.isso-preview-mode>.isso-form-wrapper input[name="edit"] {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.isso-preview {
|
||||
background: repeating-linear-gradient(-45deg,
|
||||
var(--bg-0),
|
||||
var(--bg-0) 10px,
|
||||
var(--bg-2) 10px,
|
||||
var(--bg-2) 20px);
|
||||
background-color: var(--bg-0);
|
||||
}
|
||||
|
||||
/* ========================================================================== */
|
||||
/* Animations */
|
||||
/* ========================================================================== */
|
||||
|
||||
/* "target" means the comment that's being linked to, for example:
|
||||
* https://example.com/blog/example/#isso-15
|
||||
*/
|
||||
.isso-target {
|
||||
animation: isso-target-fade 5s ease-out;
|
||||
}
|
||||
|
||||
@keyframes isso-target-fade {
|
||||
0% {
|
||||
background-color: var(--divider-color)
|
||||
}
|
||||
}
|
||||
|
||||
/* ========================================================================== */
|
||||
/* Media queries */
|
||||
/* ========================================================================== */
|
||||
@media screen and (max-width:600px) {
|
||||
.isso-auth-section {
|
||||
flex-direction: column;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.isso-input-wrapper {
|
||||
display: block;
|
||||
margin: 0 0 .4em;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.isso-input-wrapper input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.isso-post-action {
|
||||
margin: 0.4em auto;
|
||||
width: 60%;
|
||||
}
|
||||
}
|
||||
1
themes/tabi/static/isso.min.css
vendored
Normal file
1
themes/tabi/static/isso.min.css
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.isso-avatar svg,.isso-preview,.isso-textarea{border:1px solid var(--divider-color);width:100%}#isso-thread *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#isso-thread{margin:0 auto;padding:0;width:100%;color:var(--text-color);font-size:.9em;font-family:var(--sans-serif-font)}h4.isso-thread-heading{padding-bottom:.2em;color:var(--text-color);font-size:1.2rem}.isso-feedlink,.isso-note{float:right}.isso-feedlink a{vertical-align:bottom;font-size:.8em}.isso-comment{margin:0 auto;max-width:68em}.isso-preview .isso-comment{margin:0;padding-top:0}.isso-comment:not(:first-of-type),.isso-follow-up .isso-comment{margin-bottom:.5em;border-top:1px solid var(--divider-color)}.isso-avatar{display:block;float:left;margin:.95em .95em 0}.isso-avatar svg{border-radius:3px;max-width:48px;height:100%;max-height:48px}.isso-text-wrapper{display:block;padding:.3em}.isso-follow-up{padding-inline-start:calc(7% + 20px)}.isso-comment-header{font-size:.85em}.isso-comment-header a{text-decoration:none}.isso-comment-header .isso-spacer{padding:0 6px}.isso-note,.isso-parent,.isso-permalink,.isso-spacer{color:var(--meta-color);font-weight:400;text-shadow:none}.isso-note:hover,.isso-parent:hover,.isso-permalink:hover{color:var(--hover-color)}.isso-author{color:var(--text-color);font-weight:500}.isso-page-author-suffix{color:var(--text-color-high-contrast);font-weight:700}.isso-input-wrapper input,.isso-preview,.isso-textarea{background-color:var(--bg-2);color:var(--text-color);font-family:var(--sans-serif-font)}.isso-is-page-author>.isso-text-wrapper{background-color:var(--bg-1)}.isso-preview,.isso-textarea{padding:10px;font-size:.8em}.isso-comment-footer,.isso-comment-footer .isso-votes{color:var(--meta-color)}.isso-text p{margin-top:-.4em}.isso-text p:last-child{margin-bottom:.2em}.isso-text h1,.isso-text h2,.isso-text h3,.isso-text h4,.isso-text h5,.isso-text h6{font-weight:700;font-size:130%}.isso-comment-footer{clear:left;font-size:.8em}.isso-comment-footer a,.isso-feedlink{margin:.4em;padding:.1em;font-weight:700;text-decoration:none}.isso-downvote svg,.isso-upvote svg{position:relative;top:.2em}.isso-downvote:hover svg,.isso-upvote:hover svg{fill:var(--hover-color)}.isso-comment .isso-postbox{margin-top:.8em}.isso-comment.isso-no-votes>*>.isso-comment-footer .isso-votes,.isso-post-action input[name=edit],.isso-postbox.isso-preview-mode>.isso-form-wrapper .isso-textarea,.isso-postbox.isso-preview-mode>.isso-form-wrapper input[name=preview],.isso-preview{display:none}.isso-postbox{clear:right;margin:0 auto 2em}.isso-form-wrapper{display:flex;flex-direction:column}.isso-preview,.isso-textarea{margin-top:.2em;border-radius:5px}.isso-textarea{outline:0;width:100%;resize:none}.isso-form-wrapper input[type=checkbox]{position:relative;bottom:1px;vertical-align:middle;margin-inline-end:0}.isso-notification-section{display:none;padding-top:.3em;padding-bottom:10px;font-size:.9em}.isso-auth-section{display:flex;flex-direction:row}.isso-input-wrapper,.isso-post-action{display:flex;flex-direction:column;justify-content:flex-end;align-items:center;margin:0 auto;max-width:35%;font-size:.8em;font-family:var(--sans-serif-font);text-align:center}.isso-input-wrapper{margin-inline-end:.5em}.isso-input-wrapper input,.isso-post-action input{margin-top:auto}.isso-input-wrapper label{display:inline-block;margin-top:auto;height:auto;line-height:1.4em}.isso-input-wrapper input{border:1px solid var(--divider-color);border-radius:5px;padding:.3em;width:100%;line-height:1.2em}.isso-post-action input{cursor:pointer;margin:.1em;border:none;border-radius:5px;background-color:var(--primary-color);padding:.6em 1em;color:var(--background-color);font-size:.8rem}.isso-post-action{display:block;align-self:flex-end;margin:0 auto}.isso-post-action>input:hover{opacity:.8}.isso-postbox.isso-preview-mode>.isso-form-wrapper .isso-preview{display:block}.isso-postbox.isso-preview-mode>.isso-form-wrapper input[name=edit]{display:inline}.isso-preview{background:repeating-linear-gradient(-45deg,var(--bg-0),var(--bg-0) 10px,var(--bg-2) 10px,var(--bg-2) 20px);background-color:var(--bg-0)}.isso-target{animation:5s ease-out isso-target-fade}@keyframes isso-target-fade{0%{background-color:var(--divider-color)}}@media screen and (max-width:600px){.isso-auth-section{flex-direction:column;text-align:center}.isso-input-wrapper{display:block;margin:0 0 .4em;max-width:100%}.isso-input-wrapper input{width:100%}.isso-post-action{margin:.4em auto;width:60%}}
|
||||
36
themes/tabi/static/js/codeBlockNameLinks.js
Normal file
36
themes/tabi/static/js/codeBlockNameLinks.js
Normal file
@@ -0,0 +1,36 @@
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
// Convert URLs in data-name to links.
|
||||
document.querySelectorAll('code[data-name]').forEach(function(code) {
|
||||
const name = code.getAttribute('data-name');
|
||||
if (name.startsWith('http')) {
|
||||
const link = document.createElement('a');
|
||||
link.href = name;
|
||||
link.className = 'source-path';
|
||||
link.textContent = name;
|
||||
code.insertBefore(link, code.firstChild);
|
||||
// Remove data-name to avoid overlap with Zola's native display.
|
||||
code.removeAttribute('data-name');
|
||||
code.parentElement?.removeAttribute('data-name');
|
||||
}
|
||||
});
|
||||
|
||||
// Legacy support for old shortcode. https://github.com/welpo/tabi/pull/489
|
||||
document.querySelectorAll('.code-source').forEach(function(marker) {
|
||||
const sourceUrl = marker.getAttribute('data-source');
|
||||
const nextPre = marker.nextElementSibling;
|
||||
if (nextPre?.tagName === 'PRE') {
|
||||
const code = nextPre.querySelector('code');
|
||||
if (code) {
|
||||
if (sourceUrl.startsWith('http')) {
|
||||
const link = document.createElement('a');
|
||||
link.href = sourceUrl;
|
||||
link.className = 'source-path';
|
||||
link.textContent = sourceUrl;
|
||||
code.insertBefore(link, code.firstChild);
|
||||
} else {
|
||||
code.setAttribute('data-name', sourceUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
1
themes/tabi/static/js/codeBlockNameLinks.min.js
vendored
Normal file
1
themes/tabi/static/js/codeBlockNameLinks.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
document.addEventListener("DOMContentLoaded",function(){document.querySelectorAll("code[data-name]").forEach(function(e){var t,a=e.getAttribute("data-name");a.startsWith("http")&&((t=document.createElement("a")).href=a,t.className="source-path",t.textContent=a,e.insertBefore(t,e.firstChild),e.removeAttribute("data-name"),e.parentElement?.removeAttribute("data-name"))}),document.querySelectorAll(".code-source").forEach(function(e){var t,a=e.getAttribute("data-source");"PRE"===(e=e.nextElementSibling)?.tagName&&(e=e.querySelector("code"))&&(a.startsWith("http")?((t=document.createElement("a")).href=a,t.className="source-path",t.textContent=a,e.insertBefore(t,e.firstChild)):e.setAttribute("data-name",a))})});
|
||||
47
themes/tabi/static/js/copyCodeToClipboard.js
Normal file
47
themes/tabi/static/js/copyCodeToClipboard.js
Normal file
@@ -0,0 +1,47 @@
|
||||
const copiedText = document.getElementById('copy-success').textContent;
|
||||
const initCopyText = document.getElementById('copy-init').textContent;
|
||||
|
||||
const changeIcon = (copyDiv, className) => {
|
||||
copyDiv.classList.add(className);
|
||||
copyDiv.setAttribute('aria-label', copiedText);
|
||||
setTimeout(() => {
|
||||
copyDiv.classList.remove(className);
|
||||
copyDiv.setAttribute('aria-label', initCopyText);
|
||||
}, 2500);
|
||||
};
|
||||
|
||||
const addCopyEventListenerToDiv = (copyDiv, block) => {
|
||||
copyDiv.addEventListener('click', () => copyCodeAndChangeIcon(copyDiv, block));
|
||||
};
|
||||
|
||||
const copyCodeAndChangeIcon = async (copyDiv, block) => {
|
||||
const code = block.querySelector('table')
|
||||
? getTableCode(block)
|
||||
: getNonTableCode(block);
|
||||
try {
|
||||
await navigator.clipboard.writeText(code);
|
||||
changeIcon(copyDiv, 'checked');
|
||||
} catch (error) {
|
||||
changeIcon(copyDiv, 'error');
|
||||
}
|
||||
};
|
||||
|
||||
const getNonTableCode = (block) => {
|
||||
return [...block.querySelectorAll('code')].map((code) => code.textContent).join('');
|
||||
};
|
||||
|
||||
const getTableCode = (block) => {
|
||||
return [...block.querySelectorAll('tr')]
|
||||
.map((row) => row.querySelector('td:last-child')?.innerText ?? '')
|
||||
.join('');
|
||||
};
|
||||
|
||||
document.querySelectorAll('pre:not(.mermaid)').forEach((block) => {
|
||||
const copyDiv = document.createElement('div');
|
||||
copyDiv.setAttribute('role', 'button');
|
||||
copyDiv.setAttribute('aria-label', initCopyText);
|
||||
copyDiv.setAttribute('title', initCopyText);
|
||||
copyDiv.className = 'copy-code';
|
||||
block.prepend(copyDiv);
|
||||
addCopyEventListenerToDiv(copyDiv, block);
|
||||
});
|
||||
1
themes/tabi/static/js/copyCodeToClipboard.min.js
vendored
Normal file
1
themes/tabi/static/js/copyCodeToClipboard.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
const copiedText=document.getElementById("copy-success").textContent,initCopyText=document.getElementById("copy-init").textContent,changeIcon=(e,t)=>{e.classList.add(t),e.setAttribute("aria-label",copiedText),setTimeout(()=>{e.classList.remove(t),e.setAttribute("aria-label",initCopyText)},2500)},addCopyEventListenerToDiv=(e,t)=>{e.addEventListener("click",()=>copyCodeAndChangeIcon(e,t))},copyCodeAndChangeIcon=async(t,e)=>{e=(e.querySelector("table")?getTableCode:getNonTableCode)(e);try{await navigator.clipboard.writeText(e),changeIcon(t,"checked")}catch(e){changeIcon(t,"error")}},getNonTableCode=e=>[...e.querySelectorAll("code")].map(e=>e.textContent).join(""),getTableCode=e=>[...e.querySelectorAll("tr")].map(e=>e.querySelector("td:last-child")?.innerText??"").join("");document.querySelectorAll("pre:not(.mermaid)").forEach(e=>{var t=document.createElement("div");t.setAttribute("role","button"),t.setAttribute("aria-label",initCopyText),t.setAttribute("title",initCopyText),t.className="copy-code",e.prepend(t),addCopyEventListenerToDiv(t,e)});
|
||||
44
themes/tabi/static/js/decodeMail.js
Normal file
44
themes/tabi/static/js/decodeMail.js
Normal file
@@ -0,0 +1,44 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
// Utility function: Base64 Decoding.
|
||||
function decodeBase64(encodedString) {
|
||||
try {
|
||||
// Can't use atob() directly because it doesn't support non-ascii characters.
|
||||
// And non-ascii characters are allowed in email addresses and domains.
|
||||
// See https://en.wikipedia.org/wiki/Email_address#Internationalization
|
||||
// Code below adapted from Jackie Han: https://stackoverflow.com/a/64752311
|
||||
const byteString = atob(encodedString);
|
||||
|
||||
// Convert byteString to an array of char codes.
|
||||
const charCodes = [...byteString].map((char) => char.charCodeAt(0));
|
||||
|
||||
// Use TypedArray.prototype.set() to copy the char codes into a Uint8Array.
|
||||
const bytes = new Uint8Array(charCodes.length);
|
||||
bytes.set(charCodes);
|
||||
|
||||
const decoder = new TextDecoder('utf-8');
|
||||
return decoder.decode(bytes);
|
||||
} catch (e) {
|
||||
console.error('Failed to decode Base64 string: ', e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Utility function: Update href of an element with a decoded email.
|
||||
function updateEmailHref(element) {
|
||||
const encodedEmail = element.getAttribute('data-encoded-email');
|
||||
const decodedEmail = decodeBase64(encodedEmail);
|
||||
|
||||
if (decodedEmail) {
|
||||
element.setAttribute('href', `mailto:${decodedEmail}`);
|
||||
} else {
|
||||
// If the decoding fails, hide the email link.
|
||||
element.style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
// Fetch and process email elements with the "data-encoded-email" attribute.
|
||||
const encodedEmailElements = document.querySelectorAll('[data-encoded-email]');
|
||||
encodedEmailElements.forEach(updateEmailHref);
|
||||
})();
|
||||
1
themes/tabi/static/js/decodeMail.min.js
vendored
Normal file
1
themes/tabi/static/js/decodeMail.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(){"use strict";document.querySelectorAll("[data-encoded-email]").forEach(function(e){var t=function(e){try{var t=[...atob(e)].map(e=>e.charCodeAt(0)),r=new Uint8Array(t.length);return r.set(t),new TextDecoder("utf-8").decode(r)}catch(e){return console.error("Failed to decode Base64 string: ",e),null}}(e.getAttribute("data-encoded-email"));t?e.setAttribute("href","mailto:"+t):e.style.display="none"})}();
|
||||
99
themes/tabi/static/js/filterCards.js
Normal file
99
themes/tabi/static/js/filterCards.js
Normal file
@@ -0,0 +1,99 @@
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const cards = document.querySelectorAll('.card');
|
||||
const filterLinks = document.querySelectorAll('.filter-controls a');
|
||||
const allProjectsFilter = document.querySelector('#all-projects-filter');
|
||||
if (!cards.length || !filterLinks.length) return;
|
||||
allProjectsFilter.style.display = 'block';
|
||||
|
||||
// Create a Map for O(1) lookups of links by filter value.
|
||||
const linkMap = new Map(
|
||||
Array.from(filterLinks).map(link => [link.dataset.filter, link])
|
||||
);
|
||||
|
||||
// Pre-process cards data for faster filtering.
|
||||
const cardData = Array.from(cards).map(card => ({
|
||||
element: card,
|
||||
tags: card.dataset.tags?.toLowerCase().split(',').filter(Boolean) ?? []
|
||||
}));
|
||||
|
||||
function getTagSlugFromUrl(url) {
|
||||
return url.split('/').filter(Boolean).pop();
|
||||
}
|
||||
|
||||
function getFilterFromHash() {
|
||||
if (!window.location.hash) return 'all';
|
||||
const hash = decodeURIComponent(window.location.hash.slice(1));
|
||||
const matchingLink = Array.from(filterLinks).find(link =>
|
||||
getTagSlugFromUrl(link.getAttribute('href')) === hash
|
||||
);
|
||||
return matchingLink?.dataset.filter ?? 'all';
|
||||
}
|
||||
|
||||
function setActiveFilter(filterValue, updateHash = true) {
|
||||
if (updateHash) {
|
||||
if (filterValue === 'all') {
|
||||
history.pushState(null, '', window.location.pathname);
|
||||
} else {
|
||||
const activeLink = linkMap.get(filterValue);
|
||||
if (activeLink) {
|
||||
const tagSlug = getTagSlugFromUrl(activeLink.getAttribute('href'));
|
||||
history.pushState(null, '', `#${tagSlug}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
const isAll = filterValue === 'all';
|
||||
const display = isAll ? '' : 'none';
|
||||
const ariaHidden = isAll ? 'false' : 'true';
|
||||
requestAnimationFrame(() => {
|
||||
filterLinks.forEach(link => {
|
||||
const isActive = link.dataset.filter === filterValue;
|
||||
link.classList.toggle('active', isActive);
|
||||
link.setAttribute('aria-pressed', isActive);
|
||||
});
|
||||
if (isAll) {
|
||||
cardData.forEach(({ element }) => {
|
||||
element.style.display = display;
|
||||
element.setAttribute('aria-hidden', ariaHidden);
|
||||
});
|
||||
} else {
|
||||
cardData.forEach(({ element, tags }) => {
|
||||
const shouldShow = tags.includes(filterValue);
|
||||
element.style.display = shouldShow ? '' : 'none';
|
||||
element.setAttribute('aria-hidden', !shouldShow);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const filterContainer = filterLinks[0].parentElement.parentElement;
|
||||
filterContainer.addEventListener('click', e => {
|
||||
const link = e.target.closest('a');
|
||||
if (!link) return;
|
||||
e.preventDefault();
|
||||
const filterValue = link.dataset.filter;
|
||||
if (filterValue) setActiveFilter(filterValue);
|
||||
});
|
||||
|
||||
filterContainer.addEventListener('keydown', e => {
|
||||
const link = e.target.closest('a');
|
||||
if (!link) return;
|
||||
if (e.key === ' ' || e.key === 'Enter') {
|
||||
e.preventDefault();
|
||||
link.click();
|
||||
}
|
||||
});
|
||||
|
||||
filterLinks.forEach(link => {
|
||||
link.setAttribute('role', 'button');
|
||||
link.setAttribute('aria-pressed', link.classList.contains('active'));
|
||||
});
|
||||
|
||||
window.addEventListener('popstate', () => {
|
||||
setActiveFilter(getFilterFromHash(), false);
|
||||
});
|
||||
|
||||
const initialFilter = getFilterFromHash();
|
||||
if (initialFilter !== 'all') {
|
||||
setActiveFilter(initialFilter, false);
|
||||
}
|
||||
});
|
||||
1
themes/tabi/static/js/filterCards.min.js
vendored
Normal file
1
themes/tabi/static/js/filterCards.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
document.addEventListener("DOMContentLoaded",()=>{var t=document.querySelectorAll(".card");const l=document.querySelectorAll(".filter-controls a");var e=document.querySelector("#all-projects-filter");if(t.length&&l.length){e.style.display="block";const s=new Map(Array.from(l).map(t=>[t.dataset.filter,t])),i=Array.from(t).map(t=>({element:t,tags:t.dataset.tags?.toLowerCase().split(",").filter(Boolean)??[]}));function o(t){return t.split("/").filter(Boolean).pop()}function a(){if(!window.location.hash)return"all";const e=decodeURIComponent(window.location.hash.slice(1));return Array.from(l).find(t=>o(t.getAttribute("href"))===e)?.dataset.filter??"all"}function r(a,t=!0){t&&("all"===a?history.pushState(null,"",window.location.pathname):(t=s.get(a))&&(t=o(t.getAttribute("href")),history.pushState(null,"","#"+t)));const e="all"===a,r=e?"":"none",n=e?"false":"true";requestAnimationFrame(()=>{l.forEach(t=>{var e=t.dataset.filter===a;t.classList.toggle("active",e),t.setAttribute("aria-pressed",e)}),e?i.forEach(({element:t})=>{t.style.display=r,t.setAttribute("aria-hidden",n)}):i.forEach(({element:t,tags:e})=>{e=e.includes(a),t.style.display=e?"":"none",t.setAttribute("aria-hidden",!e)})})}(e=l[0].parentElement.parentElement).addEventListener("click",t=>{var e=t.target.closest("a");e&&(t.preventDefault(),t=e.dataset.filter)&&r(t)}),e.addEventListener("keydown",t=>{var e=t.target.closest("a");!e||" "!==t.key&&"Enter"!==t.key||(t.preventDefault(),e.click())}),l.forEach(t=>{t.setAttribute("role","button"),t.setAttribute("aria-pressed",t.classList.contains("active"))}),window.addEventListener("popstate",()=>{r(a(),!1)}),"all"!==(t=a())&&r(t,!1)}});
|
||||
33
themes/tabi/static/js/footnoteBacklinks.js
Normal file
33
themes/tabi/static/js/footnoteBacklinks.js
Normal file
@@ -0,0 +1,33 @@
|
||||
// Assign unique IDs to the footnote references based on their hashes.
|
||||
function assignReferenceIds() {
|
||||
const references = document.querySelectorAll('.footnote-reference');
|
||||
for (const ref of references) {
|
||||
ref.id = `ref:${ref.children[0].hash.substring(1)}`;
|
||||
}
|
||||
}
|
||||
|
||||
// Create backlinks for each footnote definition if a corresponding reference exists.
|
||||
function createFootnoteBacklinks() {
|
||||
const footnotes = document.querySelectorAll('.footnote-definition');
|
||||
for (const footnote of footnotes) {
|
||||
const backlinkId = `ref:${footnote.id}`;
|
||||
|
||||
// Skip if there's no corresponding reference in the text (i.e. the footnote doesn't reference anything).
|
||||
if (!document.getElementById(backlinkId)) continue;
|
||||
|
||||
const backlink = document.createElement('a');
|
||||
backlink.href = `#${backlinkId}`;
|
||||
backlink.className = 'footnote-backlink';
|
||||
backlink.textContent = '↩';
|
||||
footnote.lastElementChild.appendChild(backlink);
|
||||
}
|
||||
}
|
||||
|
||||
// Initialise the handlers for the footnote references and definitions.
|
||||
function initFootnotes() {
|
||||
assignReferenceIds();
|
||||
createFootnoteBacklinks();
|
||||
}
|
||||
|
||||
// Wait for the window to load, then execute the main function.
|
||||
window.addEventListener('load', initFootnotes);
|
||||
1
themes/tabi/static/js/footnoteBacklinks.min.js
vendored
Normal file
1
themes/tabi/static/js/footnoteBacklinks.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
function assignReferenceIds(){for(const e of document.querySelectorAll(".footnote-reference"))e.id="ref:"+e.children[0].hash.substring(1)}function createFootnoteBacklinks(){for(const n of document.querySelectorAll(".footnote-definition")){var e,t="ref:"+n.id;document.getElementById(t)&&((e=document.createElement("a")).href="#"+t,e.className="footnote-backlink",e.textContent="↩",n.lastElementChild.appendChild(e))}}function initFootnotes(){assignReferenceIds(),createFootnoteBacklinks()}window.addEventListener("load",initFootnotes);
|
||||
81
themes/tabi/static/js/giscus.js
Normal file
81
themes/tabi/static/js/giscus.js
Normal file
@@ -0,0 +1,81 @@
|
||||
function setGiscusTheme(newTheme) {
|
||||
// Get the giscus iframe.
|
||||
const frame = document.querySelector('iframe.giscus-frame');
|
||||
|
||||
if (frame) {
|
||||
// If the iframe exists, send a message to set the theme.
|
||||
frame.contentWindow.postMessage(
|
||||
{ giscus: { setConfig: { theme: newTheme } } },
|
||||
'https://giscus.app'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Function to initialize Giscus. This function is run when the window loads.
|
||||
function initGiscus() {
|
||||
// Get the div that will contain the comments.
|
||||
const commentsDiv = document.querySelector('.comments');
|
||||
if (commentsDiv) {
|
||||
// Get the various settings from data attributes on the div.
|
||||
const repo = commentsDiv.getAttribute('data-repo');
|
||||
const repoId = commentsDiv.getAttribute('data-repo-id');
|
||||
const category = commentsDiv.getAttribute('data-category');
|
||||
const categoryId = commentsDiv.getAttribute('data-category-id');
|
||||
const strictTitleMatching = commentsDiv.getAttribute('data-strict');
|
||||
const term = commentsDiv.getAttribute('data-term');
|
||||
const reactionsEnabled = commentsDiv.getAttribute('data-reactions-enabled');
|
||||
const inputPosition = commentsDiv.getAttribute('data-input-position');
|
||||
const lightTheme = commentsDiv.getAttribute('data-light-theme');
|
||||
const darkTheme = commentsDiv.getAttribute('data-dark-theme');
|
||||
const lang = commentsDiv.getAttribute('data-lang');
|
||||
const lazyLoading = commentsDiv.getAttribute('data-lazy-loading');
|
||||
|
||||
// Create a new script tag that will load the Giscus script.
|
||||
const script = document.createElement('script');
|
||||
script.src = 'https://giscus.app/client.js';
|
||||
script.async = true;
|
||||
|
||||
// Set the various settings as data attributes on the script tag.
|
||||
script.setAttribute('data-repo', repo);
|
||||
script.setAttribute('data-repo-id', repoId);
|
||||
script.setAttribute('data-category', category);
|
||||
script.setAttribute('data-category-id', categoryId);
|
||||
script.setAttribute('data-term', term);
|
||||
script.setAttribute('data-strict', strictTitleMatching);
|
||||
script.setAttribute('data-reactions-enabled', reactionsEnabled);
|
||||
script.setAttribute('data-emit-metadata', '0');
|
||||
script.setAttribute('data-input-position', inputPosition);
|
||||
script.setAttribute('data-lang', lang);
|
||||
script.setAttribute('crossorigin', 'anonymous');
|
||||
|
||||
// Set the mapping if it is provided.
|
||||
const mapping = commentsDiv.getAttribute('data-mapping');
|
||||
if (mapping) {
|
||||
script.setAttribute('data-mapping', mapping);
|
||||
}
|
||||
|
||||
// Choose the correct theme based on the current theme of the document.
|
||||
const currentTheme =
|
||||
document.documentElement.getAttribute('data-theme') || 'light';
|
||||
const selectedTheme = currentTheme === 'dark' ? darkTheme : lightTheme;
|
||||
script.setAttribute('data-theme', selectedTheme);
|
||||
|
||||
// Set the loading attribute if lazy loading is enabled.
|
||||
if (lazyLoading === 'true') {
|
||||
script.setAttribute('data-loading', 'lazy');
|
||||
}
|
||||
|
||||
// Add the script tag to the div.
|
||||
commentsDiv.appendChild(script);
|
||||
|
||||
// Listen for theme changes and update the Giscus theme when they occur.
|
||||
window.addEventListener('themeChanged', (event) => {
|
||||
const selectedTheme =
|
||||
event.detail.theme === 'dark' ? darkTheme : lightTheme;
|
||||
setGiscusTheme(selectedTheme);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize Giscus.
|
||||
initGiscus();
|
||||
1
themes/tabi/static/js/giscus.min.js
vendored
Normal file
1
themes/tabi/static/js/giscus.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
function setGiscusTheme(t){var e=document.querySelector("iframe.giscus-frame");e&&e.contentWindow.postMessage({giscus:{setConfig:{theme:t}}},"https://giscus.app")}function initGiscus(){var t=document.querySelector(".comments");if(t){var e=t.getAttribute("data-repo"),a=t.getAttribute("data-repo-id"),i=t.getAttribute("data-category"),r=t.getAttribute("data-category-id"),d=t.getAttribute("data-strict"),s=t.getAttribute("data-term"),u=t.getAttribute("data-reactions-enabled"),n=t.getAttribute("data-input-position");const b=t.getAttribute("data-light-theme"),A=t.getAttribute("data-dark-theme");var o=t.getAttribute("data-lang"),c=t.getAttribute("data-lazy-loading"),g=document.createElement("script"),e=(g.src="https://giscus.app/client.js",g.async=!0,g.setAttribute("data-repo",e),g.setAttribute("data-repo-id",a),g.setAttribute("data-category",i),g.setAttribute("data-category-id",r),g.setAttribute("data-term",s),g.setAttribute("data-strict",d),g.setAttribute("data-reactions-enabled",u),g.setAttribute("data-emit-metadata","0"),g.setAttribute("data-input-position",n),g.setAttribute("data-lang",o),g.setAttribute("crossorigin","anonymous"),t.getAttribute("data-mapping")),a=(e&&g.setAttribute("data-mapping",e),document.documentElement.getAttribute("data-theme")||"light"),i="dark"===a?A:b;g.setAttribute("data-theme",i),"true"===c&&g.setAttribute("data-loading","lazy"),t.appendChild(g),window.addEventListener("themeChanged",t=>{setGiscusTheme("dark"===t.detail.theme?A:b)})}}initGiscus();
|
||||
44
themes/tabi/static/js/hyvortalk.js
Normal file
44
themes/tabi/static/js/hyvortalk.js
Normal file
@@ -0,0 +1,44 @@
|
||||
function initHyvorTalk() {
|
||||
// Get the div that will contain the comments.
|
||||
const commentsDiv = document.querySelector('.comments');
|
||||
if (commentsDiv) {
|
||||
// Get the various settings from data attributes on the div.
|
||||
const websiteId = commentsDiv.getAttribute('data-website-id');
|
||||
const pageId = commentsDiv.getAttribute('data-page-id');
|
||||
const pageLanguage = commentsDiv.getAttribute('data-page-language');
|
||||
const loading = commentsDiv.getAttribute('data-loading');
|
||||
const pageAuthor = commentsDiv.getAttribute('data-page-author');
|
||||
|
||||
// Create a new script tag that will load the Hyvor Talk script.
|
||||
const script = document.createElement('script');
|
||||
script.src = 'https://talk.hyvor.com/embed/embed.js';
|
||||
script.async = true;
|
||||
script.type = 'module';
|
||||
document.head.appendChild(script);
|
||||
|
||||
// Create a new Hyvor Talk comments tag.
|
||||
const comments = document.createElement('hyvor-talk-comments');
|
||||
comments.setAttribute('website-id', websiteId);
|
||||
comments.setAttribute('page-id', pageId);
|
||||
comments.setAttribute('page-language', pageLanguage);
|
||||
comments.setAttribute('loading', loading);
|
||||
comments.setAttribute('page-author', pageAuthor);
|
||||
|
||||
// Choose the correct theme based on the current theme of the document.
|
||||
const currentTheme =
|
||||
document.documentElement.getAttribute('data-theme') || 'light';
|
||||
comments.setAttribute('colors', currentTheme);
|
||||
|
||||
// Add the Hyvor Talk comments tag to the div.
|
||||
commentsDiv.appendChild(comments);
|
||||
|
||||
// Listen for theme changes and update the Hyvor Talk theme when they occur.
|
||||
window.addEventListener('themeChanged', (event) => {
|
||||
const selectedTheme = event.detail.theme;
|
||||
comments.setAttribute('colors', selectedTheme);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize HyvorTalk.
|
||||
initHyvorTalk();
|
||||
1
themes/tabi/static/js/hyvortalk.min.js
vendored
Normal file
1
themes/tabi/static/js/hyvortalk.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
function initHyvorTalk(){var t=document.querySelector(".comments");if(t){var e=t.getAttribute("data-website-id"),a=t.getAttribute("data-page-id"),i=t.getAttribute("data-page-language"),d=t.getAttribute("data-loading"),r=t.getAttribute("data-page-author"),n=document.createElement("script");n.src="https://talk.hyvor.com/embed/embed.js",n.async=!0,n.type="module",document.head.appendChild(n);const o=document.createElement("hyvor-talk-comments");o.setAttribute("website-id",e),o.setAttribute("page-id",a),o.setAttribute("page-language",i),o.setAttribute("loading",d),o.setAttribute("page-author",r);n=document.documentElement.getAttribute("data-theme")||"light";o.setAttribute("colors",n),t.appendChild(o),window.addEventListener("themeChanged",t=>{t=t.detail.theme;o.setAttribute("colors",t)})}}initHyvorTalk();
|
||||
25
themes/tabi/static/js/initializeTheme.js
Normal file
25
themes/tabi/static/js/initializeTheme.js
Normal file
@@ -0,0 +1,25 @@
|
||||
(function () {
|
||||
// Get the default theme from the HTML data-theme attribute.
|
||||
const defaultTheme = document.documentElement.getAttribute('data-theme');
|
||||
|
||||
// Set the data-default-theme attribute only if defaultTheme is not null.
|
||||
if (defaultTheme) {
|
||||
document.documentElement.setAttribute('data-default-theme', defaultTheme);
|
||||
}
|
||||
|
||||
// Attempt to retrieve the current theme from the browser's local storage.
|
||||
const storedTheme = localStorage.getItem('theme');
|
||||
|
||||
if (storedTheme) {
|
||||
document.documentElement.setAttribute('data-theme', storedTheme);
|
||||
} else if (defaultTheme) {
|
||||
document.documentElement.setAttribute('data-theme', defaultTheme);
|
||||
} else {
|
||||
// If no theme is found in local storage and no default theme is set, use user's system preference.
|
||||
const isSystemDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
document.documentElement.setAttribute(
|
||||
'data-theme',
|
||||
isSystemDark ? 'dark' : 'light'
|
||||
);
|
||||
}
|
||||
})();
|
||||
1
themes/tabi/static/js/initializeTheme.min.js
vendored
Normal file
1
themes/tabi/static/js/initializeTheme.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(){var t=document.documentElement.getAttribute("data-theme"),e=(t&&document.documentElement.setAttribute("data-default-theme",t),localStorage.getItem("theme"));e?document.documentElement.setAttribute("data-theme",e):t?document.documentElement.setAttribute("data-theme",t):(e=window.matchMedia("(prefers-color-scheme: dark)").matches,document.documentElement.setAttribute("data-theme",e?"dark":"light"))}();
|
||||
81
themes/tabi/static/js/isso.js
Normal file
81
themes/tabi/static/js/isso.js
Normal file
@@ -0,0 +1,81 @@
|
||||
// Function to initialise Isso.
|
||||
function initIsso() {
|
||||
// Get the div that will contain the comments.
|
||||
const commentsDiv = document.querySelector('.comments');
|
||||
if (commentsDiv) {
|
||||
// Get the lazy-loading setting from the div.
|
||||
const lazyLoading = commentsDiv.getAttribute('data-lazy-loading') === 'true';
|
||||
|
||||
// If lazy-loading is enabled, create an Intersection Observer and use it.
|
||||
if (lazyLoading) {
|
||||
const observer = new IntersectionObserver((entries) => {
|
||||
// Loop over the entries.
|
||||
entries.forEach((entry) => {
|
||||
// If the element is in the viewport, initialize Isso.
|
||||
if (entry.isIntersecting) {
|
||||
loadIsso(commentsDiv);
|
||||
// Once the Isso is loaded, we don't need to observe the element anymore.
|
||||
observer.unobserve(commentsDiv);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Start observing the comments div.
|
||||
observer.observe(commentsDiv);
|
||||
} else {
|
||||
// If lazy-loading is not enabled, initialise Isso immediately.
|
||||
loadIsso(commentsDiv);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Function to load Isso.
|
||||
function loadIsso(commentsDiv) {
|
||||
// Get the various settings from data attributes on the div.
|
||||
const endpointUrl = commentsDiv.getAttribute('data-endpoint-url');
|
||||
const pageId = commentsDiv.getAttribute('data-isso-id');
|
||||
const title = commentsDiv.getAttribute('data-title');
|
||||
const lang = commentsDiv.getAttribute('data-page-language');
|
||||
const maxCommentsTop = commentsDiv.getAttribute('data-max-comments-top');
|
||||
const maxCommentsNested = commentsDiv.getAttribute('data-max-comments-nested');
|
||||
const avatar = commentsDiv.getAttribute('data-avatar');
|
||||
const voting = commentsDiv.getAttribute('data-voting');
|
||||
const hashes = commentsDiv.getAttribute('data-page-author-hashes');
|
||||
|
||||
// Create a new script tag that will load the Isso script.
|
||||
const script = document.createElement('script');
|
||||
script.src = endpointUrl + 'js/embed.min.js';
|
||||
script.async = true;
|
||||
|
||||
// Set the various settings as data attributes on the script tag.
|
||||
script.setAttribute('data-isso', endpointUrl);
|
||||
script.setAttribute('data-isso-lang', lang);
|
||||
script.setAttribute('data-isso-max-comments-top', maxCommentsTop);
|
||||
script.setAttribute('data-isso-max-comments-nested', maxCommentsNested);
|
||||
script.setAttribute('data-isso-avatar', avatar);
|
||||
script.setAttribute('data-isso-vote', voting);
|
||||
script.setAttribute('data-isso-page-author-hashes', hashes);
|
||||
script.setAttribute('data-isso-css', 'false');
|
||||
|
||||
// Set the id and data-isso-id of the Isso thread.
|
||||
const section = document.createElement('section');
|
||||
section.id = 'isso-thread';
|
||||
section.setAttribute('data-isso-id', pageId);
|
||||
section.setAttribute('data-title', title);
|
||||
commentsDiv.appendChild(section);
|
||||
|
||||
// Add the script tag to the div.
|
||||
commentsDiv.appendChild(script);
|
||||
|
||||
// Create a link tag for the Isso CSS.
|
||||
const link = document.createElement('link');
|
||||
link.rel = 'stylesheet';
|
||||
link.type = 'text/css';
|
||||
link.href = '/isso.min.css';
|
||||
|
||||
// Add the CSS link tag to the head of the document.
|
||||
document.head.appendChild(link);
|
||||
}
|
||||
|
||||
// Initialize Isso.
|
||||
initIsso();
|
||||
1
themes/tabi/static/js/isso.min.js
vendored
Normal file
1
themes/tabi/static/js/isso.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
function initIsso(){const e=document.querySelector(".comments");if(e)if("true"===e.getAttribute("data-lazy-loading")){const a=new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&(loadIsso(e),a.unobserve(e))})});a.observe(e)}else loadIsso(e)}function loadIsso(t){var e=t.getAttribute("data-endpoint-url"),a=t.getAttribute("data-isso-id"),s=t.getAttribute("data-title"),i=t.getAttribute("data-page-language"),o=t.getAttribute("data-max-comments-top"),r=(t.getAttribute("data-max-comments-nested"),t.getAttribute("data-avatar")),d=t.getAttribute("data-voting"),n=t.getAttribute("data-page-author-hashes"),u=document.createElement("script");u.src=e+"js/embed.min.js",u.async=!0,u.setAttribute("data-isso",e),u.setAttribute("data-isso-lang",i),u.setAttribute("data-isso-max-comments-top",o),u.setAttribute("data-isso-avatar",r),u.setAttribute("data-isso-vote",d),u.setAttribute("data-isso-page-author-hashes",n),u.setAttribute("data-isso-css","false"),(e=document.createElement("section")).id="isso-thread",e.setAttribute("data-isso-id",a),e.setAttribute("data-title",s),t.appendChild(e),t.appendChild(u),(i=document.createElement("link")).rel="stylesheet",i.type="text/css",i.href="/isso.min.css",document.head.appendChild(i)}initIsso();
|
||||
1
themes/tabi/static/js/katex.min.js
vendored
Normal file
1
themes/tabi/static/js/katex.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
26
themes/tabi/static/js/loadComments.js
Normal file
26
themes/tabi/static/js/loadComments.js
Normal file
@@ -0,0 +1,26 @@
|
||||
// Wait for the full HTML document to be parsed and ready.
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
// Retrieve the button element.
|
||||
const loadCommentsButton = document.querySelector('#load-comments');
|
||||
|
||||
// If the button exists…
|
||||
if (loadCommentsButton) {
|
||||
// Add a "click" event listener to the button.
|
||||
loadCommentsButton.addEventListener('click', () => {
|
||||
// Create a new "script" HTML element.
|
||||
const script = document.createElement('script');
|
||||
|
||||
// Set the source of the script to the URL in the button's "data-script-src" attribute.
|
||||
script.src = loadCommentsButton.dataset.scriptSrc;
|
||||
|
||||
// Load asynchronously.
|
||||
script.async = true;
|
||||
|
||||
// Add the script element to the end of the document body, which causes the script to start loading and executing.
|
||||
document.body.appendChild(script);
|
||||
|
||||
// Hide the button after it's clicked.
|
||||
loadCommentsButton.style.display = 'none';
|
||||
});
|
||||
}
|
||||
});
|
||||
1
themes/tabi/static/js/loadComments.min.js
vendored
Normal file
1
themes/tabi/static/js/loadComments.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
document.addEventListener("DOMContentLoaded",()=>{const t=document.querySelector("#load-comments");t&&t.addEventListener("click",()=>{var e=document.createElement("script");e.src=t.dataset.scriptSrc,e.async=!0,document.body.appendChild(e),t.style.display="none"})});
|
||||
280
themes/tabi/static/js/lunr/lunr.da.js
Normal file
280
themes/tabi/static/js/lunr/lunr.da.js
Normal file
@@ -0,0 +1,280 @@
|
||||
/*!
|
||||
* Lunr languages, `Danish` language
|
||||
* https://github.com/MihaiValentin/lunr-languages
|
||||
*
|
||||
* Copyright 2014, Mihai Valentin
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
/*!
|
||||
* based on
|
||||
* Snowball JavaScript Library v0.3
|
||||
* http://code.google.com/p/urim/
|
||||
* http://snowball.tartarus.org/
|
||||
*
|
||||
* Copyright 2010, Oleg Mazko
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
|
||||
/**
|
||||
* export the module via AMD, CommonJS or as a browser global
|
||||
* Export code from https://github.com/umdjs/umd/blob/master/returnExports.js
|
||||
*/
|
||||
;
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(factory)
|
||||
} else if (typeof exports === 'object') {
|
||||
/**
|
||||
* Node. Does not work with strict CommonJS, but
|
||||
* only CommonJS-like environments that support module.exports,
|
||||
* like Node.
|
||||
*/
|
||||
module.exports = factory()
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
factory()(root.lunr);
|
||||
}
|
||||
}(this, function() {
|
||||
/**
|
||||
* Just return a value to define the module export.
|
||||
* This example returns an object, but the module
|
||||
* can return a function as the exported value.
|
||||
*/
|
||||
return function(lunr) {
|
||||
/* throw error if lunr is not yet included */
|
||||
if ('undefined' === typeof lunr) {
|
||||
throw new Error('Lunr is not present. Please include / require Lunr before this script.');
|
||||
}
|
||||
|
||||
/* throw error if lunr stemmer support is not yet included */
|
||||
if ('undefined' === typeof lunr.stemmerSupport) {
|
||||
throw new Error('Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.');
|
||||
}
|
||||
|
||||
/* register specific locale function */
|
||||
lunr.da = function() {
|
||||
this.pipeline.reset();
|
||||
this.pipeline.add(
|
||||
lunr.da.trimmer,
|
||||
lunr.da.stopWordFilter,
|
||||
lunr.da.stemmer
|
||||
);
|
||||
};
|
||||
|
||||
/* lunr trimmer function */
|
||||
lunr.da.wordCharacters = "A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A";
|
||||
lunr.da.trimmer = lunr.trimmerSupport.generateTrimmer(lunr.da.wordCharacters);
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.da.trimmer, 'trimmer-da');
|
||||
|
||||
/* lunr stemmer function */
|
||||
lunr.da.stemmer = (function() {
|
||||
/* create the wrapped stemmer object */
|
||||
var Among = lunr.stemmerSupport.Among,
|
||||
SnowballProgram = lunr.stemmerSupport.SnowballProgram,
|
||||
st = new function DanishStemmer() {
|
||||
var a_0 = [new Among("hed", -1, 1), new Among("ethed", 0, 1),
|
||||
new Among("ered", -1, 1), new Among("e", -1, 1),
|
||||
new Among("erede", 3, 1), new Among("ende", 3, 1),
|
||||
new Among("erende", 5, 1), new Among("ene", 3, 1),
|
||||
new Among("erne", 3, 1), new Among("ere", 3, 1),
|
||||
new Among("en", -1, 1), new Among("heden", 10, 1),
|
||||
new Among("eren", 10, 1), new Among("er", -1, 1),
|
||||
new Among("heder", 13, 1), new Among("erer", 13, 1),
|
||||
new Among("s", -1, 2), new Among("heds", 16, 1),
|
||||
new Among("es", 16, 1), new Among("endes", 18, 1),
|
||||
new Among("erendes", 19, 1), new Among("enes", 18, 1),
|
||||
new Among("ernes", 18, 1), new Among("eres", 18, 1),
|
||||
new Among("ens", 16, 1), new Among("hedens", 24, 1),
|
||||
new Among("erens", 24, 1), new Among("ers", 16, 1),
|
||||
new Among("ets", 16, 1), new Among("erets", 28, 1),
|
||||
new Among("et", -1, 1), new Among("eret", 30, 1)
|
||||
],
|
||||
a_1 = [
|
||||
new Among("gd", -1, -1), new Among("dt", -1, -1),
|
||||
new Among("gt", -1, -1), new Among("kt", -1, -1)
|
||||
],
|
||||
a_2 = [
|
||||
new Among("ig", -1, 1), new Among("lig", 0, 1),
|
||||
new Among("elig", 1, 1), new Among("els", -1, 1),
|
||||
new Among("l\u00F8st", -1, 2)
|
||||
],
|
||||
g_v = [17, 65, 16, 1, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 48, 0, 128
|
||||
],
|
||||
g_s_ending = [239, 254, 42, 3,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16
|
||||
],
|
||||
I_x, I_p1, S_ch, sbp = new SnowballProgram();
|
||||
this.setCurrent = function(word) {
|
||||
sbp.setCurrent(word);
|
||||
};
|
||||
this.getCurrent = function() {
|
||||
return sbp.getCurrent();
|
||||
};
|
||||
|
||||
function r_mark_regions() {
|
||||
var v_1, c = sbp.cursor + 3;
|
||||
I_p1 = sbp.limit;
|
||||
if (0 <= c && c <= sbp.limit) {
|
||||
I_x = c;
|
||||
while (true) {
|
||||
v_1 = sbp.cursor;
|
||||
if (sbp.in_grouping(g_v, 97, 248)) {
|
||||
sbp.cursor = v_1;
|
||||
break;
|
||||
}
|
||||
sbp.cursor = v_1;
|
||||
if (v_1 >= sbp.limit)
|
||||
return;
|
||||
sbp.cursor++;
|
||||
}
|
||||
while (!sbp.out_grouping(g_v, 97, 248)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return;
|
||||
sbp.cursor++;
|
||||
}
|
||||
I_p1 = sbp.cursor;
|
||||
if (I_p1 < I_x)
|
||||
I_p1 = I_x;
|
||||
}
|
||||
}
|
||||
|
||||
function r_main_suffix() {
|
||||
var among_var, v_1;
|
||||
if (sbp.cursor >= I_p1) {
|
||||
v_1 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_p1;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_0, 32);
|
||||
sbp.limit_backward = v_1;
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 2:
|
||||
if (sbp.in_grouping_b(g_s_ending, 97, 229))
|
||||
sbp.slice_del();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_consonant_pair() {
|
||||
var v_1 = sbp.limit - sbp.cursor,
|
||||
v_2;
|
||||
if (sbp.cursor >= I_p1) {
|
||||
v_2 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_p1;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.find_among_b(a_1, 4)) {
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.limit_backward = v_2;
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
if (sbp.cursor > sbp.limit_backward) {
|
||||
sbp.cursor--;
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.slice_del();
|
||||
}
|
||||
} else
|
||||
sbp.limit_backward = v_2;
|
||||
}
|
||||
}
|
||||
|
||||
function r_other_suffix() {
|
||||
var among_var, v_1 = sbp.limit - sbp.cursor,
|
||||
v_2, v_3;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(2, "st")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (sbp.eq_s_b(2, "ig"))
|
||||
sbp.slice_del();
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
if (sbp.cursor >= I_p1) {
|
||||
v_2 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_p1;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_2, 5);
|
||||
sbp.limit_backward = v_2;
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_del();
|
||||
v_3 = sbp.limit - sbp.cursor;
|
||||
r_consonant_pair();
|
||||
sbp.cursor = sbp.limit - v_3;
|
||||
break;
|
||||
case 2:
|
||||
sbp.slice_from("l\u00F8s");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_undouble() {
|
||||
var v_1;
|
||||
if (sbp.cursor >= I_p1) {
|
||||
v_1 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_p1;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.out_grouping_b(g_v, 97, 248)) {
|
||||
sbp.bra = sbp.cursor;
|
||||
S_ch = sbp.slice_to(S_ch);
|
||||
sbp.limit_backward = v_1;
|
||||
if (sbp.eq_v_b(S_ch))
|
||||
sbp.slice_del();
|
||||
} else
|
||||
sbp.limit_backward = v_1;
|
||||
}
|
||||
}
|
||||
this.stem = function() {
|
||||
var v_1 = sbp.cursor;
|
||||
r_mark_regions();
|
||||
sbp.limit_backward = v_1;
|
||||
sbp.cursor = sbp.limit;
|
||||
r_main_suffix();
|
||||
sbp.cursor = sbp.limit;
|
||||
r_consonant_pair();
|
||||
sbp.cursor = sbp.limit;
|
||||
r_other_suffix();
|
||||
sbp.cursor = sbp.limit;
|
||||
r_undouble();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/* and return a function that stems a word for the current locale */
|
||||
return function(word) {
|
||||
st.setCurrent(word);
|
||||
st.stem();
|
||||
return st.getCurrent();
|
||||
}
|
||||
})();
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.da.stemmer, 'stemmer-da');
|
||||
|
||||
/* stop word filter function */
|
||||
lunr.da.stopWordFilter = function(token) {
|
||||
if (lunr.da.stopWordFilter.stopWords.indexOf(token) === -1) {
|
||||
return token;
|
||||
}
|
||||
};
|
||||
|
||||
lunr.da.stopWordFilter.stopWords = new lunr.SortedSet();
|
||||
lunr.da.stopWordFilter.stopWords.length = 95;
|
||||
|
||||
// The space at the beginning is crucial: It marks the empty string
|
||||
// as a stop word. lunr.js crashes during search when documents
|
||||
// processed by the pipeline still contain the empty string.
|
||||
lunr.da.stopWordFilter.stopWords.elements = ' ad af alle alt anden at blev blive bliver da de dem den denne der deres det dette dig din disse dog du efter eller en end er et for fra ham han hans har havde have hende hendes her hos hun hvad hvis hvor i ikke ind jeg jer jo kunne man mange med meget men mig min mine mit mod ned noget nogle nu når og også om op os over på selv sig sin sine sit skal skulle som sådan thi til ud under var vi vil ville vor være været'.split(' ');
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.da.stopWordFilter, 'stopWordFilter-da');
|
||||
};
|
||||
}))
|
||||
1
themes/tabi/static/js/lunr/lunr.da.min.js
vendored
Normal file
1
themes/tabi/static/js/lunr/lunr.da.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(r){if(void 0===r)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===r.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var e,t,i;r.da=function(){this.pipeline.reset(),this.pipeline.add(r.da.trimmer,r.da.stopWordFilter,r.da.stemmer)},r.da.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",r.da.trimmer=r.trimmerSupport.generateTrimmer(r.da.wordCharacters),r.Pipeline.registerFunction(r.da.trimmer,"trimmer-da"),r.da.stemmer=(e=r.stemmerSupport.Among,t=r.stemmerSupport.SnowballProgram,i=new function(){var n,s,o,d=[new e("hed",-1,1),new e("ethed",0,1),new e("ered",-1,1),new e("e",-1,1),new e("erede",3,1),new e("ende",3,1),new e("erende",5,1),new e("ene",3,1),new e("erne",3,1),new e("ere",3,1),new e("en",-1,1),new e("heden",10,1),new e("eren",10,1),new e("er",-1,1),new e("heder",13,1),new e("erer",13,1),new e("s",-1,2),new e("heds",16,1),new e("es",16,1),new e("endes",18,1),new e("erendes",19,1),new e("enes",18,1),new e("ernes",18,1),new e("eres",18,1),new e("ens",16,1),new e("hedens",24,1),new e("erens",24,1),new e("ers",16,1),new e("ets",16,1),new e("erets",28,1),new e("et",-1,1),new e("eret",30,1)],i=[new e("gd",-1,-1),new e("dt",-1,-1),new e("gt",-1,-1),new e("kt",-1,-1)],a=[new e("ig",-1,1),new e("lig",0,1),new e("elig",1,1),new e("els",-1,1),new e("løst",-1,2)],u=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],l=[239,254,42,3,0,0,0,0,0,0,0,0,0,0,0,0,16],c=new t;function m(){var e,r=c.limit-c.cursor;c.cursor>=s&&(e=c.limit_backward,c.limit_backward=s,c.ket=c.cursor,c.find_among_b(i,4)?(c.bra=c.cursor,c.limit_backward=e,c.cursor=c.limit-r,c.cursor>c.limit_backward&&(c.cursor--,c.bra=c.cursor,c.slice_del())):c.limit_backward=e)}this.setCurrent=function(e){c.setCurrent(e)},this.getCurrent=function(){return c.getCurrent()},this.stem=function(){var e,r=c.cursor;if(function(){var e,r=c.cursor+3;if(s=c.limit,0<=r&&r<=c.limit){for(n=r;;){if(e=c.cursor,c.in_grouping(u,97,248)){c.cursor=e;break}if((c.cursor=e)>=c.limit)return;c.cursor++}for(;!c.out_grouping(u,97,248);){if(c.cursor>=c.limit)return;c.cursor++}(s=c.cursor)<n&&(s=n)}}(),c.limit_backward=r,c.cursor=c.limit,c.cursor>=s&&(r=c.limit_backward,c.limit_backward=s,c.ket=c.cursor,e=c.find_among_b(d,32),c.limit_backward=r,e))switch(c.bra=c.cursor,e){case 1:c.slice_del();break;case 2:c.in_grouping_b(l,97,229)&&c.slice_del()}c.cursor=c.limit,m(),c.cursor=c.limit;var i,t,r=c.limit-c.cursor;if(c.ket=c.cursor,c.eq_s_b(2,"st")&&(c.bra=c.cursor,c.eq_s_b(2,"ig"))&&c.slice_del(),c.cursor=c.limit-r,c.cursor>=s&&(r=c.limit_backward,c.limit_backward=s,c.ket=c.cursor,i=c.find_among_b(a,5),c.limit_backward=r,i))switch(c.bra=c.cursor,i){case 1:c.slice_del(),t=c.limit-c.cursor,m(),c.cursor=c.limit-t;break;case 2:c.slice_from("løs")}return c.cursor=c.limit,c.cursor>=s&&(e=c.limit_backward,c.limit_backward=s,c.ket=c.cursor,c.out_grouping_b(u,97,248)?(c.bra=c.cursor,o=c.slice_to(o),c.limit_backward=e,c.eq_v_b(o)&&c.slice_del()):c.limit_backward=e),!0}},function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}),r.Pipeline.registerFunction(r.da.stemmer,"stemmer-da"),r.da.stopWordFilter=function(e){if(-1===r.da.stopWordFilter.stopWords.indexOf(e))return e},r.da.stopWordFilter.stopWords=new r.SortedSet,r.da.stopWordFilter.stopWords.length=95,r.da.stopWordFilter.stopWords.elements=" ad af alle alt anden at blev blive bliver da de dem den denne der deres det dette dig din disse dog du efter eller en end er et for fra ham han hans har havde have hende hendes her hos hun hvad hvis hvor i ikke ind jeg jer jo kunne man mange med meget men mig min mine mit mod ned noget nogle nu når og også om op os over på selv sig sin sine sit skal skulle som sådan thi til ud under var vi vil ville vor være været".split(" "),r.Pipeline.registerFunction(r.da.stopWordFilter,"stopWordFilter-da")}});
|
||||
380
themes/tabi/static/js/lunr/lunr.de.js
Normal file
380
themes/tabi/static/js/lunr/lunr.de.js
Normal file
@@ -0,0 +1,380 @@
|
||||
/*!
|
||||
* Lunr languages, `German` language
|
||||
* https://github.com/MihaiValentin/lunr-languages
|
||||
*
|
||||
* Copyright 2014, Mihai Valentin
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
/*!
|
||||
* based on
|
||||
* Snowball JavaScript Library v0.3
|
||||
* http://code.google.com/p/urim/
|
||||
* http://snowball.tartarus.org/
|
||||
*
|
||||
* Copyright 2010, Oleg Mazko
|
||||
* http://www.mozilla.org/MPL/
|
||||
*/
|
||||
|
||||
/**
|
||||
* export the module via AMD, CommonJS or as a browser global
|
||||
* Export code from https://github.com/umdjs/umd/blob/master/returnExports.js
|
||||
*/
|
||||
;
|
||||
(function(root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(factory)
|
||||
} else if (typeof exports === 'object') {
|
||||
/**
|
||||
* Node. Does not work with strict CommonJS, but
|
||||
* only CommonJS-like environments that support module.exports,
|
||||
* like Node.
|
||||
*/
|
||||
module.exports = factory()
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
factory()(root.lunr);
|
||||
}
|
||||
}(this, function() {
|
||||
/**
|
||||
* Just return a value to define the module export.
|
||||
* This example returns an object, but the module
|
||||
* can return a function as the exported value.
|
||||
*/
|
||||
return function(lunr) {
|
||||
/* throw error if lunr is not yet included */
|
||||
if ('undefined' === typeof lunr) {
|
||||
throw new Error('Lunr is not present. Please include / require Lunr before this script.');
|
||||
}
|
||||
|
||||
/* throw error if lunr stemmer support is not yet included */
|
||||
if ('undefined' === typeof lunr.stemmerSupport) {
|
||||
throw new Error('Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.');
|
||||
}
|
||||
|
||||
/* register specific locale function */
|
||||
lunr.de = function() {
|
||||
this.pipeline.reset();
|
||||
this.pipeline.add(
|
||||
lunr.de.trimmer,
|
||||
lunr.de.stopWordFilter,
|
||||
lunr.de.stemmer
|
||||
);
|
||||
};
|
||||
|
||||
/* lunr trimmer function */
|
||||
lunr.de.wordCharacters = "A-Za-z\xAA\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02E0-\u02E4\u1D00-\u1D25\u1D2C-\u1D5C\u1D62-\u1D65\u1D6B-\u1D77\u1D79-\u1DBE\u1E00-\u1EFF\u2071\u207F\u2090-\u209C\u212A\u212B\u2132\u214E\u2160-\u2188\u2C60-\u2C7F\uA722-\uA787\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA7FF\uAB30-\uAB5A\uAB5C-\uAB64\uFB00-\uFB06\uFF21-\uFF3A\uFF41-\uFF5A";
|
||||
lunr.de.trimmer = lunr.trimmerSupport.generateTrimmer(lunr.de.wordCharacters);
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.de.trimmer, 'trimmer-de');
|
||||
|
||||
/* lunr stemmer function */
|
||||
lunr.de.stemmer = (function() {
|
||||
/* create the wrapped stemmer object */
|
||||
var Among = lunr.stemmerSupport.Among,
|
||||
SnowballProgram = lunr.stemmerSupport.SnowballProgram,
|
||||
st = new function GermanStemmer() {
|
||||
var a_0 = [new Among("", -1, 6), new Among("U", 0, 2),
|
||||
new Among("Y", 0, 1), new Among("\u00E4", 0, 3),
|
||||
new Among("\u00F6", 0, 4), new Among("\u00FC", 0, 5)
|
||||
],
|
||||
a_1 = [
|
||||
new Among("e", -1, 2), new Among("em", -1, 1),
|
||||
new Among("en", -1, 2), new Among("ern", -1, 1),
|
||||
new Among("er", -1, 1), new Among("s", -1, 3),
|
||||
new Among("es", 5, 2)
|
||||
],
|
||||
a_2 = [new Among("en", -1, 1),
|
||||
new Among("er", -1, 1), new Among("st", -1, 2),
|
||||
new Among("est", 2, 1)
|
||||
],
|
||||
a_3 = [new Among("ig", -1, 1),
|
||||
new Among("lich", -1, 1)
|
||||
],
|
||||
a_4 = [new Among("end", -1, 1),
|
||||
new Among("ig", -1, 2), new Among("ung", -1, 1),
|
||||
new Among("lich", -1, 3), new Among("isch", -1, 2),
|
||||
new Among("ik", -1, 2), new Among("heit", -1, 3),
|
||||
new Among("keit", -1, 4)
|
||||
],
|
||||
g_v = [17, 65, 16, 1, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 8, 0, 32, 8
|
||||
],
|
||||
g_s_ending = [117, 30, 5],
|
||||
g_st_ending = [
|
||||
117, 30, 4
|
||||
],
|
||||
I_x, I_p2, I_p1, sbp = new SnowballProgram();
|
||||
this.setCurrent = function(word) {
|
||||
sbp.setCurrent(word);
|
||||
};
|
||||
this.getCurrent = function() {
|
||||
return sbp.getCurrent();
|
||||
};
|
||||
|
||||
function habr1(c1, c2, v_1) {
|
||||
if (sbp.eq_s(1, c1)) {
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.in_grouping(g_v, 97, 252)) {
|
||||
sbp.slice_from(c2);
|
||||
sbp.cursor = v_1;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function r_prelude() {
|
||||
var v_1 = sbp.cursor,
|
||||
v_2, v_3, v_4, v_5;
|
||||
while (true) {
|
||||
v_2 = sbp.cursor;
|
||||
sbp.bra = v_2;
|
||||
if (sbp.eq_s(1, "\u00DF")) {
|
||||
sbp.ket = sbp.cursor;
|
||||
sbp.slice_from("ss");
|
||||
} else {
|
||||
if (v_2 >= sbp.limit)
|
||||
break;
|
||||
sbp.cursor = v_2 + 1;
|
||||
}
|
||||
}
|
||||
sbp.cursor = v_1;
|
||||
while (true) {
|
||||
v_3 = sbp.cursor;
|
||||
while (true) {
|
||||
v_4 = sbp.cursor;
|
||||
if (sbp.in_grouping(g_v, 97, 252)) {
|
||||
v_5 = sbp.cursor;
|
||||
sbp.bra = v_5;
|
||||
if (habr1("u", "U", v_4))
|
||||
break;
|
||||
sbp.cursor = v_5;
|
||||
if (habr1("y", "Y", v_4))
|
||||
break;
|
||||
}
|
||||
if (v_4 >= sbp.limit) {
|
||||
sbp.cursor = v_3;
|
||||
return;
|
||||
}
|
||||
sbp.cursor = v_4 + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function habr2() {
|
||||
while (!sbp.in_grouping(g_v, 97, 252)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return true;
|
||||
sbp.cursor++;
|
||||
}
|
||||
while (!sbp.out_grouping(g_v, 97, 252)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return true;
|
||||
sbp.cursor++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function r_mark_regions() {
|
||||
I_p1 = sbp.limit;
|
||||
I_p2 = I_p1;
|
||||
var c = sbp.cursor + 3;
|
||||
if (0 <= c && c <= sbp.limit) {
|
||||
I_x = c;
|
||||
if (!habr2()) {
|
||||
I_p1 = sbp.cursor;
|
||||
if (I_p1 < I_x)
|
||||
I_p1 = I_x;
|
||||
if (!habr2())
|
||||
I_p2 = sbp.cursor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_postlude() {
|
||||
var among_var, v_1;
|
||||
while (true) {
|
||||
v_1 = sbp.cursor;
|
||||
sbp.bra = v_1;
|
||||
among_var = sbp.find_among(a_0, 6);
|
||||
if (!among_var)
|
||||
return;
|
||||
sbp.ket = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_from("y");
|
||||
break;
|
||||
case 2:
|
||||
case 5:
|
||||
sbp.slice_from("u");
|
||||
break;
|
||||
case 3:
|
||||
sbp.slice_from("a");
|
||||
break;
|
||||
case 4:
|
||||
sbp.slice_from("o");
|
||||
break;
|
||||
case 6:
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return;
|
||||
sbp.cursor++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_R1() {
|
||||
return I_p1 <= sbp.cursor;
|
||||
}
|
||||
|
||||
function r_R2() {
|
||||
return I_p2 <= sbp.cursor;
|
||||
}
|
||||
|
||||
function r_standard_suffix() {
|
||||
var among_var, v_1 = sbp.limit - sbp.cursor,
|
||||
v_2, v_3, v_4;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_1, 7);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R1()) {
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 2:
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(1, "s")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (sbp.eq_s_b(3, "nis"))
|
||||
sbp.slice_del();
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (sbp.in_grouping_b(g_s_ending, 98, 116))
|
||||
sbp.slice_del();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_2, 4);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R1()) {
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 2:
|
||||
if (sbp.in_grouping_b(g_st_ending, 98, 116)) {
|
||||
var c = sbp.cursor - 3;
|
||||
if (sbp.limit_backward <= c && c <= sbp.limit) {
|
||||
sbp.cursor = c;
|
||||
sbp.slice_del();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_4, 8);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R2()) {
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(2, "ig")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
v_2 = sbp.limit - sbp.cursor;
|
||||
if (!sbp.eq_s_b(1, "e")) {
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
if (r_R2())
|
||||
sbp.slice_del();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
v_3 = sbp.limit - sbp.cursor;
|
||||
if (!sbp.eq_s_b(1, "e")) {
|
||||
sbp.cursor = sbp.limit - v_3;
|
||||
sbp.slice_del();
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
v_4 = sbp.limit - sbp.cursor;
|
||||
if (!sbp.eq_s_b(2, "er")) {
|
||||
sbp.cursor = sbp.limit - v_4;
|
||||
if (!sbp.eq_s_b(2, "en"))
|
||||
break;
|
||||
}
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R1())
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 4:
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_3, 2);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R2() && among_var == 1)
|
||||
sbp.slice_del();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.stem = function() {
|
||||
var v_1 = sbp.cursor;
|
||||
r_prelude();
|
||||
sbp.cursor = v_1;
|
||||
r_mark_regions();
|
||||
sbp.limit_backward = v_1;
|
||||
sbp.cursor = sbp.limit;
|
||||
r_standard_suffix();
|
||||
sbp.cursor = sbp.limit_backward;
|
||||
r_postlude();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/* and return a function that stems a word for the current locale */
|
||||
return function(word) {
|
||||
st.setCurrent(word);
|
||||
st.stem();
|
||||
return st.getCurrent();
|
||||
}
|
||||
})();
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.de.stemmer, 'stemmer-de');
|
||||
|
||||
/* stop word filter function */
|
||||
lunr.de.stopWordFilter = function(token) {
|
||||
if (lunr.de.stopWordFilter.stopWords.indexOf(token) === -1) {
|
||||
return token;
|
||||
}
|
||||
};
|
||||
|
||||
lunr.de.stopWordFilter.stopWords = new lunr.SortedSet();
|
||||
lunr.de.stopWordFilter.stopWords.length = 232;
|
||||
|
||||
// The space at the beginning is crucial: It marks the empty string
|
||||
// as a stop word. lunr.js crashes during search when documents
|
||||
// processed by the pipeline still contain the empty string.
|
||||
lunr.de.stopWordFilter.stopWords.elements = ' aber alle allem allen aller alles als also am an ander andere anderem anderen anderer anderes anderm andern anderr anders auch auf aus bei bin bis bist da damit dann das dasselbe dazu daß dein deine deinem deinen deiner deines dem demselben den denn denselben der derer derselbe derselben des desselben dessen dich die dies diese dieselbe dieselben diesem diesen dieser dieses dir doch dort du durch ein eine einem einen einer eines einig einige einigem einigen einiger einiges einmal er es etwas euch euer eure eurem euren eurer eures für gegen gewesen hab habe haben hat hatte hatten hier hin hinter ich ihm ihn ihnen ihr ihre ihrem ihren ihrer ihres im in indem ins ist jede jedem jeden jeder jedes jene jenem jenen jener jenes jetzt kann kein keine keinem keinen keiner keines können könnte machen man manche manchem manchen mancher manches mein meine meinem meinen meiner meines mich mir mit muss musste nach nicht nichts noch nun nur ob oder ohne sehr sein seine seinem seinen seiner seines selbst sich sie sind so solche solchem solchen solcher solches soll sollte sondern sonst um und uns unse unsem unsen unser unses unter viel vom von vor war waren warst was weg weil weiter welche welchem welchen welcher welches wenn werde werden wie wieder will wir wird wirst wo wollen wollte während würde würden zu zum zur zwar zwischen über'.split(' ');
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.de.stopWordFilter, 'stopWordFilter-de');
|
||||
};
|
||||
}))
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user