@internetarchive/bookreader 5.0.0-95 → 5.0.0-96

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 (305) hide show
  1. package/BookReader/BookReader.css +2251 -0
  2. package/BookReader/BookReader.js +3 -0
  3. package/BookReader/BookReader.js.LICENSE.txt +72 -0
  4. package/BookReader/BookReader.js.map +1 -0
  5. package/BookReader/hypothesis/LICENSE +50 -0
  6. package/BookReader/hypothesis/README.md +55 -0
  7. package/BookReader/hypothesis/build/boot.js +1 -0
  8. package/BookReader/hypothesis/build/manifest.json +20 -0
  9. package/BookReader/hypothesis/build/scripts/annotator.bundle.js +184 -0
  10. package/BookReader/hypothesis/build/scripts/annotator.bundle.js.map +1 -0
  11. package/BookReader/hypothesis/build/scripts/sidebar.bundle.js +798 -0
  12. package/BookReader/hypothesis/build/scripts/sidebar.bundle.js.map +1 -0
  13. package/BookReader/hypothesis/build/scripts/ui-playground.bundle.js +711 -0
  14. package/BookReader/hypothesis/build/scripts/ui-playground.bundle.js.map +1 -0
  15. package/BookReader/hypothesis/build/styles/annotator.css +2235 -0
  16. package/BookReader/hypothesis/build/styles/annotator.css.map +1 -0
  17. package/BookReader/hypothesis/build/styles/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  18. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  19. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  20. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  21. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  22. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-Bold.woff2 +0 -0
  23. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  24. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-Italic.woff2 +0 -0
  25. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-Regular.woff2 +0 -0
  26. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  27. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Math-Italic.woff2 +0 -0
  28. package/BookReader/hypothesis/build/styles/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  29. package/BookReader/hypothesis/build/styles/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  30. package/BookReader/hypothesis/build/styles/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  31. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Script-Regular.woff2 +0 -0
  32. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  33. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  34. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  35. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  36. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  37. package/BookReader/hypothesis/build/styles/highlights.css +2 -0
  38. package/BookReader/hypothesis/build/styles/highlights.css.map +1 -0
  39. package/BookReader/hypothesis/build/styles/katex.min.css +2 -0
  40. package/BookReader/hypothesis/build/styles/katex.min.css.map +1 -0
  41. package/BookReader/hypothesis/build/styles/pdfjs-overrides.css +2 -0
  42. package/BookReader/hypothesis/build/styles/pdfjs-overrides.css.map +1 -0
  43. package/BookReader/hypothesis/build/styles/sidebar.css +2731 -0
  44. package/BookReader/hypothesis/build/styles/sidebar.css.map +1 -0
  45. package/BookReader/hypothesis/build/styles/ui-playground.css +2659 -0
  46. package/BookReader/hypothesis/build/styles/ui-playground.css.map +1 -0
  47. package/BookReader/hypothesis/package.json +126 -0
  48. package/BookReader/ia-bookreader-bundle.js +1782 -0
  49. package/BookReader/ia-bookreader-bundle.js.LICENSE.txt +7 -0
  50. package/BookReader/ia-bookreader-bundle.js.map +1 -0
  51. package/BookReader/icons/1up.svg +1 -0
  52. package/BookReader/icons/2up.svg +1 -0
  53. package/BookReader/icons/advance.svg +3 -0
  54. package/BookReader/icons/chevron-right.svg +1 -0
  55. package/BookReader/icons/close-circle-dark.svg +1 -0
  56. package/BookReader/icons/close-circle.svg +1 -0
  57. package/BookReader/icons/fullscreen.svg +1 -0
  58. package/BookReader/icons/fullscreen_exit.svg +1 -0
  59. package/BookReader/icons/hamburger.svg +1 -0
  60. package/BookReader/icons/left-arrow.svg +1 -0
  61. package/BookReader/icons/magnify-minus.svg +1 -0
  62. package/BookReader/icons/magnify-plus.svg +1 -0
  63. package/BookReader/icons/magnify.svg +1 -0
  64. package/BookReader/icons/pause.svg +1 -0
  65. package/BookReader/icons/play.svg +1 -0
  66. package/BookReader/icons/playback-speed.svg +1 -0
  67. package/BookReader/icons/read-aloud.svg +1 -0
  68. package/BookReader/icons/review.svg +3 -0
  69. package/BookReader/icons/thumbnails.svg +1 -0
  70. package/BookReader/icons/voice.svg +1 -0
  71. package/BookReader/icons/volume-full.svg +1 -0
  72. package/BookReader/images/BRicons.png +0 -0
  73. package/BookReader/images/BRicons.svg +5 -0
  74. package/BookReader/images/BRicons_ia.png +0 -0
  75. package/BookReader/images/back_pages.png +0 -0
  76. package/BookReader/images/book_bottom_icon.png +0 -0
  77. package/BookReader/images/book_down_icon.png +0 -0
  78. package/BookReader/images/book_left_icon.png +0 -0
  79. package/BookReader/images/book_leftmost_icon.png +0 -0
  80. package/BookReader/images/book_right_icon.png +0 -0
  81. package/BookReader/images/book_rightmost_icon.png +0 -0
  82. package/BookReader/images/book_top_icon.png +0 -0
  83. package/BookReader/images/book_up_icon.png +0 -0
  84. package/BookReader/images/books_graphic.svg +1 -0
  85. package/BookReader/images/booksplit.png +0 -0
  86. package/BookReader/images/control_pause_icon.png +0 -0
  87. package/BookReader/images/control_play_icon.png +0 -0
  88. package/BookReader/images/embed_icon.png +0 -0
  89. package/BookReader/images/hypothesis.ico +0 -0
  90. package/BookReader/images/icon-home-ia.png +0 -0
  91. package/BookReader/images/icon_OL-logo-xs.png +0 -0
  92. package/BookReader/images/icon_alert-xs.png +0 -0
  93. package/BookReader/images/icon_book.svg +1 -0
  94. package/BookReader/images/icon_bookmark.svg +1 -0
  95. package/BookReader/images/icon_close-pop.png +0 -0
  96. package/BookReader/images/icon_download.png +0 -0
  97. package/BookReader/images/icon_gear.svg +1 -0
  98. package/BookReader/images/icon_hamburger.svg +1 -0
  99. package/BookReader/images/icon_home.png +0 -0
  100. package/BookReader/images/icon_home.svg +1 -0
  101. package/BookReader/images/icon_home_ia.png +0 -0
  102. package/BookReader/images/icon_indicator.png +0 -0
  103. package/BookReader/images/icon_info.svg +1 -0
  104. package/BookReader/images/icon_one_page.svg +1 -0
  105. package/BookReader/images/icon_pause.svg +1 -0
  106. package/BookReader/images/icon_play.svg +1 -0
  107. package/BookReader/images/icon_playback-rate.svg +1 -0
  108. package/BookReader/images/icon_return.png +0 -0
  109. package/BookReader/images/icon_search_button.svg +1 -0
  110. package/BookReader/images/icon_share.svg +1 -0
  111. package/BookReader/images/icon_skip-ahead.svg +1 -0
  112. package/BookReader/images/icon_skip-back.svg +2 -0
  113. package/BookReader/images/icon_speaker.svg +1 -0
  114. package/BookReader/images/icon_speaker_open.svg +1 -0
  115. package/BookReader/images/icon_thumbnails.svg +1 -0
  116. package/BookReader/images/icon_toc.svg +1 -0
  117. package/BookReader/images/icon_two_pages.svg +1 -0
  118. package/BookReader/images/icon_zoomer.png +0 -0
  119. package/BookReader/images/loading.gif +0 -0
  120. package/BookReader/images/logo_icon.png +0 -0
  121. package/BookReader/images/marker_chap-off.png +0 -0
  122. package/BookReader/images/marker_chap-off.svg +1 -0
  123. package/BookReader/images/marker_chap-off_ia.png +0 -0
  124. package/BookReader/images/marker_chap-on.png +0 -0
  125. package/BookReader/images/marker_chap-on.svg +1 -0
  126. package/BookReader/images/marker_srch-on.svg +1 -0
  127. package/BookReader/images/marker_srchchap-off.png +0 -0
  128. package/BookReader/images/marker_srchchap-on.png +0 -0
  129. package/BookReader/images/nav_control-dn.png +0 -0
  130. package/BookReader/images/nav_control-dn_ia.png +0 -0
  131. package/BookReader/images/nav_control-up.png +0 -0
  132. package/BookReader/images/nav_control-up_ia.png +0 -0
  133. package/BookReader/images/nav_control.png +0 -0
  134. package/BookReader/images/one_page_mode_icon.png +0 -0
  135. package/BookReader/images/paper-badge.png +0 -0
  136. package/BookReader/images/print_icon.png +0 -0
  137. package/BookReader/images/progressbar.gif +0 -0
  138. package/BookReader/images/right_edges.png +0 -0
  139. package/BookReader/images/slider.png +0 -0
  140. package/BookReader/images/slider_ia.png +0 -0
  141. package/BookReader/images/thumbnail_mode_icon.png +0 -0
  142. package/BookReader/images/transparent.png +0 -0
  143. package/BookReader/images/two_page_mode_icon.png +0 -0
  144. package/BookReader/images/unviewable_page.png +0 -0
  145. package/BookReader/images/zoom_in_icon.png +0 -0
  146. package/BookReader/images/zoom_out_icon.png +0 -0
  147. package/BookReader/jquery-3.js +2 -0
  148. package/BookReader/jquery-3.js.LICENSE.txt +24 -0
  149. package/BookReader/plugins/plugin.archive_analytics.js +2 -0
  150. package/BookReader/plugins/plugin.archive_analytics.js.map +1 -0
  151. package/BookReader/plugins/plugin.autoplay.js +2 -0
  152. package/BookReader/plugins/plugin.autoplay.js.map +1 -0
  153. package/BookReader/plugins/plugin.chapters.js +26 -0
  154. package/BookReader/plugins/plugin.chapters.js.LICENSE.txt +1 -0
  155. package/BookReader/plugins/plugin.chapters.js.map +1 -0
  156. package/BookReader/plugins/plugin.experiments.js +3 -0
  157. package/BookReader/plugins/plugin.experiments.js.LICENSE.txt +1 -0
  158. package/BookReader/plugins/plugin.experiments.js.map +1 -0
  159. package/BookReader/plugins/plugin.iframe.js +2 -0
  160. package/BookReader/plugins/plugin.iframe.js.map +1 -0
  161. package/BookReader/plugins/plugin.iiif.js +2 -0
  162. package/BookReader/plugins/plugin.iiif.js.map +1 -0
  163. package/BookReader/plugins/plugin.resume.js +2 -0
  164. package/BookReader/plugins/plugin.resume.js.map +1 -0
  165. package/BookReader/plugins/plugin.search.js +3 -0
  166. package/BookReader/plugins/plugin.search.js.LICENSE.txt +1 -0
  167. package/BookReader/plugins/plugin.search.js.map +1 -0
  168. package/BookReader/plugins/plugin.text_selection.js +3 -0
  169. package/BookReader/plugins/plugin.text_selection.js.LICENSE.txt +1 -0
  170. package/BookReader/plugins/plugin.text_selection.js.map +1 -0
  171. package/BookReader/plugins/plugin.tts.js +3 -0
  172. package/BookReader/plugins/plugin.tts.js.LICENSE.txt +29 -0
  173. package/BookReader/plugins/plugin.tts.js.map +1 -0
  174. package/BookReader/plugins/plugin.url.js +2 -0
  175. package/BookReader/plugins/plugin.url.js.map +1 -0
  176. package/BookReader/plugins/plugin.vendor-fullscreen.js +2 -0
  177. package/BookReader/plugins/plugin.vendor-fullscreen.js.map +1 -0
  178. package/BookReader/webcomponents-bundle.js +3 -0
  179. package/BookReader/webcomponents-bundle.js.LICENSE.txt +9 -0
  180. package/BookReader/webcomponents-bundle.js.map +1 -0
  181. package/package.json +6 -1
  182. package/src/BookReader/BookModel.js +564 -0
  183. package/src/BookReader/DragScrollable.js +233 -0
  184. package/src/BookReader/ImageCache.js +149 -0
  185. package/src/BookReader/Mode1Up.js +110 -0
  186. package/src/BookReader/Mode1UpLit.js +388 -0
  187. package/src/BookReader/Mode2Up.js +107 -0
  188. package/src/BookReader/Mode2UpLit.js +777 -0
  189. package/src/BookReader/ModeCoordinateSpace.js +29 -0
  190. package/src/BookReader/ModeSmoothZoom.js +312 -0
  191. package/src/BookReader/ModeThumb.js +344 -0
  192. package/src/BookReader/Navbar/Navbar.js +355 -0
  193. package/src/BookReader/PageContainer.js +172 -0
  194. package/src/BookReader/ReduceSet.js +26 -0
  195. package/src/BookReader/Toolbar/Toolbar.js +362 -0
  196. package/src/BookReader/events.js +19 -0
  197. package/src/BookReader/options.js +387 -0
  198. package/src/BookReader/utils/HTMLDimensionsCacher.js +44 -0
  199. package/src/BookReader/utils/ScrollClassAdder.js +31 -0
  200. package/src/BookReader/utils/SelectionObserver.js +45 -0
  201. package/src/BookReader/utils/classes.js +36 -0
  202. package/src/BookReader/utils.js +313 -0
  203. package/.eslintrc.cjs +0 -51
  204. package/.gitattributes +0 -2
  205. package/.github/ISSUE_TEMPLATE/bug.md +0 -32
  206. package/.github/ISSUE_TEMPLATE/feature-request.md +0 -30
  207. package/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +0 -15
  208. package/.github/workflows/node.js.yml +0 -102
  209. package/.github/workflows/npm-publish.yml +0 -23
  210. package/.testcaferc.cjs +0 -10
  211. package/BookReaderDemo/BookReaderDemo.css +0 -40
  212. package/BookReaderDemo/BookReaderJSAdvanced.js +0 -112
  213. package/BookReaderDemo/BookReaderJSSimple.js +0 -56
  214. package/BookReaderDemo/IADemoBr.js +0 -149
  215. package/BookReaderDemo/assets/v5/Bookreader-logo-cool-grad.svg +0 -1
  216. package/BookReaderDemo/assets/v5/Bookreader-logo-flat.svg +0 -1
  217. package/BookReaderDemo/assets/v5/Bookreader-logo-hex-cool-grad.png +0 -0
  218. package/BookReaderDemo/assets/v5/Bookreader-logo-hex-flat.png +0 -0
  219. package/BookReaderDemo/assets/v5/Bookreader-logo-lines.png +0 -0
  220. package/BookReaderDemo/assets/v5/Bookreader-logo-lines.svg +0 -1
  221. package/BookReaderDemo/assets/v5/Bookreader-logo-warm.svg +0 -1
  222. package/BookReaderDemo/assets/v5/bookreader-logo-renders@1x.png +0 -0
  223. package/BookReaderDemo/assets/v5/bookreader-logo-renders@2x.png +0 -0
  224. package/BookReaderDemo/assets/v5/bookreader-v5-screenshot.png +0 -0
  225. package/BookReaderDemo/demo-advanced.html +0 -33
  226. package/BookReaderDemo/demo-embed-iframe-src.html +0 -85
  227. package/BookReaderDemo/demo-embed.html +0 -26
  228. package/BookReaderDemo/demo-fullscreen-mobile.html +0 -34
  229. package/BookReaderDemo/demo-fullscreen.html +0 -31
  230. package/BookReaderDemo/demo-iiif.html +0 -121
  231. package/BookReaderDemo/demo-internetarchive.html +0 -271
  232. package/BookReaderDemo/demo-multiple.html +0 -44
  233. package/BookReaderDemo/demo-preview-pages.html +0 -1093
  234. package/BookReaderDemo/demo-simple.html +0 -35
  235. package/BookReaderDemo/demo-vendor-fullscreen.html +0 -34
  236. package/BookReaderDemo/ia-multiple-volumes-manifest.js +0 -169
  237. package/BookReaderDemo/immersion-1up.html +0 -64
  238. package/BookReaderDemo/immersion-mode.html +0 -33
  239. package/BookReaderDemo/toggle_controls.html +0 -54
  240. package/BookReaderDemo/view_mode.html +0 -40
  241. package/BookReaderDemo/viewmode-cycle.html +0 -40
  242. package/CHANGELOG.md +0 -1087
  243. package/CONTRIBUTING.md +0 -7
  244. package/babel.config.cjs +0 -20
  245. package/codecov.yml +0 -23
  246. package/index.html +0 -34
  247. package/netlify.toml +0 -9
  248. package/renovate.json +0 -52
  249. package/screenshot.png +0 -0
  250. package/scripts/postversion.js +0 -11
  251. package/scripts/preversion.js +0 -15
  252. package/scripts/version.js +0 -24
  253. package/tests/e2e/README.md +0 -112
  254. package/tests/e2e/autoplay.test.js +0 -16
  255. package/tests/e2e/base.test.js +0 -27
  256. package/tests/e2e/helpers/base.js +0 -263
  257. package/tests/e2e/helpers/debug.js +0 -13
  258. package/tests/e2e/helpers/mockSearch.js +0 -90
  259. package/tests/e2e/helpers/params.js +0 -17
  260. package/tests/e2e/helpers/rightToLeft.js +0 -23
  261. package/tests/e2e/helpers/search.js +0 -73
  262. package/tests/e2e/models/BookReader.js +0 -11
  263. package/tests/e2e/models/Navigation.js +0 -39
  264. package/tests/e2e/rightToLeft.test.js +0 -19
  265. package/tests/e2e/viewmode.test.js +0 -44
  266. package/tests/jest/BookNavigator/book-navigator.test.js +0 -653
  267. package/tests/jest/BookNavigator/bookmarks/bookmark-button.test.js +0 -43
  268. package/tests/jest/BookNavigator/bookmarks/bookmark-edit.test.js +0 -132
  269. package/tests/jest/BookNavigator/bookmarks/bookmarks-list.test.js +0 -221
  270. package/tests/jest/BookNavigator/bookmarks/ia-bookmarks.test.js +0 -45
  271. package/tests/jest/BookNavigator/downloads/downloads-provider.test.js +0 -67
  272. package/tests/jest/BookNavigator/downloads/downloads.test.js +0 -53
  273. package/tests/jest/BookNavigator/search/search-provider.test.js +0 -179
  274. package/tests/jest/BookNavigator/search/search-results.test.js +0 -289
  275. package/tests/jest/BookNavigator/sharing/sharing-provider.test.js +0 -49
  276. package/tests/jest/BookNavigator/viewable-files/viewable-files-provider.test.js +0 -80
  277. package/tests/jest/BookNavigator/visual-adjustments.test.js +0 -200
  278. package/tests/jest/BookReader.keyboard.test.js +0 -190
  279. package/tests/jest/BookReader.options.test.js +0 -47
  280. package/tests/jest/BookReader.test.js +0 -316
  281. package/tests/jest/plugins/plugin.archive_analytics.test.js +0 -20
  282. package/tests/jest/plugins/plugin.autoplay.test.js +0 -35
  283. package/tests/jest/plugins/plugin.chapters.test.js +0 -193
  284. package/tests/jest/plugins/plugin.iframe.test.js +0 -42
  285. package/tests/jest/plugins/plugin.resume.test.js +0 -85
  286. package/tests/jest/plugins/plugin.text_selection.test.js +0 -447
  287. package/tests/jest/plugins/plugin.vendor-fullscreen.test.js +0 -65
  288. package/tests/jest/plugins/search/plugin.search.test.js +0 -120
  289. package/tests/jest/plugins/search/plugin.search.view.test.js +0 -131
  290. package/tests/jest/plugins/search/utils.js +0 -25
  291. package/tests/jest/plugins/search/utils.test.js +0 -29
  292. package/tests/jest/plugins/tts/AbstractTTSEngine.test.js +0 -173
  293. package/tests/jest/plugins/tts/FestivalTTSEngine.test.js +0 -59
  294. package/tests/jest/plugins/tts/PageChunk.test.js +0 -57
  295. package/tests/jest/plugins/tts/PageChunkIterator.test.js +0 -179
  296. package/tests/jest/plugins/tts/WebTTSEngine.test.js +0 -178
  297. package/tests/jest/plugins/tts/utils.test.js +0 -74
  298. package/tests/jest/plugins/url/UrlPlugin.test.js +0 -198
  299. package/tests/jest/plugins/url/plugin.url.test.js +0 -168
  300. package/tests/jest/setup.js +0 -3
  301. package/tests/jest/util/browserSniffing.test.js +0 -62
  302. package/tests/jest/util/docCookies.test.js +0 -24
  303. package/tests/jest/util/strings.test.js +0 -63
  304. package/tests/jest/utils.js +0 -83
  305. package/webpack.config.js +0 -97
