Don't show kyujitai info when no kyujitai

rust
Elnu 2 years ago
parent ed7a261054
commit 93527a60b8

@ -14,7 +14,7 @@
<button id="direction" title="Text direction"></button> <button id="direction" title="Text direction"></button>
<button lang="ja" id="highlight" title="Vocab/kanji links">漢字</button> <button lang="ja" id="highlight" title="Vocab/kanji links">漢字</button>
<button lang="ja" id="kyujitai" title="Shinjitai/kyujitai">旧字体</button> <button lang="ja" id="kyujitai" title="Shinjitai/kyujitai">旧字体</button>
<a target="_blank" class="clickable-icon" href="https://en.wikipedia.org/wiki/Ky%C5%ABjitai"><i class="fa-solid fa-circle-question"></i></a> <a id="kyujitai-info" target="_blank" class="clickable-icon" href="https://en.wikipedia.org/wiki/Ky%C5%ABjitai"><i class="fa-solid fa-circle-question"></i></a>
<header> <header>
<h3>Tegaki Tuesday #{{- $current -}}</h3> <h3>Tegaki Tuesday #{{- $current -}}</h3>
<small><ruby><rp>(</rp><rt></rt><rp>)</rp></ruby><ruby><rp>(</rp><rt></rt><rp>)</rp></ruby>きの<ruby><rp>(</rp><rt></rt><rp>)</rp></ruby><ruby><rp>(</rp><rt>よう</rt><rp>)</rp></ruby><ruby><rp>(</rp><rt></rt><rp>)</rp></ruby>{{- $current -}}・<time datetime="{{- .Date.Format " 2006-01-02T15:04:05Z07:00" -}}">{{- .Date.Format "2006年01月02日" -}}</time></small> <small><ruby><rp>(</rp><rt></rt><rp>)</rp></ruby><ruby><rp>(</rp><rt></rt><rp>)</rp></ruby>きの<ruby><rp>(</rp><rt></rt><rp>)</rp></ruby><ruby><rp>(</rp><rt>よう</rt><rp>)</rp></ruby><ruby><rp>(</rp><rt></rt><rp>)</rp></ruby>{{- $current -}}・<time datetime="{{- .Date.Format " 2006-01-02T15:04:05Z07:00" -}}">{{- .Date.Format "2006年01月02日" -}}</time></small>

@ -36,6 +36,8 @@ for (let i = 0; i < rubies.length; i++) {
const kyujitaiButton = document.getElementById("kyujitai"); const kyujitaiButton = document.getElementById("kyujitai");
if (kyujitaiConvertable.length === 0) { if (kyujitaiConvertable.length === 0) {
kyujitaiButton.parentNode.removeChild(kyujitaiButton); kyujitaiButton.parentNode.removeChild(kyujitaiButton);
const kyujitaiInfo = document.getElementById("kyujitai-info");
kyujitaiInfo.parentNode.removeChild(kyujitaiInfo);
} else { } else {
document.getElementById("kyujitai").addEventListener("click", function() { document.getElementById("kyujitai").addEventListener("click", function() {
let kyujitai = false; let kyujitai = false;

Loading…
Cancel
Save