| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70 | 2×
2×
2×
2×
2×
2×
2×
16×
16×
1×
1×
16×
16×
16×
16×
2×
14×
14×
14×
14×
2×
| var ArbitraryHtmlAndMath, BookContentMixin, ChapterSectionMixin, LinkContentMixin, React, ReadingStepContent, StepContent, TaskStepStore, _, ref, ref1;
React = require('react');
_ = require('underscore');
TaskStepStore = require('../../flux/task-step').TaskStepStore;
ref = require('openstax-react-components'), ArbitraryHtmlAndMath = ref.ArbitraryHtmlAndMath, ChapterSectionMixin = ref.ChapterSectionMixin;
ref1 = require('../book-content-mixin'), BookContentMixin = ref1.BookContentMixin, LinkContentMixin = ref1.LinkContentMixin;
ReadingStepContent = React.createClass({
displayName: 'ReadingStepContent',
propTypes: {
id: React.PropTypes.string.isRequired,
courseDataProps: React.PropTypes.object.isRequired,
stepType: React.PropTypes.string.isRequired
},
mixins: [BookContentMixin, ChapterSectionMixin],
getSplashTitle: function() {
var ref2;
return ((ref2 = TaskStepStore.get(this.props.id)) != null ? ref2.title : void 0) || '';
},
getCnxId: function() {
return TaskStepStore.getCnxId(this.props.id);
},
shouldOpenNewTab: function() {
return true;
},
render: function() {
var content_html, courseDataProps, id, ref2, stepType;
ref2 = this.props, id = ref2.id, courseDataProps = ref2.courseDataProps, stepType = ref2.stepType;
content_html = TaskStepStore.get(id).content_html;
return React.createElement(ArbitraryHtmlAndMath, React.__spread({}, courseDataProps, {
"className": stepType + "-step",
"html": content_html
}));
}
});
StepContent = React.createClass({
displayName: 'StepContent',
propTypes: {
id: React.PropTypes.string.isRequired,
stepType: React.PropTypes.string.isRequired
},
mixins: [LinkContentMixin],
getCnxId: function() {
return TaskStepStore.getCnxId(this.props.id);
},
render: function() {
var content_html, id, ref2, stepType;
ref2 = this.props, id = ref2.id, stepType = ref2.stepType;
content_html = TaskStepStore.get(id).content_html;
return React.createElement("div", {
"className": stepType + "-step"
}, React.createElement(ArbitraryHtmlAndMath, {
"className": stepType + "-content",
"html": content_html
}));
}
});
module.exports = {
StepContent: StepContent,
ReadingStepContent: ReadingStepContent
};
|