fix storage mining with space saver

This commit is contained in:
wareya committed 2019-06-12 07:16:26 -04:00
1 parent 655a88ce02
commit ece322126a
2 files changed
+5 -2

No files matched your search

+1 -1
View File
@@ -19,7 +19,7 @@ body
<body lang="ja"> <body lang="ja">
<p>Tab separated values. Spelling, readings, definitions, (if stored: looked up text, sentence, location in sentence), JMdict numeric ID.</p> <p>Tab separated values. Spelling, readings, definitions, (if stored: looked up text, sentence, location in sentence), JMdict numeric ID.</p>
<input type=button id=reset value="Reset"/> <input type=button id=reset value="Reset"/>
<textarea id="field" style="width:100%; height:calc(100% - 70px);"></textarea> <textarea id="field" style="width:100%; height: calc(100vh - 150px)"></textarea>
</body> </body>
</html> </html>
+4 -1
View File
@@ -2074,13 +2074,16 @@ function mine(highlight)
let readings_elements = word.getElementsByClassName("nazeka_readings"); let readings_elements = word.getElementsByClassName("nazeka_readings");
if(readings_elements.length) if(readings_elements.length)
readings = readings_elements[0].textContent; readings = readings_elements[0].textContent;
let storage_readings = readings;
if(storage_readings.length < 2 || !storage_readings.startsWith("《"))
storage_readings = "《" + storage_readings.trim() + "》";
let definitions = word.getElementsByClassName("nazeka_definitions")[0]; let definitions = word.getElementsByClassName("nazeka_definitions")[0];
let lookup = word.parentElement.querySelector(".nazeka_lookup"); let lookup = word.parentElement.querySelector(".nazeka_lookup");
let sentence = word.parentElement.querySelector(".nazeka_lookup_sentence"); let sentence = word.parentElement.querySelector(".nazeka_lookup_sentence");
let index = word.parentElement.querySelector(".nazeka_lookup_index"); let index = word.parentElement.querySelector(".nazeka_lookup_index");
let seq = word.getAttribute("nazeka_seq"); let seq = word.getAttribute("nazeka_seq");
mine_to_storage({front: front, readings: readings, definitions: definitions.innerText, lookup: lookup.textContent, sentence: sentence.textContent, index: index.textContent, seq: seq}); mine_to_storage({front: front, readings: storage_readings, definitions: definitions.innerText, lookup: lookup.textContent, sentence: sentence.textContent, index: index.textContent, seq: seq});
if(settings.live_mining) if(settings.live_mining)
{ {