From 80a1af77e45c52ee75a8bbfcfab34513e86efdcf Mon Sep 17 00:00:00 2001 From: Ren Tatsumoto Date: Tue, 7 Mar 2023 11:14:31 +0300 Subject: [PATCH] support pitch number inside pitch html --- templates/Japanese sentences/Recognition/back.html | 4 ++++ templates/Japanese sentences/Recognition/front.html | 2 +- templates/Japanese sentences/template.css | 4 +++- templates/Japanese words/template.css | 6 ++++++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/templates/Japanese sentences/Recognition/back.html b/templates/Japanese sentences/Recognition/back.html index 3ff4285..15ce6c1 100644 --- a/templates/Japanese sentences/Recognition/back.html +++ b/templates/Japanese sentences/Recognition/back.html @@ -67,12 +67,16 @@ const has_no_data = (tag) => tag.innerText.toLowerCase().includes("no pitch accent"); const pitch_num = document.getElementById("pitchnum"); const pitch_pattern = document.getElementById("pitchpattern"); + const pitch_num_inside_html = document.querySelector(".pitch_number"); if (pitch_num && has_no_data(pitch_num)) { pitch_num.remove(); } if (pitch_pattern && has_no_data(pitch_pattern)) { pitch_pattern.innerHTML = `{{text:kana:VocabFurigana}}`; } + if (pitch_num && pitch_num_inside_html) { + pitch_num.remove(); + } } markPitch(); diff --git a/templates/Japanese sentences/Recognition/front.html b/templates/Japanese sentences/Recognition/front.html index b5228f9..7987500 100644 --- a/templates/Japanese sentences/Recognition/front.html +++ b/templates/Japanese sentences/Recognition/front.html @@ -145,4 +145,4 @@ Sun Mar 5 12:08:06 AM UTC 2023 splitTagDiv(); setImageOnFront(); reformatMultiFurigana(); - + \ No newline at end of file diff --git a/templates/Japanese sentences/template.css b/templates/Japanese sentences/template.css index 871bfd3..5ca06d7 100644 --- a/templates/Japanese sentences/template.css +++ b/templates/Japanese sentences/template.css @@ -210,6 +210,7 @@ div.ensentence>a.hint:hover { /* Tags */ +.pitch_number, .tags { font-family: "Noto Sans", @@ -346,6 +347,7 @@ footer>a:not(:last-child)::after { display: none; } +.vocab .pitch_number, .vocab .tags { align-self: flex-start; vertical-align: top; @@ -554,4 +556,4 @@ div[contenteditable="true"] { border: 1px solid gray; padding: 3px; box-shadow: 10px 5px 5px gray; -} +} \ No newline at end of file diff --git a/templates/Japanese words/template.css b/templates/Japanese words/template.css index a7716ba..5afc32f 100644 --- a/templates/Japanese words/template.css +++ b/templates/Japanese words/template.css @@ -241,6 +241,7 @@ footer>a:last-child:after { width: 0; } +.pitch_number, .tags { font-family: "Noto Sans", @@ -264,6 +265,11 @@ footer>a:last-child:after { line-height: 14px; } +.pitch_number { + align-self: flex-start; + vertical-align: top; +} + /* AnkiDroid peplay button .replaybutton is an tag with a that has an inside