package/CONTRIBUTING.md DELETED
@@ -1,7 +0,0 @@
1
- # Contributing
2
-
3
- - Please try to follow the code style within the file (spacing/comments/etc).
4
- - Please only submit merge requests for features that would be useful for the general use
5
- - Please try to avoid adding new libraries
6
- - If the PR is a bug fix, include a link to a jsbin/codepen if possible
7
- - Please test the changes in desktop, mobile, and embed modes, and also on many different devices/browsers.
package/babel.config.cjs DELETED
@@ -1,20 +0,0 @@
1
- module.exports = {
2
- presets: [
3
- [
4
- "@babel/preset-env",
5
- process.env.NODE_ENV == "test" ? { targets: { node: process.version } } :
6
- process.env.NODE_ENV == "development" ? { targets: "last 2 Chrome versions, last 2 Firefox versions, last 2 Safari versions, last 2 Edge versions" } : {
7
- targets: "> 2%, ie 11, edge 14, samsung > 9, OperaMini all, UCAndroid > 12, Safari >= 9",
8
- useBuiltIns: "usage",
9
- corejs: 3,
10
- },
11
- ],
12
- ],
13
- plugins: [
14
- ["@babel/plugin-proposal-decorators", {
15
- version: "2018-09",
16
- decoratorsBeforeExport: true,
17
- }],
18
- ["@babel/plugin-proposal-class-properties"],
19
- ],
20
- };
package/codecov.yml DELETED
@@ -1,23 +0,0 @@
1
- codecov:
2
- notify:
3
- require_ci_to_pass: yes
4
- status:
5
- project:
6
- default:
7
- # Allow small drops in coverage
8
- threshold: 0.5 # 0.5%
9
- if_not_found: failure
10
-
11
- coverage:
12
- precision: 2
13
- round: down
14
- range: "70...100"
15
-
16
- parsers:
17
- javascript:
18
- enable_partials: yes
19
-
20
- ignore:
21
- - "BookReader"
22
- - "tests"
23
-
package/index.html DELETED
@@ -1,34 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>BookReader Demos</title>
5
-
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
7
- <meta name="apple-mobile-web-app-capable" content="yes">
8
- </head>
9
- <body>
10
- <ul>
11
- <li><a href="BookReaderDemo/demo-simple.html">Simple</a></li>
12
- <li><a href="BookReaderDemo/view_mode.html">Set initial view mode</a></li>
13
- <li><a href="BookReaderDemo/toggle_controls.html">Toggle and override individual controls</a></li>
14
- <li><a href="BookReaderDemo/demo-fullscreen.html">Fullscreen with mobile nav</a></li>
15
- <li><a href="BookReaderDemo/demo-fullscreen-mobile.html">Inline on page, with mobile nav on fullscreen</a></li>
16
- <li><a href="BookReaderDemo/demo-vendor-fullscreen.html">Vendor native fullscreen</a></li>
17
- <li><a href="BookReaderDemo/demo-advanced.html">Advanced</a></li>
18
- <li><a href="BookReaderDemo/demo-preview-pages.html">Preview Pages</a></li>
19
- <li><a href="BookReaderDemo/demo-embed.html">Embed</a></li>
20
- <li><a href="BookReaderDemo/demo-multiple.html">Multiple on same page</a></li>
21
- <!-- plugin.search.js -->
22
- <li><a href="BookReaderDemo/demo-internetarchive.html?ocaid=theworksofplato01platiala">From Internet Archive</a></li>
23
- <!-- plugin.search.js -->
24
- <li><a href="BookReaderDemo/demo-internetarchive.html?ocaid=adventureofsherl0000unse">From Internet Archive - a book with CHAPTERS</a></li>
25
- <li><a href="BookReaderDemo/demo-iiif.html">IIIF</a></li>
26
- <li><a href="BookReaderDemo/demo-internetarchive.html?ocaid=goodytwoshoes00newyiala&autoflip=1">Autoplay (kiosk mode)</a></li>
27
- <li><a href="BookReaderDemo/demo-plugin-menu-toggle.html">Plugin: Full screen menu toggle</a></li>
28
- <li><a href="BookReaderDemo/immersion-mode.html">Start in immersion (fullscreen) mode</a></li>
29
- <!-- plugin.search.js -->
30
- <li><a href="BookReaderDemo/immersion-1up.html">Start in immersion mode on 1up default item</a></li>
31
- <li><a href="BookReaderDemo/viewmode-cycle.html">Replace view mode buttons with view mode cycler</a></li>
32
- </ul>
33
- </body>
34
- </html>
package/netlify.toml DELETED
@@ -1,9 +0,0 @@
1
- [build.environment]
2
- # Keep in sync with CI in .github/workflows/node.js.yml
3
- NODE_VERSION = "20"
4
-
5
- [[headers]]
6
- # Define which paths this specific [[headers]] block will cover.
7
- for = "/BookReader/*"
8
- [headers.values]
9
- Access-Control-Allow-Origin = "*"
package/renovate.json DELETED
@@ -1,52 +0,0 @@
1
- {
2
- "extends": [
3
- "config:base",
4
- "schedule:monthly"
5
- ],
6
- "packageRules": [
7
- {
8
- "matchPackageNames": [
9
- "@babel/eslint-parser",
10
- "@open-wc/testing-helpers",
11
- "@types/jest",
12
- "codecov/codecov-action",
13
- "eslint",
14
- "eslint-plugin-no-jquery",
15
- "eslint-plugin-testcafe",
16
- "jest",
17
- "jest-environment-jsdom",
18
- "sinon",
19
- "testcafe"
20
- ],
21
- "automerge": true
22
- },
23
- {
24
- "matchPackageNames": [
25
- "concurrently",
26
- "http-server",
27
- "live-server",
28
- "node-fetch"
29
- ],
30
- "matchUpdateTypes": ["minor", "patch"],
31
- "automerge": true
32
- },
33
- {
34
- "matchPackagePatterns": ["^@internetarchive/icon-"],
35
- "groupName": "@internetarchive icons",
36
- "rangeStrategy": "bump"
37
- },
38
- {
39
- "matchPackagePatterns": ["*"],
40
- "rangeStrategy": "bump"
41
- },
42
- {
43
- "matchPackagePatterns": ["^actions/"],
44
- "groupName": "GitHub Actions",
45
- "automerge": true
46
- },
47
- {
48
- "matchPackagePatterns": ["^@internetarchive"],
49
- "schedule": ["at any time"]
50
- }
51
- ]
52
- }
package/screenshot.png DELETED
Binary file
@@ -1,11 +0,0 @@
1
- import fs from 'fs';
2
- import PACKAGE_JSON from '../package.json' assert { type: 'json' };
3
- const NEW_VERSION = PACKAGE_JSON.version;
4
-
5
- const tag = `v${NEW_VERSION}`;
6
- const releaseBody = fs.readFileSync('CHANGELOG.md').toString()
7
- .split(/\n# /)[0] // split at headings and get first heading
8
- .split('\n').slice(1).join('\n'); // remove heading line
9
-
10
- const GITHUB_RELEASE_URL = `https://github.com/internetarchive/bookreader/releases/new?tag=${tag}&title=${tag}&body=${encodeURIComponent(releaseBody)}`;
11
- console.log(`After you push/merge, use this link to release: ${GITHUB_RELEASE_URL}`);
@@ -1,15 +0,0 @@
1
- import PACKAGE_JSON from '../package.json' assert { type: 'json' };
2
-
3
- const OLD_VERSION = PACKAGE_JSON.version;
4
- const OLD_RELEASE_URL = `https://api.github.com/repos/internetarchive/bookreader/releases/tags/v${OLD_VERSION}`;
5
-
6
- async function main() {
7
- const {created_at} = await fetch(OLD_RELEASE_URL).then(r => r.json());
8
- const today = new Date().toISOString().slice(0, -5);
9
- const searchUrl = 'https://github.com/internetarchive/bookreader/pulls?' + new URLSearchParams({
10
- q: `is:pr is:merged merged:${created_at}..${today}Z sort:updated-asc`
11
- }).toString();
12
- console.log(`Here are all the PRs that were merged since the last version: ${searchUrl}`);
13
- }
14
-
15
- main();
@@ -1,24 +0,0 @@
1
- import fs from 'fs';
2
- import { execSync } from 'child_process';
3
- import PACKAGE_JSON from '../package.json' assert { type: 'json' };
4
- const NEW_VERSION = PACKAGE_JSON.version;
5
-
6
- async function main() {
7
- // Update the changelog
8
- const old_changelog = fs.readFileSync('CHANGELOG.md').toString();
9
- const new_changelog = `# ${NEW_VERSION}\n<!-- Write here... -->\n\n` + old_changelog;
10
- fs.writeFileSync('CHANGELOG.md', new_changelog);
11
- while (fs.readFileSync('CHANGELOG.md').toString().includes('<!-- Write here... -->')) {
12
- console.log('Changelog contains dummy text. Update the changelog, and press ENTER continue.');
13
- await new Promise(res => process.stdin.once("data", res));
14
- }
15
- execSync('git add CHANGELOG.md');
16
-
17
- // npm install to make sure deps are correct
18
- execSync('npm install', { stdio: "inherit" });
19
-
20
- // build
21
- execSync('npm run build', { stdio: "inherit" });
22
- }
23
-
24
- main().then(() => process.exit());
@@ -1,112 +0,0 @@
1
- # TestCafe End to End (e2e) Testing
2
-
3
- ## Running
4
-
5
- To run all tests in all browsers currently specified, run
6
-
7
- `npm run test:e2e`
8
-
9
- The list of browsers TestCafe will attempt to use are stored in
10
- `.testcaferc.json`.
11
-
12
- The test runner will pick up any file within the tests/e2e directory or
13
- subdirectories that ends in `test.js`. If you would like to abstract some code
14
- and place it alongside the test fixtures, as long as the file name does not
15
- end in this suffix, the test runner won't pick it up and attempt to set up a
16
- test fixture.
17
-
18
- ### Testing a specific browser
19
-
20
- To run all tests in one or more specified browsers, supply the names of the
21
- application executables after the command above. For example, if you only want
22
- to run tests in Chrome, run `npm run test:e2e chrome`. To run
23
- in both Chrome and Safari, run `npm run test:e2e chrome,safari`.
24
-
25
- ### Testing in Chrome using device emulation
26
-
27
- You can specify device presets or specify custom parameters for Chrome's
28
- device emulation when starting tests. For example:
29
-
30
- `npm run test:e2e "chrome:emulation:width=414;height=736;mobile=true;orientation=vertical;touch=true"`
31
-
32
- ### Testing on remote devices
33
-
34
- If you need to run tests on other devices like a phone, tablet, or other
35
- computer, you can specify the number of browsers on the remote devices you'd
36
- like to connect to the test runner. For example, to test Chrome on both a
37
- phone and tablet, you'd specify '2' remote browsers. If you're only testing
38
- on a phone, but are testing in Chrome and Safari, you'd also specify '2'.
39
-
40
- `npm test:e2e remote:2`
41
-
42
- This will provide you with a URL that you then visit in each browser. The URL
43
- will look something like `http://127.0.0.1:52902/browser/connect`.
44
-
45
- ### Running a specific fixture
46
-
47
- To run a particular fixture, add the path to the file at the end of your arguments list.
48
-
49
- `npm run test:e2e chrome tests/e2e/example.test.js`
50
-
51
- ### Testing netlify or archive.org
52
-
53
- ```sh
54
- BASE_URL='https://lucid-poitras-9a1249.netlify.app' npx testcafe
55
- BASE_URL='https://archive.org' npx testcafe
56
- ```
57
-
58
- ### Testing any OCAID
59
-
60
- For OCAIDs you should pick the specific test file to run, since things like autoplay tests won't work. The main tests are in `base.test.js`.
61
-
62
- ```sh
63
- OCAIDS='goody,goodytwoshoes00newyiala' npx testcafe tests/e2e/base.test.js
64
- OCAIDS='goody,goodytwoshoes00newyiala' BASE_URL='https://archive.org' npx testcafe tests/e2e/base.test.js
65
-
66
- # right to left book; note this also runs the base tests
67
- OCAIDS='gendaitankashu00meijuoft' BASE_URL='https://archive.org' npx testcafe tests/e2e/rightToLeft.test.js
68
- ```
69
-
70
- ### Running tests with browserstack
71
-
72
- Note these can only test a public url, so you either need to create a draft PR and use the netlify link, or use ngrok to publish your dev server's port.
73
-
74
- Note: Windows users, there is a bug that prevents spaces in the browser field when using `npx`, so you'll need to have `testcafe` globally installed, and run it without `npx`. (See https://github.com/DevExpress/testcafe/issues/6600 ). Or, you can add browserstack browsers the `.testcaferc.js` file.
75
-
76
- ```sh
77
- # Set auth; find yours at https://www.browserstack.com/accounts/settings
78
- export BROWSERSTACK_USERNAME="YOUR_USERNAME"
79
- export BROWSERSTACK_ACCESS_KEY="YOUR_ACCESS_KEY"
80
-
81
- BASE_URL='https://archive.org' OCAIDS='goody,goodytwoshoes00newyiala' npx testcafe 'browserstack:iPad Pro 12.9 2018@15' tests/e2e/base.test.js
82
- ```
83
-
84
- See a list of available browsers with `npx testcafe -b browserstack`. Note there are some browsers which appear to not work for some reason (eg `browserstack:iPad Mini 4@9.3`).
85
-
86
- Read more about other options/etc at the browserstack docs: https://www.browserstack.com/docs/automate/selenium/getting-started/nodejs/testcafe .
87
-
88
- ## Pending (skip) tests
89
-
90
- You can skip any tests by calling the method `.skip` on the test object rather
91
- than call the test function directly. If you have a test definition like:
92
-
93
- ```
94
- test('Subnav opened when primary nav category clicked', async (t) => {
95
- const textsTophat = Selector('.row.texts');
96
- await t.expect(await textsTophat.visible).notOk();
97
- await t.click('[data-top-kind=texts]');
98
- await t.expect(await textsTophat.visible).ok();
99
- });
100
- ```
101
-
102
- You would skip it by changing the `test` call to `test.skip`.
103
-
104
- ## Running only one test
105
-
106
- Similarly, you can use the `.only` method to skip all other tests and only run
107
- the one specified.
108
-
109
- ```
110
- test.only('Subnav opened when primary nav category clicked', async (t) => {
111
- ```
112
-
@@ -1,16 +0,0 @@
1
- import { ClientFunction } from 'testcafe';
2
- import params from './helpers/params.js';
3
-
4
- const getLocationHref = ClientFunction(() => window.location.href.toString());
5
- const FLIP_SPEED = 200;
6
- const FLIP_DELAY = 500;
7
-
8
- fixture `Autoplay plugin`.page `${params.baseUrl}/BookReaderDemo/demo-internetarchive.html?ocaid=goody&autoflip=1&flipSpeed=${FLIP_SPEED}&flipDelay=${FLIP_DELAY}`;
9
-
10
- test('page auto-advances after allotted flip speed and delay', async t => {
11
- // Flips from cover, to #page/n1 to #page/n3, etc
12
- await t.expect(getLocationHref()).notMatch(/page\/n\d+/);
13
- await t.wait(2 * (FLIP_SPEED + FLIP_DELAY) + 500);
14
- // Don't check for a specific page; initial load time can vary
15
- await t.expect(getLocationHref()).match(/page\/n\d+/);
16
- });
@@ -1,27 +0,0 @@
1
- import { runBaseTests } from './helpers/base.js';
2
- import BookReader from './models/BookReader.js';
3
- import { runSearchTests } from './helpers/search.js';
4
- import params from './helpers/params.js';
5
-
6
- const ocaids = params.ocaids || [
7
- 'theworksofplato01platiala',
8
- // Removed because failing test 'Canonical URL with cookie shows paramters'
9
- // in tests/e2e/helpers/base.js
10
- // Cookie path should be:
11
- // /BookReaderDemo/demo-ia-olivertwist.html
12
- // Cookie path is:
13
- // /BookReaderDemo/demo-ia-olivertwist.html/page/n13/mode/2up
14
- // 'demo-ia-olivertwist.html',
15
- ];
16
-
17
- ocaids.forEach(ocaid => {
18
- const url = params.getArchiveUrl(ocaid);
19
-
20
- fixture `Base Tests for: ${ocaid}`.page `${url}`;
21
- runBaseTests(new BookReader());
22
-
23
-
24
- fixture `Search Tests for: ${ocaid}`
25
- .page `${url}`;
26
- runSearchTests(new BookReader());
27
- });
@@ -1,263 +0,0 @@
1
- import { ClientFunction, Selector } from 'testcafe';
2
-
3
- const PAGE_FLIP_WAIT_TIME = 1000;
4
-
5
- const getHash = ClientFunction(() => document.location.hash);
6
- const getUrl = ClientFunction(() => window.location.href);
7
-
8
- /**
9
- * Check URL page parameter in # and path
10
- */
11
- const isPageInUrl = ClientFunction(() => {
12
- const hash = document.location.hash;
13
- if (hash) {
14
- return hash.indexOf('#page/') > -1;
15
- } else {
16
- return window.location.href.indexOf('/page/') > -1;
17
- }
18
- });
19
-
20
- /**
21
- * Check URL mode parameter in # and path
22
- *
23
- * @param mode '1up', '2up', 'thumb'
24
- */
25
- const isModeInUrl = ClientFunction((mode) => {
26
- const hash = document.location.hash;
27
- if (hash) {
28
- return hash.indexOf('/mode/' + mode) > -1;
29
- } else {
30
- return window.location.href.indexOf('/mode/' + mode) > -1;
31
- }
32
- });
33
-
34
- /**
35
- * Runs all expected base tests for BookReader
36
- *
37
- * @param { import('../models/BookReader').default } br - Model
38
- */
39
- export function runBaseTests (br) {
40
- test('On load, pages fit fully inside of the BookReader™', async t => {
41
- await t.expect(br.shell.visible).ok();
42
- await t.expect(br.BRcontainer.visible).ok();
43
-
44
- const shellHeight = await br.shell.getBoundingClientRectProperty('height');
45
- const bookHeight = await br.BRcontainer.getBoundingClientRectProperty('height');
46
- await t.expect(bookHeight).lte(shellHeight, 'images do not get cropped vertically');
47
-
48
- const shellWidth = await br.shell.getBoundingClientRectProperty('width');
49
- const bookWidth = await br.BRcontainer.getBoundingClientRectProperty('width');
50
- await t.expect(bookWidth).lte(shellWidth, 'images do not get cropped horizontally');
51
- });
52
-
53
- test('nav menu displays properly', async t => {
54
- const { nav } = br;
55
-
56
- await t.expect(nav.goLeft.visible).ok();
57
- await t.expect(nav.goRight.visible).ok();
58
- await t.expect(nav.mode1Up.visible).ok();
59
- await t.expect(nav.mode2Up.visible).ok();
60
- await t.expect(nav.modeThumb.visible).ok();
61
- await t.expect(nav.zoomIn.visible).ok();
62
- await t.expect(nav.zoomOut.visible).ok();
63
- await t.expect(nav.fullScreen.visible).ok();
64
- });
65
-
66
- test("Canonical URL has no initial parameters", async t => {
67
- // Initial URL has no params
68
- await t.expect(getHash()).eql('');
69
- // Initial URL has no page/ mode/
70
- await t.expect(getUrl()).notContains('#page/');
71
- await t.expect(getUrl()).notContains('/page/');
72
- await t.expect(getUrl()).notContains('/mode/');
73
- });
74
-
75
- // Need to disable page caching to have cookies persist in test
76
- test.disablePageCaching('Canonical URL shows parameters if cookie set', async t => {
77
- const { nav } = br;
78
-
79
- // Check if uses plugin.resume.js
80
- const usesResume = ClientFunction(() => {
81
- const hasResumePlugin = typeof(br.plugins.resume) !== "undefined";
82
- const hasResumeValue = hasResumePlugin ? br.plugins.resume.getResumeValue() : false;
83
- return hasResumeValue;
84
- });
85
-
86
- // Store initial URL
87
- const initialUrl = await getUrl();
88
-
89
- // Set Cookie by page navigation, wait for cookie
90
- await t.click(nav.goNext);
91
- await t.wait(PAGE_FLIP_WAIT_TIME);
92
-
93
- // reload canonical URL, wait for URL change
94
- await t.navigateTo(initialUrl);
95
- await t.wait(PAGE_FLIP_WAIT_TIME);
96
-
97
- if (await usesResume()) {
98
- await t.expect(isPageInUrl()).eql(true, initialUrl);
99
- await t.expect(isModeInUrl('2up')).eql(true, initialUrl);
100
- } else {
101
- // No plugin, no br-resume cookie
102
- await t.expect(getUrl()).notContains('#page/');
103
- await t.expect(getUrl()).notContains('/page/');
104
- await t.expect(getUrl()).notContains('/mode/');
105
- }
106
- });
107
-
108
- test('2up mode - Clicking `Previous page` changes the page', async t => {
109
- const { nav, BRcontainer} = br;
110
-
111
- // Go to next page, so we can go previous if at front cover
112
- await t.click(nav.goNext);
113
- await t.wait(PAGE_FLIP_WAIT_TIME);
114
- await t.click(nav.goNext);
115
- await t.wait(PAGE_FLIP_WAIT_TIME);
116
-
117
- const onLoadBrState = BRcontainer.child(0);
118
- const initialImages = onLoadBrState.find('img');
119
- const origImg1Src = await initialImages.nth(0).getAttribute('src');
120
- const origImg2Src = await initialImages.nth(-1).getAttribute('src');
121
-
122
- await t.click(nav.goPrev);
123
- await t.wait(PAGE_FLIP_WAIT_TIME);
124
-
125
- const nextBrState = Selector('.BRcontainer').child(0);
126
- const prevImages = nextBrState.find('img');
127
- const prevImg1Src = await prevImages.nth(0).getAttribute('src');
128
- const prevImg2Src = await prevImages.nth(-1).getAttribute('src');
129
-
130
- // we aren't showing the same image in both leaves
131
- await t.expect(origImg1Src).notEql(origImg2Src);
132
-
133
- // we are showing new pages
134
- await t.expect(prevImg1Src).notEql(origImg1Src);
135
- await t.expect(prevImg1Src).notEql(origImg2Src);
136
- await t.expect(prevImg2Src).notEql(origImg1Src);
137
- await t.expect(prevImg2Src).notEql(origImg2Src);
138
-
139
- // we aren't showing the same image in the new pages
140
- await t.expect(prevImg1Src).notEql(prevImg2Src);
141
- });
142
-
143
- test('2up mode - Clicking `Next page` changes the page', async t => {
144
- // Note: this will fail on a R to L book if at front cover
145
- const { nav, BRcontainer} = br;
146
- // Flip away from cover
147
- await t.click(nav.goNext);
148
- await t.wait(PAGE_FLIP_WAIT_TIME);
149
-
150
- const onLoadBrState = BRcontainer.child(0);
151
- const initialImages = onLoadBrState.find('img');
152
- const origImg1Src = await initialImages.nth(0).getAttribute('src');
153
- const origImg2Src = await initialImages.nth(-1).getAttribute('src');
154
-
155
- await t.click(nav.goNext);
156
- await t.wait(PAGE_FLIP_WAIT_TIME);
157
-
158
- const nextBrState = Selector('.BRcontainer').child(0);
159
- const nextImages = nextBrState.find('img');
160
- const nextImg1Src = await nextImages.nth(0).getAttribute('src');
161
- const nextImg2Src = await nextImages.nth(-1).getAttribute('src');
162
-
163
- // we are showing new pages
164
- await t.expect(nextImg1Src).notEql(origImg1Src);
165
- await t.expect(nextImg1Src).notEql(origImg2Src);
166
- await t.expect(nextImg2Src).notEql(origImg1Src);
167
- await t.expect(nextImg2Src).notEql(origImg2Src);
168
-
169
- // we aren't showing the same image in the new pages
170
- await t.expect(nextImg1Src).notEql(nextImg2Src);
171
- });
172
-
173
- test('Clicking `page flip buttons` updates location', async t => {
174
- const { nav } = br;
175
- // Page navigation creates params
176
- await t.click(nav.goNext);
177
- await t.expect(isPageInUrl()).eql(true);
178
- await t.expect(isModeInUrl('2up')).eql(true);
179
-
180
- await t.click(nav.goPrev);
181
- await t.expect(isPageInUrl()).eql(true);
182
- await t.expect(isModeInUrl('2up')).eql(true);
183
- });
184
-
185
- test('Clicking `2 page view` brings up cur page + caching', async t => {
186
- const { nav } = br;
187
- await t.click(nav.mode2Up);
188
- await t.expect(Selector('.BRpagecontainer.BRpage-visible').count).eql(1);
189
- await t.expect(Selector('.BRpagecontainer').count).eql(3);
190
- });
191
-
192
- test('Clicking `1 page view` brings up 1 at a time', async t => {
193
- const { nav } = br;
194
- await t.click(nav.mode1Up);
195
-
196
- // Flip away from cover
197
- await t.click(nav.goNext);
198
- await t.wait(PAGE_FLIP_WAIT_TIME);
199
-
200
- // we usually pre-fetch the page in question & the 2 after it
201
- await t.expect(Selector('.BRpagecontainer').count).gte(3);
202
- });
203
-
204
- test('Clicking `thumbnail view` brings up all of the page thumbnails', async t => {
205
- const { nav } = br;
206
- await t.click(nav.modeThumb);
207
- await t.expect(Selector('.BRpagecontainer').count).gte(3);
208
- });
209
-
210
- test('Clicking `zoom out` makes book smaller', async t => {
211
- const { nav } = br;
212
- const page = Selector('.BRpagecontainer.BRpage-visible');
213
-
214
- await t.expect(br.BRcontainer.visible).ok();
215
- await t.expect(page.visible).ok();
216
- await t.expect(nav.zoomOut.visible).ok();
217
-
218
- const initialBookHeight = await page.getBoundingClientRectProperty('height');
219
- const initialBookWidth = await page.getBoundingClientRectProperty('width');
220
-
221
- await t.click(nav.zoomOut);
222
-
223
- const zoomOutBookHeight = await page.getBoundingClientRectProperty('height');
224
- const zoomOutBookWidth = await page.getBoundingClientRectProperty('width');
225
-
226
- await t.expect(zoomOutBookHeight).lt(initialBookHeight);
227
- await t.expect(zoomOutBookWidth).lt(initialBookWidth);
228
- });
229
-
230
- test('Clicking `zoom in` makes book larger', async t => {
231
- const { nav } = br;
232
- const page = Selector('.BRpagecontainer.BRpage-visible');
233
-
234
- await t.expect(br.BRcontainer.visible).ok();
235
- await t.expect(page.visible).ok();
236
- await t.expect(nav.zoomIn.visible).ok();
237
-
238
- const initialBookHeight = await page.getBoundingClientRectProperty('height');
239
- const initialBookWidth = await page.getBoundingClientRectProperty('width');
240
-
241
- await t.click(nav.zoomIn);
242
-
243
- const zoomInBookHeight = await page.getBoundingClientRectProperty('height');
244
- const zoomIntBookWidth = await page.getBoundingClientRectProperty('width');
245
-
246
- await t.expect(zoomInBookHeight).gt(initialBookHeight);
247
- await t.expect(zoomIntBookWidth).gt(initialBookWidth);
248
- });
249
-
250
- test('Clicking `full screen button` and BookReader fills browser window', async (t) => {
251
- const { nav, BRcontainer } = br;
252
- const windowWidth = await ClientFunction(() => window.innerWidth)();
253
-
254
- // initial in-page
255
- await t.expect(BRcontainer.getBoundingClientRectProperty('width')).lte(windowWidth);
256
- await t.click(nav.fullScreen);
257
- // full screen
258
- await t.expect(BRcontainer.getBoundingClientRectProperty('width')).eql(windowWidth);
259
- await t.click(nav.fullScreen);
260
- // in-page
261
- await t.expect(BRcontainer.getBoundingClientRectProperty('width')).lte(windowWidth);
262
- });
263
- }
@@ -1,13 +0,0 @@
1
- /**
2
- * Enables a debugging breakpoint in TestCafe tests
3
- *
4
- * Usage:
5
- * import debug from './helpers/debug';
6
- *
7
- * test(`does a thing`, async (t) => {
8
- * await debug(t);
9
- * });
10
- */
11
- export default async (t) => {
12
- await t.debug().setNativeDialogHandler(() => true);
13
- };