|
6 | 6 | :style="{ width: iframeWidth }" |
7 | 7 | @changeFullscreen="isInFullscreen = $event" |
8 | 8 | > |
9 | | - <div |
10 | | - class="fullscreen-header" |
11 | | - :style="{ backgroundColor: $themePalette.grey.v_200 }" |
12 | | - > |
13 | | - <KButton |
14 | | - :primary="false" |
15 | | - appearance="flat-button" |
16 | | - @click="$refs.bloompubViewer.toggleFullscreen()" |
17 | | - > |
18 | | - <KIcon |
19 | | - v-if="isInFullscreen" |
20 | | - icon="fullscreen_exit" |
21 | | - class="fs-icon" |
22 | | - /> |
23 | | - <KIcon |
24 | | - v-else |
25 | | - icon="fullscreen" |
26 | | - class="fs-icon" |
27 | | - /> |
28 | | - {{ fullscreenText }} |
29 | | - </KButton> |
30 | | - </div> |
| 9 | + <ViewerToolbar |
| 10 | + :isInFullscreen="isInFullscreen" |
| 11 | + :embedded="embedded" |
| 12 | + @toggleFullscreen="$refs.bloompubViewer.toggleFullscreen()" |
| 13 | + /> |
31 | 14 | <div |
32 | 15 | class="iframe-container" |
33 | 16 | :style="containerStyle" |
|
58 | 41 | import urls from 'kolibri/urls'; |
59 | 42 | import { now } from 'kolibri/utils/serverClock'; |
60 | 43 | import CoreFullscreen from 'kolibri-common/components/CoreFullscreen'; |
| 44 | + import ViewerToolbar from 'kolibri-common/components/ViewerToolbar'; |
61 | 45 | import Sandbox from 'kolibri-sandbox'; |
| 46 | +
|
62 | 47 | import useContentViewer from 'kolibri/composables/useContentViewer'; |
63 | 48 |
|
64 | 49 | const defaultContentHeight = '500px'; |
65 | | - const frameTopbarHeight = '37px'; |
| 50 | + const frameTopbarHeight = '48px'; |
66 | 51 | export default { |
67 | 52 | name: 'BloomPubRendererIndex', |
68 | 53 | components: { |
69 | 54 | CoreFullscreen, |
| 55 | + ViewerToolbar, |
70 | 56 | }, |
71 | 57 | setup(props, context) { |
72 | | - const { defaultFile, options, forceDurationBasedProgress, reportError } = useContentViewer( |
73 | | - context, |
74 | | - { defaultDuration: 300 }, |
75 | | - ); |
| 58 | + const { |
| 59 | + defaultFile, |
| 60 | + options, |
| 61 | + lang, |
| 62 | + forceDurationBasedProgress, |
| 63 | + reportError, |
| 64 | + embedded, |
| 65 | + extraFields, |
| 66 | + timeSpent, |
| 67 | + userId, |
| 68 | + userFullName, |
| 69 | + progress, |
| 70 | + } = useContentViewer(context, { defaultDuration: 300 }); |
76 | 71 | return { |
77 | 72 | defaultFile, |
78 | 73 | options, |
| 74 | + lang, |
79 | 75 | forceDurationBasedProgress, |
80 | 76 | reportError, |
| 77 | + embedded, |
| 78 | + extraFields, |
| 79 | + timeSpent, |
| 80 | + userId, |
| 81 | + userFullName, |
| 82 | + progress, |
81 | 83 | }; |
82 | 84 | }, |
83 | 85 | data() { |
|
94 | 96 | iframeWidth() { |
95 | 97 | return (this.options && this.options.width) || 'auto'; |
96 | 98 | }, |
97 | | - fullscreenText() { |
98 | | - return this.isInFullscreen ? this.$tr('exitFullscreen') : this.$tr('enterFullscreen'); |
99 | | - }, |
100 | 99 | userData() { |
101 | 100 | return { |
102 | 101 | userId: this.userId, |
|
161 | 160 | } |
162 | 161 | this.$emit('stopTracking'); |
163 | 162 | }, |
164 | | - $trs: { |
165 | | - exitFullscreen: { |
166 | | - message: 'Exit fullscreen', |
167 | | - context: |
168 | | - "Learners can use the Esc key or the 'exit fullscreen' button to close the fullscreen view on an html5 app.", |
169 | | - }, |
170 | | - enterFullscreen: { |
171 | | - message: 'Enter fullscreen', |
172 | | - context: |
173 | | - 'Learners can use the full screen button in the upper right corner to open an html5 app in fullscreen view.\n', |
174 | | - }, |
175 | | - }, |
176 | 163 | }; |
177 | 164 |
|
178 | 165 | </script> |
|
181 | 168 | <style lang="scss" scoped> |
182 | 169 |
|
183 | 170 | @import '~kolibri-design-system/lib/styles/definitions'; |
184 | | - $frame-topbar-height: 37px; |
185 | | -
|
186 | | - .fullscreen-header { |
187 | | - text-align: right; |
188 | | - } |
189 | | -
|
190 | | - .fs-icon { |
191 | | - position: relative; |
192 | | - top: 8px; |
193 | | - width: 24px; |
194 | | - height: 24px; |
195 | | - } |
| 171 | + $frame-topbar-height: 48px; |
196 | 172 |
|
197 | 173 | .bloompub-viewer { |
198 | 174 | position: relative; |
|
0 commit comments