Skip to content

Commit

Permalink
Convert comma separated strings in scenes config by lists
Browse files Browse the repository at this point in the history
  • Loading branch information
sknull committed Apr 20, 2024
1 parent 792736d commit cce2b34
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ class LMScene(
) {

override fun toString(): String {
return "$name: $color${if (actions.isNotEmpty()) "\n - ${actions.joinToString("\n - ")}" else ""}"
return "$name: ${color.joinToString(",")}${if (actions.isNotEmpty()) "\n - ${actions.joinToString("\n - ")}" else ""}"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,20 @@ class LMHtmlScene(
val url = configHolder.preferences?.ownUrl
val sb = StringBuilder()
sb.append(" <div class=\"button\"")
if (scene.color?.isNotEmpty() == true) {
if (scene.color?.contains(",") == true) {
if (scene.color.isNotEmpty()) {
val sceneColor = scene.color.joinToString(",")
if (scene.color.size > 1) {
sb.append(" style=\"background: -moz-linear-gradient(left, ")
.append(scene.color)
.append(sceneColor)
.append("); background: -webkit-linear-gradient(left, ")
.append(scene.color)
.append(sceneColor)
.append("); background: linear-gradient(to right, ")
.append(scene.color)
.append(sceneColor)
.append(");\"")
}
else {
sb.append(" style=\"background-color: ")
.append(scene.color)
.append(sceneColor)
.append(";\"")
}
}
Expand Down
16 changes: 8 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@

<kotlin.code.style>official</kotlin.code.style>

<version.jackson>2.15.2</version.jackson>
<version.kotlin.maven>1.9.20</version.kotlin.maven>
<version.jackson>2.16.2</version.jackson>
<version.kotlin.maven>1.9.23</version.kotlin.maven>
<version.kotlin.language>1.9</version.kotlin.language>
<version.log4j>1.2.17</version.log4j>
<version.slf4j>2.0.5</version.slf4j>
<version.junit.jupiter>5.10.0</version.junit.jupiter>
<version.junit.jupiter>5.10.2</version.junit.jupiter>
<version.acme4j-client>2.16</version.acme4j-client>
</properties>

Expand Down Expand Up @@ -88,14 +88,14 @@
<dependency>
<groupId>org.jetbrains.kotlinx</groupId>
<artifactId>kotlinx-coroutines-core</artifactId>
<version>1.7.2</version>
<version>1.7.3</version>
</dependency>

<!-- testing -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.10.0</version>
<version>${version.junit.jupiter}</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down Expand Up @@ -128,7 +128,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version> <!-- do not update to 3.3.0 due to a bug regarding multi module builds -->
<version>3.3.0</version> <!-- do not update to 3.3.0 due to a bug regarding multi module builds -->
<executions>
<execution>
<id>attach-sources</id>
Expand Down Expand Up @@ -191,13 +191,13 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1.2</version>
<version>3.2.5</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.1.2</version>
<version>3.2.5</version>
</plugin>
</plugins>
</build>
Expand Down

0 comments on commit cce2b34

Please sign in to comment.