@internetarchive/bookreader 5.0.0-95 → 5.0.0-97
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.
- package/BookReader/474.js +2 -0
- package/BookReader/474.js.map +1 -0
- package/BookReader/BookReader.css +2257 -0
- package/BookReader/BookReader.js +3 -0
- package/BookReader/BookReader.js.LICENSE.txt +72 -0
- package/BookReader/BookReader.js.map +1 -0
- package/BookReader/bergamot-translator-worker.js +2966 -0
- package/BookReader/bergamot-translator-worker.wasm +0 -0
- package/BookReader/hypothesis/LICENSE +50 -0
- package/BookReader/hypothesis/README.md +55 -0
- package/BookReader/hypothesis/build/boot.js +1 -0
- package/BookReader/hypothesis/build/manifest.json +20 -0
- package/BookReader/hypothesis/build/scripts/annotator.bundle.js +184 -0
- package/BookReader/hypothesis/build/scripts/annotator.bundle.js.map +1 -0
- package/BookReader/hypothesis/build/scripts/sidebar.bundle.js +798 -0
- package/BookReader/hypothesis/build/scripts/sidebar.bundle.js.map +1 -0
- package/BookReader/hypothesis/build/scripts/ui-playground.bundle.js +711 -0
- package/BookReader/hypothesis/build/scripts/ui-playground.bundle.js.map +1 -0
- package/BookReader/hypothesis/build/styles/annotator.css +2235 -0
- package/BookReader/hypothesis/build/styles/annotator.css.map +1 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-Bold.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-Italic.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-Regular.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_Math-Italic.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_Script-Regular.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/BookReader/hypothesis/build/styles/highlights.css +2 -0
- package/BookReader/hypothesis/build/styles/highlights.css.map +1 -0
- package/BookReader/hypothesis/build/styles/katex.min.css +2 -0
- package/BookReader/hypothesis/build/styles/katex.min.css.map +1 -0
- package/BookReader/hypothesis/build/styles/pdfjs-overrides.css +2 -0
- package/BookReader/hypothesis/build/styles/pdfjs-overrides.css.map +1 -0
- package/BookReader/hypothesis/build/styles/sidebar.css +2731 -0
- package/BookReader/hypothesis/build/styles/sidebar.css.map +1 -0
- package/BookReader/hypothesis/build/styles/ui-playground.css +2659 -0
- package/BookReader/hypothesis/build/styles/ui-playground.css.map +1 -0
- package/BookReader/hypothesis/package.json +126 -0
- package/BookReader/ia-bookreader-bundle.js +1782 -0
- package/BookReader/ia-bookreader-bundle.js.LICENSE.txt +7 -0
- package/BookReader/ia-bookreader-bundle.js.map +1 -0
- package/BookReader/icons/1up.svg +1 -0
- package/BookReader/icons/2up.svg +1 -0
- package/BookReader/icons/advance.svg +3 -0
- package/BookReader/icons/chevron-right.svg +1 -0
- package/BookReader/icons/close-circle-dark.svg +1 -0
- package/BookReader/icons/close-circle.svg +1 -0
- package/BookReader/icons/fullscreen.svg +1 -0
- package/BookReader/icons/fullscreen_exit.svg +1 -0
- package/BookReader/icons/hamburger.svg +1 -0
- package/BookReader/icons/left-arrow.svg +1 -0
- package/BookReader/icons/magnify-minus.svg +1 -0
- package/BookReader/icons/magnify-plus.svg +1 -0
- package/BookReader/icons/magnify.svg +1 -0
- package/BookReader/icons/pause.svg +1 -0
- package/BookReader/icons/play.svg +1 -0
- package/BookReader/icons/playback-speed.svg +1 -0
- package/BookReader/icons/read-aloud.svg +1 -0
- package/BookReader/icons/review.svg +3 -0
- package/BookReader/icons/thumbnails.svg +1 -0
- package/BookReader/icons/voice.svg +1 -0
- package/BookReader/icons/volume-full.svg +1 -0
- package/BookReader/images/BRicons.png +0 -0
- package/BookReader/images/BRicons.svg +5 -0
- package/BookReader/images/BRicons_ia.png +0 -0
- package/BookReader/images/back_pages.png +0 -0
- package/BookReader/images/book_bottom_icon.png +0 -0
- package/BookReader/images/book_down_icon.png +0 -0
- package/BookReader/images/book_left_icon.png +0 -0
- package/BookReader/images/book_leftmost_icon.png +0 -0
- package/BookReader/images/book_right_icon.png +0 -0
- package/BookReader/images/book_rightmost_icon.png +0 -0
- package/BookReader/images/book_top_icon.png +0 -0
- package/BookReader/images/book_up_icon.png +0 -0
- package/BookReader/images/books_graphic.svg +1 -0
- package/BookReader/images/booksplit.png +0 -0
- package/BookReader/images/control_pause_icon.png +0 -0
- package/BookReader/images/control_play_icon.png +0 -0
- package/BookReader/images/embed_icon.png +0 -0
- package/BookReader/images/hypothesis.ico +0 -0
- package/BookReader/images/icon-home-ia.png +0 -0
- package/BookReader/images/icon_OL-logo-xs.png +0 -0
- package/BookReader/images/icon_alert-xs.png +0 -0
- package/BookReader/images/icon_book.svg +1 -0
- package/BookReader/images/icon_bookmark.svg +1 -0
- package/BookReader/images/icon_close-pop.png +0 -0
- package/BookReader/images/icon_download.png +0 -0
- package/BookReader/images/icon_experiment.svg +1 -0
- package/BookReader/images/icon_gear.svg +1 -0
- package/BookReader/images/icon_hamburger.svg +1 -0
- package/BookReader/images/icon_home.png +0 -0
- package/BookReader/images/icon_home.svg +1 -0
- package/BookReader/images/icon_home_ia.png +0 -0
- package/BookReader/images/icon_indicator.png +0 -0
- package/BookReader/images/icon_info.svg +1 -0
- package/BookReader/images/icon_one_page.svg +1 -0
- package/BookReader/images/icon_pause.svg +1 -0
- package/BookReader/images/icon_play.svg +1 -0
- package/BookReader/images/icon_playback-rate.svg +1 -0
- package/BookReader/images/icon_return.png +0 -0
- package/BookReader/images/icon_search_button.svg +1 -0
- package/BookReader/images/icon_share.svg +1 -0
- package/BookReader/images/icon_skip-ahead.svg +1 -0
- package/BookReader/images/icon_skip-back.svg +2 -0
- package/BookReader/images/icon_speaker.svg +1 -0
- package/BookReader/images/icon_speaker_open.svg +1 -0
- package/BookReader/images/icon_thumbnails.svg +1 -0
- package/BookReader/images/icon_toc.svg +1 -0
- package/BookReader/images/icon_two_pages.svg +1 -0
- package/BookReader/images/icon_zoomer.png +0 -0
- package/BookReader/images/loading.gif +0 -0
- package/BookReader/images/logo_icon.png +0 -0
- package/BookReader/images/marker_chap-off.png +0 -0
- package/BookReader/images/marker_chap-off.svg +1 -0
- package/BookReader/images/marker_chap-off_ia.png +0 -0
- package/BookReader/images/marker_chap-on.png +0 -0
- package/BookReader/images/marker_chap-on.svg +1 -0
- package/BookReader/images/marker_srch-on.svg +1 -0
- package/BookReader/images/marker_srchchap-off.png +0 -0
- package/BookReader/images/marker_srchchap-on.png +0 -0
- package/BookReader/images/nav_control-dn.png +0 -0
- package/BookReader/images/nav_control-dn_ia.png +0 -0
- package/BookReader/images/nav_control-up.png +0 -0
- package/BookReader/images/nav_control-up_ia.png +0 -0
- package/BookReader/images/nav_control.png +0 -0
- package/BookReader/images/one_page_mode_icon.png +0 -0
- package/BookReader/images/paper-badge.png +0 -0
- package/BookReader/images/print_icon.png +0 -0
- package/BookReader/images/progressbar.gif +0 -0
- package/BookReader/images/right_edges.png +0 -0
- package/BookReader/images/slider.png +0 -0
- package/BookReader/images/slider_ia.png +0 -0
- package/BookReader/images/thumbnail_mode_icon.png +0 -0
- package/BookReader/images/translate.svg +1 -0
- package/BookReader/images/transparent.png +0 -0
- package/BookReader/images/two_page_mode_icon.png +0 -0
- package/BookReader/images/unviewable_page.png +0 -0
- package/BookReader/images/zoom_in_icon.png +0 -0
- package/BookReader/images/zoom_out_icon.png +0 -0
- package/BookReader/jquery-3.js +2 -0
- package/BookReader/jquery-3.js.LICENSE.txt +24 -0
- package/BookReader/plugins/plugin.archive_analytics.js +2 -0
- package/BookReader/plugins/plugin.archive_analytics.js.map +1 -0
- package/BookReader/plugins/plugin.autoplay.js +2 -0
- package/BookReader/plugins/plugin.autoplay.js.map +1 -0
- package/BookReader/plugins/plugin.chapters.js +26 -0
- package/BookReader/plugins/plugin.chapters.js.LICENSE.txt +1 -0
- package/BookReader/plugins/plugin.chapters.js.map +1 -0
- package/BookReader/plugins/plugin.experiments.js +3 -0
- package/BookReader/plugins/plugin.experiments.js.LICENSE.txt +1 -0
- package/BookReader/plugins/plugin.experiments.js.map +1 -0
- package/BookReader/plugins/plugin.iframe.js +2 -0
- package/BookReader/plugins/plugin.iframe.js.map +1 -0
- package/BookReader/plugins/plugin.iiif.js +2 -0
- package/BookReader/plugins/plugin.iiif.js.map +1 -0
- package/BookReader/plugins/plugin.resume.js +2 -0
- package/BookReader/plugins/plugin.resume.js.map +1 -0
- package/BookReader/plugins/plugin.search.js +3 -0
- package/BookReader/plugins/plugin.search.js.LICENSE.txt +1 -0
- package/BookReader/plugins/plugin.search.js.map +1 -0
- package/BookReader/plugins/plugin.text_selection.js +3 -0
- package/BookReader/plugins/plugin.text_selection.js.LICENSE.txt +1 -0
- package/BookReader/plugins/plugin.text_selection.js.map +1 -0
- package/BookReader/plugins/plugin.translate.js +3 -0
- package/BookReader/plugins/plugin.translate.js.LICENSE.txt +1 -0
- package/BookReader/plugins/plugin.translate.js.map +1 -0
- package/BookReader/plugins/plugin.tts.js +3 -0
- package/BookReader/plugins/plugin.tts.js.LICENSE.txt +29 -0
- package/BookReader/plugins/plugin.tts.js.map +1 -0
- package/BookReader/plugins/plugin.url.js +2 -0
- package/BookReader/plugins/plugin.url.js.map +1 -0
- package/BookReader/plugins/plugin.vendor-fullscreen.js +2 -0
- package/BookReader/plugins/plugin.vendor-fullscreen.js.map +1 -0
- package/BookReader/plugins/translator-worker.js +2 -0
- package/BookReader/plugins/translator-worker.js.map +1 -0
- package/BookReader/translator-worker.js +475 -0
- package/BookReader/webcomponents-bundle.js +3 -0
- package/BookReader/webcomponents-bundle.js.LICENSE.txt +9 -0
- package/BookReader/webcomponents-bundle.js.map +1 -0
- package/package.json +11 -3
- package/src/BookNavigator/book-navigator.js +1 -0
- package/src/BookReader/BookModel.js +564 -0
- package/src/BookReader/DragScrollable.js +233 -0
- package/src/BookReader/ImageCache.js +149 -0
- package/src/BookReader/Mode1Up.js +110 -0
- package/src/BookReader/Mode1UpLit.js +393 -0
- package/src/BookReader/Mode2Up.js +107 -0
- package/src/BookReader/Mode2UpLit.js +787 -0
- package/src/BookReader/ModeCoordinateSpace.js +29 -0
- package/src/BookReader/ModeSmoothZoom.js +312 -0
- package/src/BookReader/ModeThumb.js +344 -0
- package/src/BookReader/Navbar/Navbar.js +416 -0
- package/src/BookReader/PageContainer.js +172 -0
- package/src/BookReader/ReduceSet.js +26 -0
- package/src/BookReader/Toolbar/Toolbar.js +362 -0
- package/src/BookReader/events.js +19 -0
- package/src/BookReader/options.js +387 -0
- package/src/BookReader/utils/HTMLDimensionsCacher.js +44 -0
- package/src/BookReader/utils/ScrollClassAdder.js +31 -0
- package/src/BookReader/utils/SelectionObserver.js +45 -0
- package/src/BookReader/utils/classes.js +36 -0
- package/src/BookReader/utils.js +313 -0
- package/src/BookReader.js +22 -139
- package/src/assets/images/icon_experiment.svg +1 -0
- package/src/assets/images/translate.svg +1 -0
- package/src/css/_BRnav.scss +0 -24
- package/src/css/_BRsearch.scss +0 -5
- package/src/css/_TextSelection.scss +32 -1
- package/src/plugins/plugin.experiments.js +34 -9
- package/src/plugins/plugin.text_selection.js +8 -20
- package/src/plugins/translate/TranslationManager.js +167 -0
- package/src/plugins/translate/plugin.translate.js +414 -0
- package/src/plugins/tts/utils.js +9 -20
- package/src/util/cache.js +20 -0
- package/.eslintrc.cjs +0 -51
- package/.gitattributes +0 -2
- package/.github/ISSUE_TEMPLATE/bug.md +0 -32
- package/.github/ISSUE_TEMPLATE/feature-request.md +0 -30
- package/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +0 -15
- package/.github/workflows/node.js.yml +0 -102
- package/.github/workflows/npm-publish.yml +0 -23
- package/.testcaferc.cjs +0 -10
- package/BookReaderDemo/BookReaderDemo.css +0 -40
- package/BookReaderDemo/BookReaderJSAdvanced.js +0 -112
- package/BookReaderDemo/BookReaderJSSimple.js +0 -56
- package/BookReaderDemo/IADemoBr.js +0 -149
- package/BookReaderDemo/assets/v5/Bookreader-logo-cool-grad.svg +0 -1
- package/BookReaderDemo/assets/v5/Bookreader-logo-flat.svg +0 -1
- package/BookReaderDemo/assets/v5/Bookreader-logo-hex-cool-grad.png +0 -0
- package/BookReaderDemo/assets/v5/Bookreader-logo-hex-flat.png +0 -0
- package/BookReaderDemo/assets/v5/Bookreader-logo-lines.png +0 -0
- package/BookReaderDemo/assets/v5/Bookreader-logo-lines.svg +0 -1
- package/BookReaderDemo/assets/v5/Bookreader-logo-warm.svg +0 -1
- package/BookReaderDemo/assets/v5/bookreader-logo-renders@1x.png +0 -0
- package/BookReaderDemo/assets/v5/bookreader-logo-renders@2x.png +0 -0
- package/BookReaderDemo/assets/v5/bookreader-v5-screenshot.png +0 -0
- package/BookReaderDemo/demo-advanced.html +0 -33
- package/BookReaderDemo/demo-embed-iframe-src.html +0 -85
- package/BookReaderDemo/demo-embed.html +0 -26
- package/BookReaderDemo/demo-fullscreen-mobile.html +0 -34
- package/BookReaderDemo/demo-fullscreen.html +0 -31
- package/BookReaderDemo/demo-iiif.html +0 -121
- package/BookReaderDemo/demo-internetarchive.html +0 -271
- package/BookReaderDemo/demo-multiple.html +0 -44
- package/BookReaderDemo/demo-preview-pages.html +0 -1093
- package/BookReaderDemo/demo-simple.html +0 -35
- package/BookReaderDemo/demo-vendor-fullscreen.html +0 -34
- package/BookReaderDemo/ia-multiple-volumes-manifest.js +0 -169
- package/BookReaderDemo/immersion-1up.html +0 -64
- package/BookReaderDemo/immersion-mode.html +0 -33
- package/BookReaderDemo/toggle_controls.html +0 -54
- package/BookReaderDemo/view_mode.html +0 -40
- package/BookReaderDemo/viewmode-cycle.html +0 -40
- package/CHANGELOG.md +0 -1087
- package/CONTRIBUTING.md +0 -7
- package/babel.config.cjs +0 -20
- package/codecov.yml +0 -23
- package/index.html +0 -34
- package/netlify.toml +0 -9
- package/renovate.json +0 -52
- package/screenshot.png +0 -0
- package/scripts/postversion.js +0 -11
- package/scripts/preversion.js +0 -15
- package/scripts/version.js +0 -24
- package/tests/e2e/README.md +0 -112
- package/tests/e2e/autoplay.test.js +0 -16
- package/tests/e2e/base.test.js +0 -27
- package/tests/e2e/helpers/base.js +0 -263
- package/tests/e2e/helpers/debug.js +0 -13
- package/tests/e2e/helpers/mockSearch.js +0 -90
- package/tests/e2e/helpers/params.js +0 -17
- package/tests/e2e/helpers/rightToLeft.js +0 -23
- package/tests/e2e/helpers/search.js +0 -73
- package/tests/e2e/models/BookReader.js +0 -11
- package/tests/e2e/models/Navigation.js +0 -39
- package/tests/e2e/rightToLeft.test.js +0 -19
- package/tests/e2e/viewmode.test.js +0 -44
- package/tests/jest/BookNavigator/book-navigator.test.js +0 -653
- package/tests/jest/BookNavigator/bookmarks/bookmark-button.test.js +0 -43
- package/tests/jest/BookNavigator/bookmarks/bookmark-edit.test.js +0 -132
- package/tests/jest/BookNavigator/bookmarks/bookmarks-list.test.js +0 -221
- package/tests/jest/BookNavigator/bookmarks/ia-bookmarks.test.js +0 -45
- package/tests/jest/BookNavigator/downloads/downloads-provider.test.js +0 -67
- package/tests/jest/BookNavigator/downloads/downloads.test.js +0 -53
- package/tests/jest/BookNavigator/search/search-provider.test.js +0 -179
- package/tests/jest/BookNavigator/search/search-results.test.js +0 -289
- package/tests/jest/BookNavigator/sharing/sharing-provider.test.js +0 -49
- package/tests/jest/BookNavigator/viewable-files/viewable-files-provider.test.js +0 -80
- package/tests/jest/BookNavigator/visual-adjustments.test.js +0 -200
- package/tests/jest/BookReader.keyboard.test.js +0 -190
- package/tests/jest/BookReader.options.test.js +0 -47
- package/tests/jest/BookReader.test.js +0 -316
- package/tests/jest/plugins/plugin.archive_analytics.test.js +0 -20
- package/tests/jest/plugins/plugin.autoplay.test.js +0 -35
- package/tests/jest/plugins/plugin.chapters.test.js +0 -193
- package/tests/jest/plugins/plugin.iframe.test.js +0 -42
- package/tests/jest/plugins/plugin.resume.test.js +0 -85
- package/tests/jest/plugins/plugin.text_selection.test.js +0 -447
- package/tests/jest/plugins/plugin.vendor-fullscreen.test.js +0 -65
- package/tests/jest/plugins/search/plugin.search.test.js +0 -120
- package/tests/jest/plugins/search/plugin.search.view.test.js +0 -131
- package/tests/jest/plugins/search/utils.js +0 -25
- package/tests/jest/plugins/search/utils.test.js +0 -29
- package/tests/jest/plugins/tts/AbstractTTSEngine.test.js +0 -173
- package/tests/jest/plugins/tts/FestivalTTSEngine.test.js +0 -59
- package/tests/jest/plugins/tts/PageChunk.test.js +0 -57
- package/tests/jest/plugins/tts/PageChunkIterator.test.js +0 -179
- package/tests/jest/plugins/tts/WebTTSEngine.test.js +0 -178
- package/tests/jest/plugins/tts/utils.test.js +0 -74
- package/tests/jest/plugins/url/UrlPlugin.test.js +0 -198
- package/tests/jest/plugins/url/plugin.url.test.js +0 -168
- package/tests/jest/setup.js +0 -3
- package/tests/jest/util/browserSniffing.test.js +0 -62
- package/tests/jest/util/docCookies.test.js +0 -24
- package/tests/jest/util/strings.test.js +0 -63
- package/tests/jest/utils.js +0 -83
- package/webpack.config.js +0 -97
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bind mouse handlers
|
|
3
|
+
* Disable mouse click to avoid selected/highlighted page images
|
|
4
|
+
* @param {JQuery} jObject
|
|
5
|
+
*/
|
|
6
|
+
export function disableSelect(jObject) {
|
|
7
|
+
// $$$ check here for right-click and don't disable. Also use jQuery style
|
|
8
|
+
// for stopping propagation. See https://bugs.edge.launchpad.net/gnubook/+bug/362626
|
|
9
|
+
jObject.bind('mousedown', () => false);
|
|
10
|
+
// Special hack for IE7
|
|
11
|
+
jObject[0].onselectstart = () => false;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @param {number} value
|
|
16
|
+
* @param {number} min
|
|
17
|
+
* @param {number} max
|
|
18
|
+
* @return {number}
|
|
19
|
+
*/
|
|
20
|
+
export function clamp(value, min, max) {
|
|
21
|
+
return Math.min(Math.max(value, min), max);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Given value and maximum, calculate a percentage suitable for CSS
|
|
26
|
+
* @param {number} value
|
|
27
|
+
* @param {number} max
|
|
28
|
+
* @return {string}
|
|
29
|
+
*/
|
|
30
|
+
export function cssPercentage(value, max) {
|
|
31
|
+
return ((value / max) * 100) + '%';
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @param {*} value
|
|
36
|
+
* @param {Array} array
|
|
37
|
+
* @return {boolean}
|
|
38
|
+
*/
|
|
39
|
+
export function notInArray(value, array) {
|
|
40
|
+
return !array.includes(value);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Determines the active element, going into shadow doms.
|
|
45
|
+
* @return {Element}
|
|
46
|
+
*/
|
|
47
|
+
export function getActiveElement(doc = document, recurseShadowDom = true) {
|
|
48
|
+
const activeElement = doc.activeElement;
|
|
49
|
+
if (recurseShadowDom && activeElement?.shadowRoot) {
|
|
50
|
+
return getActiveElement(activeElement.shadowRoot, true);
|
|
51
|
+
}
|
|
52
|
+
return activeElement;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Check if an input field/textarea is active. Also checks shadow DOMs. */
|
|
56
|
+
export function isInputActive(doc = document) {
|
|
57
|
+
const activeEl = getActiveElement(doc);
|
|
58
|
+
return activeEl?.tagName == "INPUT" || activeEl?.tagName == "TEXTAREA";
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @param {HTMLIFrameElement} iframe
|
|
63
|
+
* @return {Document}
|
|
64
|
+
*/
|
|
65
|
+
export function getIFrameDocument(iframe) {
|
|
66
|
+
// Adapted from http://xkr.us/articles/dom/iframe-document/
|
|
67
|
+
const outer = iframe.contentWindow || iframe.contentDocument;
|
|
68
|
+
return outer.document || outer;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @param {string} str
|
|
73
|
+
* @return {string}
|
|
74
|
+
*/
|
|
75
|
+
export function escapeHTML(str) {
|
|
76
|
+
return str.replace(/&/g,'&')
|
|
77
|
+
.replace(/>/g,'>')
|
|
78
|
+
.replace(/</g,'<')
|
|
79
|
+
.replace(/"/g,'"');
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Decodes a URI component and converts '+' to ' '
|
|
84
|
+
* @param {string} value
|
|
85
|
+
* @return {string}
|
|
86
|
+
*/
|
|
87
|
+
export function decodeURIComponentPlus(value) {
|
|
88
|
+
return decodeURIComponent(value).replace(/\+/g, ' ');
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Encodes a URI component and converts ' ' to '+'
|
|
93
|
+
* @param {string|number|boolean} value
|
|
94
|
+
* @return {string};
|
|
95
|
+
*/
|
|
96
|
+
export function encodeURIComponentPlus(value) {
|
|
97
|
+
return encodeURIComponent(value).replace(/%20/g, '+');
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* @template {Function} T
|
|
102
|
+
* Returns a function, that, as long as it continues to be invoked, will not
|
|
103
|
+
* be triggered. The function will be called after it stops being called for
|
|
104
|
+
* N milliseconds. If `immediate` is passed, trigger the function on the
|
|
105
|
+
* leading edge, instead of the trailing.
|
|
106
|
+
* @see https://davidwalsh.name/javascript-debounce-function
|
|
107
|
+
*
|
|
108
|
+
* @param {T} func
|
|
109
|
+
* @param {number} wait
|
|
110
|
+
* @param {boolean} immediate
|
|
111
|
+
* @return {T}
|
|
112
|
+
*/
|
|
113
|
+
export function debounce(func, wait, immediate) {
|
|
114
|
+
let timeout;
|
|
115
|
+
return function() {
|
|
116
|
+
const context = this;
|
|
117
|
+
const args = arguments;
|
|
118
|
+
const later = () => {
|
|
119
|
+
timeout = null;
|
|
120
|
+
if (!immediate) func.apply(context, args);
|
|
121
|
+
};
|
|
122
|
+
const callNow = immediate && !timeout;
|
|
123
|
+
clearTimeout(timeout);
|
|
124
|
+
timeout = setTimeout(later, wait);
|
|
125
|
+
if (callNow) func.apply(context, args);
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* @template T
|
|
131
|
+
* Throttle function
|
|
132
|
+
* @see https://remysharp.com/2010/07/21/throttling-function-calls
|
|
133
|
+
* @param {T} fn
|
|
134
|
+
* @param {number} threshold
|
|
135
|
+
* @param {boolean} delay
|
|
136
|
+
* @return {T}
|
|
137
|
+
*/
|
|
138
|
+
export function throttle(fn, threshold, delay) {
|
|
139
|
+
threshold || (threshold = 250);
|
|
140
|
+
let last;
|
|
141
|
+
let deferTimer;
|
|
142
|
+
if (delay) last = +new Date;
|
|
143
|
+
return function () {
|
|
144
|
+
const context = this;
|
|
145
|
+
const now = +new Date;
|
|
146
|
+
const args = arguments;
|
|
147
|
+
if (last && now < last + threshold) {
|
|
148
|
+
// hold on to it
|
|
149
|
+
clearTimeout(deferTimer);
|
|
150
|
+
deferTimer = setTimeout(() => {
|
|
151
|
+
last = now;
|
|
152
|
+
fn.apply(context, args);
|
|
153
|
+
}, threshold);
|
|
154
|
+
} else {
|
|
155
|
+
last = now;
|
|
156
|
+
fn.apply(context, args);
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* FIXME we need a better way to do this :/ This is not automatically poly-filled by
|
|
163
|
+
* core-js https://github.com/zloirock/core-js/issues/354
|
|
164
|
+
* @param {Window} window
|
|
165
|
+
*/
|
|
166
|
+
export function polyfillCustomEvent(window) {
|
|
167
|
+
if (typeof window.CustomEvent === "function") return false;
|
|
168
|
+
window.CustomEvent = PolyfilledCustomEvent;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* https://caniuse.com/customevent has issues on older browsers where it can't be
|
|
173
|
+
* called as a constructor, so we have to use older methods.
|
|
174
|
+
* @param {String} eventName
|
|
175
|
+
* @return {CustomEvent}
|
|
176
|
+
*/
|
|
177
|
+
export function PolyfilledCustomEvent(eventName, {bubbles = false, cancelable = false, detail = null} = {}) {
|
|
178
|
+
const event = document.createEvent('CustomEvent');
|
|
179
|
+
event.initCustomEvent(eventName, bubbles, cancelable, detail);
|
|
180
|
+
return event;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/*
|
|
184
|
+
* Returns the number pixels something should be rendered at to be ~1n on the users
|
|
185
|
+
* screen when measured with a ruler.
|
|
186
|
+
*/
|
|
187
|
+
export function calcScreenDPI() {
|
|
188
|
+
const el = document.createElement('div');
|
|
189
|
+
el.style.width = '1in';
|
|
190
|
+
document.body.appendChild(el);
|
|
191
|
+
const dpi = el.offsetWidth;
|
|
192
|
+
document.body.removeChild(el);
|
|
193
|
+
|
|
194
|
+
// Do you believe in magic... numbers? We tested on some devices, and the displayed
|
|
195
|
+
// size of `width: 1in` was less than desired. On @pezvi's mac, it was ~75% ; on
|
|
196
|
+
// @cdrini's laptop it was ~85%. Since we want to avoid things appearing too small,
|
|
197
|
+
// let's just use a multiplier of 1.25
|
|
198
|
+
const screenDPI = dpi * 1.25;
|
|
199
|
+
// This will return 0 in testing; never want it to be 0!
|
|
200
|
+
return screenDPI == 0 ? 100 : screenDPI;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* @param {number[]} nums
|
|
205
|
+
* @returns {number}
|
|
206
|
+
*/
|
|
207
|
+
export function sum(nums) {
|
|
208
|
+
return nums.reduce((cur, acc) => cur + acc, 0);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* @template T
|
|
213
|
+
* @param {Generator<T>} gen
|
|
214
|
+
* @returns {T[]}
|
|
215
|
+
*/
|
|
216
|
+
export function genToArray(gen) {
|
|
217
|
+
const result = [];
|
|
218
|
+
for (const item of gen) {
|
|
219
|
+
result.push(item);
|
|
220
|
+
}
|
|
221
|
+
return result;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Check if arrays contain the same elements. Does reference comparison.
|
|
226
|
+
* @param {Array} arr1
|
|
227
|
+
* @param {Array} arr2
|
|
228
|
+
*/
|
|
229
|
+
export function arrEquals(arr1, arr2) {
|
|
230
|
+
return arr1.length == arr2.length && arr1.every((x, i) => x == arr2[i]);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Check if array has changed; namely to be used with lit's property.hasChanged
|
|
235
|
+
* @param {Array} [arr1]
|
|
236
|
+
* @param {Array} [arr2]
|
|
237
|
+
*/
|
|
238
|
+
export function arrChanged(arr1, arr2) {
|
|
239
|
+
return arr1 && arr2 && !arrEquals(arr1, arr2);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Waits the provided number of ms and then resolves with a promise
|
|
244
|
+
* @param {number} ms
|
|
245
|
+
**/
|
|
246
|
+
export async function sleep(ms) {
|
|
247
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* @template T
|
|
252
|
+
* @param {function(): T} fn
|
|
253
|
+
* @param {Object} options
|
|
254
|
+
* @param {function(T): boolean} [options.until]
|
|
255
|
+
* @return {T | undefined}
|
|
256
|
+
*/
|
|
257
|
+
export async function poll(fn, { step = 50, timeout = 500, until = val => Boolean(val), _sleep = sleep } = {}) {
|
|
258
|
+
const startTime = Date.now();
|
|
259
|
+
while (Date.now() - startTime < timeout) {
|
|
260
|
+
const result = fn();
|
|
261
|
+
if (until(result)) return result;
|
|
262
|
+
await _sleep(step);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Convert a EventTarget style event into a promise
|
|
268
|
+
* @param {EventTarget} target
|
|
269
|
+
* @param {string} eventType
|
|
270
|
+
* @return {Promise<Event>}
|
|
271
|
+
*/
|
|
272
|
+
export function promisifyEvent(target, eventType) {
|
|
273
|
+
return new Promise(res => {
|
|
274
|
+
const resolver = ev => {
|
|
275
|
+
target.removeEventListener(eventType, resolver);
|
|
276
|
+
res(ev);
|
|
277
|
+
};
|
|
278
|
+
target.addEventListener(eventType, resolver);
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Escapes regex special characters in a string. Allows for safe usage in regexes.
|
|
284
|
+
* Src: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions
|
|
285
|
+
* @param {string} string
|
|
286
|
+
* @returns {string}
|
|
287
|
+
*/
|
|
288
|
+
export function escapeRegExp(string) {
|
|
289
|
+
return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* @param {number | 'fast' | 'slow' | string} speed
|
|
294
|
+
* Parsing of the jquery animation speed; see https://api.jquery.com/animate/
|
|
295
|
+
*/
|
|
296
|
+
export function parseAnimationSpeed(speed) {
|
|
297
|
+
if (speed === 'slow') return 600;
|
|
298
|
+
if (speed === 'fast') return 200;
|
|
299
|
+
return parseInt(speed, 10);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* @template T
|
|
304
|
+
* @param {T[]} array
|
|
305
|
+
* @param {function(T): number} [valueFn]
|
|
306
|
+
*/
|
|
307
|
+
export function sortBy(array, valueFn) {
|
|
308
|
+
return array.sort((a, b) => {
|
|
309
|
+
const aValue = valueFn ? valueFn(a) : a;
|
|
310
|
+
const bValue = valueFn ? valueFn(b) : b;
|
|
311
|
+
return aValue < bValue ? -1 : aValue > bValue ? 1 : 0;
|
|
312
|
+
});
|
|
313
|
+
}
|
package/src/BookReader.js
CHANGED
|
@@ -330,6 +330,24 @@ BookReader.prototype.setup = function(options) {
|
|
|
330
330
|
this.hasKeyFocus = true;
|
|
331
331
|
};
|
|
332
332
|
|
|
333
|
+
BookReader.prototype.initializePlugin = function(pluginName) {
|
|
334
|
+
const plugin = new BookReader.PLUGINS[pluginName](this);
|
|
335
|
+
this.plugins[pluginName] = plugin;
|
|
336
|
+
try {
|
|
337
|
+
plugin.setup(this.options.plugins?.[pluginName] ?? {});
|
|
338
|
+
this.options.plugins[pluginName] = plugin.options;
|
|
339
|
+
} catch (e) {
|
|
340
|
+
console.error(`Error setting up plugin ${pluginName} outside of regular cycle`, e);
|
|
341
|
+
throw e;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
try {
|
|
345
|
+
plugin.init();
|
|
346
|
+
} catch (e) {
|
|
347
|
+
console.error(`Error initializing plugin ${pluginName} outside of regular cycle`, e);
|
|
348
|
+
throw e;
|
|
349
|
+
}
|
|
350
|
+
};
|
|
333
351
|
/**
|
|
334
352
|
* Get all the HTML Elements that are being/can be rendered.
|
|
335
353
|
* Includes cached elements which might be rendered again.
|
|
@@ -632,8 +650,10 @@ BookReader.prototype.init = function() {
|
|
|
632
650
|
this.initUIStrings();
|
|
633
651
|
|
|
634
652
|
// Bind to events
|
|
635
|
-
|
|
636
|
-
this.
|
|
653
|
+
this._components.navbar.bindControlClickHandlers();
|
|
654
|
+
for (const plugin of Object.values(this.plugins)) {
|
|
655
|
+
plugin._bindNavigationHandlers();
|
|
656
|
+
}
|
|
637
657
|
this.setupKeyListeners();
|
|
638
658
|
|
|
639
659
|
this.lastScroll = (new Date().getTime());
|
|
@@ -1497,141 +1517,6 @@ exposeOverrideableMethod(Toolbar, '_components.toolbar', 'buildInfoDiv');
|
|
|
1497
1517
|
BookReader.prototype.getToolBarHeight = Toolbar.prototype.getToolBarHeight;
|
|
1498
1518
|
exposeOverrideableMethod(Toolbar, '_components.toolbar', 'getToolBarHeight');
|
|
1499
1519
|
|
|
1500
|
-
/**
|
|
1501
|
-
* Bind navigation handlers
|
|
1502
|
-
*/
|
|
1503
|
-
BookReader.prototype.bindNavigationHandlers = function() {
|
|
1504
|
-
const self = this;
|
|
1505
|
-
const jIcons = this.$('.BRicon');
|
|
1506
|
-
|
|
1507
|
-
// Map of jIcon class -> click handler
|
|
1508
|
-
const navigationControls = {
|
|
1509
|
-
book_left: () => {
|
|
1510
|
-
this.trigger(BookReader.eventNames.stop);
|
|
1511
|
-
this.left();
|
|
1512
|
-
},
|
|
1513
|
-
book_right: () => {
|
|
1514
|
-
this.trigger(BookReader.eventNames.stop);
|
|
1515
|
-
this.right();
|
|
1516
|
-
},
|
|
1517
|
-
book_top: this.first.bind(this),
|
|
1518
|
-
book_bottom: this.last.bind(this),
|
|
1519
|
-
book_leftmost: this.leftmost.bind(this),
|
|
1520
|
-
book_rightmost: this.rightmost.bind(this),
|
|
1521
|
-
onepg: () => {
|
|
1522
|
-
this.switchMode(self.constMode1up);
|
|
1523
|
-
},
|
|
1524
|
-
thumb: () => {
|
|
1525
|
-
this.switchMode(self.constModeThumb);
|
|
1526
|
-
},
|
|
1527
|
-
twopg: () => {
|
|
1528
|
-
this.switchMode(self.constMode2up);
|
|
1529
|
-
},
|
|
1530
|
-
zoom_in: () => {
|
|
1531
|
-
this.trigger(BookReader.eventNames.stop);
|
|
1532
|
-
this.zoom(1);
|
|
1533
|
-
this.trigger(BookReader.eventNames.zoomIn);
|
|
1534
|
-
},
|
|
1535
|
-
zoom_out: () => {
|
|
1536
|
-
this.trigger(BookReader.eventNames.stop);
|
|
1537
|
-
this.zoom(-1);
|
|
1538
|
-
this.trigger(BookReader.eventNames.zoomOut);
|
|
1539
|
-
},
|
|
1540
|
-
full: () => {
|
|
1541
|
-
if (this.ui == 'embed') {
|
|
1542
|
-
const url = this.$('.BRembedreturn a').attr('href');
|
|
1543
|
-
window.open(url);
|
|
1544
|
-
} else {
|
|
1545
|
-
this.toggleFullscreen();
|
|
1546
|
-
}
|
|
1547
|
-
},
|
|
1548
|
-
};
|
|
1549
|
-
|
|
1550
|
-
// custom event for auto-loan-renew in ia-book-actions
|
|
1551
|
-
// - to know if user is actively reading
|
|
1552
|
-
this.$('nav.BRcontrols li button').on('click', () => {
|
|
1553
|
-
this.trigger(BookReader.eventNames.userAction);
|
|
1554
|
-
});
|
|
1555
|
-
|
|
1556
|
-
for (const control in navigationControls) {
|
|
1557
|
-
jIcons.filter(`.${control}`).on('click.bindNavigationHandlers', () => {
|
|
1558
|
-
navigationControls[control]();
|
|
1559
|
-
return false;
|
|
1560
|
-
});
|
|
1561
|
-
}
|
|
1562
|
-
|
|
1563
|
-
const $brNavCntlBtmEl = this.$('.BRnavCntlBtm');
|
|
1564
|
-
const $brNavCntlTopEl = this.$('.BRnavCntlTop');
|
|
1565
|
-
|
|
1566
|
-
this.$('.BRnavCntl').click(
|
|
1567
|
-
function() {
|
|
1568
|
-
const promises = [];
|
|
1569
|
-
// TODO don't use magic constants
|
|
1570
|
-
// TODO move this to a function
|
|
1571
|
-
if ($brNavCntlBtmEl.hasClass('BRdn')) {
|
|
1572
|
-
if (self.refs.$BRtoolbar)
|
|
1573
|
-
promises.push(self.refs.$BRtoolbar.animate(
|
|
1574
|
-
{top: self.getToolBarHeight() * -1},
|
|
1575
|
-
).promise());
|
|
1576
|
-
promises.push(self.$('.BRfooter').animate({bottom: self.getFooterHeight() * -1}).promise());
|
|
1577
|
-
$brNavCntlBtmEl.addClass('BRup').removeClass('BRdn');
|
|
1578
|
-
$brNavCntlTopEl.addClass('BRdn').removeClass('BRup');
|
|
1579
|
-
self.$('.BRnavCntlBtm.BRnavCntl').animate({height:'45px'});
|
|
1580
|
-
self.$('.BRnavCntl').delay(1000).animate({opacity:.75}, 1000);
|
|
1581
|
-
} else {
|
|
1582
|
-
if (self.refs.$BRtoolbar)
|
|
1583
|
-
promises.push(self.refs.$BRtoolbar.animate({top:0}).promise());
|
|
1584
|
-
promises.push(self.$('.BRfooter').animate({bottom:0}).promise());
|
|
1585
|
-
$brNavCntlBtmEl.addClass('BRdn').removeClass('BRup');
|
|
1586
|
-
$brNavCntlTopEl.addClass('BRup').removeClass('BRdn');
|
|
1587
|
-
self.$('.BRnavCntlBtm.BRnavCntl').animate({height:'30px'});
|
|
1588
|
-
self.$('.BRvavCntl').animate({opacity:1});
|
|
1589
|
-
}
|
|
1590
|
-
$.when.apply($, promises).done(function() {
|
|
1591
|
-
// Only do full resize in auto mode and need to recalc. size
|
|
1592
|
-
if (self.mode == self.constMode2up && self.twoPage.autofit != null
|
|
1593
|
-
&& self.twoPage.autofit != 'none'
|
|
1594
|
-
) {
|
|
1595
|
-
self.resize();
|
|
1596
|
-
} else if (self.mode == self.constMode1up && self.onePage.autofit != null
|
|
1597
|
-
&& self.onePage.autofit != 'none') {
|
|
1598
|
-
self.resize();
|
|
1599
|
-
} else {
|
|
1600
|
-
// Don't do a full resize to avoid redrawing images
|
|
1601
|
-
self.resizeBRcontainer();
|
|
1602
|
-
}
|
|
1603
|
-
});
|
|
1604
|
-
},
|
|
1605
|
-
);
|
|
1606
|
-
$brNavCntlBtmEl
|
|
1607
|
-
.on("mouseover", function() {
|
|
1608
|
-
if ($(this).hasClass('BRup')) {
|
|
1609
|
-
self.$('.BRnavCntl').animate({opacity:1},250);
|
|
1610
|
-
}
|
|
1611
|
-
})
|
|
1612
|
-
.on("mouseleave", function() {
|
|
1613
|
-
if ($(this).hasClass('BRup')) {
|
|
1614
|
-
self.$('.BRnavCntl').animate({opacity:.75},250);
|
|
1615
|
-
}
|
|
1616
|
-
});
|
|
1617
|
-
$brNavCntlTopEl
|
|
1618
|
-
.on("mouseover", function() {
|
|
1619
|
-
if ($(this).hasClass('BRdn')) {
|
|
1620
|
-
self.$('.BRnavCntl').animate({opacity:1},250);
|
|
1621
|
-
}
|
|
1622
|
-
})
|
|
1623
|
-
.on("mouseleave", function() {
|
|
1624
|
-
if ($(this).hasClass('BRdn')) {
|
|
1625
|
-
self.$('.BRnavCntl').animate({opacity:.75},250);
|
|
1626
|
-
}
|
|
1627
|
-
});
|
|
1628
|
-
|
|
1629
|
-
// Call _bindNavigationHandlers on the plugins
|
|
1630
|
-
for (const plugin of Object.values(this.plugins)) {
|
|
1631
|
-
plugin._bindNavigationHandlers();
|
|
1632
|
-
}
|
|
1633
|
-
};
|
|
1634
|
-
|
|
1635
1520
|
/**************************/
|
|
1636
1521
|
/** BookModel extensions **/
|
|
1637
1522
|
/**************************/
|
|
@@ -1805,8 +1690,6 @@ BookReader.prototype.initUIStrings = function() {
|
|
|
1805
1690
|
'.book_right': 'Flip right',
|
|
1806
1691
|
'.play': 'Play',
|
|
1807
1692
|
'.pause': 'Pause',
|
|
1808
|
-
'.BRdn': 'Show/hide nav bar', // Would have to keep updating on state change to have just "Hide nav bar"
|
|
1809
|
-
'.BRup': 'Show/hide nav bar',
|
|
1810
1693
|
'.book_top': 'First page',
|
|
1811
1694
|
'.book_bottom': 'Last page',
|
|
1812
1695
|
'.book_leftmost': 'First page',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><g fill="#fff" fill-rule="evenodd"><path d="m20.5312017 91.3043478h59.513497c1.2006191 0 2.1739131-.973294 2.1739131-2.173913 0-.3822983-.1008154-.7578365-.2922774-1.0887357l-25.7859388-44.5652174c-.3886001-.6716082-1.1057054-1.0851774-1.8816356-1.0851774h-9.4292698c-.7956659 0-1.5277636.4346832-1.9086489 1.1332607l-24.2982884 44.5652174c-.5747365 1.0541176-.1861212 2.3745648.8679964 2.9493012.3192413.1740599.677043.2652642 1.0406524.2652642z"/><path d="m58.2338112 0c3.9857698 0 7.0754101 2.92605669 7.0754101 6.52173913 0 1.94814675-1.1751392 3.49748367-3.1329548 4.78763887-.7622726.5029309-1.2209368 1.3542647-1.2211436 2.2659686l-.0000001 17.2659447c0 1.4033895.3628136 2.7830137 1.0533233 4.0053358l29.9382305 52.9958632c.6905098 1.2223221 1.0533234 2.6019463 1.0533234 4.0053358 0 4.5023213-3.655118 8.1521739-8.1639346 8.1521739h-69.6705953c-1.3692898 0-2.7165851-.3439149-3.9178929-1.0000939-3.95568315-2.1606754-5.40829754-7.1143442-3.24450505-11.0643289l29.09149695-53.106279c.6571256-1.1995773 1.0015367-2.5449317 1.0015367-3.9122489l-.0000001-17.3410875c-.000193-.8514978-.3997534-1.6498707-1.0727831-2.1614374l-.1478555-.104365c-1.8735444-1.2352818-3.0298253-2.70631266-3.1268298-4.53659758l-.00663-.25182269c0-3.59709019 3.085096-6.52173913 7.07541-6.52173913zm0 5.43478261h-17.4163939c-.3341979 0-.655354.0973303-.9634683.29199092l-.1529759.10543374c-.2276736.17021467-.2742532.49276685-.1040386.72044045l.0538074.06119811.0627915.05193913.1617643.10919499c2.2021208 1.45291154 3.5596356 3.87504265 3.6577257 6.49699115l.0057053.3033755.0000002 17.3417027c0 2.2788621-.5740185 4.5211194-1.6692279 6.5204148l-29.0914969 53.106279c-.7212642 1.3166616-.2370594 2.9678845 1.0815017 3.6881097.4004359.2187263.8495344.3333646 1.3059643.3333646h69.6705953c1.5029388 0 2.7213115-1.2166175 2.7213115-2.7173913 0-.4677965-.1209379-.9276713-.3511078-1.3351119l-29.9382305-52.9958633c-1.1508495-2.0372034-1.7555389-4.336577-1.7555389-6.6755596l.0000002-17.2665599c.0005984-2.6392088 1.2800823-5.10829666 3.4230589-6.63488495l.2416409-.16570308c.2977633-.19621921.380081-.59667116.1838618-.89443446-.0526648-.07991901-.1224381-.14713032-.2042705-.1967699-.2372346-.14393755-.4815228-.22451299-.7328507-.24174888z" fill-rule="nonzero"/></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><g fill="#FFF"><path d="m55.6227664 40v-10.9816972c0-1.2005631.4447386-2.2302572 1.3342157-3.0890823.8894772-.858825 1.9338187-1.2888775 3.1330245-1.2901574h7.702184v6.5391015l14.2078094-10.6188404-14.2078094-10.5593242v6.6005376h-7.8252813c-3.5579086 0-6.6082065 1.2300012-9.1508934 3.6900038-2.542687 2.4600026-3.8146923 5.4095738-3.8160159 8.8487137v10.8607449z" transform="matrix(-1 0 0 1 129 0)"/><path d="m26.6227664 90v-10.9816972c0-1.2005631.4447386-2.2302572 1.3342157-3.0890823.8894772-.858825 1.9338187-1.2888775 3.1330245-1.2901574h7.702184v6.5391015l14.2078094-10.6188404-14.2078094-10.5593242v6.6005376h-7.8252813c-3.5579086 0-6.6082065 1.2300012-9.1508934 3.6900038-2.542687 2.4600026-3.8146923 5.4095738-3.8160159 8.8487137v10.8607449z" transform="matrix(1 0 0 -1 0 150)"/><g fill-rule="evenodd"><path d="m36.1711896 0c.7952259 0 1.5825239.11678603 2.361894.35035809.7793701.23357205 1.3385895.44226661 1.6776582.62608367.3390687.18381707.9354881.50929765 1.7892582.97644177v53.04711647h-41.11634795c-.26466873-.2667421-.47079323-.6253926-.61837349-1.0759518-.14758025-.4505591-.23600644-.8423796-.26527856-1.1754617v-52.7485865zm-15.8773502 11c-2.6260005.9445399-3.9390007 1.4168099-3.9390007 1.4168099.8613947 1.0405262 1.656859 2.1393299 2.3863927 3.2964109.2700118.4282536.5298575.8568906.7795373 1.2859111l-14.5207687.0008681v3l6.4238969.0000134c.8804258 3.5657294 2.3239844 6.8097976 4.3306759 9.7322048 1.0398193 1.5143213 2.176787 2.9231182 3.410903 4.2263908-3.5068695 3.0329696-7.8850877 5.246602-13.13321774 6.6415991 1.30042972 2.2665279 1.95064458 3.3997919 1.95064458 3.3997919 5.83922866-1.8768332 10.47451876-4.3674587 13.90587026-7.4718765.7278161.6172884 1.4851619 1.2034299 2.2700924 1.7596083 3.2815631 2.3252177 6.8996284 4.2293071 10.8541961 5.7122682 1.3246257-2.1759469 1.9869386-3.2639204 1.9869386-3.2639204-3.7993227-1.4042832-7.2042979-3.1143224-10.2149257-5.1301175-.8119265-.5436333-1.5953934-1.1239157-2.3504008-1.7408472 3.3115726-3.9242615 5.6922469-8.5457291 7.1440766-13.8651104l4.3889918-.0000045v-3l-12.2148765-.0011479c-.3495756-.7520023-.7243601-1.4925223-1.1243535-2.2215599-.7129337-1.2994097-1.4911578-2.5585071-2.3346725-3.7772922zm7.4469262 9.0006565c-1.3612535 4.5640835-3.3583061 8.3614158-5.9911579 11.3919968-1.0548712-1.0913671-2.041101-2.2689312-2.9598238-3.5334282-1.7358278-2.3891311-2.9991645-5.0087964-3.79001-7.858996z"/><path d="m94.1711896 45c.7952259 0 1.5825239.116786 2.361894.3503581.7793701.233572 1.3385895.4422666 1.6776582.6260837.3390687.183817.9354881.5092976 1.7892582.9764417v53.0471165h-41.116348c-.2646687-.2667421-.4707932-.6253926-.6183734-1.0759518-.1475803-.4505591-.2360065-.8423796-.2652786-1.1754617v-52.7485865zm-11.1769203 11h-7.8424068l-13.1518625 33h7.6962751l2.7277937-7.3487395h13.0057306l2.6303725 7.3487395h7.9398281zm-3.8794044 8.25 4.1351351 12.375h-8.5l4.272973-12.375z"/></g></g></svg>
|
package/src/css/_BRnav.scss
CHANGED
|
@@ -35,14 +35,6 @@
|
|
|
35
35
|
border: 3px solid rgba(255,255,255,0.3);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
.BRnavCntl {
|
|
40
|
-
z-index: $brZindexBase + 5;
|
|
41
|
-
background-color: $brColorDarkBorder;
|
|
42
|
-
}
|
|
43
|
-
.BRnavCntlBtm:hover {
|
|
44
|
-
background-color: $brColorThemeblue;
|
|
45
|
-
}
|
|
46
38
|
}
|
|
47
39
|
|
|
48
40
|
@mixin brNavLight {
|
|
@@ -66,14 +58,6 @@
|
|
|
66
58
|
border: 3px solid rgba($brColorThemeblue,0.3);
|
|
67
59
|
}
|
|
68
60
|
}
|
|
69
|
-
|
|
70
|
-
.BRnavCntl {
|
|
71
|
-
background-color: $brColorLightBorder;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.BRnavCntlBtm:hover {
|
|
75
|
-
background-color: $brColorThemeblue;
|
|
76
|
-
}
|
|
77
61
|
}
|
|
78
62
|
|
|
79
63
|
@keyframes fadeUp {
|
|
@@ -319,20 +303,12 @@
|
|
|
319
303
|
font-size: .8em;
|
|
320
304
|
vertical-align: top;
|
|
321
305
|
}
|
|
322
|
-
.BRup {
|
|
323
|
-
background-image: url("images/nav_control-up.png");
|
|
324
|
-
background-repeat: no-repeat;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
306
|
|
|
328
307
|
/* Mobile Only */
|
|
329
308
|
@media (max-width: $brBreakPointMobile) {
|
|
330
309
|
/* hide navline chapters and search in mobile */
|
|
331
310
|
.BRnavline .BRchapter { display: none; }
|
|
332
311
|
|
|
333
|
-
.BRnavCntlBtm {
|
|
334
|
-
bottom: $brNavHeightMobile;
|
|
335
|
-
}
|
|
336
312
|
.BRpager.ui-slider {
|
|
337
313
|
height: 10px;
|
|
338
314
|
top: math.div($brNavHeightMobile, 2) - 5px;
|
package/src/css/_BRsearch.scss
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.BRtextLayer {
|
|
1
|
+
.BRtextLayer, .BRtranslateLayer {
|
|
2
2
|
z-index: 2;
|
|
3
3
|
position: absolute;
|
|
4
4
|
top: 0;
|
|
@@ -8,9 +8,16 @@
|
|
|
8
8
|
// Make it so right-clicking on "blank" part of text layer sends events to the image (for saving)
|
|
9
9
|
pointer-events: none;
|
|
10
10
|
cursor: text;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.BRtextLayer {
|
|
11
14
|
mix-blend-mode: multiply;
|
|
12
15
|
}
|
|
13
16
|
|
|
17
|
+
.BRtranslateLayer {
|
|
18
|
+
hyphens: auto;
|
|
19
|
+
}
|
|
20
|
+
|
|
14
21
|
.BRparagraphElement {
|
|
15
22
|
margin: 0;
|
|
16
23
|
cursor: text;
|
|
@@ -108,3 +115,27 @@
|
|
|
108
115
|
background: #ccbfa7;
|
|
109
116
|
word-spacing: unset !important;
|
|
110
117
|
}
|
|
118
|
+
|
|
119
|
+
.BRtranslateLayer .BRparagraphElement {
|
|
120
|
+
pointer-events: auto;
|
|
121
|
+
overflow-y: auto;
|
|
122
|
+
background: rgba(248, 237, 192, 0.5);
|
|
123
|
+
backdrop-filter: blur(8px);
|
|
124
|
+
color:black;
|
|
125
|
+
line-height: 1em;
|
|
126
|
+
text-align: justify;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.BRtranslateLayer .BRparagraphElement .BRlineElement {
|
|
130
|
+
white-space: break-spaces;
|
|
131
|
+
display: inline-block;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.BRtextLayer.showingTranslation {
|
|
135
|
+
visibility: hidden;
|
|
136
|
+
pointer-events: none;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.BRtranslateLayer .BRparagraphElement.BRtranslateHidden {
|
|
140
|
+
display: none;
|
|
141
|
+
}
|