@internetarchive/bookreader 5.0.0-88-alpha.11 → 5.0.0-89

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) hide show
  1. package/BookReader/BookReader.css +17 -3
  2. package/BookReader/BookReader.js +1 -1
  3. package/BookReader/BookReader.js.map +1 -1
  4. package/BookReader/ia-bookreader-bundle.js +87 -108
  5. package/BookReader/ia-bookreader-bundle.js.map +1 -1
  6. package/BookReader/plugins/plugin.archive_analytics.js +1 -1
  7. package/BookReader/plugins/plugin.archive_analytics.js.map +1 -1
  8. package/BookReader/plugins/plugin.autoplay.js +1 -1
  9. package/BookReader/plugins/plugin.autoplay.js.map +1 -1
  10. package/BookReader/plugins/plugin.iiif.js +1 -1
  11. package/BookReader/plugins/plugin.iiif.js.map +1 -1
  12. package/BookReader/plugins/plugin.resume.js +1 -1
  13. package/BookReader/plugins/plugin.resume.js.map +1 -1
  14. package/BookReader/plugins/plugin.search.js +1 -1
  15. package/BookReader/plugins/plugin.search.js.map +1 -1
  16. package/BookReader/plugins/plugin.text_selection.js +1 -1
  17. package/BookReader/plugins/plugin.text_selection.js.map +1 -1
  18. package/BookReader/plugins/plugin.tts.js +1 -1
  19. package/BookReader/plugins/plugin.tts.js.map +1 -1
  20. package/BookReader/plugins/plugin.url.js +1 -1
  21. package/BookReader/plugins/plugin.url.js.map +1 -1
  22. package/CHANGELOG.md +14 -0
  23. package/babel.config.js +12 -30
  24. package/codecov.yml +1 -1
  25. package/jsconfig.json +1 -3
  26. package/package.json +14 -16
  27. package/src/BookNavigator/search/search-results.js +1 -1
  28. package/src/BookReader/ImageCache.js +48 -15
  29. package/src/BookReader/Mode1UpLit.js +56 -86
  30. package/src/BookReader/Mode2UpLit.js +5 -5
  31. package/src/BookReader/Navbar/Navbar.js +53 -11
  32. package/src/BookReader/PageContainer.js +41 -22
  33. package/src/BookReader/options.js +27 -3
  34. package/src/BookReader/utils.js +10 -0
  35. package/src/BookReader.js +120 -21
  36. package/src/BookReaderPlugin.js +44 -0
  37. package/src/css/_BRnav.scss +0 -3
  38. package/src/css/_BRpages.scss +21 -2
  39. package/src/css/_controls.scss +4 -0
  40. package/src/plugins/plugin.archive_analytics.js +84 -78
  41. package/src/plugins/plugin.autoplay.js +98 -102
  42. package/src/plugins/plugin.chapters.js +17 -22
  43. package/src/plugins/plugin.iiif.js +16 -30
  44. package/src/plugins/plugin.resume.js +54 -51
  45. package/src/plugins/plugin.text_selection.js +68 -76
  46. package/src/plugins/tts/AbstractTTSEngine.js +2 -4
  47. package/src/plugins/tts/PageChunk.js +5 -9
  48. package/src/plugins/tts/PageChunkIterator.js +3 -5
  49. package/src/plugins/tts/plugin.tts.js +309 -329
  50. package/src/plugins/url/plugin.url.js +1 -1
  51. package/src/util/strings.js +1 -0
  52. package/tests/e2e/autoplay.test.js +8 -5
  53. package/tests/e2e/helpers/base.js +2 -2
  54. package/tests/e2e/helpers/mockSearch.js +6 -9
  55. package/tests/jest/BookReader/Navbar/Navbar.test.js +16 -3
  56. package/tests/jest/BookReader/PageContainer.test.js +96 -55
  57. package/tests/jest/BookReader/utils.test.js +21 -0
  58. package/tests/jest/BookReader.test.js +13 -12
  59. package/tests/jest/plugins/plugin.archive_analytics.test.js +8 -11
  60. package/tests/jest/plugins/plugin.autoplay.test.js +9 -22
  61. package/tests/jest/plugins/plugin.resume.test.js +19 -32
  62. package/tests/jest/plugins/plugin.text_selection.test.js +23 -24
  63. package/dist/esm/BookNavigator/assets/bookmark-colors.js +0 -4
  64. package/dist/esm/BookNavigator/assets/button-base.js +0 -4
  65. package/dist/esm/BookNavigator/assets/ia-logo.js +0 -4
  66. package/dist/esm/BookNavigator/assets/icon_checkmark.js +0 -8
  67. package/dist/esm/BookNavigator/assets/icon_close.js +0 -4
  68. package/dist/esm/BookNavigator/book-navigator.js +0 -612
  69. package/dist/esm/BookNavigator/bookmarks/bookmark-button.js +0 -35
  70. package/dist/esm/BookNavigator/bookmarks/bookmark-edit.js +0 -78
  71. package/dist/esm/BookNavigator/bookmarks/bookmarks-list.js +0 -160
  72. package/dist/esm/BookNavigator/bookmarks/bookmarks-loginCTA.js +0 -24
  73. package/dist/esm/BookNavigator/bookmarks/bookmarks-provider.js +0 -55
  74. package/dist/esm/BookNavigator/bookmarks/ia-bookmarks.js +0 -521
  75. package/dist/esm/BookNavigator/delete-modal-actions.js +0 -29
  76. package/dist/esm/BookNavigator/downloads/downloads-provider.js +0 -84
  77. package/dist/esm/BookNavigator/downloads/downloads.js +0 -69
  78. package/dist/esm/BookNavigator/search/search-provider.js +0 -238
  79. package/dist/esm/BookNavigator/search/search-results.js +0 -161
  80. package/dist/esm/BookNavigator/sharing.js +0 -26
  81. package/dist/esm/BookNavigator/viewable-files.js +0 -94
  82. package/dist/esm/BookNavigator/visual-adjustments/visual-adjustments-provider.js +0 -83
  83. package/dist/esm/BookNavigator/visual-adjustments/visual-adjustments.js +0 -131
  84. package/dist/esm/BookReader/BookModel.js +0 -575
  85. package/dist/esm/BookReader/DragScrollable.js +0 -224
  86. package/dist/esm/BookReader/ImageCache.js +0 -122
  87. package/dist/esm/BookReader/Mode1Up.js +0 -114
  88. package/dist/esm/BookReader/Mode1UpLit.js +0 -579
  89. package/dist/esm/BookReader/Mode2Up.js +0 -106
  90. package/dist/esm/BookReader/Mode2UpLit.js +0 -1020
  91. package/dist/esm/BookReader/ModeCoordinateSpace.js +0 -28
  92. package/dist/esm/BookReader/ModeSmoothZoom.js +0 -318
  93. package/dist/esm/BookReader/ModeThumb.js +0 -366
  94. package/dist/esm/BookReader/Navbar/Navbar.js +0 -253
  95. package/dist/esm/BookReader/PageContainer.js +0 -165
  96. package/dist/esm/BookReader/ReduceSet.js +0 -27
  97. package/dist/esm/BookReader/Toolbar/Toolbar.js +0 -242
  98. package/dist/esm/BookReader/events.js +0 -20
  99. package/dist/esm/BookReader/options.js +0 -331
  100. package/dist/esm/BookReader/utils/HTMLDimensionsCacher.js +0 -48
  101. package/dist/esm/BookReader/utils/ScrollClassAdder.js +0 -31
  102. package/dist/esm/BookReader/utils/SelectionObserver.js +0 -42
  103. package/dist/esm/BookReader/utils/classes.js +0 -37
  104. package/dist/esm/BookReader/utils.js +0 -315
  105. package/dist/esm/BookReader.js +0 -1828
  106. package/dist/esm/assets/icons/1up.svg +0 -12
  107. package/dist/esm/assets/icons/2up.svg +0 -15
  108. package/dist/esm/assets/icons/advance.svg +0 -26
  109. package/dist/esm/assets/icons/chevron-right.svg +0 -1
  110. package/dist/esm/assets/icons/close-circle-dark.svg +0 -1
  111. package/dist/esm/assets/icons/close-circle.svg +0 -1
  112. package/dist/esm/assets/icons/fullscreen.svg +0 -17
  113. package/dist/esm/assets/icons/fullscreen_exit.svg +0 -17
  114. package/dist/esm/assets/icons/hamburger.svg +0 -15
  115. package/dist/esm/assets/icons/left-arrow.svg +0 -12
  116. package/dist/esm/assets/icons/magnify-minus.svg +0 -12
  117. package/dist/esm/assets/icons/magnify-plus.svg +0 -13
  118. package/dist/esm/assets/icons/magnify.svg +0 -15
  119. package/dist/esm/assets/icons/pause.svg +0 -23
  120. package/dist/esm/assets/icons/play.svg +0 -22
  121. package/dist/esm/assets/icons/playback-speed.svg +0 -34
  122. package/dist/esm/assets/icons/read-aloud.svg +0 -22
  123. package/dist/esm/assets/icons/review.svg +0 -22
  124. package/dist/esm/assets/icons/thumbnails.svg +0 -17
  125. package/dist/esm/assets/icons/voice.svg +0 -1
  126. package/dist/esm/assets/icons/volume-full.svg +0 -22
  127. package/dist/esm/assets/images/BRicons.png +0 -0
  128. package/dist/esm/assets/images/BRicons.svg +0 -94
  129. package/dist/esm/assets/images/BRicons_ia.png +0 -0
  130. package/dist/esm/assets/images/back_pages.png +0 -0
  131. package/dist/esm/assets/images/book_bottom_icon.png +0 -0
  132. package/dist/esm/assets/images/book_down_icon.png +0 -0
  133. package/dist/esm/assets/images/book_left_icon.png +0 -0
  134. package/dist/esm/assets/images/book_leftmost_icon.png +0 -0
  135. package/dist/esm/assets/images/book_right_icon.png +0 -0
  136. package/dist/esm/assets/images/book_rightmost_icon.png +0 -0
  137. package/dist/esm/assets/images/book_top_icon.png +0 -0
  138. package/dist/esm/assets/images/book_up_icon.png +0 -0
  139. package/dist/esm/assets/images/books_graphic.svg +0 -177
  140. package/dist/esm/assets/images/booksplit.png +0 -0
  141. package/dist/esm/assets/images/control_pause_icon.png +0 -0
  142. package/dist/esm/assets/images/control_play_icon.png +0 -0
  143. package/dist/esm/assets/images/embed_icon.png +0 -0
  144. package/dist/esm/assets/images/icon-home-ia.png +0 -0
  145. package/dist/esm/assets/images/icon_OL-logo-xs.png +0 -0
  146. package/dist/esm/assets/images/icon_alert-xs.png +0 -0
  147. package/dist/esm/assets/images/icon_book.svg +0 -12
  148. package/dist/esm/assets/images/icon_bookmark.svg +0 -12
  149. package/dist/esm/assets/images/icon_close-pop.png +0 -0
  150. package/dist/esm/assets/images/icon_download.png +0 -0
  151. package/dist/esm/assets/images/icon_gear.svg +0 -14
  152. package/dist/esm/assets/images/icon_hamburger.svg +0 -20
  153. package/dist/esm/assets/images/icon_home.png +0 -0
  154. package/dist/esm/assets/images/icon_home.svg +0 -21
  155. package/dist/esm/assets/images/icon_home_ia.png +0 -0
  156. package/dist/esm/assets/images/icon_indicator.png +0 -0
  157. package/dist/esm/assets/images/icon_info.svg +0 -11
  158. package/dist/esm/assets/images/icon_one_page.svg +0 -8
  159. package/dist/esm/assets/images/icon_pause.svg +0 -1
  160. package/dist/esm/assets/images/icon_play.svg +0 -1
  161. package/dist/esm/assets/images/icon_playback-rate.svg +0 -15
  162. package/dist/esm/assets/images/icon_return.png +0 -0
  163. package/dist/esm/assets/images/icon_search_button.svg +0 -8
  164. package/dist/esm/assets/images/icon_share.svg +0 -9
  165. package/dist/esm/assets/images/icon_skip-ahead.svg +0 -6
  166. package/dist/esm/assets/images/icon_skip-back.svg +0 -13
  167. package/dist/esm/assets/images/icon_speaker.svg +0 -18
  168. package/dist/esm/assets/images/icon_speaker_open.svg +0 -10
  169. package/dist/esm/assets/images/icon_thumbnails.svg +0 -12
  170. package/dist/esm/assets/images/icon_toc.svg +0 -5
  171. package/dist/esm/assets/images/icon_two_pages.svg +0 -9
  172. package/dist/esm/assets/images/icon_zoomer.png +0 -0
  173. package/dist/esm/assets/images/loading.gif +0 -0
  174. package/dist/esm/assets/images/logo_icon.png +0 -0
  175. package/dist/esm/assets/images/marker_chap-off.png +0 -0
  176. package/dist/esm/assets/images/marker_chap-off.svg +0 -11
  177. package/dist/esm/assets/images/marker_chap-off_ia.png +0 -0
  178. package/dist/esm/assets/images/marker_chap-on.png +0 -0
  179. package/dist/esm/assets/images/marker_chap-on.svg +0 -11
  180. package/dist/esm/assets/images/marker_srch-on.svg +0 -11
  181. package/dist/esm/assets/images/marker_srchchap-off.png +0 -0
  182. package/dist/esm/assets/images/marker_srchchap-on.png +0 -0
  183. package/dist/esm/assets/images/nav_control-dn.png +0 -0
  184. package/dist/esm/assets/images/nav_control-dn_ia.png +0 -0
  185. package/dist/esm/assets/images/nav_control-up.png +0 -0
  186. package/dist/esm/assets/images/nav_control-up_ia.png +0 -0
  187. package/dist/esm/assets/images/nav_control.png +0 -0
  188. package/dist/esm/assets/images/one_page_mode_icon.png +0 -0
  189. package/dist/esm/assets/images/paper-badge.png +0 -0
  190. package/dist/esm/assets/images/print_icon.png +0 -0
  191. package/dist/esm/assets/images/progressbar.gif +0 -0
  192. package/dist/esm/assets/images/right_edges.png +0 -0
  193. package/dist/esm/assets/images/slider.png +0 -0
  194. package/dist/esm/assets/images/slider_ia.png +0 -0
  195. package/dist/esm/assets/images/thumbnail_mode_icon.png +0 -0
  196. package/dist/esm/assets/images/transparent.png +0 -0
  197. package/dist/esm/assets/images/two_page_mode_icon.png +0 -0
  198. package/dist/esm/assets/images/unviewable_page.png +0 -0
  199. package/dist/esm/assets/images/zoom_in_icon.png +0 -0
  200. package/dist/esm/assets/images/zoom_out_icon.png +0 -0
  201. package/dist/esm/css/BookReader.scss +0 -85
  202. package/dist/esm/css/_BRBookmarks.scss +0 -29
  203. package/dist/esm/css/_BRComponent.scss +0 -13
  204. package/dist/esm/css/_BRfloat.scss +0 -197
  205. package/dist/esm/css/_BRicon.scss +0 -54
  206. package/dist/esm/css/_BRmain.scss +0 -262
  207. package/dist/esm/css/_BRnav.scss +0 -354
  208. package/dist/esm/css/_BRpages.scss +0 -213
  209. package/dist/esm/css/_BRsearch.scss +0 -268
  210. package/dist/esm/css/_BRtoolbar.scss +0 -84
  211. package/dist/esm/css/_BRvendor.scss +0 -5
  212. package/dist/esm/css/_TextSelection.scss +0 -108
  213. package/dist/esm/css/_colorbox.scss +0 -52
  214. package/dist/esm/css/_controls.scss +0 -257
  215. package/dist/esm/css/_icons.scss +0 -121
  216. package/dist/esm/ia-bookreader/ia-bookreader.js +0 -141
  217. package/dist/esm/jquery-wrapper.js +0 -3
  218. package/dist/esm/plugins/plugin.archive_analytics.js +0 -72
  219. package/dist/esm/plugins/plugin.autoplay.js +0 -119
  220. package/dist/esm/plugins/plugin.chapters.js +0 -288
  221. package/dist/esm/plugins/plugin.iframe.js +0 -44
  222. package/dist/esm/plugins/plugin.iiif.js +0 -146
  223. package/dist/esm/plugins/plugin.resume.js +0 -66
  224. package/dist/esm/plugins/plugin.text_selection.js +0 -621
  225. package/dist/esm/plugins/plugin.vendor-fullscreen.js +0 -227
  226. package/dist/esm/plugins/search/plugin.search.js +0 -499
  227. package/dist/esm/plugins/search/utils.js +0 -42
  228. package/dist/esm/plugins/search/view.js +0 -360
  229. package/dist/esm/plugins/tts/AbstractTTSEngine.js +0 -282
  230. package/dist/esm/plugins/tts/FestivalTTSEngine.js +0 -192
  231. package/dist/esm/plugins/tts/PageChunk.js +0 -105
  232. package/dist/esm/plugins/tts/PageChunkIterator.js +0 -155
  233. package/dist/esm/plugins/tts/WebTTSEngine.js +0 -364
  234. package/dist/esm/plugins/tts/plugin.tts.js +0 -315
  235. package/dist/esm/plugins/tts/tooltip_dict.js +0 -14
  236. package/dist/esm/plugins/tts/utils.js +0 -79
  237. package/dist/esm/plugins/url/UrlPlugin.js +0 -197
  238. package/dist/esm/plugins/url/plugin.url.js +0 -212
  239. package/dist/esm/util/browserSniffing.js +0 -56
  240. package/dist/esm/util/debouncer.js +0 -25
  241. package/dist/esm/util/docCookies.js +0 -75
  242. package/dist/esm/util/strings.js +0 -34
  243. package/index.js +0 -2
