New Features #1

Open
marvinelsen wants to merge 76 commits from develop into main
2 changed files with 23 additions and 12 deletions
Showing only changes of commit cdcfd92f60 - Show all commits

View File

@ -8,6 +8,12 @@ import javafx.scene.control.Label
import javafx.scene.control.ListView
import javafx.scene.control.TabPane
import javafx.scene.web.WebView
import kotlinx.html.body
import kotlinx.html.h1
import kotlinx.html.html
import kotlinx.html.li
import kotlinx.html.ol
import kotlinx.html.stream.createHTML
class DetailsController(private val model: Model) {
@FXML
@ -64,19 +70,19 @@ class DetailsController(private val model: Model) {
return@addListener
}
webViewDefinition.engine.loadContent(
buildString {
append("<html>")
append("<body>")
append("<h1>CC-CEDICT</h1>")
append("<ol>")
for (definition in newValue.definitions) {
append("<li>")
append(definition.joinToString(separator = "; "))
append("</li>")
createHTML().html {
body {
h1 {
+"CC-CEDICT"
}
ol {
for (definition in newValue.definitions) {
li {
+definition.joinToString(separator = "; ")
}
}
}
}
append("</ol>")
append("</body>")
append("</html>")
}
)
}

View File

@ -15,6 +15,11 @@ h1 {
font-size: 1.25em;
}
ol {
padding-left: 0;
list-style-position: inside;
}
ol li:only-child {
list-style: none;
}