• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

caleb531 / flip-book / 10499286139

21 Aug 2024 11:59PM UTC coverage: 25.53% (-2.0%) from 27.541%
10499286139

push

github

caleb531
Convert components to JSX

72 of 100 branches covered (72.0%)

Branch coverage included in aggregate %.

0 of 743 new or added lines in 22 files covered. (0.0%)

54 existing lines in 21 files now uncovered.

386 of 1694 relevant lines covered (22.79%)

6.85 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/scripts/components/app.jsx
NEW
1
import m from "mithril";
×
NEW
2
import App from "../models/app.js";
×
NEW
3
import UpdateNotificationComponent from "./update-notification.jsx";
×
NEW
4
import AppHeaderComponent from "./app-header.jsx";
×
NEW
5
import StoryComponent from "./story.jsx";
×
NEW
6
import StorageUpgraderComponent from "./storage-upgrader.jsx";
×
7

8
class AppComponent {
×
UNCOV
9
  oninit() {
×
10
    App.restore().then((app) => {
×
11
      this.app = app;
×
12
      m.redraw();
×
13
    });
×
14
  }
×
15

NEW
16
  oncreate({ dom }) {
×
17
    dom.focus();
×
18
  }
×
19

20
  async navigateFramesViaKeyboard(event) {
×
21
    let story = await this.app.selectedStory;
×
NEW
22
    if (event.key === "ArrowLeft" && !story.playing) {
×
23
      story.selectPreviousFrame();
×
24
      await story.save();
×
NEW
25
    } else if (event.key === "ArrowRight" && !story.playing) {
×
26
      story.selectNextFrame();
×
27
      await story.save();
×
NEW
28
    } else if (event.key === " ") {
×
29
      event.preventDefault();
×
30
      if (story.playing) {
×
31
        story.pause();
×
32
      } else {
×
33
        story.play(() => m.redraw());
×
34
      }
×
35
    } else {
×
36
      event.redraw = false;
×
37
    }
×
38
  }
×
39

40
  view() {
×
NEW
41
    return (
×
NEW
42
      <div
×
NEW
43
        className="app"
×
NEW
44
        tabIndex="-1"
×
NEW
45
        onkeydown={(event) => this.navigateFramesViaKeyboard(event)}
×
46
      >
47
        {/* The UpdateNotificationComponent manages its own visibility */}
NEW
48
        <UpdateNotificationComponent />
×
NEW
49
        <StorageUpgraderComponent />
×
NEW
50
        <AppHeaderComponent />
×
NEW
51
        {this.app?.selectedStory ? (
×
NEW
52
          <StoryComponent app={this.app} story={this.app.selectedStory} />
×
NEW
53
        ) : null}
×
NEW
54
      </div>
×
55
    );
UNCOV
56
  }
×
UNCOV
57
}
×
58

59
export default AppComponent;
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc