diff --git a/py/LunaTranslator/cishu/mdict.py b/py/LunaTranslator/cishu/mdict.py index eab84439..0d500778 100644 --- a/py/LunaTranslator/cishu/mdict.py +++ b/py/LunaTranslator/cishu/mdict.py @@ -2468,17 +2468,22 @@ class mdict(cishubase): contents = [] idx = 0 for _, foldflow, title, res in allres: - idx += 1 + klass2='tab-pane_mdict_internal' + klass1='tab-button_mdict_internal' + if idx==0: + klass2+=' active' + klass1+=' active' btns.append( - """""".format( - idx=idx, title=title + """""".format( + idx=idx, title=title, klass=klass1 ) ) contents.append( - """
{res}
""".format( - idx=idx, res=res + """
{res}
""".format( + idx=idx, res=res, klass=klass2 ) ) + idx += 1 commonstyle = """ """.format( commonstyle=commonstyle, btns="".join(btns), contents="".join(contents) ) @@ -2558,7 +2560,7 @@ document.querySelectorAll('.tab-widget_mdict_internal .tab-button_mdict_internal .collapsible-header { background-color: #dddddd50; - padding: 10px; + padding: 8px; cursor: pointer; border: 1px solid #ddd; border-bottom: none; diff --git a/py/files/anki/back.html b/py/files/anki/back.html index f84ebac0..1c5258ab 100644 --- a/py/files/anki/back.html +++ b/py/files/anki/back.html @@ -58,7 +58,7 @@ var scriptElementss = [] var scriptElementsssrc = [] for (var iiii = 0; iiii < dictionaryInfo.length; iiii++) { - htmltabbuttons += '' + htmltabbuttons += '' var tempParent = document.createElement('div'); tempParent.innerHTML = decodeURIComponent(dictionaryContent[dictionaryInfo[iiii]['dict']]); @@ -68,7 +68,7 @@ fragment.appendChild(tempParent.firstChild); } - htmlcontents += '
' + fragment.innerHTML + '
' + htmlcontents += '
' + fragment.innerHTML + '
' var scriptElements = fragment.getElementsByTagName('script'); for (var jjjj = 0; jjjj < scriptElements.length; jjjj++) { @@ -86,9 +86,6 @@ document.head.appendChild(newScript); } } - if (dictionaryInfo.length > 0) { - onclickbtn(dictionaryInfo[0]['dict']) - }