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

caleb531 / flip-book / 10499304652

22 Aug 2024 12:01AM UTC coverage: 27.382% (-0.2%) from 27.541%
10499304652

push

github

caleb531
Convert components to JSX

72 of 100 branches covered (72.0%)

Branch coverage included in aggregate %.

54 of 648 new or added lines in 27 files covered. (8.33%)

54 existing lines in 21 files now uncovered.

405 of 1642 relevant lines covered (24.67%)

8.88 hits per line

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

0.0
/scripts/components/app.jsx
1
import m from 'mithril';
×
2
import App from '../models/app.js';
×
3
import UpdateNotificationComponent from './update-notification.jsx';
×
4
import AppHeaderComponent from './app-header.jsx';
×
5
import StoryComponent from './story.jsx';
×
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;
×
22
    if (event.key === 'ArrowLeft' && !story.playing) {
×
23
      story.selectPreviousFrame();
×
24
      await story.save();
×
25
    } else if (event.key === 'ArrowRight' && !story.playing) {
×
26
      story.selectNextFrame();
×
27
      await story.save();
×
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

© 2026 Coveralls, Inc