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

caleb531 / flip-book / 10498848679

21 Aug 2024 11:10PM UTC coverage: 26.831% (+2.8%) from 24.055%
10498848679

push

github

caleb531
Rename components to have *.jsx extension

This is a preliminary step to the actual conversion to JSX.

72 of 102 branches covered (70.59%)

Branch coverage included in aggregate %.

0 of 65 new or added lines in 17 files covered. (0.0%)

386 of 1605 relevant lines covered (24.05%)

7.23 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';
×
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 {
×
9

10
  oninit() {
×
11
    App.restore().then((app) => {
×
12
      this.app = app;
×
13
      m.redraw();
×
14
    });
×
15
  }
×
16

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

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

41
  view() {
×
42
    return m('div.app[tabindex=-1]', {
×
43
      onkeydown: (event) => this.navigateFramesViaKeyboard(event)
×
44
    }, [
×
45

46
      // The UpdateNotificationComponent manages its own visibility
47
      m(UpdateNotificationComponent),
×
48

49
      m(StorageUpgraderComponent),
×
50

51
      m(AppHeaderComponent),
×
52

53
      this.app?.selectedStory ? m(StoryComponent, {
×
54
        app: this.app,
×
55
        story: this.app.selectedStory
×
56
      }) : null
×
57

58
    ]);
×
59
  }
×
60

61
}
×
62

63
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