mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 00:24:13 +08:00
fold
This commit is contained in:
parent
3c16f053c5
commit
e40e164305
@ -2327,12 +2327,18 @@ class mdict(cishubase):
|
|||||||
self.extraconf = json.loads(ff.read())
|
self.extraconf = json.loads(ff.read())
|
||||||
except:
|
except:
|
||||||
self.extraconf = {}
|
self.extraconf = {}
|
||||||
|
try:
|
||||||
|
with open("userconfig/mdict_config2.json", "r", encoding="utf8") as ff:
|
||||||
|
self.extraconf2 = json.loads(ff.read())
|
||||||
|
except:
|
||||||
|
self.extraconf2 = {}
|
||||||
self.sql = None
|
self.sql = None
|
||||||
paths = self.config["paths"]
|
paths = self.config["paths"]
|
||||||
|
|
||||||
self.builders = []
|
self.builders = []
|
||||||
self.dedump = set()
|
self.dedump = set()
|
||||||
|
self.FoldFlow = self.extraconf2.get("FoldFlow", False)
|
||||||
|
self.extraconf2["FoldFlow"] = self.FoldFlow
|
||||||
for f in paths:
|
for f in paths:
|
||||||
if f.strip() == "":
|
if f.strip() == "":
|
||||||
continue
|
continue
|
||||||
@ -2350,6 +2356,11 @@ class mdict(cishubase):
|
|||||||
ff.write(json.dumps(self.extraconf, ensure_ascii=False, indent=4))
|
ff.write(json.dumps(self.extraconf, ensure_ascii=False, indent=4))
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
try:
|
||||||
|
with open("userconfig/mdict_config2.json", "w", encoding="utf8") as ff:
|
||||||
|
ff.write(json.dumps(self.extraconf2, ensure_ascii=False, indent=4))
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
def querycomplex(self, word, distance, index):
|
def querycomplex(self, word, distance, index):
|
||||||
results = []
|
results = []
|
||||||
@ -2820,10 +2831,13 @@ if (content.style.display === 'block') {
|
|||||||
}
|
}
|
||||||
}</script>"""
|
}</script>"""
|
||||||
lis = []
|
lis = []
|
||||||
|
extra = "display: block;"
|
||||||
|
if self.FoldFlow:
|
||||||
|
extra = "display: none;"
|
||||||
for _, title, res in allres:
|
for _, title, res in allres:
|
||||||
uid = str(uuid.uuid4())
|
uid = str(uuid.uuid4())
|
||||||
lis.append(
|
lis.append(
|
||||||
rf"""<li><div class="collapsible-header" id="{uid}" onclick="mdict_flowstyle_clickcallback('{uid}')">{title}</div><div class="collapsible-content" style="display: block;">
|
rf"""<li><div class="collapsible-header" id="{uid}" onclick="mdict_flowstyle_clickcallback('{uid}')">{title}</div><div class="collapsible-content" style="{extra}">
|
||||||
{res}
|
{res}
|
||||||
</div></li>"""
|
</div></li>"""
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user