-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
300 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,29 @@ | ||
package com.v6ak.zbdb | ||
|
||
import org.scalajs.dom._ | ||
import scala.scalajs.js | ||
import scala.scalajs.js.annotation._ | ||
import scalatags.JsDom.all._ | ||
|
||
@js.native | ||
@JSGlobal("bootstrap.Modal") | ||
class BsModal (el: Element) extends js.Any { | ||
def show(): Unit = js.native | ||
} | ||
|
||
|
||
object Bootstrap { | ||
val toggle = data.toggle | ||
val dismiss = data.dismiss | ||
def glyphicon(name: String) = span(`class`:=s"glyphicon glyphicon-${name}", aria.hidden := "true") | ||
val toggle = attr("data-bs-toggle") | ||
val dismiss = attr("data-bs-dismiss") | ||
def btn = button(`class` := "btn") | ||
def btnDefault = btn(`class` := "btn-default") | ||
def btnPrimary = btn(`class` := "btn-primary") | ||
def btnDefault = btn(`class` := "btn-secondary") | ||
def btnLight = btn(`class` := "btn-light") | ||
implicit final class DialogUtils(val el: Element) extends AnyVal { | ||
@inline def onBsModalShown(f: js.Function) = | ||
el.addEventListener("shown.bs.modal", f.asInstanceOf[js.Function1[_, Any]]) | ||
|
||
@inline def onBsModalHidden(f: js.Function) = | ||
el.addEventListener("hidden.bs.modal", f.asInstanceOf[js.Function1[_, Any]]) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.v6ak.zbdb | ||
|
||
import scalatags.JsDom.all._ | ||
|
||
final case class Glyph(frag: Frag) extends AnyVal { | ||
@inline def toHtml: Frag = frag | ||
|
||
} | ||
|
||
object Glyphs { | ||
private def css(name: String) = Glyph(span(`class`:=s"icon-$name")) | ||
val Pedestrian = Glyph("\uD83D\uDEB6") | ||
val Globe = Glyph("\uD83C\uDF10") | ||
val Play = css("play") | ||
val Pause = css("pause") | ||
val Timeline = css("timeline") | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 6 additions & 1 deletion
7
client/src/main/scala/com/v6ak/zbdb/ParticipantPlotGenerator.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
package com.v6ak.zbdb | ||
|
||
final case class ParticipantPlotGenerator(nameGenitive: String, nameAccusative: String, glyphiconName: String, generator: Seq[Participant] => PlotData) | ||
final case class ParticipantPlotGenerator( | ||
nameGenitive: String, | ||
nameAccusative: String, | ||
glyph: Glyph, | ||
generator: Seq[Participant] => PlotData | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.