Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
268
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Kanji Reading
  2.  
  3. {{FrontSide}}
  4. <p class="english">{{FocusReading}}</p>
  5. <div class="box">
  6.  
  7. <div class="notes" class="animated fadeInUp"><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">
  8. <span style="font-family: Century Gothic;">on:</font> <span style=" font-size: 1.25em;">{{Onyomi (WK)}}</span><br>
  9. <span style="font-family: Century Gothic;">kun:</font> <span style=" font-size: 1.25em;">{{Kunyomi (WK)}}</span>
  10. </blockquote></div><br/>
  11.  
  12. <p class="alt-english"><span style="font-size: 25px">{{Meaning}}</span></p>{{#Subtitle}}
  13. <p id="altmean" class="alt-english">{{Subtitle}}</p>{{/Subtitle}}<br/>
  14.  
  15. <div class="english-notes" class="animated fadeInUp">
  16. radicals: {{Radicals}}{{#Components}} | elements: {{Components}}{{/Components}}</div><hr/>
  17. <details><summary><span class="english-notes">Nanori & Reading Compounds</span></summary>
  18. <p><div class="english-notes" class="animated fadeInUp">
  19. <blockquote style="text-align: left" class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">nanori: {{Nanori}}<br/><br/>
  20. {{furigana:Examples}}</blockquote></div></p></p></details>{{#Examples}}<hr/>{{/Examples}}
  21.  
  22. {{#Meaning Mnemonic}}<div class="mnemonics"><details><summary>Mnemonics</summary><p style="text-align: left; margin: 30px;">
  23. <font color="#764EBE"><b>Meaning</b>:</font> {{Meaning Mnemonic}}<br>
  24. <font color="#764EBE"><b>Meaning Info</b>:</font> {{Meaning Info}}<br>
  25. <font color="#764EBE"><b>Reading</b>:</font> {{Reading Mnemonic}}
  26. </details></details></div>{{/Meaning Mnemonic}}
  27.  
  28. <div class="animated fadeIn" style="padding: 10px;">
  29. <font size="4"><a id="button_1" href = 'http://jisho.org/search/{{Kanji}}'>Jisho</a> </font>
  30. <font size="4"><a id="button_1" href="http://ejje.weblio.jp/content/{{Kanji}}">Weblio</a></font>
  31. <font size="3"><a id="button_1" href="http://ejje.weblio.jp/sentence/content/{{Kanji}}">Weblio Examples</a></font>
  32. <font size="4"><a id="button_1" href="http://eow.alc.co.jp/search?q={{Kanji}}&ref=sa">ALC</a></font>
  33. <font size="4"><a id="button_1" href="http://dictionary.goo.ne.jp/srch/all/{{Kanji}}/m0u/">goo</a></font>
  34. <font size="4"><a id="button_1" href="http://tangorin.com/general/{{Kanji}}">Tangorin</a></font>
  35. <font size="3"><a id="button_1" href="http://tangorin.com/examples/{{Kanji}}">Tangorin Examples</a></font><br/>
  36. </div></div>
  37.  
  38. <p class="smallnotes">tags: {{Tags}}</p>
  39. </div>
  40.  
  41. <div id="correctAnswer" style="display:none">{{FocusReading}}</div>
  42. <script>
  43. //Script for modifying 'Show Answer' behavior for Input types.
  44. var htmlTextNodes = [];
  45. var innerHTMLText = [];
  46. var htmlNodeLength =document.getElementById('typeans').childNodes.length;
  47. var typedAnswer;
  48. var correctAnswer;
  49. var firstBr = null;
  50. var secondBr;
  51.  
  52. //capture each node to array
  53. for (i = 0; i < htmlNodeLength; i++) {
  54.  
  55. htmlTextNodes[i] = document.getElementById('typeans').childNodes[i];
  56. innerHTMLText[i] = document.getElementById('typeans').childNodes[i].innerHTML;
  57.  
  58. //locate <br> tags for output change markers
  59. if (document.getElementById('typeans').childNodes[i].nodeName == "BR") {
  60. console.log("Runs if BR");
  61. if (firstBr != null) {
  62. secondBr = i;
  63. } else {
  64. firstBr = i;
  65. };
  66. };
  67. };
  68.  
  69. //If answer is correct, firstBr will still be null, so must set to length of typeans.childNode
  70. if (firstBr == null) {
  71. firstBr = htmlNodeLength;
  72. };
  73. //assemble typed and correct answer strings
  74.  
  75. typedVar = innerHTMLText.slice(0,firstBr).join("");
  76.  
  77.  
  78. var typeParse = typedVar.replace(/\s|\-|\~|\~/g, '');
  79.  
  80.  
  81. typedAnswer = typedVar.replace(/\~|\~|-|\s/g,' ');
  82.  
  83. if (typedVar.slice(-1) === 'n') {
  84. typedAnswer = typedVar.substr(0, typedVar.length-1);
  85. typedAnswer += "ん";
  86. } else {
  87. typedAnswer = typedVar.replace(/\~|\~|-/g,' ');
  88. };
  89.  
  90.  
  91. var corr = document.getElementById('correctAnswer');
  92. str = corr.innerHTML;
  93. var correctParse = str.replace(/\s|\-|\~|\~/g, '');
  94. var correctAnswer = correctParse
  95.  
  96.  
  97.  
  98. var kanjisr = document.getElementById('kanjise');
  99. var kanjise = kanjisr.innerHTML;
  100.  
  101.  
  102. //split alternative answers into array
  103.  
  104. var getalt = document.getElementById('altread');
  105. var altmean = getalt.innerHTML;
  106.  
  107. altmean += ", "
  108. altmean += correctAnswer;
  109.  
  110.  
  111. altmean += ", "
  112. altmean += kanjise;
  113.  
  114. var array = altmean.split(", ");
  115.  
  116.  
  117.  
  118. for ( var i = 0; i < array.length; i++ ) {
  119. array[i] = "" + array[i].toUpperCase() + "";
  120. array[i] = "" + array[i].replace(/\s|\-|\~|\~/g, '');; + "";
  121. }
  122.  
  123.  
  124. //Modify answer output
  125. if ((array.indexOf(typeParse) > -1) && (!(typeParse== "" ))) {
  126. var c = "<div class=\"animated fadeIn\" id='correct'>"+typedAnswer+"</div>";
  127. var d = document.getElementById('typeans');
  128. d.innerHTML = c;
  129. } else {
  130. if(typeParse == "") {
  131. typeParse = "BITTERNESS INTENSIFIES!!!";
  132. }
  133. var e = "<div class=\"animated fadeIn\" id='incorrect'>"+typeParse+"</div>";
  134. var f = document.getElementById('typeans');
  135. f.innerHTML = e;
  136. };
  137. </script>
Advertisement
RAW Paste Data Copied
Advertisement