@@ -1,257 +0,0 @@
1
- .BRcontrols {
2
- width: 100%;
3
-
4
- .BRtooltip {
5
- display: none;
6
- position: absolute;
7
- width: auto;
8
- left: 50%;
9
- bottom: calc(100% + 10px);
10
- transform: translateX(-50%);
11
- padding: 5px 10px;
12
- font-weight: bold;
13
- white-space: nowrap;
14
- color: $controlsText;
15
- border-radius: 3px;
16
- background: $tooltipBG;
17
- pointer-events: none;
18
- }
19
-
20
- .full .BRtooltip {
21
- left: auto;
22
- right: 0;
23
- transform: translateX(0);
24
- }
25
-
26
- .BRfullscreenActive & {
27
- .icon-fullscreen {
28
- background-image: url("icons/fullscreen_exit.svg");
29
- }
30
- }
31
-
32
- select.playback-speed, select.playback-voices {
33
- padding-top: 18px;
34
- -moz-appearance: none;
35
- -webkit-appearance: none;
36
- appearance: none;
37
- font-size: 10px;
38
- text-align-last: center;
39
- color: $controlsText;
40
- border: none;
41
- cursor: pointer;
42
- option, optgroup {
43
- background: $controlsBG;
44
- }
45
- }
46
-
47
- select.playback-speed {
48
- width: 30px;
49
- background: transparent url("icons/playback-speed.svg") 50% 0 no-repeat;
50
- }
51
-
52
- select.playback-voices {
53
- width: 30px;
54
- background: transparent url("icons/voice.svg") 50% 0 no-repeat;
55
- background-size: 18px;
56
- }
57
-
58
- .active {
59
- background: $activeButtonBG;
60
- }
61
-
62
- li {
63
- position: relative;
64
- }
65
-
66
- .controls {
67
- position: relative;
68
- z-index: 2;
69
- display: flex;
70
- padding: 2px 10px;
71
- margin: 0;
72
- list-style: none;
73
- background: $controlsBG;
74
- @media (max-width: $brBreakPointMobile) {
75
- padding-left: 0;
76
- }
77
- }
78
-
79
- .controls button {
80
- width: 30px;
81
- height: 30px;
82
- }
83
-
84
- @keyframes slideUp {
85
- from {
86
- opacity: 0;
87
- transform: translateY(10px);
88
- }
89
- to {
90
- opacity: 1;
91
- transform: translateY(0);
92
- }
93
- }
94
-
95
- .read-aloud {
96
- display: none;
97
- position: absolute;
98
- bottom: 100%;
99
- right: 0;
100
- left: 0;
101
- z-index: 1;
102
- padding: 5px 0;
103
- margin: 0;
104
- align-items: center;
105
- justify-content: center;
106
- list-style: none;
107
- background: $controlsBG;
108
-
109
- &.visible {
110
- display: flex;
111
- animation: slideUp 0.2s;
112
- button {
113
- width: unset;
114
- height: unset;
115
- }
116
- }
117
-
118
- li {
119
- padding: 0 10px;
120
- }
121
-
122
- [name="play"] {
123
- .icon-pause {
124
- display: none;
125
- }
126
- &.playing {
127
- .icon-play {
128
- display: none;
129
- }
130
- .icon-pause {
131
- display: inline-block;
132
- }
133
- }
134
- }
135
- }
136
-
137
- .scrubber {
138
- display: flex;
139
- width: 100%;
140
- height: 30px;
141
- }
142
-
143
- .frame {
144
- position: relative;
145
- width: 100%;
146
- }
147
-
148
- .color-fill {
149
- position: absolute;
150
- top: 50%;
151
- left: 0;
152
- transform: translateY(-50%);
153
- width: 100%;
154
- height: 8px;
155
- border-radius: 8px;
156
- }
157
-
158
- .scrubber input[type=range] {
159
- position: absolute;
160
- top: 50%;
161
- left: 0;
162
- transform: translateY(-50%);
163
- width: 100%;
164
- background-color: transparent;
165
- -webkit-appearance: none;
166
- }
167
-
168
- .scrubber input[type=range]:focus {
169
- outline: none;
170
- }
171
-
172
- .scrubber input[type=range]::-webkit-slider-runnable-track {
173
- background: transparent;
174
- border: 0px solid rgba(204, 204, 204, 0);
175
- border: 0;
176
- border-radius: 8px;
177
- width: 100%;
178
- height: 8px;
179
- cursor: pointer;
180
- }
181
-
182
- .scrubber input[type=range]::-webkit-slider-thumb {
183
- margin-top: -4px;
184
- width: 16px;
185
- height: 16px;
186
- background: #ffffff;
187
- border: 0px solid rgba(0, 0, 0, 0);
188
- border: 0;
189
- border-radius: 8px;
190
- cursor: pointer;
191
- -webkit-appearance: none;
192
- }
193
-
194
- .scrubber input[type=range]::-moz-range-track {
195
- background: #666666;
196
- border: 0px solid rgba(204, 204, 204, 0);
197
- border: 0;
198
- border-radius: 8px;
199
- width: 100%;
200
- height: 8px;
201
- cursor: pointer;
202
- }
203
-
204
- .scrubber input[type=range]::-moz-range-progress {
205
- height: 8px;
206
- background: #ccc;
207
- }
208
-
209
- .scrubber input[type=range]::-ms-track {
210
- border: none;
211
- color: transparent;
212
- background: #666;
213
- }
214
-
215
- .scrubber input[type=range]::-ms-fill-lower {
216
- background: #ccc;
217
- }
218
-
219
- .scrubber input[type=range]::-ms-tooltip {
220
- display: none;
221
- }
222
-
223
- .scrubber input[type=range]::-moz-range-thumb {
224
- width: 16px;
225
- height: 16px;
226
- background: #ffffff;
227
- border: 0px solid rgba(0, 0, 0, 0);
228
- border: 0;
229
- border-radius: 8px;
230
- cursor: pointer;
231
- }
232
-
233
- .scrubber p {
234
- padding: 0 20px 0 13px;
235
- margin: 0;
236
- align-self: stretch;
237
- font-weight: 700;
238
- line-height: 26px;
239
- color: $controlsText;
240
- @media (max-width: $brBreakPointMobile) {
241
- padding: 0;
242
- }
243
- }
244
-
245
- /* BookReader defaults overrides */
246
- .BRnavline {
247
- top: -4px;
248
- }
249
-
250
- .scrubber .BRpager.ui-slider {
251
- top: 10px;
252
- background-color: $trackColor;
253
- }
254
- .scrubber .BRpager.ui-slider .ui-slider-range {
255
- background-color: $trackFillColor;
256
- }
257
- }
@@ -1,121 +0,0 @@
1
- .icon {
2
- display: inline-block;
3
- background: transparent 50% 50% no-repeat;
4
- }
5
-
6
- .icon.hflip {
7
- transform: scaleX(-1);
8
- }
9
-
10
- .active .icon {
11
- filter: brightness(.2);
12
- }
13
-
14
- .icon-read-aloud {
15
- width: 20px;
16
- height: 16px;
17
- background-image: url("icons/read-aloud.svg");
18
- }
19
-
20
- .icon-onepg {
21
- width: 11px;
22
- height: 19px;
23
- background-image: url("icons/1up.svg");
24
- }
25
-
26
- .icon-twopg {
27
- width: 20px;
28
- height: 19px;
29
- background-image: url("icons/2up.svg");
30
- }
31
-
32
- .icon-fullscreen,
33
- .icon-fullscreen-exit {
34
- width: 18px;
35
- height: 18px;
36
- background-image: url("icons/fullscreen.svg");
37
- }
38
-
39
- .icon-fullscreen-exit {
40
- background-image: url("icons/fullscreen_exit.svg");
41
- }
42
-
43
- .icon-thumb {
44
- width: 17px;
45
- height: 19px;
46
- background-image: url("icons/thumbnails.svg");
47
- }
48
-
49
- .icon-playback-speed {
50
- width: 24px;
51
- height: 32px;
52
- background-image: url("icons/playback-speed.svg");
53
- }
54
-
55
- .icon-review,
56
- .icon-advance {
57
- width: 21px;
58
- height: 19px;
59
- background-image: url("icons/review.svg");
60
- }
61
-
62
- .icon-advance {
63
- background-image: url("icons/advance.svg");
64
- }
65
-
66
- .icon-volume-full {
67
- width: 23px;
68
- height: 22px;
69
- background-image: url("icons/volume-full.svg");
70
- }
71
-
72
- .icon-play,
73
- .icon-pause {
74
- width: 40px;
75
- height: 40px;
76
- background-image: url("icons/play.svg");
77
- }
78
-
79
- .icon-pause {
80
- background-image: url("icons/pause.svg");
81
- }
82
-
83
- .icon-left-arrow {
84
- width: 12px;
85
- height: 14px;
86
- background-image: url("icons/left-arrow.svg");
87
- }
88
-
89
- .icon-magnify {
90
- position: relative;
91
- width: 18px;
92
- height: 18px;
93
- background-image: url("icons/magnify-minus.svg");
94
- &.plus{
95
- background-image: url("icons/magnify-plus.svg");
96
- }
97
- }
98
-
99
- .icon-search {
100
- width: 19px;
101
- height: 19px;
102
- background-image: url("images/icon_search_button.svg");
103
- }
104
-
105
- .icon-chevron {
106
- width: 5px;
107
- height: 8px;
108
- background-image: url("icons/chevron-right.svg");
109
- }
110
-
111
- .icon-close {
112
- width: 12px;
113
- height: 12px;
114
- background-image: url("icons/close-circle.svg");
115
- }
116
-
117
- .icon-close-dark {
118
- width: 12px;
119
- height: 12px;
120
- background-image: url("icons/close-circle-dark.svg");
121
- }
@@ -1,141 +0,0 @@
1
- var _templateObject, _templateObject2;
2
- function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
3
- /**
4
- * BookReaderTemplate to load BookNavigator components
5
- */
6
-
7
- import { LitElement, html, css } from 'lit';
8
- import '@internetarchive/ia-item-navigator';
9
- import '../BookNavigator/book-navigator.js';
10
- // eslint-disable-next-line no-unused-vars
11
- import { ModalManager } from '@internetarchive/modal-manager';
12
- import '@internetarchive/modal-manager';
13
- import { SharedResizeObserver } from '@internetarchive/shared-resize-observer';
14
- export class IaBookReader extends LitElement {
15
- static get properties() {
16
- return {
17
- item: {
18
- type: Object
19
- },
20
- baseHost: {
21
- type: String
22
- },
23
- signedIn: {
24
- type: Boolean
25
- },
26
- fullscreen: {
27
- type: Boolean,
28
- reflect: true,
29
- attribute: true
30
- },
31
- sharedObserver: {
32
- type: Object,
33
- attribute: false
34
- },
35
- modal: {
36
- type: Object,
37
- attribute: false
38
- },
39
- loaded: {
40
- type: Boolean
41
- },
42
- menuShortcuts: {
43
- type: Array
44
- },
45
- menuContents: {
46
- type: Array
47
- }
48
- };
49
- }
50
- constructor() {
51
- super();
52
- this.item = undefined;
53
- this.bookreader = undefined;
54
- this.baseHost = 'archive.org';
55
- this.fullscreen = false;
56
- this.signedIn = false;
57
- /** @type {ModalManager} */
58
- this.modal = undefined;
59
- /** @type {SharedResizeObserver} */
60
- this.sharedObserver = undefined;
61
- this.loaded = false;
62
- this.menuShortcuts = [];
63
- this.menuContents = [];
64
- this.openMenuName = '';
65
- }
66
- updated() {
67
- if (!this.modal) {
68
- this.setModalManager();
69
- }
70
- if (!this.sharedObserver) {
71
- this.sharedObserver = new SharedResizeObserver();
72
- }
73
- }
74
- get itemNav() {
75
- return this.shadowRoot.querySelector('iaux-item-navigator');
76
- }
77
-
78
- /** Creates modal DOM & attaches to `<body>` */
79
- setModalManager() {
80
- var modalManager = document.querySelector('modal-manager');
81
- if (!modalManager) {
82
- modalManager = document.createElement('modal-manager');
83
- document.body.appendChild(modalManager);
84
- }
85
- this.modal = modalManager;
86
- }
87
- manageFullscreen(e) {
88
- var {
89
- detail
90
- } = e;
91
- var fullscreen = !!detail.isFullScreen;
92
- this.fullscreen = fullscreen;
93
- this.dispatchEvent(new CustomEvent('fullscreenStateUpdated', {
94
- detail: {
95
- fullscreen
96
- }
97
- }));
98
- }
99
- loadingStateUpdated(e) {
100
- var {
101
- loaded
102
- } = e.detail;
103
- this.loaded = loaded || null;
104
- this.dispatchEvent(new CustomEvent('loadingStateUpdated', {
105
- detail: {
106
- loaded
107
- }
108
- }));
109
- }
110
- setMenuShortcuts(e) {
111
- this.menuShortcuts = [...e.detail];
112
- }
113
- setMenuContents(e) {
114
- var updatedContents = [...e.detail];
115
- this.menuContents = updatedContents;
116
- }
117
- manageSideMenuEvents(e) {
118
- var {
119
- menuId,
120
- action
121
- } = e.detail;
122
- if (!menuId) {
123
- return;
124
- }
125
- this.openMenuName = menuId;
126
- if (action === 'open') {
127
- var _this$itemNav;
128
- (_this$itemNav = this.itemNav) === null || _this$itemNav === void 0 || _this$itemNav.openShortcut(menuId);
129
- } else if (action === 'toggle') {
130
- var _this$itemNav2;
131
- (_this$itemNav2 = this.itemNav) === null || _this$itemNav2 === void 0 || _this$itemNav2.toggleMenu();
132
- }
133
- }
134
- render() {
135
- return html(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n <div class=\"main-component\">\n <iaux-item-navigator\n ?viewportInFullscreen=", "\n .basehost=", "\n .item=", "\n .modal=", "\n .loaded=", "\n .sharedObserver=", "\n ?signedIn=", "\n .menuShortcuts=", "\n .menuContents=", "\n .openMenu=", "\n >\n <div slot=\"header\">\n <slot name=\"header\"></slot>\n </div>\n <div slot=\"main\">\n <book-navigator\n .modal=", "\n .baseHost=", "\n .itemMD=", "\n ?signedIn=", "\n ?sideMenuOpen=", "\n .sharedObserver=", "\n @ViewportInFullScreen=", "\n @loadingStateUpdated=", "\n @updateSideMenu=", "\n @menuUpdated=", "\n @menuShortcutsUpdated=", "\n >\n <div slot=\"main\">\n <slot name=\"main\"></slot>\n </div>\n </book-navigator>\n </div>\n </iaux-item-navigator>\n </div>\n "])), this.fullscreen, this.baseHost, this.item, this.modal, this.loaded, this.sharedObserver, this.signedIn, this.menuShortcuts, this.menuContents, this.openMenuName, this.modal, this.baseHost, this.item, this.signedIn, this.menuOpened, this.sharedObserver, this.manageFullscreen, this.loadingStateUpdated, this.manageSideMenuEvents, this.setMenuContents, this.setMenuShortcuts);
136
- }
137
- static get styles() {
138
- return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n :host {\n display: block;\n --primaryBGColor: var(--black, #000);\n --secondaryBGColor: #222;\n --tertiaryBGColor: #333;\n --primaryTextColor: var(--white, #fff);\n --primaryCTAFill: #194880;\n --primaryCTABorder: #c5d1df;\n --secondaryCTAFill: #333;\n --secondaryCTABorder: #999;\n --primaryErrorCTAFill: #e51c26;\n --primaryErrorCTABorder: #f8c6c8;\n background-color: var(--primaryBGColor);\n position: relative;\n }\n\n :host([fullscreen]),\n iaux-item-navigator[viewportinfullscreen] {\n position: fixed;\n inset: 0;\n height: 100%;\n min-height: unset;\n }\n\n .main-component {\n height: 100%;\n width: 100%;\n min-height: inherit;\n }\n\n div[slot=\"header\"],\n div[slot=\"main\"] {\n display: flex;\n width: 100%;\n }\n\n slot {\n display: block;\n flex: 1;\n }\n\n iaux-item-navigator {\n min-height: var(--br-height, inherit);\n height: var(--br-height, inherit);\n display: block;\n width: 100%;\n color: var(--primaryTextColor);\n --menuButtonLabelDisplay: block;\n --menuWidth: 320px;\n --menuSliderBg: var(--secondaryBGColor);\n --activeButtonBg: var(--tertiaryBGColor);\n --subpanelRightBorderColor: var(--secondaryCTABorder);\n --animationTiming: 100ms;\n --iconFillColor: var(--primaryTextColor);\n --iconStrokeColor: var(--primaryTextColor);\n --menuSliderHeaderIconHeight: 2rem;\n --menuSliderHeaderIconWidth: 2rem;\n --iconWidth: 2.4rem;\n --iconHeight: 2.4rem;\n --shareLinkColor: var(--primaryTextColor);\n --shareIconBorder: var(--primaryTextColor);\n --shareIconBg: var(--secondaryBGColor);\n --activityIndicatorLoadingDotColor: var(--primaryTextColor);\n --activityIndicatorLoadingRingColor: var(--primaryTextColor);\n }\n "])));
139
- }
140
- }
141
- window.customElements.define("ia-bookreader", IaBookReader);
@@ -1,3 +0,0 @@
1
- import $ from 'jquery';
2
- window.jQuery = $;
3
- window.$ = $;
@@ -1,72 +0,0 @@
1
- /* global BookReader */
2
- /**
3
- * Plugin for Archive.org analytics
4
- */
5
- jQuery.extend(BookReader.defaultOptions, {
6
- enableArchiveAnalytics: true,
7
- /** Provide a means of debugging, cause otherwise it's impossible to test locally */
8
- debugArchiveAnaltyics: false
9
- });
10
- BookReader.prototype.init = function (super_) {
11
- return function () {
12
- super_.call(this);
13
- if (this.options.enableArchiveAnalytics) {
14
- this.bind(BookReader.eventNames.fragmentChange, () => this.archiveAnalyticsSendFragmentChange());
15
- }
16
- };
17
- }(BookReader.prototype.init);
18
-
19
- /** @private */
20
- BookReader.prototype.archiveAnalyticsSendFragmentChange = function () {
21
- if (!window.archive_analytics) {
22
- return;
23
- }
24
- var prevFragment = this.archiveAnalyticsSendFragmentChange.prevFragment;
25
- var params = this.paramsFromCurrent();
26
- var newFragment = this.fragmentFromParams(params);
27
- if (prevFragment != newFragment) {
28
- var values = {
29
- bookreader: "user_changed_view",
30
- itemid: this.bookId,
31
- cache_bust: Math.random()
32
- };
33
- // EEK! offsite embedding and /details/ page books look the same in analytics, otherwise!
34
- values.offsite = 1;
35
- values.details = 0;
36
- try {
37
- values.offsite = window.top.location.hostname.match(/\.archive.org$/) ? 0 : 1;
38
- values.details = !values.offsite && window.top.location.pathname.match(/^\/details\//) ? 1 : 0;
39
- } catch (e) {}
40
- // avoids embed cross site exceptions -- but on (+) side, means it is and keeps marked offite!
41
-
42
- // Send bookreader ping
43
- window.archive_analytics.send_ping(values, null, "augment_for_ao_site");
44
-
45
- // Also send tracking event ping
46
- var additionalEventParams = this.options.lendingInfo && this.options.lendingInfo.loanId ? {
47
- loanId: this.options.lendingInfo.loanId
48
- } : {};
49
- window.archive_analytics.send_event('BookReader', 'UserChangedView', window.location.pathname, additionalEventParams);
50
- this.archiveAnalyticsSendFragmentChange.prevFragment = newFragment;
51
- }
52
- };
53
-
54
- /**
55
- * Sends a tracking "Event". See https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#events
56
- * @param {string} category
57
- * @param {string} action
58
- * @param {number} [value] (must be an int)
59
- * @param {Object} [additionalEventParams]
60
- */
61
- BookReader.prototype.archiveAnalyticsSendEvent = function (category, action, value, additionalEventParams) {
62
- if (!this.options.enableArchiveAnalytics) return;
63
- if (this.options.debugArchiveAnaltyics) {
64
- console.log("archiveAnalyticsSendEvent", arguments, window.archive_analytics);
65
- }
66
- if (!window.archive_analytics) return;
67
- additionalEventParams = additionalEventParams || {};
68
- if (typeof value == 'number') {
69
- additionalEventParams.ev = value;
70
- }
71
- window.archive_analytics.send_event(category, action, null, additionalEventParams);
72
- };
@@ -1,119 +0,0 @@
1
- /*global BookReader */
2
-
3
- /**
4
- * Plugin which adds an autoplay feature. Useful for kiosk situations.
5
- */
6
- jQuery.extend(BookReader.defaultOptions, {
7
- enableAutoPlayPlugin: true
8
- });
9
-
10
- /**
11
- * @override BookReader.setup
12
- */
13
- BookReader.prototype.setup = function (super_) {
14
- return function (options) {
15
- super_.call(this, options);
16
- this.autoTimer = null;
17
- this.flipDelay = 5000;
18
- };
19
- }(BookReader.prototype.setup);
20
-
21
- /**
22
- * @override BookReader.init
23
- */
24
- BookReader.prototype.init = function (super_) {
25
- return function (options) {
26
- super_.call(this, options);
27
- if (!this.options.enableAutoPlayPlugin) return;
28
- this.bind(BookReader.eventNames.stop, () => this.autoStop());
29
- var urlParams = new URLSearchParams(window.location.search);
30
- if (urlParams.get('autoflip') === '1') {
31
- this.autoToggle();
32
- }
33
- };
34
- }(BookReader.prototype.init);
35
-
36
- /**
37
- * @override BookReader.bindNavigationHandlers
38
- */
39
- BookReader.prototype.bindNavigationHandlers = function (super_) {
40
- return function () {
41
- super_.call(this);
42
- if (!this.options.enableAutoPlayPlugin) return;
43
- var jIcons = this.$('.BRicon');
44
- jIcons.filter('.play').click(() => {
45
- this.autoToggle();
46
- return false;
47
- });
48
- jIcons.filter('.pause').click(() => {
49
- this.autoToggle();
50
- return false;
51
- });
52
- };
53
- }(BookReader.prototype.bindNavigationHandlers);
54
-
55
- /**
56
- * Starts autoplay mode
57
- * @param {object} overrides
58
- * @param {number} overrides.flipSpeed
59
- * @param {number} overrides.flipDelay
60
- */
61
- BookReader.prototype.autoToggle = function (overrides) {
62
- if (!this.options.enableAutoPlayPlugin) return;
63
- var options = $.extend({
64
- flipSpeed: this.flipSpeed,
65
- flipDelay: this.flipDelay
66
- }, overrides);
67
- this.flipSpeed = typeof options.flipSpeed === "number" ? options.flipSpeed : this.flipSpeed;
68
- this.flipDelay = typeof options.flipDelay === "number" ? options.flipDelay : this.flipDelay;
69
- this.trigger(BookReader.eventNames.stop);
70
- var bComingFrom1up = false;
71
- if (this.constMode2up != this.mode) {
72
- bComingFrom1up = true;
73
- this.switchMode(this.constMode2up);
74
- }
75
- if (null == this.autoTimer) {
76
- // $$$ Draw events currently cause layout problems when they occur during animation.
77
- // There is a specific problem when changing from 1-up immediately to autoplay in RTL so
78
- // we workaround for now by not triggering immediate animation in that case.
79
- // See https://bugs.launchpad.net/gnubook/+bug/328327
80
- if ('rl' == this.pageProgression && bComingFrom1up) {
81
- // don't flip immediately -- wait until timer fires
82
- } else {
83
- // flip immediately
84
- this.next({
85
- triggerStop: false
86
- });
87
- }
88
- this.$('.play').hide();
89
- this.$('.pause').show();
90
- this.autoTimer = setInterval(() => {
91
- if (this.animating) return;
92
- if (Math.max(this.twoPage.currentIndexL, this.twoPage.currentIndexR) >= this.book.getNumLeafs() - 1) {
93
- this.prev({
94
- triggerStop: false
95
- }); // $$$ really what we want?
96
- } else {
97
- this.next({
98
- triggerStop: false
99
- });
100
- }
101
- }, this.flipDelay);
102
- } else {
103
- this.autoStop();
104
- }
105
- };
106
-
107
- /**
108
- * Stop autoplay mode, allowing animations to finish
109
- */
110
- BookReader.prototype.autoStop = function () {
111
- if (!this.options.enableAutoPlayPlugin) return;
112
- if (null != this.autoTimer) {
113
- clearInterval(this.autoTimer);
114
- this.flipSpeed = 'fast';
115
- this.$('.pause').hide();
116
- this.$('.play').show();
117
- this.autoTimer = null;
118
- }
119
- };