Merge commit '8be91ee3d9
' as 'themes/tabi-lean'
This commit is contained in:
commit
2c6602e3b2
336 changed files with 25227 additions and 0 deletions
1
themes/tabi-lean/static/custom_subset.css
Normal file
1
themes/tabi-lean/static/custom_subset.css
Normal file
File diff suppressed because one or more lines are too long
119
themes/tabi-lean/static/feed_style.xsl
Normal file
119
themes/tabi-lean/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-lean/static/fonts/HackNerdFontMono-Bold.ttf
Normal file
BIN
themes/tabi-lean/static/fonts/HackNerdFontMono-Bold.ttf
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/HackNerdFontMono-BoldItalic.ttf
Normal file
BIN
themes/tabi-lean/static/fonts/HackNerdFontMono-BoldItalic.ttf
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/HackNerdFontMono-Italic.ttf
Normal file
BIN
themes/tabi-lean/static/fonts/HackNerdFontMono-Italic.ttf
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/HackNerdFontMono-Regular.ttf
Normal file
BIN
themes/tabi-lean/static/fonts/HackNerdFontMono-Regular.ttf
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_AMS-Regular.ttf
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_AMS-Regular.ttf
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_AMS-Regular.woff
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_AMS-Regular.woff
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_AMS-Regular.woff2
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_AMS-Regular.woff2
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Caligraphic-Bold.ttf
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Caligraphic-Bold.ttf
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Caligraphic-Bold.woff
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Caligraphic-Bold.woff
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Caligraphic-Bold.woff2
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Caligraphic-Bold.woff2
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Fraktur-Bold.ttf
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Fraktur-Bold.ttf
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Fraktur-Bold.woff
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Fraktur-Bold.woff
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Fraktur-Bold.woff2
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Fraktur-Bold.woff2
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Fraktur-Regular.ttf
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Fraktur-Regular.ttf
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Fraktur-Regular.woff
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Fraktur-Regular.woff
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Fraktur-Regular.woff2
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Fraktur-Regular.woff2
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Main-Bold.ttf
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Main-Bold.ttf
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Main-Bold.woff
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Main-Bold.woff
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Main-Bold.woff2
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Main-Bold.woff2
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Main-BoldItalic.ttf
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Main-BoldItalic.ttf
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Main-BoldItalic.woff
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Main-BoldItalic.woff
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Main-BoldItalic.woff2
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Main-BoldItalic.woff2
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Main-Italic.ttf
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Main-Italic.ttf
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Main-Italic.woff
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Main-Italic.woff
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Main-Italic.woff2
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Main-Italic.woff2
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Main-Regular.ttf
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Main-Regular.ttf
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Main-Regular.woff
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Main-Regular.woff
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Main-Regular.woff2
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Main-Regular.woff2
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Math-BoldItalic.ttf
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Math-BoldItalic.ttf
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Math-BoldItalic.woff
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Math-BoldItalic.woff
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Math-BoldItalic.woff2
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Math-BoldItalic.woff2
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Math-Italic.ttf
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Math-Italic.ttf
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Math-Italic.woff
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Math-Italic.woff
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Math-Italic.woff2
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Math-Italic.woff2
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_SansSerif-Bold.ttf
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_SansSerif-Bold.ttf
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_SansSerif-Bold.woff
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_SansSerif-Bold.woff
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_SansSerif-Bold.woff2
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_SansSerif-Bold.woff2
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_SansSerif-Italic.ttf
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_SansSerif-Italic.ttf
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_SansSerif-Italic.woff
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_SansSerif-Italic.woff
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_SansSerif-Italic.woff2
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_SansSerif-Italic.woff2
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_SansSerif-Regular.ttf
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_SansSerif-Regular.ttf
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_SansSerif-Regular.woff
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_SansSerif-Regular.woff
Normal file
Binary file not shown.
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Script-Regular.ttf
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Script-Regular.ttf
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Script-Regular.woff
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Script-Regular.woff
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Script-Regular.woff2
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Script-Regular.woff2
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Size1-Regular.ttf
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Size1-Regular.ttf
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Size1-Regular.woff
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Size1-Regular.woff
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Size1-Regular.woff2
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Size1-Regular.woff2
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Size2-Regular.ttf
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Size2-Regular.ttf
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Size2-Regular.woff
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Size2-Regular.woff
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Size2-Regular.woff2
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Size2-Regular.woff2
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Size3-Regular.ttf
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Size3-Regular.ttf
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Size3-Regular.woff
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Size3-Regular.woff
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Size3-Regular.woff2
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Size3-Regular.woff2
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Size4-Regular.ttf
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Size4-Regular.ttf
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Size4-Regular.woff
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Size4-Regular.woff
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Size4-Regular.woff2
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Size4-Regular.woff2
Normal file
Binary file not shown.
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Typewriter-Regular.ttf
Normal file
BIN
themes/tabi-lean/static/fonts/KaTeX/KaTeX_Typewriter-Regular.ttf
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
1
themes/tabi-lean/static/inter_subset_en.css
Normal file
1
themes/tabi-lean/static/inter_subset_en.css
Normal file
File diff suppressed because one or more lines are too long
1
themes/tabi-lean/static/inter_subset_es.css
Normal file
1
themes/tabi-lean/static/inter_subset_es.css
Normal file
File diff suppressed because one or more lines are too long
375
themes/tabi-lean/static/isso.css
Normal file
375
themes/tabi-lean/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-lean/static/isso.min.css
vendored
Normal file
1
themes/tabi-lean/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-lean/static/js/codeBlockNameLinks.js
Normal file
36
themes/tabi-lean/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-lean/static/js/codeBlockNameLinks.min.js
vendored
Normal file
1
themes/tabi-lean/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-lean/static/js/copyCodeToClipboard.js
Normal file
47
themes/tabi-lean/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-lean/static/js/copyCodeToClipboard.min.js
vendored
Normal file
1
themes/tabi-lean/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-lean/static/js/decodeMail.js
Normal file
44
themes/tabi-lean/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-lean/static/js/decodeMail.min.js
vendored
Normal file
1
themes/tabi-lean/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-lean/static/js/filterCards.js
Normal file
99
themes/tabi-lean/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-lean/static/js/filterCards.min.js
vendored
Normal file
1
themes/tabi-lean/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-lean/static/js/footnoteBacklinks.js
Normal file
33
themes/tabi-lean/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-lean/static/js/footnoteBacklinks.min.js
vendored
Normal file
1
themes/tabi-lean/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-lean/static/js/giscus.js
Normal file
81
themes/tabi-lean/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-lean/static/js/giscus.min.js
vendored
Normal file
1
themes/tabi-lean/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-lean/static/js/hyvortalk.js
Normal file
44
themes/tabi-lean/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-lean/static/js/hyvortalk.min.js
vendored
Normal file
1
themes/tabi-lean/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-lean/static/js/initializeTheme.js
Normal file
25
themes/tabi-lean/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-lean/static/js/initializeTheme.min.js
vendored
Normal file
1
themes/tabi-lean/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-lean/static/js/isso.js
Normal file
81
themes/tabi-lean/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-lean/static/js/isso.min.js
vendored
Normal file
1
themes/tabi-lean/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-lean/static/js/katex.min.js
vendored
Normal file
1
themes/tabi-lean/static/js/katex.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
26
themes/tabi-lean/static/js/loadComments.js
Normal file
26
themes/tabi-lean/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-lean/static/js/loadComments.min.js
vendored
Normal file
1
themes/tabi-lean/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-lean/static/js/lunr/lunr.da.js
Normal file
280
themes/tabi-lean/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-lean/static/js/lunr/lunr.da.min.js
vendored
Normal file
1
themes/tabi-lean/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-lean/static/js/lunr/lunr.de.js
Normal file
380
themes/tabi-lean/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');
|
||||
};
|
||||
}))
|
1
themes/tabi-lean/static/js/lunr/lunr.de.min.js
vendored
Normal file
1
themes/tabi-lean/static/js/lunr/lunr.de.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
444
themes/tabi-lean/static/js/lunr/lunr.du.js
Normal file
444
themes/tabi-lean/static/js/lunr/lunr.du.js
Normal file
|
@ -0,0 +1,444 @@
|
|||
/*!
|
||||
* Lunr languages, `Dutch` 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.du = function() {
|
||||
this.pipeline.reset();
|
||||
this.pipeline.add(
|
||||
lunr.du.trimmer,
|
||||
lunr.du.stopWordFilter,
|
||||
lunr.du.stemmer
|
||||
);
|
||||
};
|
||||
|
||||
/* lunr trimmer function */
|
||||
lunr.du.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.du.trimmer = lunr.trimmerSupport.generateTrimmer(lunr.du.wordCharacters);
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.du.trimmer, 'trimmer-du');
|
||||
|
||||
/* lunr stemmer function */
|
||||
lunr.du.stemmer = (function() {
|
||||
/* create the wrapped stemmer object */
|
||||
var Among = lunr.stemmerSupport.Among,
|
||||
SnowballProgram = lunr.stemmerSupport.SnowballProgram,
|
||||
st = new function DutchStemmer() {
|
||||
var a_0 = [new Among("", -1, 6), new Among("\u00E1", 0, 1),
|
||||
new Among("\u00E4", 0, 1), new Among("\u00E9", 0, 2),
|
||||
new Among("\u00EB", 0, 2), new Among("\u00ED", 0, 3),
|
||||
new Among("\u00EF", 0, 3), new Among("\u00F3", 0, 4),
|
||||
new Among("\u00F6", 0, 4), new Among("\u00FA", 0, 5),
|
||||
new Among("\u00FC", 0, 5)
|
||||
],
|
||||
a_1 = [new Among("", -1, 3),
|
||||
new Among("I", 0, 2), new Among("Y", 0, 1)
|
||||
],
|
||||
a_2 = [
|
||||
new Among("dd", -1, -1), new Among("kk", -1, -1),
|
||||
new Among("tt", -1, -1)
|
||||
],
|
||||
a_3 = [new Among("ene", -1, 2),
|
||||
new Among("se", -1, 3), new Among("en", -1, 2),
|
||||
new Among("heden", 2, 1), new Among("s", -1, 3)
|
||||
],
|
||||
a_4 = [
|
||||
new Among("end", -1, 1), new Among("ig", -1, 2),
|
||||
new Among("ing", -1, 1), new Among("lijk", -1, 3),
|
||||
new Among("baar", -1, 4), new Among("bar", -1, 5)
|
||||
],
|
||||
a_5 = [
|
||||
new Among("aa", -1, -1), new Among("ee", -1, -1),
|
||||
new Among("oo", -1, -1), new Among("uu", -1, -1)
|
||||
],
|
||||
g_v = [17, 65,
|
||||
16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128
|
||||
],
|
||||
g_v_I = [1, 0, 0,
|
||||
17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128
|
||||
],
|
||||
g_v_j = [
|
||||
17, 67, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128
|
||||
],
|
||||
I_p2, I_p1, B_e_found, sbp = new SnowballProgram();
|
||||
this.setCurrent = function(word) {
|
||||
sbp.setCurrent(word);
|
||||
};
|
||||
this.getCurrent = function() {
|
||||
return sbp.getCurrent();
|
||||
};
|
||||
|
||||
function r_prelude() {
|
||||
var among_var, v_1 = sbp.cursor,
|
||||
v_2, v_3;
|
||||
while (true) {
|
||||
sbp.bra = sbp.cursor;
|
||||
among_var = sbp.find_among(a_0, 11);
|
||||
if (among_var) {
|
||||
sbp.ket = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_from("a");
|
||||
continue;
|
||||
case 2:
|
||||
sbp.slice_from("e");
|
||||
continue;
|
||||
case 3:
|
||||
sbp.slice_from("i");
|
||||
continue;
|
||||
case 4:
|
||||
sbp.slice_from("o");
|
||||
continue;
|
||||
case 5:
|
||||
sbp.slice_from("u");
|
||||
continue;
|
||||
case 6:
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
break;
|
||||
sbp.cursor++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
sbp.cursor = v_1;
|
||||
sbp.bra = v_1;
|
||||
if (sbp.eq_s(1, "y")) {
|
||||
sbp.ket = sbp.cursor;
|
||||
sbp.slice_from("Y");
|
||||
} else
|
||||
sbp.cursor = v_1;
|
||||
while (true) {
|
||||
v_2 = sbp.cursor;
|
||||
if (sbp.in_grouping(g_v, 97, 232)) {
|
||||
v_3 = sbp.cursor;
|
||||
sbp.bra = v_3;
|
||||
if (sbp.eq_s(1, "i")) {
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.in_grouping(g_v, 97, 232)) {
|
||||
sbp.slice_from("I");
|
||||
sbp.cursor = v_2;
|
||||
}
|
||||
} else {
|
||||
sbp.cursor = v_3;
|
||||
if (sbp.eq_s(1, "y")) {
|
||||
sbp.ket = sbp.cursor;
|
||||
sbp.slice_from("Y");
|
||||
sbp.cursor = v_2;
|
||||
} else if (habr1(v_2))
|
||||
break;
|
||||
}
|
||||
} else if (habr1(v_2))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function habr1(v_1) {
|
||||
sbp.cursor = v_1;
|
||||
if (v_1 >= sbp.limit)
|
||||
return true;
|
||||
sbp.cursor++;
|
||||
return false;
|
||||
}
|
||||
|
||||
function r_mark_regions() {
|
||||
I_p1 = sbp.limit;
|
||||
I_p2 = I_p1;
|
||||
if (!habr2()) {
|
||||
I_p1 = sbp.cursor;
|
||||
if (I_p1 < 3)
|
||||
I_p1 = 3;
|
||||
if (!habr2())
|
||||
I_p2 = sbp.cursor;
|
||||
}
|
||||
}
|
||||
|
||||
function habr2() {
|
||||
while (!sbp.in_grouping(g_v, 97, 232)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return true;
|
||||
sbp.cursor++;
|
||||
}
|
||||
while (!sbp.out_grouping(g_v, 97, 232)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return true;
|
||||
sbp.cursor++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function r_postlude() {
|
||||
var among_var;
|
||||
while (true) {
|
||||
sbp.bra = sbp.cursor;
|
||||
among_var = sbp.find_among(a_1, 3);
|
||||
if (among_var) {
|
||||
sbp.ket = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_from("y");
|
||||
break;
|
||||
case 2:
|
||||
sbp.slice_from("i");
|
||||
break;
|
||||
case 3:
|
||||
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_undouble() {
|
||||
var v_1 = sbp.limit - sbp.cursor;
|
||||
if (sbp.find_among_b(a_2, 3)) {
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.cursor > sbp.limit_backward) {
|
||||
sbp.cursor--;
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.slice_del();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_e_ending() {
|
||||
var v_1;
|
||||
B_e_found = false;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(1, "e")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R1()) {
|
||||
v_1 = sbp.limit - sbp.cursor;
|
||||
if (sbp.out_grouping_b(g_v, 97, 232)) {
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
sbp.slice_del();
|
||||
B_e_found = true;
|
||||
r_undouble();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_en_ending() {
|
||||
var v_1;
|
||||
if (r_R1()) {
|
||||
v_1 = sbp.limit - sbp.cursor;
|
||||
if (sbp.out_grouping_b(g_v, 97, 232)) {
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
if (!sbp.eq_s_b(3, "gem")) {
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
sbp.slice_del();
|
||||
r_undouble();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_standard_suffix() {
|
||||
var among_var, v_1 = sbp.limit - sbp.cursor,
|
||||
v_2, v_3, v_4, v_5, v_6;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_3, 5);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
if (r_R1())
|
||||
sbp.slice_from("heid");
|
||||
break;
|
||||
case 2:
|
||||
r_en_ending();
|
||||
break;
|
||||
case 3:
|
||||
if (r_R1() && sbp.out_grouping_b(g_v_j, 97, 232))
|
||||
sbp.slice_del();
|
||||
break;
|
||||
}
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
r_e_ending();
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(4, "heid")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R2()) {
|
||||
v_2 = sbp.limit - sbp.cursor;
|
||||
if (!sbp.eq_s_b(1, "c")) {
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(2, "en")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
r_en_ending();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_4, 6);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
if (r_R2()) {
|
||||
sbp.slice_del();
|
||||
v_3 = sbp.limit - sbp.cursor;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(2, "ig")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R2()) {
|
||||
v_4 = sbp.limit - sbp.cursor;
|
||||
if (!sbp.eq_s_b(1, "e")) {
|
||||
sbp.cursor = sbp.limit - v_4;
|
||||
sbp.slice_del();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_3;
|
||||
r_undouble();
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (r_R2()) {
|
||||
v_5 = sbp.limit - sbp.cursor;
|
||||
if (!sbp.eq_s_b(1, "e")) {
|
||||
sbp.cursor = sbp.limit - v_5;
|
||||
sbp.slice_del();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (r_R2()) {
|
||||
sbp.slice_del();
|
||||
r_e_ending();
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (r_R2())
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 5:
|
||||
if (r_R2() && B_e_found)
|
||||
sbp.slice_del();
|
||||
break;
|
||||
}
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
if (sbp.out_grouping_b(g_v_I, 73, 232)) {
|
||||
v_6 = sbp.limit - sbp.cursor;
|
||||
if (sbp.find_among_b(a_5, 4) && sbp.out_grouping_b(g_v, 97, 232)) {
|
||||
sbp.cursor = sbp.limit - v_6;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.cursor > sbp.limit_backward) {
|
||||
sbp.cursor--;
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.slice_del();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
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.du.stemmer, 'stemmer-du');
|
||||
|
||||
/* stop word filter function */
|
||||
lunr.du.stopWordFilter = function(token) {
|
||||
if (lunr.du.stopWordFilter.stopWords.indexOf(token) === -1) {
|
||||
return token;
|
||||
}
|
||||
};
|
||||
|
||||
lunr.du.stopWordFilter.stopWords = new lunr.SortedSet();
|
||||
lunr.du.stopWordFilter.stopWords.length = 103;
|
||||
|
||||
// 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.du.stopWordFilter.stopWords.elements = ' aan al alles als altijd andere ben bij daar dan dat de der deze die dit doch doen door dus een eens en er ge geen geweest haar had heb hebben heeft hem het hier hij hoe hun iemand iets ik in is ja je kan kon kunnen maar me meer men met mij mijn moet na naar niet niets nog nu of om omdat onder ons ook op over reeds te tegen toch toen tot u uit uw van veel voor want waren was wat werd wezen wie wil worden wordt zal ze zelf zich zij zijn zo zonder zou'.split(' ');
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.du.stopWordFilter, 'stopWordFilter-du');
|
||||
};
|
||||
}))
|
1
themes/tabi-lean/static/js/lunr/lunr.du.min.js
vendored
Normal file
1
themes/tabi-lean/static/js/lunr/lunr.du.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
595
themes/tabi-lean/static/js/lunr/lunr.es.js
Normal file
595
themes/tabi-lean/static/js/lunr/lunr.es.js
Normal file
|
@ -0,0 +1,595 @@
|
|||
/*!
|
||||
* Lunr languages, `Spanish` 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.es = function() {
|
||||
this.pipeline.reset();
|
||||
this.pipeline.add(
|
||||
lunr.es.trimmer,
|
||||
lunr.es.stopWordFilter,
|
||||
lunr.es.stemmer
|
||||
);
|
||||
};
|
||||
|
||||
/* lunr trimmer function */
|
||||
lunr.es.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.es.trimmer = lunr.trimmerSupport.generateTrimmer(lunr.es.wordCharacters);
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.es.trimmer, 'trimmer-es');
|
||||
|
||||
/* lunr stemmer function */
|
||||
lunr.es.stemmer = (function() {
|
||||
/* create the wrapped stemmer object */
|
||||
var Among = lunr.stemmerSupport.Among,
|
||||
SnowballProgram = lunr.stemmerSupport.SnowballProgram,
|
||||
st = new function SpanishStemmer() {
|
||||
var a_0 = [new Among("", -1, 6), new Among("\u00E1", 0, 1),
|
||||
new Among("\u00E9", 0, 2), new Among("\u00ED", 0, 3),
|
||||
new Among("\u00F3", 0, 4), new Among("\u00FA", 0, 5)
|
||||
],
|
||||
a_1 = [
|
||||
new Among("la", -1, -1), new Among("sela", 0, -1),
|
||||
new Among("le", -1, -1), new Among("me", -1, -1),
|
||||
new Among("se", -1, -1), new Among("lo", -1, -1),
|
||||
new Among("selo", 5, -1), new Among("las", -1, -1),
|
||||
new Among("selas", 7, -1), new Among("les", -1, -1),
|
||||
new Among("los", -1, -1), new Among("selos", 10, -1),
|
||||
new Among("nos", -1, -1)
|
||||
],
|
||||
a_2 = [new Among("ando", -1, 6),
|
||||
new Among("iendo", -1, 6), new Among("yendo", -1, 7),
|
||||
new Among("\u00E1ndo", -1, 2), new Among("i\u00E9ndo", -1, 1),
|
||||
new Among("ar", -1, 6), new Among("er", -1, 6),
|
||||
new Among("ir", -1, 6), new Among("\u00E1r", -1, 3),
|
||||
new Among("\u00E9r", -1, 4), new Among("\u00EDr", -1, 5)
|
||||
],
|
||||
a_3 = [
|
||||
new Among("ic", -1, -1), new Among("ad", -1, -1),
|
||||
new Among("os", -1, -1), new Among("iv", -1, 1)
|
||||
],
|
||||
a_4 = [
|
||||
new Among("able", -1, 1), new Among("ible", -1, 1),
|
||||
new Among("ante", -1, 1)
|
||||
],
|
||||
a_5 = [new Among("ic", -1, 1),
|
||||
new Among("abil", -1, 1), new Among("iv", -1, 1)
|
||||
],
|
||||
a_6 = [
|
||||
new Among("ica", -1, 1), new Among("ancia", -1, 2),
|
||||
new Among("encia", -1, 5), new Among("adora", -1, 2),
|
||||
new Among("osa", -1, 1), new Among("ista", -1, 1),
|
||||
new Among("iva", -1, 9), new Among("anza", -1, 1),
|
||||
new Among("log\u00EDa", -1, 3), new Among("idad", -1, 8),
|
||||
new Among("able", -1, 1), new Among("ible", -1, 1),
|
||||
new Among("ante", -1, 2), new Among("mente", -1, 7),
|
||||
new Among("amente", 13, 6), new Among("aci\u00F3n", -1, 2),
|
||||
new Among("uci\u00F3n", -1, 4), new Among("ico", -1, 1),
|
||||
new Among("ismo", -1, 1), new Among("oso", -1, 1),
|
||||
new Among("amiento", -1, 1), new Among("imiento", -1, 1),
|
||||
new Among("ivo", -1, 9), new Among("ador", -1, 2),
|
||||
new Among("icas", -1, 1), new Among("ancias", -1, 2),
|
||||
new Among("encias", -1, 5), new Among("adoras", -1, 2),
|
||||
new Among("osas", -1, 1), new Among("istas", -1, 1),
|
||||
new Among("ivas", -1, 9), new Among("anzas", -1, 1),
|
||||
new Among("log\u00EDas", -1, 3), new Among("idades", -1, 8),
|
||||
new Among("ables", -1, 1), new Among("ibles", -1, 1),
|
||||
new Among("aciones", -1, 2), new Among("uciones", -1, 4),
|
||||
new Among("adores", -1, 2), new Among("antes", -1, 2),
|
||||
new Among("icos", -1, 1), new Among("ismos", -1, 1),
|
||||
new Among("osos", -1, 1), new Among("amientos", -1, 1),
|
||||
new Among("imientos", -1, 1), new Among("ivos", -1, 9)
|
||||
],
|
||||
a_7 = [
|
||||
new Among("ya", -1, 1), new Among("ye", -1, 1),
|
||||
new Among("yan", -1, 1), new Among("yen", -1, 1),
|
||||
new Among("yeron", -1, 1), new Among("yendo", -1, 1),
|
||||
new Among("yo", -1, 1), new Among("yas", -1, 1),
|
||||
new Among("yes", -1, 1), new Among("yais", -1, 1),
|
||||
new Among("yamos", -1, 1), new Among("y\u00F3", -1, 1)
|
||||
],
|
||||
a_8 = [
|
||||
new Among("aba", -1, 2), new Among("ada", -1, 2),
|
||||
new Among("ida", -1, 2), new Among("ara", -1, 2),
|
||||
new Among("iera", -1, 2), new Among("\u00EDa", -1, 2),
|
||||
new Among("ar\u00EDa", 5, 2), new Among("er\u00EDa", 5, 2),
|
||||
new Among("ir\u00EDa", 5, 2), new Among("ad", -1, 2),
|
||||
new Among("ed", -1, 2), new Among("id", -1, 2),
|
||||
new Among("ase", -1, 2), new Among("iese", -1, 2),
|
||||
new Among("aste", -1, 2), new Among("iste", -1, 2),
|
||||
new Among("an", -1, 2), new Among("aban", 16, 2),
|
||||
new Among("aran", 16, 2), new Among("ieran", 16, 2),
|
||||
new Among("\u00EDan", 16, 2), new Among("ar\u00EDan", 20, 2),
|
||||
new Among("er\u00EDan", 20, 2), new Among("ir\u00EDan", 20, 2),
|
||||
new Among("en", -1, 1), new Among("asen", 24, 2),
|
||||
new Among("iesen", 24, 2), new Among("aron", -1, 2),
|
||||
new Among("ieron", -1, 2), new Among("ar\u00E1n", -1, 2),
|
||||
new Among("er\u00E1n", -1, 2), new Among("ir\u00E1n", -1, 2),
|
||||
new Among("ado", -1, 2), new Among("ido", -1, 2),
|
||||
new Among("ando", -1, 2), new Among("iendo", -1, 2),
|
||||
new Among("ar", -1, 2), new Among("er", -1, 2),
|
||||
new Among("ir", -1, 2), new Among("as", -1, 2),
|
||||
new Among("abas", 39, 2), new Among("adas", 39, 2),
|
||||
new Among("idas", 39, 2), new Among("aras", 39, 2),
|
||||
new Among("ieras", 39, 2), new Among("\u00EDas", 39, 2),
|
||||
new Among("ar\u00EDas", 45, 2), new Among("er\u00EDas", 45, 2),
|
||||
new Among("ir\u00EDas", 45, 2), new Among("es", -1, 1),
|
||||
new Among("ases", 49, 2), new Among("ieses", 49, 2),
|
||||
new Among("abais", -1, 2), new Among("arais", -1, 2),
|
||||
new Among("ierais", -1, 2), new Among("\u00EDais", -1, 2),
|
||||
new Among("ar\u00EDais", 55, 2), new Among("er\u00EDais", 55, 2),
|
||||
new Among("ir\u00EDais", 55, 2), new Among("aseis", -1, 2),
|
||||
new Among("ieseis", -1, 2), new Among("asteis", -1, 2),
|
||||
new Among("isteis", -1, 2), new Among("\u00E1is", -1, 2),
|
||||
new Among("\u00E9is", -1, 1), new Among("ar\u00E9is", 64, 2),
|
||||
new Among("er\u00E9is", 64, 2), new Among("ir\u00E9is", 64, 2),
|
||||
new Among("ados", -1, 2), new Among("idos", -1, 2),
|
||||
new Among("amos", -1, 2), new Among("\u00E1bamos", 70, 2),
|
||||
new Among("\u00E1ramos", 70, 2), new Among("i\u00E9ramos", 70, 2),
|
||||
new Among("\u00EDamos", 70, 2), new Among("ar\u00EDamos", 74, 2),
|
||||
new Among("er\u00EDamos", 74, 2), new Among("ir\u00EDamos", 74, 2),
|
||||
new Among("emos", -1, 1), new Among("aremos", 78, 2),
|
||||
new Among("eremos", 78, 2), new Among("iremos", 78, 2),
|
||||
new Among("\u00E1semos", 78, 2), new Among("i\u00E9semos", 78, 2),
|
||||
new Among("imos", -1, 2), new Among("ar\u00E1s", -1, 2),
|
||||
new Among("er\u00E1s", -1, 2), new Among("ir\u00E1s", -1, 2),
|
||||
new Among("\u00EDs", -1, 2), new Among("ar\u00E1", -1, 2),
|
||||
new Among("er\u00E1", -1, 2), new Among("ir\u00E1", -1, 2),
|
||||
new Among("ar\u00E9", -1, 2), new Among("er\u00E9", -1, 2),
|
||||
new Among("ir\u00E9", -1, 2), new Among("i\u00F3", -1, 2)
|
||||
],
|
||||
a_9 = [
|
||||
new Among("a", -1, 1), new Among("e", -1, 2),
|
||||
new Among("o", -1, 1), new Among("os", -1, 1),
|
||||
new Among("\u00E1", -1, 1), new Among("\u00E9", -1, 2),
|
||||
new Among("\u00ED", -1, 1), new Among("\u00F3", -1, 1)
|
||||
],
|
||||
g_v = [17,
|
||||
65, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 4, 10
|
||||
],
|
||||
I_p2, I_p1, I_pV, sbp = new SnowballProgram();
|
||||
this.setCurrent = function(word) {
|
||||
sbp.setCurrent(word);
|
||||
};
|
||||
this.getCurrent = function() {
|
||||
return sbp.getCurrent();
|
||||
};
|
||||
|
||||
function habr1() {
|
||||
if (sbp.out_grouping(g_v, 97, 252)) {
|
||||
while (!sbp.in_grouping(g_v, 97, 252)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return true;
|
||||
sbp.cursor++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function habr2() {
|
||||
if (sbp.in_grouping(g_v, 97, 252)) {
|
||||
var v_1 = sbp.cursor;
|
||||
if (habr1()) {
|
||||
sbp.cursor = v_1;
|
||||
if (!sbp.in_grouping(g_v, 97, 252))
|
||||
return true;
|
||||
while (!sbp.out_grouping(g_v, 97, 252)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return true;
|
||||
sbp.cursor++;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function habr3() {
|
||||
var v_1 = sbp.cursor,
|
||||
v_2;
|
||||
if (habr2()) {
|
||||
sbp.cursor = v_1;
|
||||
if (!sbp.out_grouping(g_v, 97, 252))
|
||||
return;
|
||||
v_2 = sbp.cursor;
|
||||
if (habr1()) {
|
||||
sbp.cursor = v_2;
|
||||
if (!sbp.in_grouping(g_v, 97, 252) || sbp.cursor >= sbp.limit)
|
||||
return;
|
||||
sbp.cursor++;
|
||||
}
|
||||
}
|
||||
I_pV = sbp.cursor;
|
||||
}
|
||||
|
||||
function habr4() {
|
||||
while (!sbp.in_grouping(g_v, 97, 252)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return false;
|
||||
sbp.cursor++;
|
||||
}
|
||||
while (!sbp.out_grouping(g_v, 97, 252)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return false;
|
||||
sbp.cursor++;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function r_mark_regions() {
|
||||
var v_1 = sbp.cursor;
|
||||
I_pV = sbp.limit;
|
||||
I_p1 = I_pV;
|
||||
I_p2 = I_pV;
|
||||
habr3();
|
||||
sbp.cursor = v_1;
|
||||
if (habr4()) {
|
||||
I_p1 = sbp.cursor;
|
||||
if (habr4())
|
||||
I_p2 = sbp.cursor;
|
||||
}
|
||||
}
|
||||
|
||||
function r_postlude() {
|
||||
var among_var;
|
||||
while (true) {
|
||||
sbp.bra = sbp.cursor;
|
||||
among_var = sbp.find_among(a_0, 6);
|
||||
if (among_var) {
|
||||
sbp.ket = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.slice_from("a");
|
||||
continue;
|
||||
case 2:
|
||||
sbp.slice_from("e");
|
||||
continue;
|
||||
case 3:
|
||||
sbp.slice_from("i");
|
||||
continue;
|
||||
case 4:
|
||||
sbp.slice_from("o");
|
||||
continue;
|
||||
case 5:
|
||||
sbp.slice_from("u");
|
||||
continue;
|
||||
case 6:
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
break;
|
||||
sbp.cursor++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function r_RV() {
|
||||
return I_pV <= sbp.cursor;
|
||||
}
|
||||
|
||||
function r_R1() {
|
||||
return I_p1 <= sbp.cursor;
|
||||
}
|
||||
|
||||
function r_R2() {
|
||||
return I_p2 <= sbp.cursor;
|
||||
}
|
||||
|
||||
function r_attached_pronoun() {
|
||||
var among_var;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.find_among_b(a_1, 13)) {
|
||||
sbp.bra = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_2, 11);
|
||||
if (among_var && r_RV())
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.slice_from("iendo");
|
||||
break;
|
||||
case 2:
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.slice_from("ando");
|
||||
break;
|
||||
case 3:
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.slice_from("ar");
|
||||
break;
|
||||
case 4:
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.slice_from("er");
|
||||
break;
|
||||
case 5:
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.slice_from("ir");
|
||||
break;
|
||||
case 6:
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 7:
|
||||
if (sbp.eq_s_b(1, "u"))
|
||||
sbp.slice_del();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function habr5(a, n) {
|
||||
if (!r_R2())
|
||||
return true;
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
var among_var = sbp.find_among_b(a, n);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (among_var == 1 && r_R2())
|
||||
sbp.slice_del();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function habr6(c1) {
|
||||
if (!r_R2())
|
||||
return true;
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(2, c1)) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R2())
|
||||
sbp.slice_del();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function r_standard_suffix() {
|
||||
var among_var;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_6, 46);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
if (!r_R2())
|
||||
return false;
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 2:
|
||||
if (habr6("ic"))
|
||||
return false;
|
||||
break;
|
||||
case 3:
|
||||
if (!r_R2())
|
||||
return false;
|
||||
sbp.slice_from("log");
|
||||
break;
|
||||
case 4:
|
||||
if (!r_R2())
|
||||
return false;
|
||||
sbp.slice_from("u");
|
||||
break;
|
||||
case 5:
|
||||
if (!r_R2())
|
||||
return false;
|
||||
sbp.slice_from("ente");
|
||||
break;
|
||||
case 6:
|
||||
if (!r_R1())
|
||||
return false;
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_3, 4);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R2()) {
|
||||
sbp.slice_del();
|
||||
if (among_var == 1) {
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(2, "at")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (r_R2())
|
||||
sbp.slice_del();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
if (habr5(a_4, 3))
|
||||
return false;
|
||||
break;
|
||||
case 8:
|
||||
if (habr5(a_5, 3))
|
||||
return false;
|
||||
break;
|
||||
case 9:
|
||||
if (habr6("at"))
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function r_y_verb_suffix() {
|
||||
var among_var, v_1;
|
||||
if (sbp.cursor >= I_pV) {
|
||||
v_1 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_pV;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_7, 12);
|
||||
sbp.limit_backward = v_1;
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (among_var == 1) {
|
||||
if (!sbp.eq_s_b(1, "u"))
|
||||
return false;
|
||||
sbp.slice_del();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function r_verb_suffix() {
|
||||
var among_var, v_1, v_2, v_3;
|
||||
if (sbp.cursor >= I_pV) {
|
||||
v_1 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_pV;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_8, 96);
|
||||
sbp.limit_backward = v_1;
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
v_2 = sbp.limit - sbp.cursor;
|
||||
if (sbp.eq_s_b(1, "u")) {
|
||||
v_3 = sbp.limit - sbp.cursor;
|
||||
if (sbp.eq_s_b(1, "g"))
|
||||
sbp.cursor = sbp.limit - v_3;
|
||||
else
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
} else
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
sbp.bra = sbp.cursor;
|
||||
case 2:
|
||||
sbp.slice_del();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function r_residual_suffix() {
|
||||
var among_var, v_1;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_9, 8);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
if (r_RV())
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 2:
|
||||
if (r_RV()) {
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(1, "u")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
v_1 = sbp.limit - sbp.cursor;
|
||||
if (sbp.eq_s_b(1, "g")) {
|
||||
sbp.cursor = sbp.limit - v_1;
|
||||
if (r_RV())
|
||||
sbp.slice_del();
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.stem = function() {
|
||||
var v_1 = sbp.cursor;
|
||||
r_mark_regions();
|
||||
sbp.limit_backward = v_1;
|
||||
sbp.cursor = sbp.limit;
|
||||
r_attached_pronoun();
|
||||
sbp.cursor = sbp.limit;
|
||||
if (!r_standard_suffix()) {
|
||||
sbp.cursor = sbp.limit;
|
||||
if (!r_y_verb_suffix()) {
|
||||
sbp.cursor = sbp.limit;
|
||||
r_verb_suffix();
|
||||
}
|
||||
}
|
||||
sbp.cursor = sbp.limit;
|
||||
r_residual_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.es.stemmer, 'stemmer-es');
|
||||
|
||||
/* stop word filter function */
|
||||
lunr.es.stopWordFilter = function(token) {
|
||||
if (lunr.es.stopWordFilter.stopWords.indexOf(token) === -1) {
|
||||
return token;
|
||||
}
|
||||
};
|
||||
|
||||
lunr.es.stopWordFilter.stopWords = new lunr.SortedSet();
|
||||
lunr.es.stopWordFilter.stopWords.length = 309;
|
||||
|
||||
// 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.es.stopWordFilter.stopWords.elements = ' a al algo algunas algunos ante antes como con contra cual cuando de del desde donde durante e el ella ellas ellos en entre era erais eran eras eres es esa esas ese eso esos esta estaba estabais estaban estabas estad estada estadas estado estados estamos estando estar estaremos estará estarán estarás estaré estaréis estaría estaríais estaríamos estarían estarías estas este estemos esto estos estoy estuve estuviera estuvierais estuvieran estuvieras estuvieron estuviese estuvieseis estuviesen estuvieses estuvimos estuviste estuvisteis estuviéramos estuviésemos estuvo está estábamos estáis están estás esté estéis estén estés fue fuera fuerais fueran fueras fueron fuese fueseis fuesen fueses fui fuimos fuiste fuisteis fuéramos fuésemos ha habida habidas habido habidos habiendo habremos habrá habrán habrás habré habréis habría habríais habríamos habrían habrías habéis había habíais habíamos habían habías han has hasta hay haya hayamos hayan hayas hayáis he hemos hube hubiera hubierais hubieran hubieras hubieron hubiese hubieseis hubiesen hubieses hubimos hubiste hubisteis hubiéramos hubiésemos hubo la las le les lo los me mi mis mucho muchos muy más mí mía mías mío míos nada ni no nos nosotras nosotros nuestra nuestras nuestro nuestros o os otra otras otro otros para pero poco por porque que quien quienes qué se sea seamos sean seas seremos será serán serás seré seréis sería seríais seríamos serían serías seáis sido siendo sin sobre sois somos son soy su sus suya suyas suyo suyos sí también tanto te tendremos tendrá tendrán tendrás tendré tendréis tendría tendríais tendríamos tendrían tendrías tened tenemos tenga tengamos tengan tengas tengo tengáis tenida tenidas tenido tenidos teniendo tenéis tenía teníais teníamos tenían tenías ti tiene tienen tienes todo todos tu tus tuve tuviera tuvierais tuvieran tuvieras tuvieron tuviese tuvieseis tuviesen tuvieses tuvimos tuviste tuvisteis tuviéramos tuviésemos tuvo tuya tuyas tuyo tuyos tú un una uno unos vosotras vosotros vuestra vuestras vuestro vuestros y ya yo él éramos'.split(' ');
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.es.stopWordFilter, 'stopWordFilter-es');
|
||||
};
|
||||
}))
|
1
themes/tabi-lean/static/js/lunr/lunr.es.min.js
vendored
Normal file
1
themes/tabi-lean/static/js/lunr/lunr.es.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
536
themes/tabi-lean/static/js/lunr/lunr.fi.js
Normal file
536
themes/tabi-lean/static/js/lunr/lunr.fi.js
Normal file
|
@ -0,0 +1,536 @@
|
|||
/*!
|
||||
* Lunr languages, `Finnish` 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.fi = function() {
|
||||
this.pipeline.reset();
|
||||
this.pipeline.add(
|
||||
lunr.fi.trimmer,
|
||||
lunr.fi.stopWordFilter,
|
||||
lunr.fi.stemmer
|
||||
);
|
||||
};
|
||||
|
||||
/* lunr trimmer function */
|
||||
lunr.fi.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.fi.trimmer = lunr.trimmerSupport.generateTrimmer(lunr.fi.wordCharacters);
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.fi.trimmer, 'trimmer-fi');
|
||||
|
||||
/* lunr stemmer function */
|
||||
lunr.fi.stemmer = (function() {
|
||||
/* create the wrapped stemmer object */
|
||||
var Among = lunr.stemmerSupport.Among,
|
||||
SnowballProgram = lunr.stemmerSupport.SnowballProgram,
|
||||
st = new function FinnishStemmer() {
|
||||
var a_0 = [new Among("pa", -1, 1), new Among("sti", -1, 2),
|
||||
new Among("kaan", -1, 1), new Among("han", -1, 1),
|
||||
new Among("kin", -1, 1), new Among("h\u00E4n", -1, 1),
|
||||
new Among("k\u00E4\u00E4n", -1, 1), new Among("ko", -1, 1),
|
||||
new Among("p\u00E4", -1, 1), new Among("k\u00F6", -1, 1)
|
||||
],
|
||||
a_1 = [
|
||||
new Among("lla", -1, -1), new Among("na", -1, -1),
|
||||
new Among("ssa", -1, -1), new Among("ta", -1, -1),
|
||||
new Among("lta", 3, -1), new Among("sta", 3, -1)
|
||||
],
|
||||
a_2 = [
|
||||
new Among("ll\u00E4", -1, -1), new Among("n\u00E4", -1, -1),
|
||||
new Among("ss\u00E4", -1, -1), new Among("t\u00E4", -1, -1),
|
||||
new Among("lt\u00E4", 3, -1), new Among("st\u00E4", 3, -1)
|
||||
],
|
||||
a_3 = [
|
||||
new Among("lle", -1, -1), new Among("ine", -1, -1)
|
||||
],
|
||||
a_4 = [
|
||||
new Among("nsa", -1, 3), new Among("mme", -1, 3),
|
||||
new Among("nne", -1, 3), new Among("ni", -1, 2),
|
||||
new Among("si", -1, 1), new Among("an", -1, 4),
|
||||
new Among("en", -1, 6), new Among("\u00E4n", -1, 5),
|
||||
new Among("ns\u00E4", -1, 3)
|
||||
],
|
||||
a_5 = [new Among("aa", -1, -1),
|
||||
new Among("ee", -1, -1), new Among("ii", -1, -1),
|
||||
new Among("oo", -1, -1), new Among("uu", -1, -1),
|
||||
new Among("\u00E4\u00E4", -1, -1),
|
||||
new Among("\u00F6\u00F6", -1, -1)
|
||||
],
|
||||
a_6 = [new Among("a", -1, 8),
|
||||
new Among("lla", 0, -1), new Among("na", 0, -1),
|
||||
new Among("ssa", 0, -1), new Among("ta", 0, -1),
|
||||
new Among("lta", 4, -1), new Among("sta", 4, -1),
|
||||
new Among("tta", 4, 9), new Among("lle", -1, -1),
|
||||
new Among("ine", -1, -1), new Among("ksi", -1, -1),
|
||||
new Among("n", -1, 7), new Among("han", 11, 1),
|
||||
new Among("den", 11, -1, r_VI), new Among("seen", 11, -1, r_LONG),
|
||||
new Among("hen", 11, 2), new Among("tten", 11, -1, r_VI),
|
||||
new Among("hin", 11, 3), new Among("siin", 11, -1, r_VI),
|
||||
new Among("hon", 11, 4), new Among("h\u00E4n", 11, 5),
|
||||
new Among("h\u00F6n", 11, 6), new Among("\u00E4", -1, 8),
|
||||
new Among("ll\u00E4", 22, -1), new Among("n\u00E4", 22, -1),
|
||||
new Among("ss\u00E4", 22, -1), new Among("t\u00E4", 22, -1),
|
||||
new Among("lt\u00E4", 26, -1), new Among("st\u00E4", 26, -1),
|
||||
new Among("tt\u00E4", 26, 9)
|
||||
],
|
||||
a_7 = [new Among("eja", -1, -1),
|
||||
new Among("mma", -1, 1), new Among("imma", 1, -1),
|
||||
new Among("mpa", -1, 1), new Among("impa", 3, -1),
|
||||
new Among("mmi", -1, 1), new Among("immi", 5, -1),
|
||||
new Among("mpi", -1, 1), new Among("impi", 7, -1),
|
||||
new Among("ej\u00E4", -1, -1), new Among("mm\u00E4", -1, 1),
|
||||
new Among("imm\u00E4", 10, -1), new Among("mp\u00E4", -1, 1),
|
||||
new Among("imp\u00E4", 12, -1)
|
||||
],
|
||||
a_8 = [new Among("i", -1, -1),
|
||||
new Among("j", -1, -1)
|
||||
],
|
||||
a_9 = [new Among("mma", -1, 1),
|
||||
new Among("imma", 0, -1)
|
||||
],
|
||||
g_AEI = [17, 1, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 8
|
||||
],
|
||||
g_V1 = [17, 65, 16, 1, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 8, 0, 32
|
||||
],
|
||||
g_V2 = [17, 65, 16, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 8, 0, 32
|
||||
],
|
||||
g_particle_end = [17, 97, 24, 1, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 32
|
||||
],
|
||||
B_ending_removed, S_x, I_p2, I_p1, sbp = new SnowballProgram();
|
||||
this.setCurrent = function(word) {
|
||||
sbp.setCurrent(word);
|
||||
};
|
||||
this.getCurrent = function() {
|
||||
return sbp.getCurrent();
|
||||
};
|
||||
|
||||
function r_mark_regions() {
|
||||
I_p1 = sbp.limit;
|
||||
I_p2 = I_p1;
|
||||
if (!habr1()) {
|
||||
I_p1 = sbp.cursor;
|
||||
if (!habr1())
|
||||
I_p2 = sbp.cursor;
|
||||
}
|
||||
}
|
||||
|
||||
function habr1() {
|
||||
var v_1;
|
||||
while (true) {
|
||||
v_1 = sbp.cursor;
|
||||
if (sbp.in_grouping(g_V1, 97, 246))
|
||||
break;
|
||||
sbp.cursor = v_1;
|
||||
if (v_1 >= sbp.limit)
|
||||
return true;
|
||||
sbp.cursor++;
|
||||
}
|
||||
sbp.cursor = v_1;
|
||||
while (!sbp.out_grouping(g_V1, 97, 246)) {
|
||||
if (sbp.cursor >= sbp.limit)
|
||||
return true;
|
||||
sbp.cursor++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function r_R2() {
|
||||
return I_p2 <= sbp.cursor;
|
||||
}
|
||||
|
||||
function r_particle_etc() {
|
||||
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, 10);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.limit_backward = v_1;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
if (!sbp.in_grouping_b(g_particle_end, 97, 246))
|
||||
return;
|
||||
break;
|
||||
case 2:
|
||||
if (!r_R2())
|
||||
return;
|
||||
break;
|
||||
}
|
||||
sbp.slice_del();
|
||||
} else
|
||||
sbp.limit_backward = v_1;
|
||||
}
|
||||
}
|
||||
|
||||
function r_possessive() {
|
||||
var among_var, v_1, v_2;
|
||||
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_4, 9);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.limit_backward = v_1;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
v_2 = sbp.limit - sbp.cursor;
|
||||
if (!sbp.eq_s_b(1, "k")) {
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
sbp.slice_del();
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
sbp.slice_del();
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(3, "kse")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.slice_from("ksi");
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 4:
|
||||
if (sbp.find_among_b(a_1, 6))
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 5:
|
||||
if (sbp.find_among_b(a_2, 6))
|
||||
sbp.slice_del();
|
||||
break;
|
||||
case 6:
|
||||
if (sbp.find_among_b(a_3, 2))
|
||||
sbp.slice_del();
|
||||
break;
|
||||
}
|
||||
} else
|
||||
sbp.limit_backward = v_1;
|
||||
}
|
||||
}
|
||||
|
||||
function r_LONG() {
|
||||
return sbp.find_among_b(a_5, 7);
|
||||
}
|
||||
|
||||
function r_VI() {
|
||||
return sbp.eq_s_b(1, "i") && sbp.in_grouping_b(g_V2, 97, 246);
|
||||
}
|
||||
|
||||
function r_case_ending() {
|
||||
var among_var, v_1, v_2;
|
||||
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_6, 30);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.limit_backward = v_1;
|
||||
switch (among_var) {
|
||||
case 1:
|
||||
if (!sbp.eq_s_b(1, "a"))
|
||||
return;
|
||||
break;
|
||||
case 2:
|
||||
case 9:
|
||||
if (!sbp.eq_s_b(1, "e"))
|
||||
return;
|
||||
break;
|
||||
case 3:
|
||||
if (!sbp.eq_s_b(1, "i"))
|
||||
return;
|
||||
break;
|
||||
case 4:
|
||||
if (!sbp.eq_s_b(1, "o"))
|
||||
return;
|
||||
break;
|
||||
case 5:
|
||||
if (!sbp.eq_s_b(1, "\u00E4"))
|
||||
return;
|
||||
break;
|
||||
case 6:
|
||||
if (!sbp.eq_s_b(1, "\u00F6"))
|
||||
return;
|
||||
break;
|
||||
case 7:
|
||||
v_2 = sbp.limit - sbp.cursor;
|
||||
if (!r_LONG()) {
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
if (!sbp.eq_s_b(2, "ie")) {
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
if (sbp.cursor <= sbp.limit_backward) {
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
break;
|
||||
}
|
||||
sbp.cursor--;
|
||||
sbp.bra = sbp.cursor;
|
||||
break;
|
||||
case 8:
|
||||
if (!sbp.in_grouping_b(g_V1, 97, 246) || !sbp.out_grouping_b(g_V1, 97, 246))
|
||||
return;
|
||||
break;
|
||||
}
|
||||
sbp.slice_del();
|
||||
B_ending_removed = true;
|
||||
} else
|
||||
sbp.limit_backward = v_1;
|
||||
}
|
||||
}
|
||||
|
||||
function r_other_endings() {
|
||||
var among_var, v_1, v_2;
|
||||
if (sbp.cursor >= I_p2) {
|
||||
v_1 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_p2;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_7, 14);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.limit_backward = v_1;
|
||||
if (among_var == 1) {
|
||||
v_2 = sbp.limit - sbp.cursor;
|
||||
if (sbp.eq_s_b(2, "po"))
|
||||
return;
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
}
|
||||
sbp.slice_del();
|
||||
} else
|
||||
sbp.limit_backward = v_1;
|
||||
}
|
||||
}
|
||||
|
||||
function r_i_plural() {
|
||||
var v_1;
|
||||
if (sbp.cursor >= I_p1) {
|
||||
v_1 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_p1;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.find_among_b(a_8, 2)) {
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.limit_backward = v_1;
|
||||
sbp.slice_del();
|
||||
} else
|
||||
sbp.limit_backward = v_1;
|
||||
}
|
||||
}
|
||||
|
||||
function r_t_plural() {
|
||||
var among_var, v_1, v_2, v_3, v_4, v_5;
|
||||
if (sbp.cursor >= I_p1) {
|
||||
v_1 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_p1;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(1, "t")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
v_2 = sbp.limit - sbp.cursor;
|
||||
if (sbp.in_grouping_b(g_V1, 97, 246)) {
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
sbp.slice_del();
|
||||
sbp.limit_backward = v_1;
|
||||
v_3 = sbp.limit - sbp.cursor;
|
||||
if (sbp.cursor >= I_p2) {
|
||||
sbp.cursor = I_p2;
|
||||
v_4 = sbp.limit_backward;
|
||||
sbp.limit_backward = sbp.cursor;
|
||||
sbp.cursor = sbp.limit - v_3;
|
||||
sbp.ket = sbp.cursor;
|
||||
among_var = sbp.find_among_b(a_9, 2);
|
||||
if (among_var) {
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.limit_backward = v_4;
|
||||
if (among_var == 1) {
|
||||
v_5 = sbp.limit - sbp.cursor;
|
||||
if (sbp.eq_s_b(2, "po"))
|
||||
return;
|
||||
sbp.cursor = sbp.limit - v_5;
|
||||
}
|
||||
sbp.slice_del();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
sbp.limit_backward = v_1;
|
||||
}
|
||||
}
|
||||
|
||||
function r_tidy() {
|
||||
var v_1, v_2, v_3, v_4;
|
||||
if (sbp.cursor >= I_p1) {
|
||||
v_1 = sbp.limit_backward;
|
||||
sbp.limit_backward = I_p1;
|
||||
v_2 = sbp.limit - sbp.cursor;
|
||||
if (r_LONG()) {
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.cursor > sbp.limit_backward) {
|
||||
sbp.cursor--;
|
||||
sbp.bra = sbp.cursor;
|
||||
sbp.slice_del();
|
||||
}
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.in_grouping_b(g_AEI, 97, 228)) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (sbp.out_grouping_b(g_V1, 97, 246))
|
||||
sbp.slice_del();
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(1, "j")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
v_3 = sbp.limit - sbp.cursor;
|
||||
if (!sbp.eq_s_b(1, "o")) {
|
||||
sbp.cursor = sbp.limit - v_3;
|
||||
if (sbp.eq_s_b(1, "u"))
|
||||
sbp.slice_del();
|
||||
} else
|
||||
sbp.slice_del();
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.eq_s_b(1, "o")) {
|
||||
sbp.bra = sbp.cursor;
|
||||
if (sbp.eq_s_b(1, "j"))
|
||||
sbp.slice_del();
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_2;
|
||||
sbp.limit_backward = v_1;
|
||||
while (true) {
|
||||
v_4 = sbp.limit - sbp.cursor;
|
||||
if (sbp.out_grouping_b(g_V1, 97, 246)) {
|
||||
sbp.cursor = sbp.limit - v_4;
|
||||
break;
|
||||
}
|
||||
sbp.cursor = sbp.limit - v_4;
|
||||
if (sbp.cursor <= sbp.limit_backward)
|
||||
return;
|
||||
sbp.cursor--;
|
||||
}
|
||||
sbp.ket = sbp.cursor;
|
||||
if (sbp.cursor > sbp.limit_backward) {
|
||||
sbp.cursor--;
|
||||
sbp.bra = sbp.cursor;
|
||||
S_x = sbp.slice_to();
|
||||
if (sbp.eq_v_b(S_x))
|
||||
sbp.slice_del();
|
||||
}
|
||||
}
|
||||
}
|
||||
this.stem = function() {
|
||||
var v_1 = sbp.cursor;
|
||||
r_mark_regions();
|
||||
B_ending_removed = false;
|
||||
sbp.limit_backward = v_1;
|
||||
sbp.cursor = sbp.limit;
|
||||
r_particle_etc();
|
||||
sbp.cursor = sbp.limit;
|
||||
r_possessive();
|
||||
sbp.cursor = sbp.limit;
|
||||
r_case_ending();
|
||||
sbp.cursor = sbp.limit;
|
||||
r_other_endings();
|
||||
sbp.cursor = sbp.limit;
|
||||
if (B_ending_removed) {
|
||||
r_i_plural();
|
||||
sbp.cursor = sbp.limit;
|
||||
} else {
|
||||
sbp.cursor = sbp.limit;
|
||||
r_t_plural();
|
||||
sbp.cursor = sbp.limit;
|
||||
}
|
||||
r_tidy();
|
||||
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.fi.stemmer, 'stemmer-fi');
|
||||
|
||||
/* stop word filter function */
|
||||
lunr.fi.stopWordFilter = function(token) {
|
||||
if (lunr.fi.stopWordFilter.stopWords.indexOf(token) === -1) {
|
||||
return token;
|
||||
}
|
||||
};
|
||||
|
||||
lunr.fi.stopWordFilter.stopWords = new lunr.SortedSet();
|
||||
lunr.fi.stopWordFilter.stopWords.length = 236;
|
||||
|
||||
// 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.fi.stopWordFilter.stopWords.elements = ' ei eivät emme en et ette että he heidän heidät heihin heille heillä heiltä heissä heistä heitä hän häneen hänelle hänellä häneltä hänen hänessä hänestä hänet häntä itse ja johon joiden joihin joiksi joilla joille joilta joina joissa joista joita joka joksi jolla jolle jolta jona jonka jos jossa josta jota jotka kanssa keiden keihin keiksi keille keillä keiltä keinä keissä keistä keitä keneen keneksi kenelle kenellä keneltä kenen kenenä kenessä kenestä kenet ketkä ketkä ketä koska kuin kuka kun me meidän meidät meihin meille meillä meiltä meissä meistä meitä mihin miksi mikä mille millä miltä minkä minkä minua minulla minulle minulta minun minussa minusta minut minuun minä minä missä mistä mitkä mitä mukaan mutta ne niiden niihin niiksi niille niillä niiltä niin niin niinä niissä niistä niitä noiden noihin noiksi noilla noille noilta noin noina noissa noista noita nuo nyt näiden näihin näiksi näille näillä näiltä näinä näissä näistä näitä nämä ole olemme olen olet olette oli olimme olin olisi olisimme olisin olisit olisitte olisivat olit olitte olivat olla olleet ollut on ovat poikki se sekä sen siihen siinä siitä siksi sille sillä sillä siltä sinua sinulla sinulle sinulta sinun sinussa sinusta sinut sinuun sinä sinä sitä tai te teidän teidät teihin teille teillä teiltä teissä teistä teitä tuo tuohon tuoksi tuolla tuolle tuolta tuon tuona tuossa tuosta tuota tähän täksi tälle tällä tältä tämä tämän tänä tässä tästä tätä vaan vai vaikka yli'.split(' ');
|
||||
|
||||
lunr.Pipeline.registerFunction(lunr.fi.stopWordFilter, 'stopWordFilter-fi');
|
||||
};
|
||||
}))
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue