diff --git a/BookReader/BookReader.css b/BookReader/BookReader.css index ac4c615dc..557daa771 100644 --- a/BookReader/BookReader.css +++ b/BookReader/BookReader.css @@ -1,5 +1,4 @@ -/* Variables */ -/* COLORBOX POP-UP */ +/* Variables */ /* COLORBOX POP-UP */ #colorbox, #cboxOverlay, #cboxWrapper { position: absolute; top: 0; @@ -323,47 +322,38 @@ body.BRfullscreenActive .mm-menu { .BRinfoLeftCol { font-size: 14px; } - .BRimageW { text-align: center; margin-bottom: 10px; } - .BRimageW img { height: 200px; width: auto; } - .BRinfoValue.larger { font-size: 16px; } - .BRinfoMoreInfoWrapper a { font-size: inherit; color: white; text-decoration: none; } - .BRinfoOtherFormatsFormat { margin-bottom: 6px; } - .BRinfoFooter { margin-bottom: 10px; text-align: left; } - .BRinfoFooter a { display: block; } - .BRfloatFoot.BRinfoFooter { margin: initial; padding: initial; border: initial; font-size: inherit; } - .BookReader .fieldset-embed, .BRmobileMenu .fieldset-embed, .BRfloat .fieldset-embed { display: none; } @@ -380,56 +370,46 @@ body.BRfullscreenActive .mm-menu { position: relative; padding: 15px; } - .BRinfoLeftCol { float: left; width: 40%; min-height: 1px; } - .BRinfoRightCol { float: left; width: 58%; } - .BRimageW { text-align: center; margin-bottom: 10px; margin-right: 26px; } - .BRimageW img { height: auto; width: 100%; } - .BRinfoValue.larger { font-size: 20px; line-height: 1.2; } - .BRinfoMoreInfoWrapper a { font-size: 14px; color: white; text-decoration: none; font-weight: bold; } - .BRinfoOtherFormatsFormat { display: inline; margin-right: 10px; } - .BRinfoFooter { font-size: 1em; clear: both; } - .BRinfoFooter a { display: inline; margin-right: 10px; } - .BookReader .BRaction, .BRmobileMenu .BRaction, .BRfloat .BRaction { padding: 8px 16px; } @@ -984,14 +964,13 @@ i.BRicon { /* Desktop Only */ @media (min-width: 801px) { .BRfloat .message, -.BRfloatBody { + .BRfloatBody { padding: 10px 15px 10px 15px; font-size: 16px; line-height: normal; margin-top: 0; margin-bottom: 0px; } - .BRfloatHead { box-sizing: border-box; line-height: normal; @@ -1001,7 +980,6 @@ i.BRicon { text-align: center; border-bottom: 1px solid rgb(216, 216, 216); } - .BRfloatFoot { padding: 10px; margin-bottom: 10px; @@ -1012,10 +990,9 @@ i.BRicon { .BRfloatBody { padding: 10px 10px; } - .BRfloat .message, -.BRfloatBody, -.BRfloatHead { + .BRfloatBody, + .BRfloatHead { box-sizing: border-box; line-height: normal; border-bottom: 1px solid rgb(216, 216, 216); @@ -1025,12 +1002,10 @@ i.BRicon { font-weight: 700; text-align: center; } - .BRfloatFoot { padding: 10px 10px 0 10px; border-top: 1px solid #ccc; } - .BRfloatFoot .BRaction { margin-bottom: 10px; } @@ -1040,7 +1015,6 @@ i.BRicon { max-width: initial; width: 455px; } - .BRfloat.wide { max-width: initial; width: 555px; @@ -1064,11 +1038,11 @@ i.BRicon { @keyframes fadeUp { from { opacity: 0; - transform: translateY(10px); + translate: 0 10px; } to { opacity: 1; - transform: translateY(0); + translate: 0 0; } } .BRfooter { @@ -1240,8 +1214,7 @@ i.BRicon { appearance: none; border: 0; text-align: center; - text-align-last: center; - /* Chrome */ + text-align-last: center; /* Chrome */ padding-top: 60%; padding-left: 10%; padding-right: 10%; @@ -1340,8 +1313,7 @@ i.BRicon { height: 20px; border-radius: 50%; top: -5px; - margin-left: -9px; - /* Center icon */ + margin-left: -9px; /* Center icon */ z-index: 6; border: none; } @@ -1425,11 +1397,9 @@ i.BRicon { .BRnavline .BRchapter { display: none; } - .BRnavCntlBtm { bottom: 34px; } - .BRpager.ui-slider { height: 10px; top: 12px; @@ -1543,24 +1513,31 @@ i.BRicon { bottom: calc(100% + 5px); left: 50%; transform: translateX(-50%); - width: 230px; + width: 350px; + max-width: 100vw; padding: 12px 14px; + padding-bottom: 10px; color: #fff; - font-weight: bold; background: #333; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); + border-radius: 4px; + animation: fadeUp 0.2s; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + -o-user-select: none; + user-select: none; } .BookReader .BRquery:after, .BRmobileMenu .BRquery:after, .BRfloat .BRquery:after, .BookReader .BRchapter > div:after, .BRmobileMenu .BRchapter > div:after, .BRfloat .BRchapter > div:after { - display: none; position: absolute; - top: 100%; + content: ""; + bottom: -9px; left: 50%; + margin-left: -1px; transform: translateX(-50%); - content: ""; - border: 7px solid transparent; - border-width: 7px 4px; - border-bottom: none; - border-top-color: #333; + width: 30px; + height: 10px; + clip-path: polygon(0 0, 100% 0, 50% 100%); } .BookReader .searchHiliteLayer, .BookReader .ttsHiliteLayer, .BRmobileMenu .searchHiliteLayer, .BRmobileMenu .ttsHiliteLayer, .BRfloat .searchHiliteLayer, .BRfloat .ttsHiliteLayer { @@ -1606,8 +1583,7 @@ i.BRicon { } .BookReader .BRchapter, .BookReader .BRsearch, .BRmobileMenu .BRchapter, .BRmobileMenu .BRsearch, .BRfloat .BRchapter, .BRfloat .BRsearch { position: absolute; - bottom: 0; - /* Relative to nav line */ + bottom: 0; /* Relative to nav line */ cursor: pointer; z-index: 3; background-color: transparent; @@ -1620,8 +1596,7 @@ i.BRicon { height: 8px; width: 4px; bottom: -13px; - margin-left: -12px; - /* Center icon */ + margin-left: -12px; /* Center icon */ } .BookReader .BRchapter:hover > div, .BRmobileMenu .BRchapter:hover > div, .BRfloat .BRchapter:hover > div { display: block; @@ -1650,7 +1625,19 @@ i.BRicon { .BookReader .BRsearch .BRquery, .BRmobileMenu .BRsearch .BRquery, .BRfloat .BRsearch .BRquery { display: none; } -.BookReader .BRquery b, .BRmobileMenu .BRquery b, .BRfloat .BRquery b { +.BookReader .BRquery main, .BRmobileMenu .BRquery main, .BRfloat .BRquery main { + display: -webkit-box; + -webkit-line-clamp: 4; + -webkit-box-orient: vertical; + overflow: hidden; + margin-bottom: 6px; +} +.BookReader .BRquery footer, .BRmobileMenu .BRquery footer, .BRfloat .BRquery footer { + text-align: center; + font-weight: bold; + font-size: 0.9em; +} +.BookReader .BRquery mark, .BRmobileMenu .BRquery mark, .BRfloat .BRquery mark { color: #adaedc; font-weight: bold; background-color: #272958; @@ -2535,7 +2522,7 @@ html.mm-background .BookReader { /* Mobile Only */ @media (max-width: 800px) { .BRbodyMobileNavEnabled .BRtoolbar.responsive, -.BRbodyMobileNavEnabledFullscreen.BRfullscreenActive .BRtoolbar.responsive { + .BRbodyMobileNavEnabledFullscreen.BRfullscreenActive .BRtoolbar.responsive { display: block; height: 40px; box-sizing: border-box; @@ -2544,15 +2531,15 @@ html.mm-background .BookReader { background: #333; } .BRbodyMobileNavEnabled .BRtoolbar.responsive .BRtoolbarbuttons, -.BRbodyMobileNavEnabledFullscreen.BRfullscreenActive .BRtoolbar.responsive .BRtoolbarbuttons { + .BRbodyMobileNavEnabledFullscreen.BRfullscreenActive .BRtoolbar.responsive .BRtoolbarbuttons { display: none; } .BRbodyMobileNavEnabled .BRtoolbar.responsive .BRmobileHamburgerWrapper, -.BRbodyMobileNavEnabledFullscreen.BRfullscreenActive .BRtoolbar.responsive .BRmobileHamburgerWrapper { + .BRbodyMobileNavEnabledFullscreen.BRfullscreenActive .BRtoolbar.responsive .BRmobileHamburgerWrapper { display: block; } .BRbodyMobileNavEnabled .BRtoolbar.responsive .BRmobileMenu, -.BRbodyMobileNavEnabledFullscreen.BRfullscreenActive .BRtoolbar.responsive .BRmobileMenu { + .BRbodyMobileNavEnabledFullscreen.BRfullscreenActive .BRtoolbar.responsive .BRmobileMenu { display: block; } } @@ -2996,10 +2983,10 @@ li.BRtable-contents-el .BRTOCElementPage { } .BRwordElement::selection, .BRspace::selection, .BRparagraphElement::selection, .BRparagraphElement br::selection { - background: hsla(210deg, 74%, 62%, 0.4); + background: hsla(210, 74%, 62%, 0.4); } .BRwordElement::-moz-selection, .BRspace::-moz-selection, .BRparagraphElement::-moz-selection, .BRparagraphElement br::-moz-selection { - background: hsla(210deg, 74%, 62%, 0.4); + background: hsla(210, 74%, 62%, 0.4); color: transparent; } diff --git a/BookReader/BookReader.js b/BookReader/BookReader.js index 6ed44c9e5..028b264cb 100644 --- a/BookReader/BookReader.js +++ b/BookReader/BookReader.js @@ -1,3 +1,3 @@ /*! For license information please see BookReader.js.LICENSE.txt */ -(function(){var __webpack_modules__={2292:function(e,t,n){"use strict";n(5666),n(1539),n(9714),n(5827),n(2222),n(1249),n(6833),n(8674),n(7327),n(7941),n(4916),n(6992),n(8783),n(3948),n(1637),n(4765),n(7042),n(4747),n(9826),n(6699),n(2023),n(1058),n(3123),n(5306),n(9600),n(2526),n(1817),n(2165),n(1038),n(8309),n(6891),n(6177),n(5557);var r=n(5685);function i(e,t,n,r,i,o){var a,s=(a=e.prototype[t],function(){return a.apply(o(this),arguments)});Object.defineProperty(r.prototype,i,{get:function(){return s},set:function(r){e.prototype[t]=function(){var t=this instanceof e?n(this):this;return r.apply(t,arguments)},s=r}})}n(6227);var o={fragmentChange:"fragmentChange",pageChanged:"pageChanged",PostInit:"PostInit",stop:"stop",resize:"resize",userAction:"userAction",fullscreenToggled:"fullscreenToggled",zoomOut:"zoomOut",zoomIn:"zoomIn","1PageViewSelected":"1PageViewSelected","2PageViewSelected":"2PageViewSelected","3PageViewSelected":"3PageViewSelected",mobileNavOpen:"mobileNavOpen"},a=n(3609);function s(e,t){for(var n=0;n".concat(t.template(this.br),""):'
  • \n \n
  • "):""}},{key:"_renderControls",value:function(){var e=this;return["bookLeft","bookRight","onePage","twoPage","thumbnail","viewmode","zoomOut","zoomIn","fullScreen"].map((function(t){return e.controlFor(t)})).join("")}},{key:"_bindViewModeButton",value:function(){var e=this,t=this.br,n=t.options.controls.viewmode,r=[{mode:t.constMode1up,className:"onepg",title:"One-page view"},{mode:t.constMode2up,className:"twopg",title:"Two-page view"},{mode:t.constModeThumb,className:"thumb",title:"Thumbnail view"}].filter((function(e){return!n.excludedModes.includes(e.mode)})),i=r.map((function(e){return e.mode}));n.excludedModes.includes(t.mode)&&t.switchMode(i[0]);for(var s=i.indexOf(t.mode),u=0;u<=s;u++)i.push(i.shift());r.length<2&&this.$nav.find(".".concat(n.className)).remove(),this.br.bind(o.PostInit,(function(){var o=e.$nav.find(".".concat(n.className)).off(".bindNavigationHandlers").on("click",(function(n){var o=i.shift(),s=r.find((function(e){return e.mode===o})),u=r.find((function(e){return e.mode===i[0]}));i.push(o),t.viewModeOrder=i,e.updateViewModeButton(a(n.currentTarget),u.className,u.title),t.switchMode(s.mode)})),s=r.find((function(e){return e.mode===i[0]}));e.updateViewModeButton(o,s.className,s.title)}))}},{key:"updateViewModeButton",value:function(e,t,n){e.attr("title",n).find(".icon").removeClass().addClass("icon icon-".concat(t)).end().find(".tooltip").text(n)}},{key:"switchNavbarControls",value:function(){"linerNotes"!==this.br.options.bookType&&(this.br.refs.$brContainer.prop("clientWidth")<640?this.showMinimumNavbarControls():this.showMaximumNavbarControls())}},{key:"showMinimumNavbarControls",value:function(){this.minimumControls.forEach((function(e){var t=document.querySelector(".controls .".concat(e));t&&t.classList.remove("hide")})),this.maximumControls.forEach((function(e){var t=document.querySelector(".controls .".concat(e));t&&t.classList.add("hide")}))}},{key:"showMaximumNavbarControls",value:function(){this.maximumControls.forEach((function(e){var t=document.querySelector(".controls .".concat(e));t&&t.classList.remove("hide")})),this.minimumControls.forEach((function(e){var t=document.querySelector(".controls .".concat(e));t&&t.classList.add("hide")}))}},{key:"init",value:function(){var e=this,t=this.br,n=t.options.navbarTitle,r="rl"===t.pageProgression,i=r?"book_flip_next":"book_flip_prev",o=r?"book_flip_prev":"book_flip_next";this.br.options.controls.bookLeft.className="book_left ".concat(i),this.br.options.controls.bookRight.className="book_right ".concat(o),t.refs.$BRfooter=this.$root=a('
    '),t.refs.$BRnav=this.$nav=a('
    \n '.concat(n?'
    '.concat(n,"
    "):"",'\n \n
    ")),this.$root.append(this.$nav),t.refs.$br.append(this.$root);var s=this.$root.find(".BRpager").slider({animate:!0,min:0,max:t.book.getNumLeafs()-1,value:t.currentIndex(),range:"min"});return s.on("slide",(function(t,n){return e.updateNavPageNum(n.value),!0})),s.on("slidechange",(function(n,r){return e.updateNavPageNum(r.value),s.data("swallowchange")?s.data("swallowchange",!1):t.jumpToIndex(r.value),!0})),t.options.controls.viewmode.visible&&this._bindViewModeButton(),this.updateNavPageNum(t.currentIndex()),this.$nav}},{key:"getNavPageNumString",value:function(e){var t=this.br,n=t.book.getPageNum(e),r=(t.book.getPageProp(e,"pageType"),t.book.getNumLeafs());if(!this.maxPageNum){for(var i,o=0,a=0;ao&&(o=i);this.maxPageNum=o}return function(e,t,n,r,i){if("n"==n[0])return"(".concat(e+1," of ").concat(t,")");var o=i?" of ".concat(i):"";return"".concat(n).concat(o)}(e,r,n,0,this.maxPageNum)}},{key:"updateNavPageNum",value:function(e){this.$root.find(".BRcurrentpage").html(this.getNavPageNumString(e))}},{key:"updateNavIndex",value:function(e){e=void 0!==e?e:this.br.currentIndex(),this.$root.find(".BRpager").data("swallowchange",!0).slider("value",e)}}])&&s(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){if(t&&("object"===c(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function f(e){var t="function"==typeof Map?new Map:void 0;return(f=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return d(e,arguments,g(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),v(r,e)})(e)}function d(e,t,n){return(d=p()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&v(i,n.prototype),i}).apply(null,arguments)}function p(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n(489),n(2419),n(1532);var m={defaults:null,padding:10,ui:"full",uiAutoHide:!1,thumbRowBuffer:1,thumbColumns:6,thumbMaxLoading:4,thumbPadding:10,thumbMinZoomColumns:2,thumbMaxZoomColumns:8,flipSpeed:400,showToolbar:!0,showNavbar:!0,navBarTitle:"",showLogo:!0,logoURL:"https://archive.org",imagesBaseURL:"/BookReader/images/",reduceSet:"pow2",reductionFactors:[{reduce:.25,autofit:null},{reduce:.5,autofit:null},{reduce:1,autofit:null},{reduce:2,autofit:null},{reduce:3,autofit:null},{reduce:4,autofit:null},{reduce:6,autofit:null}],onePage:{autofit:"auto"},twoPage:{coverInternalPadding:0,coverExternalPadding:0,bookSpineDivWidth:64,autofit:"auto"},onePageMinBreakpoint:800,bookTitle:"",bookUrl:null,bookUrlText:null,bookUrlTitle:null,enableBookTitleLink:!0,bookLanguage:null,metadata:[],thumbnail:null,bookUrlMoreInfo:null,enableExperimentalControls:!1,el:"#BookReader",pageProgression:"lr",ppi:500,protected:!1,plugins:{textSelection:null},vars:{},data:[],getNumLeafs:null,getPageWidth:null,getPageHeight:null,getPageURI:null,getPageSide:null,getSpreadIndices:null,getPageNum:null,getPageProp:null,leafNumToIndex:null,getEmbedCode:null,controls:{bookLeft:{visible:!0,label:"Flip left",className:"book_left",iconClassName:"left-arrow"},bookRight:{visible:!0,label:"Flip right",className:"book_right",iconClassName:"left-arrow hflip"},onePage:{visible:!0,label:"One-page view",className:"onepg",iconClassName:"onepg"},twoPage:{visible:!0,label:"Two-page view",className:"twopg",iconClassName:"twopg"},thumbnail:{visible:!0,label:"Thumbnail view",className:"thumb",iconClassName:"thumb"},viewmode:{visible:!0,className:"viewmode",excludedModes:[]},zoomOut:{visible:!0,label:"Zoom out",className:"zoom_out",iconClassName:"magnify"},zoomIn:{visible:!0,label:"Zoom in",className:"zoom_in",iconClassName:"magnify plus"},fullScreen:{visible:!0,label:"Toggle fullscreen",className:"full",iconClassName:"fullscreen"}},startFullscreen:!1,enableFSLogoShortcut:!1,autoResize:!0,useSrcSet:!1},y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&v(e,t)}(o,e);var t,n,r,i=(t=o,n=p(),function(){var e,r=g(t);if(n){var i=g(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return h(this,e)});function o(){return l(this,o),i.apply(this,arguments)}return r=o,Object.defineProperty(r,"prototype",{writable:!1}),r}(f(Error)),b=n(105),w=(n(4581),n(3609));function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n\n \n '):"";e.refs.$BRtoolbar=w('\n
    \n
    \n
    \n '.concat(t,'\n \n
    \n
    \n \n \n \n \n
    \n
    \n
    '));var n=e.refs.$BRtoolbar.find(".BRtoolbarSectionTitle");return e.bookUrl&&e.options.enableBookTitleLink?n.append(w("").attr({href:e.bookUrl,title:e.bookUrlTitle}).addClass("BRreturn").html(e.bookUrlText||e.bookTitle)):e.bookTitle&&n.append(e.bookUrlText||e.bookTitle),e.refs.$BRtoolbar}},{key:"initToolbar",value:function(e,t){var n=this.br;n.refs.$br.append(this.buildToolbarElement()),n.$(".BRnavCntl").addClass("BRup"),n.$(".pause").hide(),n.refs.$BRtoolbar.append(),n.canSwitchToMode(n.constMode2up)||n.$(".two_page_mode, .play, .pause").hide(),n.canSwitchToMode(n.constModeThumb)||n.$(".thumbnail_mode").hide(),n.canSwitchToMode(n.constMode2up)||n.canSwitchToMode(n.constModeThumb)||n.$(".one_page_mode").hide(),w('
    ').append(w('\n
    \n
    \n Share\n \n
    \n
    ')).append(w('\n
    ')).appendTo(n.refs.$br),n.$(".BRinfo .BRfloatTitle a").attr({href:n.bookUrl}).text(n.bookTitle).addClass("title"),this.buildInfoDiv(n.$(".BRinfo")),this.buildShareDiv(n.$(".BRshare")),n.$(".share").colorbox({inline:!0,opacity:"0.5",href:n.$(".BRshare"),onLoad:function(){n.trigger(o.stop),n.$(".BRpageviewValue").val(window.location.href)}}),n.$(".info").colorbox({inline:!0,opacity:"0.5",href:n.$(".BRinfo"),onLoad:function(){n.trigger(o.stop)}})}},{key:"buildShareDiv",value:function(e){var t=this,n=this.br,r=document.location+"",i=(r+"").replace(/#.*/,""),o=n.getEmbedCode?'\n '):"",a=w('\n \n