diff --git a/data/db.test.js b/data/db.test.js index 5a1d39c..27f2508 100644 --- a/data/db.test.js +++ b/data/db.test.js @@ -7,8 +7,7 @@ // Setting up a second singleton instance for testing is possible, but would // not actually test the production variant. -import { Round } from "../models/round.js"; -import WbDb from "./db.js"; +import WbDb from "/data/db.js"; /** The instance used for the current test. * diff --git a/data/session_repo.js b/data/session_repo.js index 790e2a0..dc0c18f 100644 --- a/data/session_repo.js +++ b/data/session_repo.js @@ -1,7 +1,7 @@ "use strict"; -import Session from "../models/session.js"; -import WbDb from "./db.js"; +import Session from "/models/session.js"; +import WbDb from "/data/db.js"; /** A transaction or known type that can be turned into a transaction. * @typedef {IDBTransaction|IDBDatabase|WbDb=} Transactable diff --git a/data/session_repo.test.js b/data/session_repo.test.js index b6012ab..059cae4 100644 --- a/data/session_repo.test.js +++ b/data/session_repo.test.js @@ -1,9 +1,9 @@ "use strict"; -import { Team } from "../models/round.js"; -import Session from "../models/session.js"; -import WbDb from "./db.js"; -import SessionRepo from "./session_repo.js"; +import { Team } from "/models/round.js"; +import Session from "/models/session.js"; +import WbDb from "/data/db.js"; +import SessionRepo from "/data/session_repo.js"; /** The instance used for the current test. * diff --git a/index.html b/index.html index a027b0e..86036d5 100644 --- a/index.html +++ b/index.html @@ -5,16 +5,16 @@ Watterblock - - - + + + diff --git a/models/game.js b/models/game.js index c28bd53..7708958 100644 --- a/models/game.js +++ b/models/game.js @@ -1,7 +1,7 @@ "use strict"; -import { Round, Team } from "./round.js"; -import RoundResult from "./round_result.js"; +import { Round, Team } from "/models/round.js"; +import RoundResult from "/models/round_result.js"; /** A single game of watten. * diff --git a/models/game.test.js b/models/game.test.js index 311c3fb..0436175 100644 --- a/models/game.test.js +++ b/models/game.test.js @@ -1,8 +1,8 @@ "use strict"; -import { Round, Team } from "./round.js"; -import RoundResult from "./round_result.js"; -import Game from "./game.js"; +import { Round, Team } from "/models/round.js"; +import RoundResult from "/models/round_result.js"; +import Game from "/models/game.js"; export default function() { QUnit.module("game", function() { diff --git a/models/round.test.js b/models/round.test.js index 4e7b91b..c3a54d7 100644 --- a/models/round.test.js +++ b/models/round.test.js @@ -1,6 +1,6 @@ "use strict"; -import { Round, Team } from "./round.js"; +import { Round, Team } from "/models/round.js"; export default function() { QUnit.module("round", function() { diff --git a/models/round_result.js b/models/round_result.js index 964bd6a..9d5e2f6 100644 --- a/models/round_result.js +++ b/models/round_result.js @@ -1,6 +1,6 @@ "use strict"; -import { Round, Team } from "./round.js"; +import { Team } from "/models/round.js"; /** A finished round of Watten. */ export default class RoundResult { diff --git a/models/round_result.test.js b/models/round_result.test.js index 80c10dc..2e3a12b 100644 --- a/models/round_result.test.js +++ b/models/round_result.test.js @@ -1,7 +1,7 @@ "use strict"; -import { Team } from "./round.js"; -import RoundResult from "./round_result.js"; +import { Team } from "/models/round.js"; +import RoundResult from "/models/round_result.js"; export default function() { QUnit.module("RoundResult", function() { diff --git a/models/session.js b/models/session.js index fe681cb..6443962 100644 --- a/models/session.js +++ b/models/session.js @@ -1,7 +1,7 @@ "use strict"; -import Game from "./game.js"; -import { Team } from "./round.js"; +import Game from "/models/game.js"; +import { Team } from "/models/round.js"; /** A session of Watten. * diff --git a/models/session.test.js b/models/session.test.js index 7874517..2ae03b3 100644 --- a/models/session.test.js +++ b/models/session.test.js @@ -1,8 +1,8 @@ "use strict"; -import { Round, Team } from "./round.js"; -import Game from "./game.js"; -import Session from "./session.js"; +import { Team } from "/models/round.js"; +import Game from "/models/game.js"; +import Session from "/models/session.js"; export default function() { QUnit.module("session", function() { diff --git a/test.html b/test.html index 78d0e2e..a39d2f8 100644 --- a/test.html +++ b/test.html @@ -4,14 +4,14 @@ Watterblock Tests - +
- - + + \ No newline at end of file diff --git a/test.js b/test.js index d41b87d..55d702a 100644 --- a/test.js +++ b/test.js @@ -1,12 +1,12 @@ "use strict"; -import round from "./models/round.test.js"; -import roundResult from "./models/round_result.test.js"; -import game from "./models/game.test.js"; -import session from "./models/session.test.js"; +import round from "/models/round.test.js"; +import roundResult from "/models/round_result.test.js"; +import game from "/models/game.test.js"; +import session from "/models/session.test.js"; -import db from "./data/db.test.js"; -import session_repo from "./data/session_repo.test.js"; +import db from "/data/db.test.js"; +import session_repo from "/data/session_repo.test.js"; QUnit.module("models", function() { round(); diff --git a/ui/app.js b/ui/app.js index e3505a8..340f47b 100644 --- a/ui/app.js +++ b/ui/app.js @@ -1,7 +1,7 @@ "use strict"; -import WbDb from "../data/db.js"; -import Shell from "./shell.js"; +import WbDb from "/data/db.js"; +import Shell from "/ui/shell.js"; export default class App { #needsHandler = true; diff --git a/ui/game.js b/ui/game.js index eb6f060..5a3a221 100644 --- a/ui/game.js +++ b/ui/game.js @@ -1,15 +1,12 @@ "use strict"; -import { Team } from "../models/round.js"; -import Game from "../models/game.js"; -import RoundView from "./round.js"; +import { Team } from "/models/round.js"; +import Game from "/models/game.js"; export default class GameView { /** @param {{ attrs: { model: Game } }} param The game model to use. */ view({ attrs: { model } }) { - let { winner, points, ourPoints, theirPoints } = model.result; - - let markers = "•".repeat(points); + let { ourPoints, theirPoints } = model.result; return m("[", [ (model.rounds.length !== 0) diff --git a/ui/round.js b/ui/round.js index 6bc5b57..231a414 100644 --- a/ui/round.js +++ b/ui/round.js @@ -1,17 +1,11 @@ "use strict"; -import { Round, Team } from "../models/round.js"; +import { Round, Team } from "/models/round.js"; export default class RoundView { /** @param { { attrs: { model: Round } } } param The round model to use. */ view({ attrs: { model } }) { - let winner = "no koana"; - if (model.winner === Team.We) - winner = "mia"; - else if (model.winner === Team.They) - winner = "se"; - return m("section.current-round", [ m("span.current-points", `${model.points}`), m("button.they-raise", diff --git a/ui/session.js b/ui/session.js index 6ffd816..ddeb9df 100644 --- a/ui/session.js +++ b/ui/session.js @@ -1,8 +1,8 @@ "use strict"; -import Session from "../models/session.js"; -import GameView from "./game.js"; -import RoundView from "./round.js"; +import Session from "/models/session.js"; +import GameView from "/ui/game.js"; +import RoundView from "/ui/round.js"; export default class SessionView { /** @param {{ attrs: { model: Session } }} param The session model to use. */ diff --git a/ui/session_list.js b/ui/session_list.js index bd4aaf1..e3f4ba3 100644 --- a/ui/session_list.js +++ b/ui/session_list.js @@ -1,6 +1,6 @@ "use strict"; -import Session from "../models/session.js"; +import Session from "/models/session.js"; export default class SessionList { /** @param {{ attrs: { models: Session[] } }} param The sessions to show. */ diff --git a/ui/shell.js b/ui/shell.js index 0a997a3..e19df09 100644 --- a/ui/shell.js +++ b/ui/shell.js @@ -1,9 +1,9 @@ "use strict"; -import Session from "../models/session.js"; -import SessionRepo from "../data/session_repo.js"; -import SessionList from "./session_list.js"; -import SessionView from "./session.js"; +import Session from "/models/session.js"; +import SessionRepo from "/data/session_repo.js"; +import SessionList from "/ui/session_list.js"; +import SessionView from "/ui/session.js"; export default class Shell { /** @type(?Session[]) */