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

View File

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