@internetarchive/bookreader
Advanced tools
Comparing version 4.20.0 to 4.20.1-alpha1
@@ -1,2 +0,172 @@ | ||
(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[810],{7269:function(e,n,t){"use strict";var a;t(4916),t(4723),t(3609).extend(BookReader.defaultOptions,{enableArchiveAnalytics:!0,debugArchiveAnaltyics:!1}),BookReader.prototype.init=(a=BookReader.prototype.init,function(){var e=this;a.call(this),this.options.enableArchiveAnalytics&&this.bind(BookReader.eventNames.fragmentChange,(function(){return e.archiveAnalyticsSendFragmentChange()}))}),BookReader.prototype.archiveAnalyticsSendFragmentChange=function(){if(window.archive_analytics){var e=this.archiveAnalyticsSendFragmentChange.prevFragment,n=this.paramsFromCurrent(),t=this.fragmentFromParams(n);if(e!=t){var a={bookreader:"user_changed_view",itemid:this.bookId,cache_bust:Math.random(),offsite:1,details:0};try{a.offsite=window.top.location.hostname.match(/\.archive.org$/)?0:1,a.details=!a.offsite&&window.top.location.pathname.match(/^\/details\//)?1:0}catch(e){}archive_analytics.send_ping(a,null,"augment_for_ao_site");var i=this.options.lendingInfo&&this.options.lendingInfo.loanId?{loanId:this.options.lendingInfo.loanId}:{};archive_analytics.send_event("BookReader","UserChangedView",window.location.pathname,i),this.archiveAnalyticsSendFragmentChange.prevFragment=t}}},BookReader.prototype.archiveAnalyticsSendEvent=function(e,n,t,a){this.options.enableArchiveAnalytics&&(this.options.debugArchiveAnaltyics&&console.log("archiveAnalyticsSendEvent",arguments,window.archive_analytics),window.archive_analytics&&(a=a||{},"number"==typeof t&&(a.ev=t),window.archive_analytics.send_event(e,n,null,a)))}},4723:function(e,n,t){"use strict";var a=t(7007),i=t(9670),o=t(7466),r=t(4488),s=t(1530),c=t(7651);a("match",1,(function(e,n,t){return[function(n){var t=r(this),a=null==n?void 0:n[e];return void 0!==a?a.call(n,t):new RegExp(n)[e](String(t))},function(e){var a=t(n,e,this);if(a.done)return a.value;var r=i(e),l=String(this);if(!r.global)return c(r,l);var h=r.unicode;r.lastIndex=0;for(var d,v=[],u=0;null!==(d=c(r,l));){var f=String(d[0]);v[u]=f,""===f&&(r.lastIndex=s(l,o(r.lastIndex),h)),u++}return 0===u?null:v}]}))}},0,[[7269,898]]]); | ||
(self["webpackChunk_internetarchive_bookreader"] = self["webpackChunk_internetarchive_bookreader"] || []).push([["plugins/plugin.archive_analytics.js"],{ | ||
/***/ "./src/js/plugins/plugin.archive_analytics.js": | ||
/*!****************************************************!*\ | ||
!*** ./src/js/plugins/plugin.archive_analytics.js ***! | ||
\****************************************************/ | ||
/*! namespace exports */ | ||
/*! exports [not provided] [no usage info] */ | ||
/*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.* */ | ||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
__webpack_require__.r(__webpack_exports__); | ||
/* harmony import */ var core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.regexp.exec */ "./node_modules/core-js/modules/es.regexp.exec.js"); | ||
/* harmony import */ var core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_0__); | ||
/* harmony import */ var core_js_modules_es_string_match__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.string.match */ "./node_modules/core-js/modules/es.string.match.js"); | ||
/* harmony import */ var core_js_modules_es_string_match__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_match__WEBPACK_IMPORTED_MODULE_1__); | ||
/* provided dependency */ var jQuery = __webpack_require__(/*! jquery */ "jquery"); | ||
/* global BookReader, archive_analytics */ | ||
/** | ||
* Plugin for Archive.org analytics | ||
*/ | ||
jQuery.extend(BookReader.defaultOptions, { | ||
enableArchiveAnalytics: true, | ||
/** Provide a means of debugging, cause otherwise it's impossible to test locally */ | ||
debugArchiveAnaltyics: false | ||
}); | ||
BookReader.prototype.init = function (super_) { | ||
return function () { | ||
var _this = this; | ||
super_.call(this); | ||
if (this.options.enableArchiveAnalytics) { | ||
this.bind(BookReader.eventNames.fragmentChange, function () { | ||
return _this.archiveAnalyticsSendFragmentChange(); | ||
}); | ||
} | ||
}; | ||
}(BookReader.prototype.init); | ||
/** @private */ | ||
BookReader.prototype.archiveAnalyticsSendFragmentChange = function () { | ||
if (!window.archive_analytics) { | ||
return; | ||
} | ||
var prevFragment = this.archiveAnalyticsSendFragmentChange.prevFragment; | ||
var params = this.paramsFromCurrent(); | ||
var newFragment = this.fragmentFromParams(params); | ||
if (prevFragment != newFragment) { | ||
var values = { | ||
bookreader: "user_changed_view", | ||
itemid: this.bookId, | ||
cache_bust: Math.random() | ||
}; // EEK! offsite embedding and /details/ page books look the same in analytics, otherwise! | ||
values.offsite = 1; | ||
values.details = 0; | ||
try { | ||
values.offsite = window.top.location.hostname.match(/\.archive.org$/) ? 0 : 1; | ||
values.details = !values.offsite && window.top.location.pathname.match(/^\/details\//) ? 1 : 0; | ||
} catch (e) {} // avoids embed cross site exceptions -- but on (+) side, means it is and keeps marked offite! | ||
// Send bookreader ping | ||
archive_analytics.send_ping(values, null, "augment_for_ao_site"); // Also send tracking event ping | ||
var additionalEventParams = this.options.lendingInfo && this.options.lendingInfo.loanId ? { | ||
loanId: this.options.lendingInfo.loanId | ||
} : {}; | ||
archive_analytics.send_event('BookReader', 'UserChangedView', window.location.pathname, additionalEventParams); | ||
this.archiveAnalyticsSendFragmentChange.prevFragment = newFragment; | ||
} | ||
}; | ||
/** | ||
* Sends a tracking "Event". See https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#events | ||
* @param {string} category | ||
* @param {string} action | ||
* @param {number} [value] (must be an int) | ||
* @param {Object} [additionalEventParams] | ||
*/ | ||
BookReader.prototype.archiveAnalyticsSendEvent = function (category, action, value, additionalEventParams) { | ||
if (!this.options.enableArchiveAnalytics) return; | ||
if (this.options.debugArchiveAnaltyics) { | ||
console.log("archiveAnalyticsSendEvent", arguments, window.archive_analytics); | ||
} | ||
if (!window.archive_analytics) return; | ||
additionalEventParams = additionalEventParams || {}; | ||
if (typeof value == 'number') { | ||
additionalEventParams.ev = value; | ||
} | ||
window.archive_analytics.send_event(category, action, null, additionalEventParams); | ||
}; | ||
/***/ }), | ||
/***/ "./node_modules/core-js/modules/es.string.match.js": | ||
/*!*********************************************************!*\ | ||
!*** ./node_modules/core-js/modules/es.string.match.js ***! | ||
\*********************************************************/ | ||
/*! unknown exports (runtime-defined) */ | ||
/*! runtime requirements: __webpack_require__ */ | ||
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { | ||
"use strict"; | ||
var fixRegExpWellKnownSymbolLogic = __webpack_require__(/*! ../internals/fix-regexp-well-known-symbol-logic */ "./node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js"); | ||
var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js"); | ||
var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js"); | ||
var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/core-js/internals/require-object-coercible.js"); | ||
var advanceStringIndex = __webpack_require__(/*! ../internals/advance-string-index */ "./node_modules/core-js/internals/advance-string-index.js"); | ||
var regExpExec = __webpack_require__(/*! ../internals/regexp-exec-abstract */ "./node_modules/core-js/internals/regexp-exec-abstract.js"); | ||
// @@match logic | ||
fixRegExpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCallNative) { | ||
return [ | ||
// `String.prototype.match` method | ||
// https://tc39.github.io/ecma262/#sec-string.prototype.match | ||
function match(regexp) { | ||
var O = requireObjectCoercible(this); | ||
var matcher = regexp == undefined ? undefined : regexp[MATCH]; | ||
return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); | ||
}, | ||
// `RegExp.prototype[@@match]` method | ||
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match | ||
function (regexp) { | ||
var res = maybeCallNative(nativeMatch, regexp, this); | ||
if (res.done) return res.value; | ||
var rx = anObject(regexp); | ||
var S = String(this); | ||
if (!rx.global) return regExpExec(rx, S); | ||
var fullUnicode = rx.unicode; | ||
rx.lastIndex = 0; | ||
var A = []; | ||
var n = 0; | ||
var result; | ||
while ((result = regExpExec(rx, S)) !== null) { | ||
var matchStr = String(result[0]); | ||
A[n] = matchStr; | ||
if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); | ||
n++; | ||
} | ||
return n === 0 ? null : A; | ||
} | ||
]; | ||
}); | ||
/***/ }) | ||
}, | ||
0,[["./src/js/plugins/plugin.archive_analytics.js","BookReader.js"]]]); | ||
//# sourceMappingURL=plugin.archive_analytics.js.map |
@@ -1,2 +0,163 @@ | ||
(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[320],{6593:function(e,t,i){"use strict";i(7327),i(5827);var o,a=i(3609),n=i(3609);a.extend(BookReader.defaultOptions,{enableAutoPlayPlugin:!0}),BookReader.prototype.setup=(o=BookReader.prototype.setup,function(e){o.call(this,e),this.auto=!1,this.autoTimer=null,this.flipDelay=5e3}),BookReader.prototype.init=function(e){return function(t){var i=this;e.call(this,t),this.options.enableAutoPlayPlugin&&this.bind(BookReader.eventNames.stop,(function(){return i.autoStop()}))}}(BookReader.prototype.init),BookReader.prototype.bindNavigationHandlers=function(e){return function(){var t=this;if(e.call(this),this.options.enableAutoPlayPlugin){var i=this.$(".BRicon").add(".BRmobileMenu .BRicon");i.filter(".play").click((function(){return t.autoToggle(),!1})),i.filter(".pause").click((function(){return t.autoToggle(),!1}))}}}(BookReader.prototype.bindNavigationHandlers),BookReader.prototype.autoToggle=function(e){var t=this;if(this.options.enableAutoPlayPlugin){var i=n.extend({flipSpeed:this.flipSpeed,flipDelay:this.flipDelay},e);this.flipSpeed="number"==typeof i.flipSpeed?i.flipSpeed:this.flipSpeed,this.flipDelay="number"==typeof i.flipDelay?i.flipDelay:this.flipDelay,this.trigger(BookReader.eventNames.stop);var o=!1;this.constMode2up!=this.mode&&(o=!0,this.switchMode(this.constMode2up)),this.reduce<this.twoPageGetAutofitReduce()&&this.zoom2up("auto"),null==this.autoTimer?("rl"==this.pageProgression&&o||this.flipFwdToIndex(),this.$(".play").hide(),this.$(".pause").show(),this.autoTimer=setInterval((function(){t.animating||(Math.max(t.twoPage.currentIndexL,t.twoPage.currentIndexR)>=t.lastDisplayableIndex()?t.flipBackToIndex(1):t.flipFwdToIndex())}),this.flipDelay)):this.autoStop()}},BookReader.prototype.autoStop=function(){this.options.enableAutoPlayPlugin&&null!=this.autoTimer&&(clearInterval(this.autoTimer),this.flipSpeed="fast",this.$(".pause").hide(),this.$(".play").show(),this.autoTimer=null)}}},0,[[6593,898]]]); | ||
(self["webpackChunk_internetarchive_bookreader"] = self["webpackChunk_internetarchive_bookreader"] || []).push([["plugins/plugin.autoplay.js"],{ | ||
/***/ "./src/js/plugins/plugin.autoplay.js": | ||
/*!*******************************************!*\ | ||
!*** ./src/js/plugins/plugin.autoplay.js ***! | ||
\*******************************************/ | ||
/*! namespace exports */ | ||
/*! exports [not provided] [no usage info] */ | ||
/*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.* */ | ||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
__webpack_require__.r(__webpack_exports__); | ||
/* harmony import */ var core_js_modules_es_array_filter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.filter */ "./node_modules/core-js/modules/es.array.filter.js"); | ||
/* harmony import */ var core_js_modules_es_array_filter__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_filter__WEBPACK_IMPORTED_MODULE_0__); | ||
/* harmony import */ var core_js_modules_es_array_reduce__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.reduce */ "./node_modules/core-js/modules/es.array.reduce.js"); | ||
/* harmony import */ var core_js_modules_es_array_reduce__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_reduce__WEBPACK_IMPORTED_MODULE_1__); | ||
/* provided dependency */ var jQuery = __webpack_require__(/*! jquery */ "jquery"); | ||
/* provided dependency */ var $ = __webpack_require__(/*! jquery */ "jquery"); | ||
/*global BookReader */ | ||
/** | ||
* Plugin which adds an autoplay feature. Useful for kiosk situations. | ||
*/ | ||
jQuery.extend(BookReader.defaultOptions, { | ||
enableAutoPlayPlugin: true | ||
}); | ||
/** | ||
* @override BookReader.setup | ||
*/ | ||
BookReader.prototype.setup = function (super_) { | ||
return function (options) { | ||
super_.call(this, options); | ||
this.auto = false; | ||
this.autoTimer = null; | ||
this.flipDelay = 5000; | ||
}; | ||
}(BookReader.prototype.setup); | ||
/** | ||
* @override BookReader.init | ||
*/ | ||
BookReader.prototype.init = function (super_) { | ||
return function (options) { | ||
var _this = this; | ||
super_.call(this, options); | ||
if (!this.options.enableAutoPlayPlugin) return; | ||
this.bind(BookReader.eventNames.stop, function () { | ||
return _this.autoStop(); | ||
}); | ||
}; | ||
}(BookReader.prototype.init); | ||
/** | ||
* @override BookReader.bindNavigationHandlers | ||
*/ | ||
BookReader.prototype.bindNavigationHandlers = function (super_) { | ||
return function () { | ||
var _this2 = this; | ||
super_.call(this); | ||
if (!this.options.enableAutoPlayPlugin) return; // Note the mobile plugin attaches itself to body, so we need to select outside | ||
var jIcons = this.$('.BRicon').add('.BRmobileMenu .BRicon'); | ||
jIcons.filter('.play').click(function () { | ||
_this2.autoToggle(); | ||
return false; | ||
}); | ||
jIcons.filter('.pause').click(function () { | ||
_this2.autoToggle(); | ||
return false; | ||
}); | ||
}; | ||
}(BookReader.prototype.bindNavigationHandlers); | ||
/** | ||
* Starts autoplay mode | ||
* @param {object} overrides | ||
* @param {number} overrides.flipSpeed | ||
* @param {number} overrides.flipDelay | ||
*/ | ||
BookReader.prototype.autoToggle = function (overrides) { | ||
var _this3 = this; | ||
if (!this.options.enableAutoPlayPlugin) return; | ||
var options = $.extend({ | ||
flipSpeed: this.flipSpeed, | ||
flipDelay: this.flipDelay | ||
}, overrides); | ||
this.flipSpeed = typeof options.flipSpeed === "number" ? options.flipSpeed : this.flipSpeed; | ||
this.flipDelay = typeof options.flipDelay === "number" ? options.flipDelay : this.flipDelay; | ||
this.trigger(BookReader.eventNames.stop); | ||
var bComingFrom1up = false; | ||
if (this.constMode2up != this.mode) { | ||
bComingFrom1up = true; | ||
this.switchMode(this.constMode2up); | ||
} // Change to autofit if book is too large | ||
if (this.reduce < this.twoPageGetAutofitReduce()) { | ||
this.zoom2up('auto'); | ||
} | ||
if (null == this.autoTimer) { | ||
// $$$ Draw events currently cause layout problems when they occur during animation. | ||
// There is a specific problem when changing from 1-up immediately to autoplay in RTL so | ||
// we workaround for now by not triggering immediate animation in that case. | ||
// See https://bugs.launchpad.net/gnubook/+bug/328327 | ||
if ('rl' == this.pageProgression && bComingFrom1up) {// don't flip immediately -- wait until timer fires | ||
} else { | ||
// flip immediately | ||
this.flipFwdToIndex(); | ||
} | ||
this.$('.play').hide(); | ||
this.$('.pause').show(); | ||
this.autoTimer = setInterval(function () { | ||
if (_this3.animating) return; | ||
if (Math.max(_this3.twoPage.currentIndexL, _this3.twoPage.currentIndexR) >= _this3.lastDisplayableIndex()) { | ||
_this3.flipBackToIndex(1); // $$$ really what we want? | ||
} else { | ||
_this3.flipFwdToIndex(); | ||
} | ||
}, this.flipDelay); | ||
} else { | ||
this.autoStop(); | ||
} | ||
}; | ||
/** | ||
* Stop autoplay mode, allowing animations to finish | ||
*/ | ||
BookReader.prototype.autoStop = function () { | ||
if (!this.options.enableAutoPlayPlugin) return; | ||
if (null != this.autoTimer) { | ||
clearInterval(this.autoTimer); | ||
this.flipSpeed = 'fast'; | ||
this.$('.pause').hide(); | ||
this.$('.play').show(); | ||
this.autoTimer = null; | ||
} | ||
}; | ||
/***/ }) | ||
}, | ||
0,[["./src/js/plugins/plugin.autoplay.js","BookReader.js"]]]); | ||
//# sourceMappingURL=plugin.autoplay.js.map |
@@ -1,2 +0,302 @@ | ||
(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[529],{7184:function(e,t,n){"use strict";n(2222),n(7327),n(9826),n(4553),n(9600);var a,o=n(3609),r=n(3609);o.extend(BookReader.defaultOptions,{olHost:"https://openlibrary.org",enableChaptersPlugin:!0,bookId:""}),BookReader.prototype.setup=(a=BookReader.prototype.setup,function(e){a.call(this,e),this.olHost=e.olHost,this.enableChaptersPlugin=e.enableChaptersPlugin,this.bookId=e.bookId}),BookReader.prototype.init=function(e){return function(){var t=this;e.call(this),this.enableChaptersPlugin&&"embed"!==this.ui&&this.getOpenLibraryRecord(),this.enableMobileNav&&(this.bind(BookReader.eventNames.mobileNavOpen,(function(){t.updateTOCState(t.firstIndex,t._tocEntries),r("table-contents-list").parent().hasClass("mm-opened")&&t.updateTOCState(t.firstIndex,t._tocEntries)})),r(".BRmobileMenu__tableContents").click((function(){t.updateTOCState(t.firstIndex,t._tocEntries)})))}}(BookReader.prototype.init),BookReader.prototype.addChapter=function(e,t,n){var a=this,o=BookReader.util.cssPercentage(n,this.getNumLeafs()-1),i=function(e){a.jumpToIndex(r(e.delegateTarget).data("pageIndex")),r(".current-chapter").removeClass("current-chapter"),r(e.delegateTarget).addClass("current-chapter")},s="".concat(e," | "),l="".concat("Page"," ").concat(t),c=r("<li></li>").append(r("<span class='BRTOCElementTitle'></span>").text(s)).append(r("<span class='BRTOCElementPage'></span>").text(l));c.addClass("BRtable-contents-el").appendTo(this.$(".table-contents-list")).data({pageIndex:n}),null!=n&&(r("<div></div>").append(r("<div />").text(s+l)).addClass("BRchapter").css({left:o}).appendTo(this.$(".BRnavline")).data({pageIndex:n}).hover((function(e){var t=e.currentTarget,n=t.querySelector("div"),o=n.getBoundingClientRect(),i=t.getBoundingClientRect(),s=2*parseInt(getComputedStyle(n).paddingLeft);o.x-s<0&&n.style.setProperty("transform","translateX(-".concat(i.left-s,"px)")),a.$(".BRsearch,.BRchapter").removeClass("front"),r(e.target).addClass("front")}),(function(e){return r(e.target).removeClass("front")})).on("click",i),c.bind("click",i).addClass("chapter-clickable").attr("data-event-click-tracking","BRTOCPanel|GoToChapter"))},BookReader.prototype.removeChapters=function(){this.$(".BRnavpos .BRchapter").remove()},BookReader.prototype.updateTOC=function(e){this.removeChapters(),this.enableMobileNav&&e.length>0&&this.$(".BRmobileMenu__tableContents").show();for(var t=0;t<e.length;t++)this.addChapterFromEntry(e[t]);this._tocEntries=e,r(".table-contents-list").children().each((function(t,n){e[t].mobileHTML=n}))},BookReader.prototype.addChapterFromEntry=function(e){e.pageIndex=this.getPageIndex(e.pagenum);var t=[e.label,e.title].filter((function(e){return e})).join(" ");this.addChapter(t,e.pagenum,e.pageIndex),this.$(".BRchapter, .BRsearch").each((function(e,t){var n=r(t);n.hover((function(){return n.addClass("front")}),(function(){return n.removeClass("front")}))}))},BookReader.prototype.getOpenLibraryRecord=function(){var e=this,t="".concat(this.olHost,"/query.json?type=/type/edition&*="),n="".concat(t,"&ocaid=").concat(this.bookId);r.ajax({url:n,dataType:"jsonp"}).then((function(n){return n&&n.length>0?n:r.ajax({url:"".concat(t,"&source_records=ia:").concat(e.bookId),dataType:"jsonp"})})).then((function(t){var n;t&&t.length>0&&(n=t[0])&&n.table_of_contents&&e.updateTOC(n.table_of_contents)}))},BookReader.prototype.buildMobileDrawerElement=function(e){return function(){var t=e.call(this);return this.enableMobileNav&&this.options.enableChaptersPlugin&&t.find(".BRmobileMenu__moreInfoRow").after(r('\n <li class="BRmobileMenu__tableContents" data-event-click-tracking="BRSidebar|TOCPanel">\n <span>\n <span class="DrawerIconWrapper">\n <img class="DrawerIcon" src="'.concat(this.imagesBaseURL,'icon_toc.svg" alt="toc-icon"/>\n </span>\n Table of Contents\n </span>\n <div>\n <ol class="table-contents-list">\n </ol>\n </div>\n </li>')).hide()),t}}(BookReader.prototype.buildMobileDrawerElement),BookReader.prototype.updateTOCState=function(e,t){if(t){r(".current-chapter").removeClass("current-chapter");var n=t.filter((function(e){return null!=e.pageIndex})).reverse(),a=n[n.findIndex((function(t){return t.pageIndex<=e}))];null!=a&&r(a.mobileHTML).addClass("current-chapter")}}}},0,[[7184,898]]]); | ||
(self["webpackChunk_internetarchive_bookreader"] = self["webpackChunk_internetarchive_bookreader"] || []).push([["plugins/plugin.chapters.js"],{ | ||
/***/ "./src/js/plugins/plugin.chapters.js": | ||
/*!*******************************************!*\ | ||
!*** ./src/js/plugins/plugin.chapters.js ***! | ||
\*******************************************/ | ||
/*! namespace exports */ | ||
/*! exports [not provided] [no usage info] */ | ||
/*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.* */ | ||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
__webpack_require__.r(__webpack_exports__); | ||
/* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat */ "./node_modules/core-js/modules/es.array.concat.js"); | ||
/* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__); | ||
/* harmony import */ var core_js_modules_es_array_filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.filter */ "./node_modules/core-js/modules/es.array.filter.js"); | ||
/* harmony import */ var core_js_modules_es_array_filter__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_filter__WEBPACK_IMPORTED_MODULE_1__); | ||
/* harmony import */ var core_js_modules_es_array_find__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.array.find */ "./node_modules/core-js/modules/es.array.find.js"); | ||
/* harmony import */ var core_js_modules_es_array_find__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_find__WEBPACK_IMPORTED_MODULE_2__); | ||
/* harmony import */ var core_js_modules_es_array_find_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.array.find-index */ "./node_modules/core-js/modules/es.array.find-index.js"); | ||
/* harmony import */ var core_js_modules_es_array_find_index__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_find_index__WEBPACK_IMPORTED_MODULE_3__); | ||
/* harmony import */ var core_js_modules_es_array_join__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.array.join */ "./node_modules/core-js/modules/es.array.join.js"); | ||
/* harmony import */ var core_js_modules_es_array_join__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_join__WEBPACK_IMPORTED_MODULE_4__); | ||
/* provided dependency */ var jQuery = __webpack_require__(/*! jquery */ "jquery"); | ||
/* provided dependency */ var $ = __webpack_require__(/*! jquery */ "jquery"); | ||
/* global BookReader */ | ||
/** | ||
* Plugin for chapter markers in BookReader. Fetches from openlibrary.org | ||
* Could be forked, or extended to alter behavior | ||
*/ | ||
jQuery.extend(BookReader.defaultOptions, { | ||
olHost: 'https://openlibrary.org', | ||
enableChaptersPlugin: true, | ||
bookId: '' | ||
}); | ||
/** @override Extend the constructor to add search properties */ | ||
BookReader.prototype.setup = function (super_) { | ||
return function (options) { | ||
super_.call(this, options); | ||
this.olHost = options.olHost; | ||
this.enableChaptersPlugin = options.enableChaptersPlugin; | ||
this.bookId = options.bookId; | ||
}; | ||
}(BookReader.prototype.setup); | ||
/** @override Extend to call Open Library for TOC */ | ||
BookReader.prototype.init = function (super_) { | ||
return function () { | ||
var _this = this; | ||
super_.call(this); | ||
if (this.enableChaptersPlugin && this.ui !== 'embed') { | ||
this.getOpenLibraryRecord(); | ||
} | ||
if (this.enableMobileNav) { | ||
this.bind(BookReader.eventNames.mobileNavOpen, function () { | ||
_this.updateTOCState(_this.firstIndex, _this._tocEntries); | ||
if ($('table-contents-list').parent().hasClass('mm-opened')) { | ||
_this.updateTOCState(_this.firstIndex, _this._tocEntries); | ||
} | ||
}); | ||
$(".BRmobileMenu__tableContents").click(function () { | ||
_this.updateTOCState(_this.firstIndex, _this._tocEntries); | ||
}); | ||
} | ||
}; | ||
}(BookReader.prototype.init); | ||
/** | ||
* Adds chapter marker to navigation scrubber | ||
* | ||
* @param {string} chapterTitle | ||
* @param {string} pageNumber | ||
* @param {number} pageIndex | ||
*/ | ||
BookReader.prototype.addChapter = function (chapterTitle, pageNumber, pageIndex) { | ||
var _this2 = this; | ||
var uiStringPage = 'Page'; // i18n | ||
var percentThrough = BookReader.util.cssPercentage(pageIndex, this.getNumLeafs() - 1); | ||
var jumpToChapter = function jumpToChapter(event) { | ||
_this2.jumpToIndex($(event.delegateTarget).data('pageIndex')); | ||
$('.current-chapter').removeClass('current-chapter'); | ||
$(event.delegateTarget).addClass('current-chapter'); | ||
}; | ||
var title = "".concat(chapterTitle, " | "); | ||
var pageStr = "".concat(uiStringPage, " ").concat(pageNumber); //adding items to mobile table of contents | ||
var mobileChapter = $("<li></li>").append($("<span class='BRTOCElementTitle'></span>").text(title)).append($("<span class='BRTOCElementPage'></span>").text(pageStr)); | ||
mobileChapter.addClass('BRtable-contents-el').appendTo(this.$('.table-contents-list')).data({ | ||
pageIndex: pageIndex | ||
}); //adds .BRchapters to the slider only if pageIndex exists | ||
if (pageIndex != undefined) { | ||
$("<div></div>").append($('<div />').text(title + pageStr)).addClass('BRchapter').css({ | ||
left: percentThrough | ||
}).appendTo(this.$('.BRnavline')).data({ | ||
pageIndex: pageIndex | ||
}).hover(function (event) { | ||
// remove hover effect from other markers then turn on just for this | ||
var marker = event.currentTarget; | ||
var tooltip = marker.querySelector('div'); | ||
var tooltipOffset = tooltip.getBoundingClientRect(); | ||
var targetOffset = marker.getBoundingClientRect(); | ||
var boxSizeAdjust = parseInt(getComputedStyle(tooltip).paddingLeft) * 2; | ||
if (tooltipOffset.x - boxSizeAdjust < 0) { | ||
tooltip.style.setProperty('transform', "translateX(-".concat(targetOffset.left - boxSizeAdjust, "px)")); | ||
} | ||
_this2.$('.BRsearch,.BRchapter').removeClass('front'); | ||
$(event.target).addClass('front'); | ||
}, function (event) { | ||
return $(event.target).removeClass('front'); | ||
}).on('click', jumpToChapter); //adding clickable properties to mobile chapters | ||
mobileChapter.bind('click', jumpToChapter).addClass('chapter-clickable').attr("data-event-click-tracking", "BRTOCPanel|GoToChapter"); | ||
} | ||
}; | ||
/* | ||
* Remove all chapters. | ||
*/ | ||
BookReader.prototype.removeChapters = function () { | ||
this.$('.BRnavpos .BRchapter').remove(); | ||
}; | ||
/** | ||
* Update the table of contents based on array of TOC entries. | ||
* @param {TocEntry[]} tocEntries | ||
*/ | ||
BookReader.prototype.updateTOC = function (tocEntries) { | ||
this.removeChapters(); | ||
if (this.enableMobileNav && tocEntries.length > 0) { | ||
this.$(".BRmobileMenu__tableContents").show(); | ||
} | ||
for (var i = 0; i < tocEntries.length; i++) { | ||
this.addChapterFromEntry(tocEntries[i]); | ||
} | ||
this._tocEntries = tocEntries; | ||
$('.table-contents-list').children().each(function (i, el) { | ||
tocEntries[i].mobileHTML = el; | ||
}); | ||
}; | ||
/** | ||
* @typedef {Object} TocEntry | ||
* Table of contents entry as defined -- format is defined by Open Library | ||
* @property {string} pagenum | ||
* @property {number} level | ||
* @property {string} label | ||
* @property {{type: '/type/toc_item'}} type | ||
* @property {string} title | ||
* @property {HTMLElement} mobileHTML | ||
* @property {number} pageIndex | ||
* | ||
* @example { | ||
* "pagenum": "17", | ||
* "level": 1, | ||
* "label": "CHAPTER I", | ||
* "type": {"key": "/type/toc_item"}, | ||
* "title": "THE COUNTRY AND THE MISSION" | ||
* } | ||
*/ | ||
/** | ||
* @param {TocEntry} tocEntryObject | ||
*/ | ||
BookReader.prototype.addChapterFromEntry = function (tocEntryObject) { | ||
tocEntryObject.pageIndex = this.getPageIndex(tocEntryObject['pagenum']); //creates a string with non-void tocEntryObject.label and tocEntryObject.title | ||
var chapterStr = [tocEntryObject.label, tocEntryObject.title].filter(function (x) { | ||
return x; | ||
}).join(' '); | ||
this.addChapter(chapterStr, tocEntryObject['pagenum'], tocEntryObject.pageIndex); | ||
this.$('.BRchapter, .BRsearch').each(function (i, el) { | ||
var $el = $(el); | ||
$el.hover(function () { | ||
return $el.addClass('front'); | ||
}, function () { | ||
return $el.removeClass('front'); | ||
}); | ||
}); | ||
}; | ||
/** | ||
* getOpenLibraryRecord | ||
* | ||
* The bookreader is designed to call openlibrary API and constructs the | ||
* "Return book" button using the response. | ||
* | ||
* This makes a call to OL API and calls the given callback function with the | ||
* response from the API. | ||
*/ | ||
BookReader.prototype.getOpenLibraryRecord = function () { | ||
var _this3 = this; | ||
// Try looking up by ocaid first, then by source_record | ||
var baseURL = "".concat(this.olHost, "/query.json?type=/type/edition&*="); | ||
var fetchUrlByBookId = "".concat(baseURL, "&ocaid=").concat(this.bookId); | ||
/* | ||
* Update Chapter markers based on received record from Open Library. | ||
* Notes that Open Library record is used for extra metadata, and also for lending | ||
*/ | ||
var setUpChapterMarkers = function setUpChapterMarkers(olObject) { | ||
if (olObject && olObject.table_of_contents) { | ||
// XXX check here that TOC is valid | ||
_this3.updateTOC(olObject.table_of_contents); | ||
} | ||
}; | ||
$.ajax({ | ||
url: fetchUrlByBookId, | ||
dataType: 'jsonp' | ||
}).then(function (data) { | ||
if (data && data.length > 0) { | ||
return data; | ||
} else { | ||
// try sourceid | ||
return $.ajax({ | ||
url: "".concat(baseURL, "&source_records=ia:").concat(_this3.bookId), | ||
dataType: 'jsonp' | ||
}); | ||
} | ||
}).then(function (data) { | ||
if (data && data.length > 0) { | ||
setUpChapterMarkers(data[0]); | ||
} | ||
}); | ||
}; // Extend buildMobileDrawerElement with table of contents list | ||
BookReader.prototype.buildMobileDrawerElement = function (super_) { | ||
return function () { | ||
var $el = super_.call(this); | ||
if (this.enableMobileNav && this.options.enableChaptersPlugin) { | ||
$el.find('.BRmobileMenu__moreInfoRow').after($("\n <li class=\"BRmobileMenu__tableContents\" data-event-click-tracking=\"BRSidebar|TOCPanel\">\n <span>\n <span class=\"DrawerIconWrapper\">\n <img class=\"DrawerIcon\" src=\"".concat(this.imagesBaseURL, "icon_toc.svg\" alt=\"toc-icon\"/>\n </span>\n Table of Contents\n </span>\n <div>\n <ol class=\"table-contents-list\">\n </ol>\n </div>\n </li>")).hide()); | ||
} | ||
return $el; | ||
}; | ||
}(BookReader.prototype.buildMobileDrawerElement); | ||
/** | ||
* highlights the current chapter based on current page | ||
* @private | ||
* @param {TocEntry[]} tocEntries | ||
* @param {number} tocEntries | ||
*/ | ||
BookReader.prototype.updateTOCState = function (currIndex, tocEntries) { | ||
//this function won't have any effects if called before OpenLibrary request is finished | ||
if (!tocEntries) { | ||
return; | ||
} | ||
$('.current-chapter').removeClass('current-chapter'); | ||
var tocEntriesIndexed = tocEntries.filter(function (el) { | ||
return el.pageIndex != undefined; | ||
}).reverse(); | ||
var currChapter = tocEntriesIndexed[tocEntriesIndexed.findIndex(function (el) { | ||
return el.pageIndex <= currIndex; | ||
})]; | ||
if (currChapter != undefined) { | ||
$(currChapter.mobileHTML).addClass('current-chapter'); | ||
} | ||
}; | ||
/***/ }) | ||
}, | ||
0,[["./src/js/plugins/plugin.chapters.js","BookReader.js"]]]); | ||
//# sourceMappingURL=plugin.chapters.js.map |
@@ -1,2 +0,73 @@ | ||
(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[697],{8164:function(e,a,t){"use strict";var r,n="bookReaderFragmentChange";BookReader.prototype.init=(r=BookReader.prototype.init,function(){r.call(this),function(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.parent;a&&(e.bind(BookReader.eventNames.fragmentChange,(function(){var t=e.fragmentFromParams(e.paramsFromCurrent());a.postMessage({type:n,fragment:t},"*")})),window.addEventListener("message",(function(a){a.data&&a.data.type===n&&e.updateFromParams(e.paramsFromFragment(a.data.fragment))})))}(this)})}},0,[[8164,898]]]); | ||
(self["webpackChunk_internetarchive_bookreader"] = self["webpackChunk_internetarchive_bookreader"] || []).push([["plugins/plugin.iframe.js"],{ | ||
/***/ "./src/js/plugins/plugin.iframe.js": | ||
/*!*****************************************!*\ | ||
!*** ./src/js/plugins/plugin.iframe.js ***! | ||
\*****************************************/ | ||
/*! namespace exports */ | ||
/*! export _attachEventListeners [provided] [no usage info] [missing usage info prevents renaming] */ | ||
/*! other exports [not provided] [no usage info] */ | ||
/*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ | ||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
__webpack_require__.r(__webpack_exports__); | ||
/* harmony export */ __webpack_require__.d(__webpack_exports__, { | ||
/* harmony export */ "_attachEventListeners": function() { return /* binding */ _attachEventListeners; } | ||
/* harmony export */ }); | ||
/* global BookReader */ | ||
/** | ||
* Plugin for two-way communication between a BookReader in an IFrame and the | ||
* parent web page | ||
*/ | ||
var MESSAGE_TYPE_FRAGMENT_CHANGE = 'bookReaderFragmentChange'; | ||
BookReader.prototype.init = function (super_) { | ||
return function () { | ||
super_.call(this); | ||
_attachEventListeners(this); | ||
}; | ||
}(BookReader.prototype.init); | ||
/** | ||
* @private | ||
* Using window.postMessage() and event listeners, the plugin notifies the | ||
* parent window when pages change, and the parent window can also | ||
* explicitly request a page change by sending its own message. | ||
* | ||
* @param {BookReader} br | ||
* @param {Window?} [parent] | ||
*/ | ||
function _attachEventListeners(br) { | ||
var parent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.parent; | ||
// Not embedded, abort | ||
if (!parent) { | ||
return; | ||
} | ||
br.bind(BookReader.eventNames.fragmentChange, function () { | ||
var fragment = br.fragmentFromParams(br.paramsFromCurrent()); | ||
parent.postMessage({ | ||
type: MESSAGE_TYPE_FRAGMENT_CHANGE, | ||
fragment: fragment | ||
}, '*'); | ||
}); | ||
window.addEventListener('message', function (event) { | ||
// Not a recognized message type, abort | ||
if (!event.data || event.data.type !== MESSAGE_TYPE_FRAGMENT_CHANGE) { | ||
return; | ||
} | ||
br.updateFromParams(br.paramsFromFragment(event.data.fragment)); | ||
}); | ||
} | ||
/***/ }) | ||
}, | ||
0,[["./src/js/plugins/plugin.iframe.js","BookReader.js"]]]); | ||
//# sourceMappingURL=plugin.iframe.js.map |
@@ -1,2 +0,366 @@ | ||
(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[777],{9179:function(e,n,o){"use strict";o(9600);var t=o(3609),a=o(3609);!function(){t.extend(BookReader.defaultOptions,{enableMenuToggle:!0});var e=!1;function n(e){e.refs&&e.refs.$BRnav&&e.refs.$BRnav.children(".BRnavCntl").css("display","none")}var o,i,r=!1,c=function(n,o,t){if(!e){var i,c,s=(i=document.querySelector(".BRcontainer")).scrollWidth>i.offsetWidth?n.refs.$brContainer[0]:o.currentTarget,d=n.constMode1up===n.mode||function(e,n){var o=e.clientX,t=n.offsetWidth,a=n.offsetLeft,i=Math.round(t/3),r=Math.round(i+a),c=Math.round(t-i+a);return o>r&&o<c}(o,s);(t?d:(c=o.target,a(c).hasClass("BookReader")||a(c).hasClass("BRcontainer")||a(c).hasClass("BRemptypage")||a(c).hasClass("BRpageview")||a(c).hasClass("BRtwopageview")))&&(function(e){r||(r=!0,a(document).on("BookReader:navToggled",(function e(){r=!1,window.removeEventListener("BookReader:navToggled",e)})),e.navigationIsVisible()?e.hideNavigation():e.showNavigation())}(n),t&&o.stopPropagation())}};function s(e,n){c(e,n)}function d(e,n){c(e,n,!0)}function u(n){var t=document.querySelector(".BookReader");if(t){t.addEventListener("click",s.bind(null,n),{capture:!0,passive:!0});var a=(document.querySelector(".BRcontainer")||{}).firstChild;a&&(a.addEventListener("click",d.bind(null,n),!0),function(){var n=document.querySelector(".BookReader");n&&(n.addEventListener("mousedown",(function(n){o=n.screenX,i=n.screenY,e=!0}),!0),n.addEventListener("mouseup",(function(n){Math.abs(o-n.screenX)>5||Math.abs(i-n.screenY)>5||(e=!1,o=0,i=0)}),!0))}())}}var l,f=function(e){var o=!1;try{o=e.navigationIsVisible()}catch(e){o=!1}if(o){var t=function(n){u(e)},i=function(o){!function(e){n(e),u(e)}(e)};a(document).on(["BookReader:3PageViewSelected"].join(" "),(function(o){!function(e){n(e),function(e){e.refs.$brPageViewEl&&e.refs.$brPageViewEl[0].removeEventListener("click",d,!0),e.refs.$brTwoPageView&&e.refs.$brTwoPageView[0].removeEventListener("click",d,!0)}(e),e.showNavigation()}(e)})),a(document).on(["BookReader:1PageViewSelected","BookReader:2PageViewSelected","BookReader:zoomIn","BookReader:zoomOut","BookReader:resize"].join(" "),t),a(window).on("orientationchange",t),a(document).on("BookReader:fullscreenToggled",i),a(window).on("DOMContentLoaded",i),i()}};BookReader.prototype.setup=(l=BookReader.prototype.setup,function(e){l.call(this,e)}),BookReader.prototype.init=function(e){return function(){e.call(this),this.options.enableMenuToggle&&f(this)}}(BookReader.prototype.init)}()}},0,[[9179,898]]]); | ||
(self["webpackChunk_internetarchive_bookreader"] = self["webpackChunk_internetarchive_bookreader"] || []).push([["plugins/plugin.menu_toggle.js"],{ | ||
/***/ "./src/js/plugins/menu_toggle/plugin.menu_toggle.js": | ||
/*!**********************************************************!*\ | ||
!*** ./src/js/plugins/menu_toggle/plugin.menu_toggle.js ***! | ||
\**********************************************************/ | ||
/*! namespace exports */ | ||
/*! exports [not provided] [no usage info] */ | ||
/*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.* */ | ||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
__webpack_require__.r(__webpack_exports__); | ||
/* harmony import */ var core_js_modules_es_array_join__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.join */ "./node_modules/core-js/modules/es.array.join.js"); | ||
/* harmony import */ var core_js_modules_es_array_join__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_join__WEBPACK_IMPORTED_MODULE_0__); | ||
/* provided dependency */ var jQuery = __webpack_require__(/*! jquery */ "jquery"); | ||
/* provided dependency */ var $ = __webpack_require__(/*! jquery */ "jquery"); | ||
/* global BookReader */ | ||
/** | ||
* Plugin for managing menu visibility | ||
* Enabling this plug-in: | ||
* + removes the "menu tab" triangle | ||
* + toggles nav at: book center tap/click | ||
* + toggles nav at: black background tap/click | ||
* | ||
* Handles to events at CAPTURE phase | ||
* | ||
* This uses core BookReader functions and parameters to check its UI state: | ||
* - br.refs = (at best) ui references that are present at any given time | ||
* - br.navigationIsVisible() - checks using refs to confirm the navbar's presence | ||
* - br.showNavigation() & br.hideNavigation() | ||
* - br.constMode1up checks against br.mode; | ||
* | ||
* The list of BookReader custom events this plugin taps into are mainly | ||
* listed in the `.init` function | ||
*/ | ||
(function addMenuToggler() { | ||
jQuery.extend(BookReader.defaultOptions, { | ||
enableMenuToggle: true | ||
}); | ||
/** | ||
* `holdOffOnToggle` is used in fn `toggleRouter` | ||
* to determine if menu toggle should happen | ||
* set by `registerDragHandlers` | ||
*/ | ||
var holdOffOnToggle = false; | ||
/** | ||
* Hides Nav arrow tab | ||
* | ||
* @param { object } br - BookReader instance | ||
*/ | ||
function hideArrow(br) { | ||
if (!br.refs || !br.refs.$BRnav) { | ||
return; | ||
} | ||
var $menuTab = br.refs.$BRnav.children('.BRnavCntl'); | ||
$menuTab.css('display', 'none'); | ||
} | ||
/** | ||
* Sets up nav - hides arrow tab & adds click events | ||
* | ||
* @param { object } br - BookReader instance | ||
*/ | ||
function setupNavForToggle(br) { | ||
hideArrow(br); | ||
registerClickHandlers(br); | ||
} | ||
/** | ||
* Resets nav to always show | ||
* hides arrow tab, removes click events, shows nav chrome | ||
* | ||
* @param { object } br - BookReader instance | ||
*/ | ||
function alwaysShowNav(br) { | ||
hideArrow(br); | ||
removeClickHandlers(br); | ||
br.showNavigation(); | ||
} | ||
/** | ||
* Removes click handlers on elements that house the book pages | ||
* | ||
* @param { object } br - BookReader instance | ||
*/ | ||
var removeClickHandlers = function removeClickHandlers(br) { | ||
if (br.refs.$brPageViewEl) { | ||
br.refs.$brPageViewEl[0].removeEventListener('click', onBookClick, true); | ||
} | ||
if (br.refs.$brTwoPageView) { | ||
br.refs.$brTwoPageView[0].removeEventListener('click', onBookClick, true); | ||
} | ||
}; | ||
/** | ||
* Toggle functionality | ||
* Responsible for calling native functions `hideNavigation` & `showNavigation` | ||
* Makes sure only 1 toggle action is taken at a time using `togglingNav` switch. | ||
* | ||
* @params { object } br - bookreader instance | ||
*/ | ||
var togglingNav = false; | ||
/* flag to make sure animations only fire once */ | ||
var toggleNav = function toggleNav(br) { | ||
if (togglingNav) { | ||
return; | ||
} | ||
togglingNav = true; | ||
var navToggled = function navToggled() { | ||
togglingNav = false; | ||
window.removeEventListener('BookReader:navToggled', navToggled); | ||
}; | ||
$(document).on('BookReader:navToggled', navToggled); | ||
var menuIsShowing = br.navigationIsVisible(); | ||
if (menuIsShowing) { | ||
br.hideNavigation(); | ||
} else { | ||
br.showNavigation(); | ||
} | ||
}; | ||
/** | ||
* Check if div `BRcontainer` is scrollable. | ||
* This normally happens when bookreader is zoomed in. | ||
* not using br.refs, because `scrollWidth` & `offsetWidth` is not easily accessible. | ||
*/ | ||
var isBRcontainerScrollable = function isBRcontainerScrollable() { | ||
var brContainer = document.querySelector('.BRcontainer'); | ||
var scrollWidth = brContainer.scrollWidth; | ||
var offsetWidth = brContainer.offsetWidth; | ||
return scrollWidth > offsetWidth; | ||
}; | ||
/** | ||
* Confirms whether or not the click happened in the nav toggle zone | ||
* | ||
* @param { MouseEvent } event - JS click event object | ||
* @param { DOM } book - DOM element that represents book | ||
*/ | ||
var isCenterClick = function isCenterClick(event, book) { | ||
var clickPosition = event.clientX; | ||
var bookWidth = book.offsetWidth; | ||
var leftOffset = book.offsetLeft; | ||
var bookEndPageFlipArea = Math.round(bookWidth / 3); | ||
var leftThreshold = Math.round(bookEndPageFlipArea + leftOffset); // without it, the click area is small | ||
var rightThreshold = Math.round(bookWidth - bookEndPageFlipArea + leftOffset); | ||
var isOkOnRight = clickPosition > leftThreshold; | ||
var isOkOnLeft = clickPosition < rightThreshold; | ||
var isCenterClick = isOkOnRight && isOkOnLeft; | ||
return isCenterClick; | ||
}; | ||
/** | ||
* Confirms whether or not the click happened in the background | ||
* | ||
* @param { DOM } element | ||
*/ | ||
var isBackground = function isBackground(element) { | ||
var isBackgroundClick = $(element).hasClass('BookReader') || $(element).hasClass('BRcontainer') | ||
/* main black theatre */ | ||
|| $(element).hasClass('BRemptypage') | ||
/* empty page placeholder */ | ||
|| $(element).hasClass('BRpageview') | ||
/* empty page placeholder, 1up */ | ||
|| $(element).hasClass('BRtwopageview'); | ||
/* empty page placeholder, 2up */ | ||
return isBackgroundClick; | ||
}; | ||
/** | ||
* Main hook into toggle functionality | ||
* This is the only function that should be called by the event handlers | ||
* | ||
* @param { object } br - BookReader instance | ||
* @param { MouseEvent } e - JS event object | ||
* @param { boolean } atBookCenter - optional | ||
*/ | ||
var toggleRouter = function toggleRouter(br, e, atBookCenter) { | ||
if (holdOffOnToggle) { | ||
return; | ||
} | ||
var book = isBRcontainerScrollable() ? br.refs.$brContainer[0] : e.currentTarget; | ||
var is1UpMode = br.constMode1up === br.mode; | ||
var validBookClick = is1UpMode || isCenterClick(e, book); | ||
var isValidClickArea = atBookCenter ? validBookClick : isBackground(e.target); | ||
if (isValidClickArea) { | ||
toggleNav(br, atBookCenter); | ||
if (atBookCenter) { | ||
e.stopPropagation(); // don't turn the page. this takes prescendence | ||
} | ||
} | ||
}; | ||
/** | ||
* background click event handler | ||
* @param { object } br - BookReader instance | ||
* @param { MouseEvent } e - JS event object | ||
*/ | ||
function onBackgroundClick(br, e) { | ||
toggleRouter(br, e); | ||
} | ||
/** | ||
* actual book container click event handler | ||
* | ||
* @param { object } br - BookReader instance | ||
* @param { MouseEvent } e - JS event object | ||
*/ | ||
function onBookClick(br, e) { | ||
var atBookCenter = true; | ||
toggleRouter(br, e, atBookCenter); | ||
} | ||
var initialX; | ||
var initialY; | ||
/** | ||
* attaches mouseup & mousedown event handlers to assess if user is dragging | ||
* sets `initialX`, `initialY`, and `holdOffOnToggle` | ||
*/ | ||
function registerDragHandlers() { | ||
var background = document.querySelector('.BookReader'); | ||
if (!background) { | ||
return; | ||
} | ||
background.addEventListener('mousedown', function (e) { | ||
initialX = e.screenX; | ||
initialY = e.screenY; | ||
holdOffOnToggle = true; | ||
}, true); | ||
background.addEventListener('mouseup', function (e) { | ||
var isDrag = Math.abs(initialX - e.screenX) > 5 || Math.abs(initialY - e.screenY) > 5; | ||
if (!isDrag) { | ||
holdOffOnToggle = false; | ||
initialX = 0; | ||
initialY = 0; | ||
} | ||
}, true); | ||
} | ||
/** | ||
* attaches click handlers to background & book | ||
* @param { object } br - BookReader instance | ||
*/ | ||
function registerClickHandlers(br) { | ||
var background = document.querySelector('.BookReader'); | ||
if (!background) { | ||
return; | ||
} | ||
background.addEventListener('click', onBackgroundClick.bind(null, br), { | ||
capture: true, | ||
passive: true | ||
}); | ||
var desk = document.querySelector('.BRcontainer') || {}; | ||
var book = desk.firstChild; | ||
if (book) { | ||
book.addEventListener('click', onBookClick.bind(null, br), true); | ||
registerDragHandlers(); | ||
} | ||
} | ||
/** | ||
* Install menu toggle | ||
* attaches event handlers, sets up DOM on load | ||
*/ | ||
var installMenuToggle = function installMenuToggle(br) { | ||
var hasNav = false; | ||
try { | ||
hasNav = br.navigationIsVisible(); | ||
} catch (error) { | ||
hasNav = false; | ||
} | ||
if (!hasNav) { | ||
return; | ||
} | ||
var menuToggleEventRegister = function menuToggleEventRegister(e) { | ||
registerClickHandlers(br); | ||
}; | ||
var setupDOMandHandlers = function setupDOMandHandlers(e) { | ||
setupNavForToggle(br); | ||
}; | ||
var persistNav = function persistNav(e) { | ||
alwaysShowNav(br); | ||
}; | ||
var whenToToggleNav = ['BookReader:1PageViewSelected', 'BookReader:2PageViewSelected', 'BookReader:zoomIn', 'BookReader:zoomOut', 'BookReader:resize']; | ||
var whenTolwaysShowNavWhen = ['BookReader:3PageViewSelected']; | ||
$(document).on(whenTolwaysShowNavWhen.join(' '), persistNav); | ||
$(document).on(whenToToggleNav.join(' '), menuToggleEventRegister); | ||
$(window).on('orientationchange', menuToggleEventRegister); | ||
$(document).on('BookReader:fullscreenToggled', setupDOMandHandlers); | ||
$(window).on('DOMContentLoaded', setupDOMandHandlers); | ||
setupDOMandHandlers(); | ||
}; | ||
/** | ||
* Add to BookReader | ||
*/ | ||
BookReader.prototype.setup = function (super_) { | ||
return function (options) { | ||
super_.call(this, options); | ||
}; | ||
}(BookReader.prototype.setup); | ||
/** | ||
* Initialize plugin | ||
*/ | ||
BookReader.prototype.init = function (super_) { | ||
return function () { | ||
super_.call(this); | ||
if (this.options.enableMenuToggle) { | ||
installMenuToggle(this); | ||
} | ||
}; | ||
}(BookReader.prototype.init); | ||
})(); | ||
/***/ }) | ||
}, | ||
0,[["./src/js/plugins/menu_toggle/plugin.menu_toggle.js","BookReader.js"]]]); | ||
//# sourceMappingURL=plugin.menu_toggle.js.map |
@@ -1,2 +0,296 @@ | ||
(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[111],{5703:function(e,n,t){"use strict";t(2222),t(7327),t(9826),t(9554);var a,o=t(7112),i=t(3609),r=t(3609),s=[{filter:"grayscale(100%)",label:"Grayscale"},{filter:"brightness(120%)",label:"High brightness"},{filter:"invert(100%)",label:"Inverted (dark mode)"},{filter:"contrast(120%)",label:"High contrast"}];i.extend(BookReader.defaultOptions,{enableMobileNav:!0,mobileNavTitle:"Internet Archive",mobileNavFullscreenOnly:!1}),BookReader.prototype.setup=(a=BookReader.prototype.setup,function(e){a.call(this,e),this.enableMobileNav=e.enableMobileNav,this.mobileNavTitle=e.mobileNavTitle,this.mobileNavFullscreenOnly=e.mobileNavFullscreenOnly,this.refs.$mmenu=null}),BookReader.prototype.initToolbar=function(e){return function(n,t){var a,i=this;if(this.enableMobileNav){var s=this.buildMobileDrawerElement();this.refs.$br.append(s),this.buildInfoDiv(this.$(".BRmobileInfo")),this.buildShareDiv(this.$(".BRmobileShare")),(a=s).mmenu({navbars:[{position:"top"}],navbar:{add:!0,title:this.mobileNavTitle,titleLink:"panel"},extensions:["panelshadow"]},{offCanvas:{wrapPageIfNeeded:!1,zposition:"next",pageSelector:this.el}});var c=a.find(".BRpageviewValue");a.data("mmenu").bind("opened",(function(){c.length&&c.val(window.location.href)})),s.find(".BRcheckbox-filters").click((function(){return l(s,i)})),s.find(".DrawerLayoutButton.one_page_mode").click((function(){return i.switchMode(i.constMode1up)})),s.find(".DrawerLayoutButton.two_page_mode").click((function(){return i.switchMode(i.constMode2up)})),s.find(".DrawerLayoutButton.thumbnail_mode").click((function(){return i.switchMode(i.constModeThumb)})),this.mobileNavFullscreenOnly?r(document.body).addClass("BRbodyMobileNavEnabledFullscreen"):r(document.body).addClass("BRbodyMobileNavEnabled"),this.refs.$mmenu=a}if(e.apply(this,arguments),this.enableMobileNav){this.$(".BRmobileHamburger").click((function(){a.data("mmenu").getInstance().vars.opened?a.data("mmenu").close():(a.data("mmenu").open(),i.trigger("mobileNavOpen"))}));var u=function(e){var n=r(window).width();a.data("mmenu").getInstance().vars.opened&&n>=800&&a.data("mmenu").close()};window.addEventListener("resize",o.debounce(u,900))}}}(BookReader.prototype.initToolbar),BookReader.prototype.buildToolbarElement=function(e){return function(){var n=e.call(this);if(this.enableMobileNav){var t=BookReader.util.escapeHTML(this.bookTitle),a='\n <span class="BRmobileHamburgerWrapper">\n <button class="BRmobileHamburger"></button>\n <span class="BRtoolbarMobileTitle" title="'.concat(t,'">').concat(t,"</span>\n </span>\n ");n.addClass("responsive").prepend(r(a))}return n}}(BookReader.prototype.buildToolbarElement),BookReader.prototype.buildMobileDrawerElement=function(){var e="";this.enableExperimentalControls&&(e='\n <p class="DrawerSettingsTitle">Visual Adjustment</p>\n <div class="BRcheckbox-group-filters">\n ',s.forEach((function(n,t){var a='\n <input type="checkbox" class="BRcheckbox-filters" id="filter'.concat(t,'">\n <label for="filter').concat(t,'" class="BRcheckbox-label-filters">').concat(n.label,"</label><br>\n \n ");e=e.concat(a)})),e=e.concat("</div>"));var n='\n <span>\n <span class="DrawerIconWrapper">\n <img class="DrawerIcon" src="'.concat("".concat(this.imagesBaseURL,"icon_gear.svg"),'" alt="settings-icon"/>\n </span>\n Settings\n </span>\n <div class=DrawerSettingsWrapper>\n <div class="DrawerSettingsLayoutWrapper">\n <button class="DrawerLayoutButton one_page_mode">\n <img src="',this.imagesBaseURL,'icon_one_page.svg" alt="Single Page"/>\n <br>\n One Page\n </button>\n <button class="DrawerLayoutButton two_page_mode TwoPagesButton">\n <img src="').concat(this.imagesBaseURL,'icon_two_pages.svg" alt="Two Pages"/>\n <br>\n Two Pages\n </button>\n <button class="DrawerLayoutButton thumbnail_mode">\n <img src="').concat(this.imagesBaseURL,'icon_thumbnails.svg" alt="Thumbnails"/>\n <br>\n Thumbnails\n </button>\n </div>\n <br>\n <div class="DrawerSettingsTitle">Zoom</div>\n <button class=\'BRicon zoom_out\'></button>\n <button class=\'BRicon zoom_in\'></button>\n <br style="clear:both"><br><br>\n ').concat(e,"\n </div>\n "),t='\n <span>\n <span class="DrawerIconWrapper ">\n <img class="DrawerIcon" src="'.concat(this.imagesBaseURL,'icon_info.svg" alt="info-icon"/>\n </span>\n About This Book\n </span>\n <div class="BRmobileInfo"></div>\n '),a='\n <span>\n <span class="DrawerIconWrapper">\n <img class="DrawerIcon" src="'.concat(this.imagesBaseURL,'icon_share.svg" alt="info-share"/>\n </span>\n Share This Book\n </span>\n <div class="BRmobileShare"></div>\n '),o='\n <nav id="BRmobileMenu" class="BRmobileMenu">\n <ul>\n <li class="BRmobileMenu__settings">'.concat(n,'</li>\n <li class="BRmobileMenu__moreInfoRow">').concat(t,'</li>\n <li class="BRmobileMenu__share">').concat(a,"</li>\n </ul>\n </nav>\n ");return r(o)},BookReader.prototype.$=function(e){return function(n){var t=e.call(this,n);return this.refs.$mmenu&&(t=t.add(this.refs.$mmenu.find(n))),t}}(BookReader.prototype.$);var l=function(e,n){var t="";r(".BRcheckbox-filters").each((function(e,a){n.refs.$br.removeClass("filter-applied"),r(a).is(":checked")&&(n.refs.$br.addClass(r(a).attr("filter-applied")),t+=s[e].filter)}));var a=r("#filtersStyle")[0]||document.createElement("style");a.id="filtersStyle",a.innerHTML=".BRpagecontainer img {\n filter: ".concat(t,";\n -webkit-filter: ").concat(t,";}"),document.body.appendChild(a)}},8533:function(e,n,t){"use strict";var a=t(2092).forEach,o=t(9341),i=t(9207),r=o("forEach"),s=i("forEach");e.exports=r&&s?[].forEach:function(e){return a(this,e,arguments.length>1?arguments[1]:void 0)}},9554:function(e,n,t){"use strict";var a=t(2109),o=t(8533);a({target:"Array",proto:!0,forced:[].forEach!=o},{forEach:o})}},0,[[5703,898]]]); | ||
(self["webpackChunk_internetarchive_bookreader"] = self["webpackChunk_internetarchive_bookreader"] || []).push([["plugins/plugin.mobile_nav.js"],{ | ||
/***/ "./src/js/plugins/plugin.mobile_nav.js": | ||
/*!*********************************************!*\ | ||
!*** ./src/js/plugins/plugin.mobile_nav.js ***! | ||
\*********************************************/ | ||
/*! namespace exports */ | ||
/*! exports [not provided] [no usage info] */ | ||
/*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.* */ | ||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
__webpack_require__.r(__webpack_exports__); | ||
/* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat */ "./node_modules/core-js/modules/es.array.concat.js"); | ||
/* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__); | ||
/* harmony import */ var core_js_modules_es_array_filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.filter */ "./node_modules/core-js/modules/es.array.filter.js"); | ||
/* harmony import */ var core_js_modules_es_array_filter__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_filter__WEBPACK_IMPORTED_MODULE_1__); | ||
/* harmony import */ var core_js_modules_es_array_find__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.array.find */ "./node_modules/core-js/modules/es.array.find.js"); | ||
/* harmony import */ var core_js_modules_es_array_find__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_find__WEBPACK_IMPORTED_MODULE_2__); | ||
/* harmony import */ var core_js_modules_es_array_for_each__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.array.for-each */ "./node_modules/core-js/modules/es.array.for-each.js"); | ||
/* harmony import */ var core_js_modules_es_array_for_each__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_for_each__WEBPACK_IMPORTED_MODULE_3__); | ||
/* harmony import */ var _BookReader_utils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../BookReader/utils.js */ "./src/js/BookReader/utils.js"); | ||
/* provided dependency */ var jQuery = __webpack_require__(/*! jquery */ "jquery"); | ||
/* provided dependency */ var $ = __webpack_require__(/*! jquery */ "jquery"); | ||
/* global BookReader */ | ||
/** | ||
* Adds mobile navigation at responsive breakpoint | ||
* NOTE additional script and style tags must be included. | ||
* | ||
* <script src="../BookReader/mmenu/dist/js/jquery.mmenu.min.js"></script> | ||
* <script src="../BookReader/mmenu/dist/addons/navbars/jquery.mmenu.navbars.min.js"></script> | ||
* <link rel="stylesheet" href="../BookReader/mmenu/dist/css/jquery.mmenu.css" /> | ||
* <link rel="stylesheet" href="../BookReader/mmenu/dist/addons/navbars/jquery.mmenu.navbars.css" /> | ||
*/ | ||
//contains all filters and labels for checkboxs | ||
var FILTERLIST = [{ | ||
filter: "grayscale(100%)", | ||
label: "Grayscale" | ||
}, { | ||
filter: "brightness(120%)", | ||
label: "High brightness" | ||
}, { | ||
filter: "invert(100%)", | ||
label: "Inverted (dark mode)" | ||
}, { | ||
filter: "contrast(120%)", | ||
label: "High contrast" | ||
}]; | ||
jQuery.extend(BookReader.defaultOptions, { | ||
enableMobileNav: true, | ||
mobileNavTitle: 'Internet Archive', | ||
mobileNavFullscreenOnly: false | ||
}); | ||
BookReader.prototype.setup = function (super_) { | ||
return function (options) { | ||
super_.call(this, options); | ||
this.enableMobileNav = options.enableMobileNav; | ||
this.mobileNavTitle = options.mobileNavTitle; | ||
this.mobileNavFullscreenOnly = options.mobileNavFullscreenOnly; | ||
this.refs.$mmenu = null; | ||
}; | ||
}(BookReader.prototype.setup); // Extend initToolbar | ||
BookReader.prototype.initToolbar = function (super_) { | ||
return function (mode, ui) { | ||
var _this = this; | ||
var $mmenuEl; | ||
if (this.enableMobileNav) { | ||
var $drawerEl = this.buildMobileDrawerElement(); | ||
this.refs.$br.append($drawerEl); // Render info into mobile info before mmenu | ||
this.buildInfoDiv(this.$('.BRmobileInfo')); | ||
this.buildShareDiv(this.$('.BRmobileShare')); | ||
$mmenuEl = $drawerEl; | ||
$mmenuEl.mmenu({ | ||
navbars: [{ | ||
"position": "top" | ||
}], | ||
navbar: { | ||
add: true, | ||
title: this.mobileNavTitle, | ||
titleLink: 'panel' | ||
}, | ||
extensions: ["panelshadow"] | ||
}, { | ||
offCanvas: { | ||
wrapPageIfNeeded: false, | ||
zposition: 'next', | ||
pageSelector: this.el | ||
} | ||
}); | ||
var $BRpageviewField = $mmenuEl.find('.BRpageviewValue'); | ||
$mmenuEl.data('mmenu').bind('opened', function () { | ||
// Update "Link to this page view" link | ||
if ($BRpageviewField.length) { | ||
$BRpageviewField.val(window.location.href); | ||
} | ||
}); //apply filters when checkboxs clicked | ||
$drawerEl.find('.BRcheckbox-filters').click(function () { | ||
return applyFilters($drawerEl, _this); | ||
}); // Bind mobile switch buttons | ||
$drawerEl.find('.DrawerLayoutButton.one_page_mode').click(function () { | ||
return _this.switchMode(_this.constMode1up); | ||
}); | ||
$drawerEl.find('.DrawerLayoutButton.two_page_mode').click(function () { | ||
return _this.switchMode(_this.constMode2up); | ||
}); | ||
$drawerEl.find('.DrawerLayoutButton.thumbnail_mode').click(function () { | ||
return _this.switchMode(_this.constModeThumb); | ||
}); | ||
if (this.mobileNavFullscreenOnly) { | ||
$(document.body).addClass('BRbodyMobileNavEnabledFullscreen'); | ||
} else { | ||
$(document.body).addClass('BRbodyMobileNavEnabled'); | ||
} | ||
this.refs.$mmenu = $mmenuEl; | ||
} // Call the parent method at the end, because it binds events to DOM | ||
super_.apply(this, arguments); | ||
if (this.enableMobileNav) { | ||
// Need to bind more, console after toolbar is initialized | ||
this.$('.BRmobileHamburger').click(function () { | ||
if ($mmenuEl.data('mmenu').getInstance().vars.opened) { | ||
$mmenuEl.data('mmenu').close(); | ||
} else { | ||
$mmenuEl.data('mmenu').open(); | ||
_this.trigger("mobileNavOpen"); | ||
} | ||
}); | ||
var closeMobileMenu = function closeMobileMenu(e) { | ||
// Need to close the mobile menu to reset DOM & Style | ||
// driven by menu plugin | ||
var width = $(window).width(); | ||
var mobileMenuIsOpen = $mmenuEl.data('mmenu').getInstance().vars.opened; // $brBreakPointMobile: 800px; | ||
if (mobileMenuIsOpen && width >= 800) { | ||
$mmenuEl.data('mmenu').close(); | ||
} | ||
}; | ||
window.addEventListener('resize', _BookReader_utils_js__WEBPACK_IMPORTED_MODULE_4__.debounce(closeMobileMenu, 900)); | ||
} | ||
}; | ||
}(BookReader.prototype.initToolbar); | ||
BookReader.prototype.buildToolbarElement = function (super_) { | ||
return function () { | ||
var $el = super_.call(this); | ||
if (this.enableMobileNav) { | ||
var escapedTitle = BookReader.util.escapeHTML(this.bookTitle); | ||
var toolbar = "\n <span class=\"BRmobileHamburgerWrapper\">\n <button class=\"BRmobileHamburger\"></button>\n <span class=\"BRtoolbarMobileTitle\" title=\"".concat(escapedTitle, "\">").concat(escapedTitle, "</span>\n </span>\n "); | ||
$el.addClass('responsive').prepend($(toolbar)); | ||
} | ||
return $el; | ||
}; | ||
}(BookReader.prototype.buildToolbarElement); | ||
/** | ||
* This method builds the html for the mobile drawer. It can be decorated to | ||
* extend the default drawer. | ||
* @return {jqueryElement} | ||
*/ | ||
BookReader.prototype.buildMobileDrawerElement = function () { | ||
var experimentalHtml = ''; //builds filters checkbox html | ||
if (this.enableExperimentalControls) { | ||
experimentalHtml = "\n <p class=\"DrawerSettingsTitle\">Visual Adjustment</p>\n <div class=\"BRcheckbox-group-filters\">\n "; | ||
FILTERLIST.forEach(function (el, i) { | ||
var checkboxHtml = "\n <input type=\"checkbox\" class=\"BRcheckbox-filters\" id=\"filter".concat(i, "\">\n <label for=\"filter").concat(i, "\" class=\"BRcheckbox-label-filters\">").concat(el.label, "</label><br>\n \n "); | ||
experimentalHtml = experimentalHtml.concat(checkboxHtml); | ||
}); | ||
experimentalHtml = experimentalHtml.concat("</div>"); | ||
} | ||
var settingsSection = "\n <span>\n <span class=\"DrawerIconWrapper\">\n <img class=\"DrawerIcon\" src=\"".concat("".concat(this.imagesBaseURL, "icon_gear.svg"), "\" alt=\"settings-icon\"/>\n </span>\n Settings\n </span>\n <div class=DrawerSettingsWrapper>\n <div class=\"DrawerSettingsLayoutWrapper\">\n <button class=\"DrawerLayoutButton one_page_mode\">\n <img src=\"", this.imagesBaseURL, "icon_one_page.svg\" alt=\"Single Page\"/>\n <br>\n One Page\n </button>\n <button class=\"DrawerLayoutButton two_page_mode TwoPagesButton\">\n <img src=\"").concat(this.imagesBaseURL, "icon_two_pages.svg\" alt=\"Two Pages\"/>\n <br>\n Two Pages\n </button>\n <button class=\"DrawerLayoutButton thumbnail_mode\">\n <img src=\"").concat(this.imagesBaseURL, "icon_thumbnails.svg\" alt=\"Thumbnails\"/>\n <br>\n Thumbnails\n </button>\n </div>\n <br>\n <div class=\"DrawerSettingsTitle\">Zoom</div>\n <button class='BRicon zoom_out'></button>\n <button class='BRicon zoom_in'></button>\n <br style=\"clear:both\"><br><br>\n ").concat(experimentalHtml, "\n </div>\n "); | ||
var moreInfo = "\n <span>\n <span class=\"DrawerIconWrapper \">\n <img class=\"DrawerIcon\" src=\"".concat(this.imagesBaseURL, "icon_info.svg\" alt=\"info-icon\"/>\n </span>\n About This Book\n </span>\n <div class=\"BRmobileInfo\"></div>\n "); | ||
var share = "\n <span>\n <span class=\"DrawerIconWrapper\">\n <img class=\"DrawerIcon\" src=\"".concat(this.imagesBaseURL, "icon_share.svg\" alt=\"info-share\"/>\n </span>\n Share This Book\n </span>\n <div class=\"BRmobileShare\"></div>\n "); | ||
var navMenu = "\n <nav id=\"BRmobileMenu\" class=\"BRmobileMenu\">\n <ul>\n <li class=\"BRmobileMenu__settings\">".concat(settingsSection, "</li>\n <li class=\"BRmobileMenu__moreInfoRow\">").concat(moreInfo, "</li>\n <li class=\"BRmobileMenu__share\">").concat(share, "</li>\n </ul>\n </nav>\n "); | ||
var $el = $(navMenu); | ||
return $el; | ||
}; | ||
/** | ||
* Mmenu moves itself out side of the root BookReader element, so we need to | ||
* include it in the scoped $ function. | ||
*/ | ||
BookReader.prototype.$ = function (super_) { | ||
return function (arg) { | ||
var $results = super_.call(this, arg); | ||
if (this.refs.$mmenu) { | ||
$results = $results.add(this.refs.$mmenu.find(arg)); | ||
} | ||
return $results; | ||
}; | ||
}(BookReader.prototype.$); | ||
/** | ||
* Dynamically creates styles combining different filters for BookReaders imgs | ||
* based on filters checkbox | ||
*/ | ||
var applyFilters = function applyFilters(drawerEl, br) { | ||
var filterStr = ""; | ||
$('.BRcheckbox-filters').each(function (i, el) { | ||
br.refs.$br.removeClass("filter-applied"); | ||
if ($(el).is(':checked')) { | ||
br.refs.$br.addClass($(el).attr("filter-applied")); | ||
filterStr = filterStr + FILTERLIST[i].filter; | ||
} | ||
}); | ||
var filtersSheet = $("#filtersStyle")[0] || document.createElement('style'); | ||
filtersSheet.id = "filtersStyle"; | ||
filtersSheet.innerHTML = ".BRpagecontainer img {\n filter: ".concat(filterStr, ";\n -webkit-filter: ").concat(filterStr, ";}"); | ||
document.body.appendChild(filtersSheet); | ||
}; | ||
/***/ }), | ||
/***/ "./node_modules/core-js/internals/array-for-each.js": | ||
/*!**********************************************************!*\ | ||
!*** ./node_modules/core-js/internals/array-for-each.js ***! | ||
\**********************************************************/ | ||
/*! unknown exports (runtime-defined) */ | ||
/*! runtime requirements: __webpack_require__, module */ | ||
/*! CommonJS bailout: module.exports is used directly at 11:0-14 */ | ||
/***/ (function(module, __unused_webpack_exports, __webpack_require__) { | ||
"use strict"; | ||
var $forEach = __webpack_require__(/*! ../internals/array-iteration */ "./node_modules/core-js/internals/array-iteration.js").forEach; | ||
var arrayMethodIsStrict = __webpack_require__(/*! ../internals/array-method-is-strict */ "./node_modules/core-js/internals/array-method-is-strict.js"); | ||
var arrayMethodUsesToLength = __webpack_require__(/*! ../internals/array-method-uses-to-length */ "./node_modules/core-js/internals/array-method-uses-to-length.js"); | ||
var STRICT_METHOD = arrayMethodIsStrict('forEach'); | ||
var USES_TO_LENGTH = arrayMethodUsesToLength('forEach'); | ||
// `Array.prototype.forEach` method implementation | ||
// https://tc39.github.io/ecma262/#sec-array.prototype.foreach | ||
module.exports = (!STRICT_METHOD || !USES_TO_LENGTH) ? function forEach(callbackfn /* , thisArg */) { | ||
return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); | ||
} : [].forEach; | ||
/***/ }), | ||
/***/ "./node_modules/core-js/modules/es.array.for-each.js": | ||
/*!***********************************************************!*\ | ||
!*** ./node_modules/core-js/modules/es.array.for-each.js ***! | ||
\***********************************************************/ | ||
/*! unknown exports (runtime-defined) */ | ||
/*! runtime requirements: __webpack_require__ */ | ||
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { | ||
"use strict"; | ||
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js"); | ||
var forEach = __webpack_require__(/*! ../internals/array-for-each */ "./node_modules/core-js/internals/array-for-each.js"); | ||
// `Array.prototype.forEach` method | ||
// https://tc39.github.io/ecma262/#sec-array.prototype.foreach | ||
$({ target: 'Array', proto: true, forced: [].forEach != forEach }, { | ||
forEach: forEach | ||
}); | ||
/***/ }) | ||
}, | ||
0,[["./src/js/plugins/plugin.mobile_nav.js","BookReader.js"]]]); | ||
//# sourceMappingURL=plugin.mobile_nav.js.map |
@@ -1,2 +0,330 @@ | ||
(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[485],{8684:function(t,e,r){"use strict";var i;r(4603),r(4916),r(9714),r(4723),r(5306),r(3609).extend(BookReader.defaultOptions,{imageFormat:"jp2",subPrefix:"",server:"",zip:""}),BookReader.prototype.setup=(i=BookReader.prototype.setup,function(t){i.call(this,t),this.imageFormat=t.imageFormat,this.subPrefix=t.subPrefix,this.server=t.server,this.zip=t.zip}),BookReader.prototype.printPage=function(){window.open(this.getPrintURI(),"printpage","width=400, height=500, resizable=yes, scrollbars=no, toolbar=no, location=no")},BookReader.prototype.getPrintURI=function(){var t;t=this.constMode2up===this.mode?this.twoPage.currentIndexL:this.firstIndex;var e="id="+this.subPrefix+"&server="+this.server+"&zip="+this.zip+"&format="+this.imageFormat+"&file="+this.getPageFile(t)+"&width="+this._getPageWidth(t)+"&height="+this._getPageHeight(t);return this.constMode2up===this.mode?(e+="&file2="+this.getPageFile(this.twoPage.currentIndexR)+"&width2="+this._getPageWidth(this.twoPage.currentIndexR),e+="&height2="+this._getPageHeight(this.twoPage.currentIndexR),e+="&title="+encodeURIComponent(this.shortTitle(50)+" - Pages "+this.getPageNum(this.twoPage.currentIndexL)+", "+this.getPageNum(this.twoPage.currentIndexR))):e+="&title="+encodeURIComponent(this.shortTitle(50)+" - Page "+this.getPageNum(t)),"/bookreader/print.php?"+e},BookReader.prototype.getPageFile=function(t){if(null===t)return"";var e=String(t),r=new RegExp("0{"+e.length+"}$"),i=this.subPrefix.match("[^/]+$");return i+"_"+this.imageFormat+"/"+i+"_"+"0000".replace(r,e)+"."+this.imageFormat}},9587:function(t,e,r){var i=r(111),n=r(7674);t.exports=function(t,e,r){var o,a;return n&&"function"==typeof(o=e.constructor)&&o!==r&&i(a=o.prototype)&&a!==r.prototype&&n(t,a),t}},6340:function(t,e,r){"use strict";var i=r(5005),n=r(3070),o=r(5112),a=r(9781),s=o("species");t.exports=function(t){var e=i(t),r=n.f;a&&e&&!e[s]&&r(e,s,{configurable:!0,get:function(){return this}})}},4603:function(t,e,r){var i=r(9781),n=r(7854),o=r(4705),a=r(9587),s=r(3070).f,u=r(8006).f,h=r(7850),c=r(7066),g=r(2999),p=r(1320),f=r(7293),l=r(9909).set,d=r(6340),v=r(5112)("match"),P=n.RegExp,x=P.prototype,m=/a/g,R=/a/g,w=new P(m)!==m,b=g.UNSUPPORTED_Y;if(i&&o("RegExp",!w||b||f((function(){return R[v]=!1,P(m)!=m||P(R)==R||"/a/i"!=P(m,"i")})))){for(var k=function(t,e){var r,i=this instanceof k,n=h(t),o=void 0===e;if(!i&&n&&t.constructor===k&&o)return t;w?n&&!o&&(t=t.source):t instanceof k&&(o&&(e=c.call(t)),t=t.source),b&&(r=!!e&&e.indexOf("y")>-1)&&(e=e.replace(/y/g,""));var s=a(w?new P(t,e):P(t,e),i?this:x,k);return b&&r&&l(s,{sticky:r}),s},y=function(t){t in k||s(k,t,{configurable:!0,get:function(){return P[t]},set:function(e){P[t]=e}})},I=u(P),_=0;I.length>_;)y(I[_++]);x.constructor=k,k.prototype=x,p(n,"RegExp",k)}d("RegExp")},4723:function(t,e,r){"use strict";var i=r(7007),n=r(9670),o=r(7466),a=r(4488),s=r(1530),u=r(7651);i("match",1,(function(t,e,r){return[function(e){var r=a(this),i=null==e?void 0:e[t];return void 0!==i?i.call(e,r):new RegExp(e)[t](String(r))},function(t){var i=r(e,t,this);if(i.done)return i.value;var a=n(t),h=String(this);if(!a.global)return u(a,h);var c=a.unicode;a.lastIndex=0;for(var g,p=[],f=0;null!==(g=u(a,h));){var l=String(g[0]);p[f]=l,""===l&&(a.lastIndex=s(h,o(a.lastIndex),c)),f++}return 0===f?null:p}]}))}},0,[[8684,898]]]); | ||
(self["webpackChunk_internetarchive_bookreader"] = self["webpackChunk_internetarchive_bookreader"] || []).push([["plugins/plugin.print.js"],{ | ||
/***/ "./src/js/plugins/plugin.print.js": | ||
/*!****************************************!*\ | ||
!*** ./src/js/plugins/plugin.print.js ***! | ||
\****************************************/ | ||
/*! namespace exports */ | ||
/*! exports [not provided] [no usage info] */ | ||
/*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.* */ | ||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
__webpack_require__.r(__webpack_exports__); | ||
/* harmony import */ var core_js_modules_es_regexp_constructor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.regexp.constructor */ "./node_modules/core-js/modules/es.regexp.constructor.js"); | ||
/* harmony import */ var core_js_modules_es_regexp_constructor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_constructor__WEBPACK_IMPORTED_MODULE_0__); | ||
/* harmony import */ var core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.regexp.exec */ "./node_modules/core-js/modules/es.regexp.exec.js"); | ||
/* harmony import */ var core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_1__); | ||
/* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.regexp.to-string */ "./node_modules/core-js/modules/es.regexp.to-string.js"); | ||
/* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_2__); | ||
/* harmony import */ var core_js_modules_es_string_match__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.string.match */ "./node_modules/core-js/modules/es.string.match.js"); | ||
/* harmony import */ var core_js_modules_es_string_match__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_match__WEBPACK_IMPORTED_MODULE_3__); | ||
/* harmony import */ var core_js_modules_es_string_replace__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.string.replace */ "./node_modules/core-js/modules/es.string.replace.js"); | ||
/* harmony import */ var core_js_modules_es_string_replace__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_replace__WEBPACK_IMPORTED_MODULE_4__); | ||
/* provided dependency */ var jQuery = __webpack_require__(/*! jquery */ "jquery"); | ||
/* global BookReader */ | ||
/** | ||
* Plugin which used to print book images. | ||
*/ | ||
jQuery.extend(BookReader.defaultOptions, { | ||
imageFormat: 'jp2', | ||
subPrefix: '', | ||
server: '', | ||
zip: '' | ||
}); | ||
/** @override */ | ||
BookReader.prototype.setup = function (super_) { | ||
return function (options) { | ||
super_.call(this, options); | ||
this.imageFormat = options.imageFormat; | ||
this.subPrefix = options.subPrefix; | ||
this.server = options.server; | ||
this.zip = options.zip; | ||
}; | ||
}(BookReader.prototype.setup); | ||
/** | ||
* Print page of any book item | ||
*/ | ||
BookReader.prototype.printPage = function () { | ||
window.open(this.getPrintURI(), 'printpage', 'width=400, height=500, resizable=yes, scrollbars=no, toolbar=no, location=no'); | ||
}; | ||
/** | ||
* Generate print URL from current indices and mode | ||
* | ||
* @returns {string} URL | ||
*/ | ||
BookReader.prototype.getPrintURI = function () { | ||
var indexToPrint; | ||
if (this.constMode2up === this.mode) { | ||
indexToPrint = this.twoPage.currentIndexL; | ||
} else { | ||
indexToPrint = this.firstIndex; // $$$ the index in the middle of the viewport would make more sense | ||
} | ||
var options = 'id=' + this.subPrefix + '&server=' + this.server + '&zip=' + this.zip + '&format=' + this.imageFormat + '&file=' + this.getPageFile(indexToPrint) + '&width=' + this._getPageWidth(indexToPrint) + '&height=' + this._getPageHeight(indexToPrint); | ||
if (this.constMode2up === this.mode) { | ||
options += '&file2=' + this.getPageFile(this.twoPage.currentIndexR) + '&width2=' + this._getPageWidth(this.twoPage.currentIndexR); | ||
options += '&height2=' + this._getPageHeight(this.twoPage.currentIndexR); | ||
options += '&title=' + encodeURIComponent(this.shortTitle(50) + ' - Pages ' + this.getPageNum(this.twoPage.currentIndexL) + ', ' + this.getPageNum(this.twoPage.currentIndexR)); | ||
} else { | ||
options += '&title=' + encodeURIComponent(this.shortTitle(50) + ' - Page ' + this.getPageNum(indexToPrint)); | ||
} | ||
return '/bookreader/print.php?' + options; | ||
}; | ||
/** | ||
* Get file from lead index to create print URL | ||
* | ||
* @returns {null|string} | ||
*/ | ||
BookReader.prototype.getPageFile = function (index) { | ||
if (index === null) { | ||
return ''; | ||
} | ||
var leafStr = '0000'; | ||
var imgStr = String(index); // String(this._leafMap[index]); // if index != leafNum | ||
var re = new RegExp("0{" + imgStr.length + "}$"); | ||
var insideZipPrefix = this.subPrefix.match('[^/]+$'); | ||
var file = insideZipPrefix + '_' + this.imageFormat + '/' + insideZipPrefix + '_' + leafStr.replace(re, imgStr) + '.' + this.imageFormat; | ||
return file; | ||
}; | ||
/***/ }), | ||
/***/ "./node_modules/core-js/internals/inherit-if-required.js": | ||
/*!***************************************************************!*\ | ||
!*** ./node_modules/core-js/internals/inherit-if-required.js ***! | ||
\***************************************************************/ | ||
/*! unknown exports (runtime-defined) */ | ||
/*! runtime requirements: module, __webpack_require__ */ | ||
/*! CommonJS bailout: module.exports is used directly at 5:0-14 */ | ||
/***/ (function(module, __unused_webpack_exports, __webpack_require__) { | ||
var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js"); | ||
var setPrototypeOf = __webpack_require__(/*! ../internals/object-set-prototype-of */ "./node_modules/core-js/internals/object-set-prototype-of.js"); | ||
// makes subclassing work correct for wrapped built-ins | ||
module.exports = function ($this, dummy, Wrapper) { | ||
var NewTarget, NewTargetPrototype; | ||
if ( | ||
// it can work only with native `setPrototypeOf` | ||
setPrototypeOf && | ||
// we haven't completely correct pre-ES6 way for getting `new.target`, so use this | ||
typeof (NewTarget = dummy.constructor) == 'function' && | ||
NewTarget !== Wrapper && | ||
isObject(NewTargetPrototype = NewTarget.prototype) && | ||
NewTargetPrototype !== Wrapper.prototype | ||
) setPrototypeOf($this, NewTargetPrototype); | ||
return $this; | ||
}; | ||
/***/ }), | ||
/***/ "./node_modules/core-js/internals/set-species.js": | ||
/*!*******************************************************!*\ | ||
!*** ./node_modules/core-js/internals/set-species.js ***! | ||
\*******************************************************/ | ||
/*! unknown exports (runtime-defined) */ | ||
/*! runtime requirements: module, __webpack_require__ */ | ||
/*! CommonJS bailout: module.exports is used directly at 9:0-14 */ | ||
/***/ (function(module, __unused_webpack_exports, __webpack_require__) { | ||
"use strict"; | ||
var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "./node_modules/core-js/internals/get-built-in.js"); | ||
var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js"); | ||
var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js"); | ||
var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js"); | ||
var SPECIES = wellKnownSymbol('species'); | ||
module.exports = function (CONSTRUCTOR_NAME) { | ||
var Constructor = getBuiltIn(CONSTRUCTOR_NAME); | ||
var defineProperty = definePropertyModule.f; | ||
if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) { | ||
defineProperty(Constructor, SPECIES, { | ||
configurable: true, | ||
get: function () { return this; } | ||
}); | ||
} | ||
}; | ||
/***/ }), | ||
/***/ "./node_modules/core-js/modules/es.regexp.constructor.js": | ||
/*!***************************************************************!*\ | ||
!*** ./node_modules/core-js/modules/es.regexp.constructor.js ***! | ||
\***************************************************************/ | ||
/*! unknown exports (runtime-defined) */ | ||
/*! runtime requirements: __webpack_require__ */ | ||
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { | ||
var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js"); | ||
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js"); | ||
var isForced = __webpack_require__(/*! ../internals/is-forced */ "./node_modules/core-js/internals/is-forced.js"); | ||
var inheritIfRequired = __webpack_require__(/*! ../internals/inherit-if-required */ "./node_modules/core-js/internals/inherit-if-required.js"); | ||
var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js").f; | ||
var getOwnPropertyNames = __webpack_require__(/*! ../internals/object-get-own-property-names */ "./node_modules/core-js/internals/object-get-own-property-names.js").f; | ||
var isRegExp = __webpack_require__(/*! ../internals/is-regexp */ "./node_modules/core-js/internals/is-regexp.js"); | ||
var getFlags = __webpack_require__(/*! ../internals/regexp-flags */ "./node_modules/core-js/internals/regexp-flags.js"); | ||
var stickyHelpers = __webpack_require__(/*! ../internals/regexp-sticky-helpers */ "./node_modules/core-js/internals/regexp-sticky-helpers.js"); | ||
var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/core-js/internals/redefine.js"); | ||
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js"); | ||
var setInternalState = __webpack_require__(/*! ../internals/internal-state */ "./node_modules/core-js/internals/internal-state.js").set; | ||
var setSpecies = __webpack_require__(/*! ../internals/set-species */ "./node_modules/core-js/internals/set-species.js"); | ||
var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js"); | ||
var MATCH = wellKnownSymbol('match'); | ||
var NativeRegExp = global.RegExp; | ||
var RegExpPrototype = NativeRegExp.prototype; | ||
var re1 = /a/g; | ||
var re2 = /a/g; | ||
// "new" should create a new object, old webkit bug | ||
var CORRECT_NEW = new NativeRegExp(re1) !== re1; | ||
var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y; | ||
var FORCED = DESCRIPTORS && isForced('RegExp', (!CORRECT_NEW || UNSUPPORTED_Y || fails(function () { | ||
re2[MATCH] = false; | ||
// RegExp constructor can alter flags and IsRegExp works correct with @@match | ||
return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i'; | ||
}))); | ||
// `RegExp` constructor | ||
// https://tc39.github.io/ecma262/#sec-regexp-constructor | ||
if (FORCED) { | ||
var RegExpWrapper = function RegExp(pattern, flags) { | ||
var thisIsRegExp = this instanceof RegExpWrapper; | ||
var patternIsRegExp = isRegExp(pattern); | ||
var flagsAreUndefined = flags === undefined; | ||
var sticky; | ||
if (!thisIsRegExp && patternIsRegExp && pattern.constructor === RegExpWrapper && flagsAreUndefined) { | ||
return pattern; | ||
} | ||
if (CORRECT_NEW) { | ||
if (patternIsRegExp && !flagsAreUndefined) pattern = pattern.source; | ||
} else if (pattern instanceof RegExpWrapper) { | ||
if (flagsAreUndefined) flags = getFlags.call(pattern); | ||
pattern = pattern.source; | ||
} | ||
if (UNSUPPORTED_Y) { | ||
sticky = !!flags && flags.indexOf('y') > -1; | ||
if (sticky) flags = flags.replace(/y/g, ''); | ||
} | ||
var result = inheritIfRequired( | ||
CORRECT_NEW ? new NativeRegExp(pattern, flags) : NativeRegExp(pattern, flags), | ||
thisIsRegExp ? this : RegExpPrototype, | ||
RegExpWrapper | ||
); | ||
if (UNSUPPORTED_Y && sticky) setInternalState(result, { sticky: sticky }); | ||
return result; | ||
}; | ||
var proxy = function (key) { | ||
key in RegExpWrapper || defineProperty(RegExpWrapper, key, { | ||
configurable: true, | ||
get: function () { return NativeRegExp[key]; }, | ||
set: function (it) { NativeRegExp[key] = it; } | ||
}); | ||
}; | ||
var keys = getOwnPropertyNames(NativeRegExp); | ||
var index = 0; | ||
while (keys.length > index) proxy(keys[index++]); | ||
RegExpPrototype.constructor = RegExpWrapper; | ||
RegExpWrapper.prototype = RegExpPrototype; | ||
redefine(global, 'RegExp', RegExpWrapper); | ||
} | ||
// https://tc39.github.io/ecma262/#sec-get-regexp-@@species | ||
setSpecies('RegExp'); | ||
/***/ }), | ||
/***/ "./node_modules/core-js/modules/es.string.match.js": | ||
/*!*********************************************************!*\ | ||
!*** ./node_modules/core-js/modules/es.string.match.js ***! | ||
\*********************************************************/ | ||
/*! unknown exports (runtime-defined) */ | ||
/*! runtime requirements: __webpack_require__ */ | ||
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { | ||
"use strict"; | ||
var fixRegExpWellKnownSymbolLogic = __webpack_require__(/*! ../internals/fix-regexp-well-known-symbol-logic */ "./node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js"); | ||
var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js"); | ||
var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js"); | ||
var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/core-js/internals/require-object-coercible.js"); | ||
var advanceStringIndex = __webpack_require__(/*! ../internals/advance-string-index */ "./node_modules/core-js/internals/advance-string-index.js"); | ||
var regExpExec = __webpack_require__(/*! ../internals/regexp-exec-abstract */ "./node_modules/core-js/internals/regexp-exec-abstract.js"); | ||
// @@match logic | ||
fixRegExpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCallNative) { | ||
return [ | ||
// `String.prototype.match` method | ||
// https://tc39.github.io/ecma262/#sec-string.prototype.match | ||
function match(regexp) { | ||
var O = requireObjectCoercible(this); | ||
var matcher = regexp == undefined ? undefined : regexp[MATCH]; | ||
return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); | ||
}, | ||
// `RegExp.prototype[@@match]` method | ||
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match | ||
function (regexp) { | ||
var res = maybeCallNative(nativeMatch, regexp, this); | ||
if (res.done) return res.value; | ||
var rx = anObject(regexp); | ||
var S = String(this); | ||
if (!rx.global) return regExpExec(rx, S); | ||
var fullUnicode = rx.unicode; | ||
rx.lastIndex = 0; | ||
var A = []; | ||
var n = 0; | ||
var result; | ||
while ((result = regExpExec(rx, S)) !== null) { | ||
var matchStr = String(result[0]); | ||
A[n] = matchStr; | ||
if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); | ||
n++; | ||
} | ||
return n === 0 ? null : A; | ||
} | ||
]; | ||
}); | ||
/***/ }) | ||
}, | ||
0,[["./src/js/plugins/plugin.print.js","BookReader.js"]]]); | ||
//# sourceMappingURL=plugin.print.js.map |
@@ -1,2 +0,408 @@ | ||
(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[951],{930:function(e,t,n){"use strict";var o={};function r(e){return e&&decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null}function a(e,t,n,o,r,a){return document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+(n?"; expires=".concat(n.toUTCString()):"")+(r?"; domain=".concat(r):"")+(o?"; path=".concat(o):"")+(a?"; secure":""),!0}function i(e,t,n){return!!hasItem(e)&&(document.cookie=encodeURIComponent(e)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT"+(n?"; domain=".concat(n):"")+(t?"; path=".concat(t):""),!0)}n.r(o),n.d(o,{getItem:function(){return r},removeItem:function(){return i},setItem:function(){return a}}),n(4916),n(4723),n(4603),n(9714),n(5306);var u,c=n(3609);BookReader.docCookies=o,c.extend(BookReader.defaultOptions,{enablePageResume:!0,resumeCookiePath:null}),BookReader.prototype.init=(u=BookReader.prototype.init,function(){var e=this;u.call(this),this.options.enablePageResume&&this.bind(BookReader.eventNames.fragmentChange,(function(){var t=e.paramsFromCurrent();e.updateResumeValue(t.index)}))}),BookReader.prototype.getResumeValue=function(){var e=BookReader.docCookies.getItem("br-resume");return null!==e?parseInt(e):null},BookReader.prototype.getCookiePath=function(e){return e.match(".+?(?=/page/|/mode/|$)")[0]},BookReader.prototype.updateResumeValue=function(e,t){var n=new Date(+new Date+12096e5),o=this.options.resumeCookiePath||this.getCookiePath(window.location.pathname);BookReader.docCookies.setItem(t||"br-resume",e,n,o,null,!1)}},9587:function(e,t,n){var o=n(111),r=n(7674);e.exports=function(e,t,n){var a,i;return r&&"function"==typeof(a=t.constructor)&&a!==n&&o(i=a.prototype)&&i!==n.prototype&&r(e,i),e}},6340:function(e,t,n){"use strict";var o=n(5005),r=n(3070),a=n(5112),i=n(9781),u=a("species");e.exports=function(e){var t=o(e),n=r.f;i&&t&&!t[u]&&n(t,u,{configurable:!0,get:function(){return this}})}},4603:function(e,t,n){var o=n(9781),r=n(7854),a=n(4705),i=n(9587),u=n(3070).f,c=n(8006).f,s=n(7850),p=n(7066),f=n(2999),d=n(1320),l=n(7293),m=n(9909).set,h=n(6340),g=n(5112)("match"),v=r.RegExp,k=v.prototype,R=/a/g,C=/a/g,x=new v(R)!==R,I=f.UNSUPPORTED_Y;if(o&&a("RegExp",!x||I||l((function(){return C[g]=!1,v(R)!=R||v(C)==C||"/a/i"!=v(R,"i")})))){for(var y=function(e,t){var n,o=this instanceof y,r=s(e),a=void 0===t;if(!o&&r&&e.constructor===y&&a)return e;x?r&&!a&&(e=e.source):e instanceof y&&(a&&(t=p.call(e)),e=e.source),I&&(n=!!t&&t.indexOf("y")>-1)&&(t=t.replace(/y/g,""));var u=i(x?new v(e,t):v(e,t),o?this:k,y);return I&&n&&m(u,{sticky:n}),u},b=function(e){e in y||u(y,e,{configurable:!0,get:function(){return v[e]},set:function(t){v[e]=t}})},w=c(v),B=0;w.length>B;)b(w[B++]);k.constructor=y,y.prototype=k,d(r,"RegExp",y)}h("RegExp")},4723:function(e,t,n){"use strict";var o=n(7007),r=n(9670),a=n(7466),i=n(4488),u=n(1530),c=n(7651);o("match",1,(function(e,t,n){return[function(t){var n=i(this),o=null==t?void 0:t[e];return void 0!==o?o.call(t,n):new RegExp(t)[e](String(n))},function(e){var o=n(t,e,this);if(o.done)return o.value;var i=r(e),s=String(this);if(!i.global)return c(i,s);var p=i.unicode;i.lastIndex=0;for(var f,d=[],l=0;null!==(f=c(i,s));){var m=String(f[0]);d[l]=m,""===m&&(i.lastIndex=u(s,a(i.lastIndex),p)),l++}return 0===l?null:d}]}))}},0,[[930,898]]]); | ||
(self["webpackChunk_internetarchive_bookreader"] = self["webpackChunk_internetarchive_bookreader"] || []).push([["plugins/plugin.resume.js"],{ | ||
/***/ "./src/js/plugins/plugin.resume.js": | ||
/*!*****************************************!*\ | ||
!*** ./src/js/plugins/plugin.resume.js ***! | ||
\*****************************************/ | ||
/*! namespace exports */ | ||
/*! exports [not provided] [no usage info] */ | ||
/*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.* */ | ||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
__webpack_require__.r(__webpack_exports__); | ||
/* harmony import */ var core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.regexp.exec */ "./node_modules/core-js/modules/es.regexp.exec.js"); | ||
/* harmony import */ var core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_0__); | ||
/* harmony import */ var core_js_modules_es_string_match__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.string.match */ "./node_modules/core-js/modules/es.string.match.js"); | ||
/* harmony import */ var core_js_modules_es_string_match__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_match__WEBPACK_IMPORTED_MODULE_1__); | ||
/* harmony import */ var _util_docCookies_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/docCookies.js */ "./src/util/docCookies.js"); | ||
/* provided dependency */ var jQuery = __webpack_require__(/*! jquery */ "jquery"); | ||
/* global BookReader */ | ||
/** @deprecated Exposed for backward compatibility */ | ||
BookReader.docCookies = _util_docCookies_js__WEBPACK_IMPORTED_MODULE_2__; | ||
/** | ||
* Plugin to remember the current page number in a cookie | ||
*/ | ||
jQuery.extend(BookReader.defaultOptions, { | ||
enablePageResume: true, | ||
/** @type {string|null} eg '/', '/details/id' */ | ||
resumeCookiePath: null | ||
}); | ||
/** @override */ | ||
BookReader.prototype.init = function (super_) { | ||
return function () { | ||
var _this = this; | ||
super_.call(this); | ||
if (this.options.enablePageResume) { | ||
this.bind(BookReader.eventNames.fragmentChange, function () { | ||
var params = _this.paramsFromCurrent(); | ||
_this.updateResumeValue(params.index); | ||
}); | ||
} | ||
}; | ||
}(BookReader.prototype.init); | ||
/** | ||
* Gets page resume value, for remembering reader's page | ||
* Can be overriden for different implementation | ||
* | ||
* @return {number|null} | ||
*/ | ||
BookReader.prototype.getResumeValue = function () { | ||
var val = BookReader.docCookies.getItem('br-resume'); | ||
if (val !== null) return parseInt(val);else return null; | ||
}; | ||
/** | ||
* Return cookie path using pathname up to /page/... or /mode/... | ||
* using window.location.pathname for urlPathPart: | ||
* - matches encoding | ||
* - ignores querystring part | ||
* - ignores fragment part (after #) | ||
* @param {string} urlPathPart - window.location.pathname | ||
*/ | ||
BookReader.prototype.getCookiePath = function (urlPathPart) { | ||
return urlPathPart.match('.+?(?=/page/|/mode/|$)')[0]; | ||
}; | ||
/** | ||
* Sets page resume value, for remembering reader's page | ||
* Can be overriden for different implementation | ||
* | ||
* @param {Number} index leaf index | ||
* @param {string} [cookieName] | ||
*/ | ||
BookReader.prototype.updateResumeValue = function (index, cookieName) { | ||
var ttl = new Date(+new Date() + 12096e5); // 2 weeks | ||
// For multiple files in item, leave resumeCookiePath blank | ||
// It's likely we can remove resumeCookiePath using getCookiePath() | ||
var path = this.options.resumeCookiePath || this.getCookiePath(window.location.pathname); | ||
BookReader.docCookies.setItem(cookieName || 'br-resume', index, ttl, path, null, false); | ||
}; | ||
/***/ }), | ||
/***/ "./src/util/docCookies.js": | ||
/*!********************************!*\ | ||
!*** ./src/util/docCookies.js ***! | ||
\********************************/ | ||
/*! namespace exports */ | ||
/*! export getItem [provided] [no usage info] [missing usage info prevents renaming] */ | ||
/*! export removeItem [provided] [no usage info] [missing usage info prevents renaming] */ | ||
/*! export setItem [provided] [no usage info] [missing usage info prevents renaming] */ | ||
/*! other exports [not provided] [no usage info] */ | ||
/*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ | ||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
__webpack_require__.r(__webpack_exports__); | ||
/* harmony export */ __webpack_require__.d(__webpack_exports__, { | ||
/* harmony export */ "getItem": function() { return /* binding */ getItem; }, | ||
/* harmony export */ "setItem": function() { return /* binding */ setItem; }, | ||
/* harmony export */ "removeItem": function() { return /* binding */ removeItem; } | ||
/* harmony export */ }); | ||
/* harmony import */ var core_js_modules_es_regexp_constructor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.regexp.constructor */ "./node_modules/core-js/modules/es.regexp.constructor.js"); | ||
/* harmony import */ var core_js_modules_es_regexp_constructor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_constructor__WEBPACK_IMPORTED_MODULE_0__); | ||
/* harmony import */ var core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.regexp.exec */ "./node_modules/core-js/modules/es.regexp.exec.js"); | ||
/* harmony import */ var core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_1__); | ||
/* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.regexp.to-string */ "./node_modules/core-js/modules/es.regexp.to-string.js"); | ||
/* harmony import */ var core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_to_string__WEBPACK_IMPORTED_MODULE_2__); | ||
/* harmony import */ var core_js_modules_es_string_replace__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.string.replace */ "./node_modules/core-js/modules/es.string.replace.js"); | ||
/* harmony import */ var core_js_modules_es_string_replace__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_replace__WEBPACK_IMPORTED_MODULE_3__); | ||
/** | ||
* Helper module use to get, set and remove item from cookie | ||
* | ||
* See more: | ||
* https://developer.mozilla.org/en-US/docs/Web/API/document.cookie | ||
* https://developer.mozilla.org/User:fusionchess | ||
* https://github.com/madmurphy/cookies.js | ||
* This framework is released under the GNU Public License, version 3 or later. | ||
* http://www.gnu.org/licenses/gpl-3.0-standalone.html | ||
*/ | ||
/** | ||
* Get specific key's value stored in cookie | ||
* | ||
* @param {string} sKey | ||
* | ||
* @returns {string|null} | ||
*/ | ||
function getItem(sKey) { | ||
if (!sKey) return null; | ||
return decodeURIComponent( // eslint-disable-next-line no-useless-escape | ||
document.cookie.replace(new RegExp('(?:(?:^|.*;)\\s*' + encodeURIComponent(sKey).replace(/[\-\.\+\*]/g, '\\$&') + '\\s*\\=\\s*([^;]*).*$)|^.*$'), '$1')) || null; | ||
} | ||
/** | ||
* Set specific key's value in cookie | ||
* | ||
* @param {string} sKey cookie name | ||
* @param {string} sValue cookie value | ||
* @param {string} [vEnd] expire|max-age | ||
* @param {string} [sPath] path of current item | ||
* @param {string} [sDomain] domain name | ||
* @param {boolean} [bSecure] | ||
* | ||
* @returns {true} | ||
*/ | ||
function setItem(sKey, sValue, vEnd, sPath, sDomain, bSecure) { | ||
document.cookie = encodeURIComponent(sKey) + '=' + encodeURIComponent(sValue) + (vEnd ? "; expires=".concat(vEnd.toUTCString()) : '') + (sDomain ? "; domain=".concat(sDomain) : '') + (sPath ? "; path=".concat(sPath) : '') + (bSecure ? "; secure" : ''); | ||
return true; | ||
} | ||
/** | ||
* BROKEN Remove specific key's value from cookie | ||
* @fixme hasItem isn't even implemented! This will always error. | ||
* @param {string} sKey cookie name | ||
* @param {string} [sPath] path of current item | ||
* @param {string} [sDomain] | ||
* | ||
* @returns {boolean} | ||
*/ | ||
function removeItem(sKey, sPath, sDomain) { | ||
if (!hasItem(sKey)) return false; | ||
document.cookie = encodeURIComponent(sKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT" + (sDomain ? "; domain=".concat(sDomain) : '') + (sPath ? "; path=".concat(sPath) : ''); | ||
return true; | ||
} | ||
/***/ }), | ||
/***/ "./node_modules/core-js/internals/inherit-if-required.js": | ||
/*!***************************************************************!*\ | ||
!*** ./node_modules/core-js/internals/inherit-if-required.js ***! | ||
\***************************************************************/ | ||
/*! unknown exports (runtime-defined) */ | ||
/*! runtime requirements: module, __webpack_require__ */ | ||
/*! CommonJS bailout: module.exports is used directly at 5:0-14 */ | ||
/***/ (function(module, __unused_webpack_exports, __webpack_require__) { | ||
var isObject = __webpack_require__(/*! ../internals/is-object */ "./node_modules/core-js/internals/is-object.js"); | ||
var setPrototypeOf = __webpack_require__(/*! ../internals/object-set-prototype-of */ "./node_modules/core-js/internals/object-set-prototype-of.js"); | ||
// makes subclassing work correct for wrapped built-ins | ||
module.exports = function ($this, dummy, Wrapper) { | ||
var NewTarget, NewTargetPrototype; | ||
if ( | ||
// it can work only with native `setPrototypeOf` | ||
setPrototypeOf && | ||
// we haven't completely correct pre-ES6 way for getting `new.target`, so use this | ||
typeof (NewTarget = dummy.constructor) == 'function' && | ||
NewTarget !== Wrapper && | ||
isObject(NewTargetPrototype = NewTarget.prototype) && | ||
NewTargetPrototype !== Wrapper.prototype | ||
) setPrototypeOf($this, NewTargetPrototype); | ||
return $this; | ||
}; | ||
/***/ }), | ||
/***/ "./node_modules/core-js/internals/set-species.js": | ||
/*!*******************************************************!*\ | ||
!*** ./node_modules/core-js/internals/set-species.js ***! | ||
\*******************************************************/ | ||
/*! unknown exports (runtime-defined) */ | ||
/*! runtime requirements: module, __webpack_require__ */ | ||
/*! CommonJS bailout: module.exports is used directly at 9:0-14 */ | ||
/***/ (function(module, __unused_webpack_exports, __webpack_require__) { | ||
"use strict"; | ||
var getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ "./node_modules/core-js/internals/get-built-in.js"); | ||
var definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js"); | ||
var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js"); | ||
var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js"); | ||
var SPECIES = wellKnownSymbol('species'); | ||
module.exports = function (CONSTRUCTOR_NAME) { | ||
var Constructor = getBuiltIn(CONSTRUCTOR_NAME); | ||
var defineProperty = definePropertyModule.f; | ||
if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) { | ||
defineProperty(Constructor, SPECIES, { | ||
configurable: true, | ||
get: function () { return this; } | ||
}); | ||
} | ||
}; | ||
/***/ }), | ||
/***/ "./node_modules/core-js/modules/es.regexp.constructor.js": | ||
/*!***************************************************************!*\ | ||
!*** ./node_modules/core-js/modules/es.regexp.constructor.js ***! | ||
\***************************************************************/ | ||
/*! unknown exports (runtime-defined) */ | ||
/*! runtime requirements: __webpack_require__ */ | ||
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { | ||
var DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ "./node_modules/core-js/internals/descriptors.js"); | ||
var global = __webpack_require__(/*! ../internals/global */ "./node_modules/core-js/internals/global.js"); | ||
var isForced = __webpack_require__(/*! ../internals/is-forced */ "./node_modules/core-js/internals/is-forced.js"); | ||
var inheritIfRequired = __webpack_require__(/*! ../internals/inherit-if-required */ "./node_modules/core-js/internals/inherit-if-required.js"); | ||
var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ "./node_modules/core-js/internals/object-define-property.js").f; | ||
var getOwnPropertyNames = __webpack_require__(/*! ../internals/object-get-own-property-names */ "./node_modules/core-js/internals/object-get-own-property-names.js").f; | ||
var isRegExp = __webpack_require__(/*! ../internals/is-regexp */ "./node_modules/core-js/internals/is-regexp.js"); | ||
var getFlags = __webpack_require__(/*! ../internals/regexp-flags */ "./node_modules/core-js/internals/regexp-flags.js"); | ||
var stickyHelpers = __webpack_require__(/*! ../internals/regexp-sticky-helpers */ "./node_modules/core-js/internals/regexp-sticky-helpers.js"); | ||
var redefine = __webpack_require__(/*! ../internals/redefine */ "./node_modules/core-js/internals/redefine.js"); | ||
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js"); | ||
var setInternalState = __webpack_require__(/*! ../internals/internal-state */ "./node_modules/core-js/internals/internal-state.js").set; | ||
var setSpecies = __webpack_require__(/*! ../internals/set-species */ "./node_modules/core-js/internals/set-species.js"); | ||
var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ "./node_modules/core-js/internals/well-known-symbol.js"); | ||
var MATCH = wellKnownSymbol('match'); | ||
var NativeRegExp = global.RegExp; | ||
var RegExpPrototype = NativeRegExp.prototype; | ||
var re1 = /a/g; | ||
var re2 = /a/g; | ||
// "new" should create a new object, old webkit bug | ||
var CORRECT_NEW = new NativeRegExp(re1) !== re1; | ||
var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y; | ||
var FORCED = DESCRIPTORS && isForced('RegExp', (!CORRECT_NEW || UNSUPPORTED_Y || fails(function () { | ||
re2[MATCH] = false; | ||
// RegExp constructor can alter flags and IsRegExp works correct with @@match | ||
return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i'; | ||
}))); | ||
// `RegExp` constructor | ||
// https://tc39.github.io/ecma262/#sec-regexp-constructor | ||
if (FORCED) { | ||
var RegExpWrapper = function RegExp(pattern, flags) { | ||
var thisIsRegExp = this instanceof RegExpWrapper; | ||
var patternIsRegExp = isRegExp(pattern); | ||
var flagsAreUndefined = flags === undefined; | ||
var sticky; | ||
if (!thisIsRegExp && patternIsRegExp && pattern.constructor === RegExpWrapper && flagsAreUndefined) { | ||
return pattern; | ||
} | ||
if (CORRECT_NEW) { | ||
if (patternIsRegExp && !flagsAreUndefined) pattern = pattern.source; | ||
} else if (pattern instanceof RegExpWrapper) { | ||
if (flagsAreUndefined) flags = getFlags.call(pattern); | ||
pattern = pattern.source; | ||
} | ||
if (UNSUPPORTED_Y) { | ||
sticky = !!flags && flags.indexOf('y') > -1; | ||
if (sticky) flags = flags.replace(/y/g, ''); | ||
} | ||
var result = inheritIfRequired( | ||
CORRECT_NEW ? new NativeRegExp(pattern, flags) : NativeRegExp(pattern, flags), | ||
thisIsRegExp ? this : RegExpPrototype, | ||
RegExpWrapper | ||
); | ||
if (UNSUPPORTED_Y && sticky) setInternalState(result, { sticky: sticky }); | ||
return result; | ||
}; | ||
var proxy = function (key) { | ||
key in RegExpWrapper || defineProperty(RegExpWrapper, key, { | ||
configurable: true, | ||
get: function () { return NativeRegExp[key]; }, | ||
set: function (it) { NativeRegExp[key] = it; } | ||
}); | ||
}; | ||
var keys = getOwnPropertyNames(NativeRegExp); | ||
var index = 0; | ||
while (keys.length > index) proxy(keys[index++]); | ||
RegExpPrototype.constructor = RegExpWrapper; | ||
RegExpWrapper.prototype = RegExpPrototype; | ||
redefine(global, 'RegExp', RegExpWrapper); | ||
} | ||
// https://tc39.github.io/ecma262/#sec-get-regexp-@@species | ||
setSpecies('RegExp'); | ||
/***/ }), | ||
/***/ "./node_modules/core-js/modules/es.string.match.js": | ||
/*!*********************************************************!*\ | ||
!*** ./node_modules/core-js/modules/es.string.match.js ***! | ||
\*********************************************************/ | ||
/*! unknown exports (runtime-defined) */ | ||
/*! runtime requirements: __webpack_require__ */ | ||
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { | ||
"use strict"; | ||
var fixRegExpWellKnownSymbolLogic = __webpack_require__(/*! ../internals/fix-regexp-well-known-symbol-logic */ "./node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js"); | ||
var anObject = __webpack_require__(/*! ../internals/an-object */ "./node_modules/core-js/internals/an-object.js"); | ||
var toLength = __webpack_require__(/*! ../internals/to-length */ "./node_modules/core-js/internals/to-length.js"); | ||
var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/core-js/internals/require-object-coercible.js"); | ||
var advanceStringIndex = __webpack_require__(/*! ../internals/advance-string-index */ "./node_modules/core-js/internals/advance-string-index.js"); | ||
var regExpExec = __webpack_require__(/*! ../internals/regexp-exec-abstract */ "./node_modules/core-js/internals/regexp-exec-abstract.js"); | ||
// @@match logic | ||
fixRegExpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCallNative) { | ||
return [ | ||
// `String.prototype.match` method | ||
// https://tc39.github.io/ecma262/#sec-string.prototype.match | ||
function match(regexp) { | ||
var O = requireObjectCoercible(this); | ||
var matcher = regexp == undefined ? undefined : regexp[MATCH]; | ||
return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); | ||
}, | ||
// `RegExp.prototype[@@match]` method | ||
// https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match | ||
function (regexp) { | ||
var res = maybeCallNative(nativeMatch, regexp, this); | ||
if (res.done) return res.value; | ||
var rx = anObject(regexp); | ||
var S = String(this); | ||
if (!rx.global) return regExpExec(rx, S); | ||
var fullUnicode = rx.unicode; | ||
rx.lastIndex = 0; | ||
var A = []; | ||
var n = 0; | ||
var result; | ||
while ((result = regExpExec(rx, S)) !== null) { | ||
var matchStr = String(result[0]); | ||
A[n] = matchStr; | ||
if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); | ||
n++; | ||
} | ||
return n === 0 ? null : A; | ||
} | ||
]; | ||
}); | ||
/***/ }) | ||
}, | ||
0,[["./src/js/plugins/plugin.resume.js","BookReader.js"]]]); | ||
//# sourceMappingURL=plugin.resume.js.map |
@@ -1,2 +0,78 @@ | ||
(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[16],{814:function(e,t,h){"use strict";h(2772);var s,a=h(3609),i=h(3609);a.extend(BookReader.defaultOptions,{enableThemesPlugin:!0}),BookReader.prototype.setup=(s=BookReader.prototype.setup,function(e){s.call(this,e),this.enableThemesPlugin=e.enableThemesPlugin,this.themes={ol:null},this.default_theme="ol",this.theme="ol"}),BookReader.prototype.updateTheme=function(e){if(e in this.themes&&0!=i("#BRCSS").length&&e!=this.theme)if(this.theme=e,e!=this.default_theme){var t=i("#BRCSSTheme");0==t.length&&(t=i('<link rel="stylesheet" type="text/css">').attr("id","BRCSSTheme"),i("head").append(t));var h=i("#BRCSS").attr("href"),s=h.indexOf("BookReader.css"),a=h.substr(0,s)+this.themes[e];t.attr({disabled:!1,href:a})}else i("#BRCSSTheme").attr("disabled",!0)}}},0,[[814,898]]]); | ||
(self["webpackChunk_internetarchive_bookreader"] = self["webpackChunk_internetarchive_bookreader"] || []).push([["plugins/plugin.themes.js"],{ | ||
/***/ "./src/js/plugins/plugin.themes.js": | ||
/*!*****************************************!*\ | ||
!*** ./src/js/plugins/plugin.themes.js ***! | ||
\*****************************************/ | ||
/*! namespace exports */ | ||
/*! exports [not provided] [no usage info] */ | ||
/*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.* */ | ||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
__webpack_require__.r(__webpack_exports__); | ||
/* harmony import */ var core_js_modules_es_array_index_of__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.index-of */ "./node_modules/core-js/modules/es.array.index-of.js"); | ||
/* harmony import */ var core_js_modules_es_array_index_of__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_index_of__WEBPACK_IMPORTED_MODULE_0__); | ||
/* provided dependency */ var jQuery = __webpack_require__(/*! jquery */ "jquery"); | ||
/* provided dependency */ var $ = __webpack_require__(/*! jquery */ "jquery"); | ||
/* global BookReader */ | ||
/** | ||
* Deprecated theming functionality | ||
* @deprecated | ||
*/ | ||
jQuery.extend(BookReader.defaultOptions, { | ||
enableThemesPlugin: true | ||
}); | ||
BookReader.prototype.setup = function (super_) { | ||
return function (options) { | ||
super_.call(this, options); | ||
this.enableThemesPlugin = options.enableThemesPlugin; // Themes | ||
this.themes = { | ||
ol: null | ||
}; | ||
this.default_theme = 'ol'; | ||
this.theme = 'ol'; | ||
}; | ||
}(BookReader.prototype.setup); // updateTheme | ||
//______________________________________________________________________________ | ||
BookReader.prototype.updateTheme = function (theme) { | ||
if (!(theme in this.themes)) return; | ||
var main_style = $('#BRCSS'); | ||
if (main_style.length == 0) return; | ||
if (theme == this.theme) return; | ||
this.theme = theme; | ||
if (theme == this.default_theme) { | ||
$('#BRCSSTheme').attr('disabled', true); | ||
return; | ||
} | ||
var stylesheet = $('#BRCSSTheme'); | ||
if (stylesheet.length == 0) { | ||
stylesheet = $('<link rel="stylesheet" type="text/css">').attr('id', 'BRCSSTheme'); | ||
$('head').append(stylesheet); | ||
} | ||
var main_href = $('#BRCSS').attr('href'); | ||
var index = main_href.indexOf('BookReader.css'); | ||
var css_prefix = main_href.substr(0, index); | ||
var theme_href = css_prefix + this.themes[theme]; | ||
stylesheet.attr({ | ||
disabled: false, | ||
href: theme_href | ||
}); | ||
}; | ||
/***/ }) | ||
}, | ||
0,[["./src/js/plugins/plugin.themes.js","BookReader.js"]]]); | ||
//# sourceMappingURL=plugin.themes.js.map |
@@ -1,2 +0,258 @@ | ||
(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[336],{5894:function(t,o,e){"use strict";var a;e(2222),e(6992),e(5827),e(1539),e(4916),e(8783),e(5306),e(3948),e(285),e(3609).extend(BookReader.defaultOptions,{enableUrlPlugin:!0,bookId:"",defaults:null,updateWindowTitle:!1,urlMode:"hash",urlHistoryBasePath:"/",urlTrackedParams:["page","search","mode","region","highlight"],urlTrackIndex0:!1}),BookReader.prototype.setup=(a=BookReader.prototype.setup,function(t){a.call(this,t),this.bookId=t.bookId,this.defaults=t.defaults,this.locationPollId=null,this.oldLocationHash=null,this.oldUserHash=null}),BookReader.prototype.init=function(t){return function(){var o=this;this.options.enableUrlPlugin&&(this.bind(BookReader.eventNames.PostInit,(function(){var t=o.options,e=t.updateWindowTitle,a=t.urlMode;e&&(document.title=o.shortTitle(50)),"hash"===a&&o.urlStartLocationPolling()})),this.bind(BookReader.eventNames.fragmentChange,this.urlUpdateFragment.bind(this))),t.call(this)}}(BookReader.prototype.init),BookReader.prototype.shortTitle=function(t){return this.bookTitle.length<t?this.bookTitle:"".concat(this.bookTitle.substr(0,t-3),"...")},BookReader.prototype.urlStartLocationPolling=function(){var t=this;this.oldLocationHash=this.urlReadFragment(),this.locationPollId&&(clearInterval(this.locationPollID),this.locationPollId=null),this.locationPollId=setInterval((function(){var o=t.urlReadFragment();if(o!=t.oldLocationHash&&o!=t.oldUserHash){var e=t.paramsFromFragment(o),a=function(){return t.updateFromParams(e)};t.trigger(BookReader.eventNames.stop),t.animating?(t.autoStop&&t.autoStop(),t.animationFinishedCallback=a):a(),t.oldUserHash=o}}),500)},BookReader.prototype.urlUpdateFragment=function(){var t=this.paramsFromCurrent(),o=this.options,e=o.urlMode,a=o.urlTrackIndex0,r=o.urlTrackedParams;a||void 0===t.index||0!==t.index||(delete t.index,delete t.page);var i=r.reduce((function(o,e){return e in t&&(o[e]=t[e]),o}),{}),n=this.fragmentFromParams(i,e),s=this.urlReadFragment(),l=this.getLocationSearch(),h=this.queryStringFromParams(i,l,e);if(s!==n||l!==h)if("history"===e){if(window.history&&window.history.replaceState){var d=this.options.urlHistoryBasePath.replace(/\/+$/,""),u=""===n?"":"/".concat(n),c="".concat(d).concat(u).concat(h);window.history.replaceState({},null,c),this.oldLocationHash=n+h}}else{var p=this.urlParamsFiltersOnlySearch(this.readQueryString());window.location.replace("#"+n+p),this.oldLocationHash=n+p}},BookReader.prototype.urlParamsFiltersOnlySearch=function(t){var o=new URLSearchParams(t);return o.has("q")?"?".concat(new URLSearchParams({q:o.get("q")})):""},BookReader.prototype.urlReadFragment=function(){var t=this.options,o=t.urlMode,e=t.urlHistoryBasePath;return"history"===o?window.location.pathname.substr(e.length):window.location.hash.substr(1)}}},0,[[5894,898]]]); | ||
(self["webpackChunk_internetarchive_bookreader"] = self["webpackChunk_internetarchive_bookreader"] || []).push([["plugins/plugin.url.js"],{ | ||
/***/ "./src/js/plugins/plugin.url.js": | ||
/*!**************************************!*\ | ||
!*** ./src/js/plugins/plugin.url.js ***! | ||
\**************************************/ | ||
/*! namespace exports */ | ||
/*! exports [not provided] [no usage info] */ | ||
/*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.* */ | ||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
__webpack_require__.r(__webpack_exports__); | ||
/* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.concat */ "./node_modules/core-js/modules/es.array.concat.js"); | ||
/* harmony import */ var core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_concat__WEBPACK_IMPORTED_MODULE_0__); | ||
/* harmony import */ var core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.iterator */ "./node_modules/core-js/modules/es.array.iterator.js"); | ||
/* harmony import */ var core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_iterator__WEBPACK_IMPORTED_MODULE_1__); | ||
/* harmony import */ var core_js_modules_es_array_reduce__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.array.reduce */ "./node_modules/core-js/modules/es.array.reduce.js"); | ||
/* harmony import */ var core_js_modules_es_array_reduce__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_reduce__WEBPACK_IMPORTED_MODULE_2__); | ||
/* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.object.to-string */ "./node_modules/core-js/modules/es.object.to-string.js"); | ||
/* harmony import */ var core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_3__); | ||
/* harmony import */ var core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.regexp.exec */ "./node_modules/core-js/modules/es.regexp.exec.js"); | ||
/* harmony import */ var core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_exec__WEBPACK_IMPORTED_MODULE_4__); | ||
/* harmony import */ var core_js_modules_es_string_iterator__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.string.iterator */ "./node_modules/core-js/modules/es.string.iterator.js"); | ||
/* harmony import */ var core_js_modules_es_string_iterator__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_iterator__WEBPACK_IMPORTED_MODULE_5__); | ||
/* harmony import */ var core_js_modules_es_string_replace__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.string.replace */ "./node_modules/core-js/modules/es.string.replace.js"); | ||
/* harmony import */ var core_js_modules_es_string_replace__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_replace__WEBPACK_IMPORTED_MODULE_6__); | ||
/* harmony import */ var core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator */ "./node_modules/core-js/modules/web.dom-collections.iterator.js"); | ||
/* harmony import */ var core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_iterator__WEBPACK_IMPORTED_MODULE_7__); | ||
/* harmony import */ var core_js_modules_web_url__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/web.url */ "./node_modules/core-js/modules/web.url.js"); | ||
/* harmony import */ var core_js_modules_web_url__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_url__WEBPACK_IMPORTED_MODULE_8__); | ||
/* provided dependency */ var jQuery = __webpack_require__(/*! jquery */ "jquery"); | ||
/* global BookReader */ | ||
/** | ||
* Plugin for URL management in BookReader | ||
* Note read more about the url "fragment" here: | ||
* https://openlibrary.org/dev/docs/bookurls | ||
*/ | ||
jQuery.extend(BookReader.defaultOptions, { | ||
enableUrlPlugin: true, | ||
bookId: '', | ||
/** @type {string} Defaults can be a urlFragment string */ | ||
defaults: null, | ||
updateWindowTitle: false, | ||
/** @type {'history' | 'hash'} */ | ||
urlMode: 'hash', | ||
/** | ||
* When using 'history' mode, this part of the URL is kept constant | ||
* @example /details/plato/ | ||
*/ | ||
urlHistoryBasePath: '/', | ||
/** Only these params will be reflected onto the URL */ | ||
urlTrackedParams: ['page', 'search', 'mode', 'region', 'highlight'], | ||
/** If true, don't update the URL when `page == n0 (eg "/page/n0")` */ | ||
urlTrackIndex0: false | ||
}); | ||
/** @override */ | ||
BookReader.prototype.setup = function (super_) { | ||
return function (options) { | ||
super_.call(this, options); | ||
this.bookId = options.bookId; | ||
this.defaults = options.defaults; | ||
this.locationPollId = null; | ||
this.oldLocationHash = null; | ||
this.oldUserHash = null; | ||
}; | ||
}(BookReader.prototype.setup); | ||
/** @override */ | ||
BookReader.prototype.init = function (super_) { | ||
return function () { | ||
var _this = this; | ||
if (this.options.enableUrlPlugin) { | ||
this.bind(BookReader.eventNames.PostInit, function () { | ||
var _this$options = _this.options, | ||
updateWindowTitle = _this$options.updateWindowTitle, | ||
urlMode = _this$options.urlMode; | ||
if (updateWindowTitle) { | ||
document.title = _this.shortTitle(50); | ||
} | ||
if (urlMode === 'hash') { | ||
_this.urlStartLocationPolling(); | ||
} | ||
}); | ||
this.bind(BookReader.eventNames.fragmentChange, this.urlUpdateFragment.bind(this)); | ||
} | ||
super_.call(this); | ||
}; | ||
}(BookReader.prototype.init); | ||
/** | ||
* Returns a shortened version of the title with the maximum number of characters | ||
* @param {number} maximumCharacters | ||
* @return {string} | ||
*/ | ||
BookReader.prototype.shortTitle = function (maximumCharacters) { | ||
if (this.bookTitle.length < maximumCharacters) { | ||
return this.bookTitle; | ||
} | ||
var title = "".concat(this.bookTitle.substr(0, maximumCharacters - 3), "..."); | ||
return title; | ||
}; | ||
/** | ||
* Starts polling of window.location to see hash fragment changes | ||
*/ | ||
BookReader.prototype.urlStartLocationPolling = function () { | ||
var _this2 = this; | ||
this.oldLocationHash = this.urlReadFragment(); | ||
if (this.locationPollId) { | ||
clearInterval(this.locationPollID); | ||
this.locationPollId = null; | ||
} | ||
var updateHash = function updateHash() { | ||
var newFragment = _this2.urlReadFragment(); | ||
var hasFragmentChange = newFragment != _this2.oldLocationHash && newFragment != _this2.oldUserHash; | ||
if (!hasFragmentChange) { | ||
return; | ||
} | ||
var params = _this2.paramsFromFragment(newFragment); | ||
var updateParams = function updateParams() { | ||
return _this2.updateFromParams(params); | ||
}; | ||
_this2.trigger(BookReader.eventNames.stop); | ||
if (_this2.animating) { | ||
// Queue change if animating | ||
if (_this2.autoStop) _this2.autoStop(); | ||
_this2.animationFinishedCallback = updateParams; | ||
} else { | ||
// update immediately | ||
updateParams(); | ||
} | ||
_this2.oldUserHash = newFragment; | ||
}; | ||
this.locationPollId = setInterval(updateHash, 500); | ||
}; | ||
/** | ||
* Update URL from the current parameters. | ||
* Call this instead of manually using window.location.replace | ||
*/ | ||
BookReader.prototype.urlUpdateFragment = function () { | ||
var allParams = this.paramsFromCurrent(); | ||
var _this$options2 = this.options, | ||
urlMode = _this$options2.urlMode, | ||
urlTrackIndex0 = _this$options2.urlTrackIndex0, | ||
urlTrackedParams = _this$options2.urlTrackedParams; | ||
if (!urlTrackIndex0 && typeof allParams.index !== 'undefined' && allParams.index === 0) { | ||
delete allParams.index; | ||
delete allParams.page; | ||
} | ||
var params = urlTrackedParams.reduce(function (validParams, paramName) { | ||
if (paramName in allParams) { | ||
validParams[paramName] = allParams[paramName]; | ||
} | ||
return validParams; | ||
}, {}); | ||
var newFragment = this.fragmentFromParams(params, urlMode); | ||
var currFragment = this.urlReadFragment(); | ||
var currQueryString = this.getLocationSearch(); | ||
var newQueryString = this.queryStringFromParams(params, currQueryString, urlMode); | ||
if (currFragment === newFragment && currQueryString === newQueryString) { | ||
return; | ||
} | ||
if (urlMode === 'history') { | ||
if (window.history && window.history.replaceState) { | ||
var baseWithoutSlash = this.options.urlHistoryBasePath.replace(/\/+$/, ''); | ||
var newFragmentWithSlash = newFragment === '' ? '' : "/".concat(newFragment); | ||
var newUrlPath = "".concat(baseWithoutSlash).concat(newFragmentWithSlash).concat(newQueryString); | ||
window.history.replaceState({}, null, newUrlPath); | ||
this.oldLocationHash = newFragment + newQueryString; | ||
} | ||
} else { | ||
var newQueryStringSearch = this.urlParamsFiltersOnlySearch(this.readQueryString()); | ||
window.location.replace('#' + newFragment + newQueryStringSearch); | ||
this.oldLocationHash = newFragment + newQueryStringSearch; | ||
} | ||
}; | ||
/** | ||
* @private | ||
* Filtering query parameters to select only book search param (?q=foo) | ||
This needs to be updated/URL system modified if future query params are to be added | ||
* @param {string} url | ||
* @return {string} | ||
* */ | ||
BookReader.prototype.urlParamsFiltersOnlySearch = function (url) { | ||
var params = new URLSearchParams(url); | ||
return params.has('q') ? "?".concat(new URLSearchParams({ | ||
q: params.get('q') | ||
})) : ''; | ||
}; | ||
/** | ||
* Will read either the hash or URL and return the bookreader fragment | ||
* @return {string} | ||
*/ | ||
BookReader.prototype.urlReadFragment = function () { | ||
var _this$options3 = this.options, | ||
urlMode = _this$options3.urlMode, | ||
urlHistoryBasePath = _this$options3.urlHistoryBasePath; | ||
if (urlMode === 'history') { | ||
return window.location.pathname.substr(urlHistoryBasePath.length); | ||
} else { | ||
return window.location.hash.substr(1); | ||
} | ||
}; | ||
/***/ }) | ||
}, | ||
0,[["./src/js/plugins/plugin.url.js","BookReader.js"]]]); | ||
//# sourceMappingURL=plugin.url.js.map |
@@ -1,2 +0,398 @@ | ||
(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[46],{4416:function(e,t,n){"use strict";n(2772),n(9600),n(3210);var r,o=n(3609),i=n(3609);if(!f()){var u=".bookreader_vendor-fullscreen";o.extend(BookReader.defaultOptions,{enableVendorFullscreenPlugin:!0}),BookReader.prototype.setup=(r=BookReader.prototype.setup,function(e){r.call(this,e),this.isVendorFullscreenActive=!1}),BookReader.prototype.getInitialMode=function(e){return function(t){var n=e.call(this,t);return this.isVendorFullscreenActive&&(n=this.constMode1up),n}}(BookReader.prototype.getInitialMode),BookReader.prototype.init=function(e){return function(){e.call(this),d()&&p(this,(function(e){e.data.resize(),e.data.updateBrClasses();var t=i("#cboxOverlay"),n=i("#colorbox");s()?i(l()).append(t).append(n):i(document.body).append(t).append(n)}))}}(BookReader.prototype.init),BookReader.prototype.enterFullWindow=function(){var e=this;this.refs.$brContainer.css("opacity",0),i(window).width()<=this.onePageMinBreakpoint&&this.switchMode(this.constMode1up),this.isVendorFullscreenActive=!0,this.updateBrClasses(),this.resize(),this.jumpToIndex(this.currentIndex()),this.refs.$brContainer.animate({opacity:1},400,"linear"),i(document).on("keyup.".concat(u),(function(t){27===t.keyCode&&e.exitFullScreen()}))},BookReader.prototype.exitFullWindow=function(){this.refs.$brContainer.css("opacity",0),i(document).off("keyup"+u),this.isFullscreenActive=!1,this.updateBrClasses(),this.resize(),this.refs.$brContainer.animate({opacity:1},400,"linear")},BookReader.prototype.isFullscreen=function(){return s()||this.isVendorFullscreenActive},BookReader.prototype.toggleFullscreen=function(){this.isFullscreen()?d()?c():this.exitFullWindow():d()?a(this.refs.$br[0]):this.enterFullWindow()},BookReader.util.isMobile=f,BookReader.util.getFullscreenElement=l,BookReader.util.bindFullscreenChangeListener=p,BookReader.util.fullscreenAllowed=d,BookReader.util.requestFullscreen=a,BookReader.util.exitFullscreen=c,BookReader.util.isFullscreenActive=s}function l(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement}function s(){return null!=l()}function c(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen()}function a(e){e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen()}function d(){return document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullScreenEnabled}function p(e,t){var n="fullscreenchange ",r=i.trim(n+["webkit","moz","ms"].join(n)+n);i(document).bind(r,e,t)}function f(){return void 0!==window.orientation||-1!==navigator.userAgent.indexOf("IEMobile")}},6091:function(e,t,n){var r=n(7293),o=n(1361);e.exports=function(e){return r((function(){return!!o[e]()||" "!=" "[e]()||o[e].name!==e}))}},3111:function(e,t,n){var r=n(4488),o="["+n(1361)+"]",i=RegExp("^"+o+o+"*"),u=RegExp(o+o+"*$"),l=function(e){return function(t){var n=String(r(t));return 1&e&&(n=n.replace(i,"")),2&e&&(n=n.replace(u,"")),n}};e.exports={start:l(1),end:l(2),trim:l(3)}},1361:function(e){e.exports="\t\n\v\f\r \u2028\u2029\ufeff"},3210:function(e,t,n){"use strict";var r=n(2109),o=n(3111).trim;r({target:"String",proto:!0,forced:n(6091)("trim")},{trim:function(){return o(this)}})}},0,[[4416,898]]]); | ||
(self["webpackChunk_internetarchive_bookreader"] = self["webpackChunk_internetarchive_bookreader"] || []).push([["plugins/plugin.vendor-fullscreen.js"],{ | ||
/***/ "./src/js/plugins/plugin.vendor-fullscreen.js": | ||
/*!****************************************************!*\ | ||
!*** ./src/js/plugins/plugin.vendor-fullscreen.js ***! | ||
\****************************************************/ | ||
/*! namespace exports */ | ||
/*! export bindFullscreenChangeListener [provided] [no usage info] [missing usage info prevents renaming] */ | ||
/*! export exitFullscreen [provided] [no usage info] [missing usage info prevents renaming] */ | ||
/*! export fullscreenAllowed [provided] [no usage info] [missing usage info prevents renaming] */ | ||
/*! export getFullscreenElement [provided] [no usage info] [missing usage info prevents renaming] */ | ||
/*! export isFullscreenActive [provided] [no usage info] [missing usage info prevents renaming] */ | ||
/*! export isMobile [provided] [no usage info] [missing usage info prevents renaming] */ | ||
/*! export requestFullscreen [provided] [no usage info] [missing usage info prevents renaming] */ | ||
/*! other exports [not provided] [no usage info] */ | ||
/*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */ | ||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
__webpack_require__.r(__webpack_exports__); | ||
/* harmony export */ __webpack_require__.d(__webpack_exports__, { | ||
/* harmony export */ "getFullscreenElement": function() { return /* binding */ getFullscreenElement; }, | ||
/* harmony export */ "isFullscreenActive": function() { return /* binding */ isFullscreenActive; }, | ||
/* harmony export */ "exitFullscreen": function() { return /* binding */ exitFullscreen; }, | ||
/* harmony export */ "requestFullscreen": function() { return /* binding */ requestFullscreen; }, | ||
/* harmony export */ "fullscreenAllowed": function() { return /* binding */ fullscreenAllowed; }, | ||
/* harmony export */ "bindFullscreenChangeListener": function() { return /* binding */ bindFullscreenChangeListener; }, | ||
/* harmony export */ "isMobile": function() { return /* binding */ isMobile; } | ||
/* harmony export */ }); | ||
/* harmony import */ var core_js_modules_es_array_index_of__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.index-of */ "./node_modules/core-js/modules/es.array.index-of.js"); | ||
/* harmony import */ var core_js_modules_es_array_index_of__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_index_of__WEBPACK_IMPORTED_MODULE_0__); | ||
/* harmony import */ var core_js_modules_es_array_join__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.join */ "./node_modules/core-js/modules/es.array.join.js"); | ||
/* harmony import */ var core_js_modules_es_array_join__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_join__WEBPACK_IMPORTED_MODULE_1__); | ||
/* harmony import */ var core_js_modules_es_string_trim__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.string.trim */ "./node_modules/core-js/modules/es.string.trim.js"); | ||
/* harmony import */ var core_js_modules_es_string_trim__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_trim__WEBPACK_IMPORTED_MODULE_2__); | ||
/* provided dependency */ var jQuery = __webpack_require__(/*! jquery */ "jquery"); | ||
/* provided dependency */ var $ = __webpack_require__(/*! jquery */ "jquery"); | ||
/* global BookReader */ | ||
/** | ||
* Toggles browser's native fullscreen mode if available device is not mobile | ||
*/ | ||
if (!isMobile()) { | ||
var EVENT_NAMESPACE = '.bookreader_vendor-fullscreen'; | ||
jQuery.extend(BookReader.defaultOptions, { | ||
/** @type {boolean} */ | ||
enableVendorFullscreenPlugin: true | ||
}); | ||
/** @override */ | ||
BookReader.prototype.setup = function (super_) { | ||
return function (options) { | ||
super_.call(this, options); | ||
this.isVendorFullscreenActive = false; | ||
}; | ||
}(BookReader.prototype.setup); | ||
/** @override */ | ||
BookReader.prototype.getInitialMode = function (super_) { | ||
return function (params) { | ||
var nextMode = super_.call(this, params); | ||
if (this.isVendorFullscreenActive) { | ||
nextMode = this.constMode1up; | ||
} | ||
return nextMode; | ||
}; | ||
}(BookReader.prototype.getInitialMode); | ||
/** @override */ | ||
BookReader.prototype.init = function (super_) { | ||
return function () { | ||
super_.call(this); | ||
if (!fullscreenAllowed()) { | ||
return; | ||
} // In fullscreen mode the colorbox and overlay need to be inside the fullscreen element to display properly. | ||
bindFullscreenChangeListener(this, function (e) { | ||
e.data.resize(); | ||
e.data.updateBrClasses(); | ||
var cboxOverlay = $('#cboxOverlay'); | ||
var cbox = $('#colorbox'); | ||
if (isFullscreenActive()) { | ||
// In full screen mode, the colorbox and overlay need | ||
// to be children of the fullscreen element to display properly. | ||
var $fullscreen = $(getFullscreenElement()); | ||
$fullscreen.append(cboxOverlay).append(cbox); | ||
} else { | ||
// In non-fullscreen mode, the colorbox and overlay need | ||
// to be children of the main document body. | ||
$(document.body).append(cboxOverlay).append(cbox); | ||
} | ||
}); | ||
}; | ||
}(BookReader.prototype.init); | ||
/** | ||
* Start fullscreen mode | ||
*/ | ||
BookReader.prototype.enterFullWindow = function () { | ||
var _this = this; | ||
this.refs.$brContainer.css('opacity', 0); | ||
var windowWidth = $(window).width(); | ||
if (windowWidth <= this.onePageMinBreakpoint) { | ||
this.switchMode(this.constMode1up); | ||
} | ||
this.isVendorFullscreenActive = true; | ||
this.updateBrClasses(); | ||
this.resize(); | ||
this.jumpToIndex(this.currentIndex()); | ||
this.refs.$brContainer.animate({ | ||
opacity: 1 | ||
}, 400, 'linear'); | ||
$(document).on("keyup.".concat(EVENT_NAMESPACE), function (e) { | ||
if (e.keyCode === 27) _this.exitFullScreen(); | ||
}); | ||
}; | ||
/** | ||
* Exit from fullscreen mode | ||
*/ | ||
BookReader.prototype.exitFullWindow = function () { | ||
this.refs.$brContainer.css('opacity', 0); | ||
$(document).off('keyup' + EVENT_NAMESPACE); | ||
this.isFullscreenActive = false; | ||
this.updateBrClasses(); | ||
this.resize(); | ||
this.refs.$brContainer.animate({ | ||
opacity: 1 | ||
}, 400, 'linear'); | ||
}; | ||
/** | ||
* Returns true if fullscreen mode is enabled | ||
* | ||
* @returns {boolean} | ||
*/ | ||
BookReader.prototype.isFullscreen = function () { | ||
return isFullscreenActive() || this.isVendorFullscreenActive; | ||
}; | ||
/** | ||
* Toggle screen | ||
*/ | ||
BookReader.prototype.toggleFullscreen = function () { | ||
if (this.isFullscreen()) { | ||
if (fullscreenAllowed()) { | ||
exitFullscreen(); | ||
} else { | ||
this.exitFullWindow(); | ||
} | ||
} else { | ||
if (fullscreenAllowed()) { | ||
requestFullscreen(this.refs.$br[0]); | ||
} else { | ||
this.enterFullWindow(); | ||
} | ||
} | ||
}; | ||
/** @deprecated */ | ||
BookReader.util.isMobile = isMobile; | ||
/** @deprecated */ | ||
BookReader.util.getFullscreenElement = getFullscreenElement; | ||
/** @deprecated */ | ||
BookReader.util.bindFullscreenChangeListener = bindFullscreenChangeListener; | ||
/** @deprecated */ | ||
BookReader.util.fullscreenAllowed = fullscreenAllowed; | ||
/** @deprecated */ | ||
BookReader.util.requestFullscreen = requestFullscreen; | ||
/** @deprecated */ | ||
BookReader.util.exitFullscreen = exitFullscreen; | ||
/** @deprecated */ | ||
BookReader.util.isFullscreenActive = isFullscreenActive; | ||
} | ||
/** | ||
* Returns the DOM element being used for fullscreen. | ||
* | ||
* @returns {HTMLElement} | ||
* @see https://developer.mozilla.org/en-US/docs/Web/API/DocumentOrShadowRoot/fullscreenElement | ||
*/ | ||
function getFullscreenElement() { | ||
return document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement; | ||
} | ||
/** | ||
* Returns true if the document is in fullscreen mode. | ||
* | ||
* @returns {boolean} | ||
*/ | ||
function isFullscreenActive() { | ||
var fullscreenElement = getFullscreenElement(); | ||
return fullscreenElement !== null && fullscreenElement !== undefined; | ||
} | ||
/** | ||
* Exits fullscreen mode. | ||
* | ||
* @see https://developer.mozilla.org/en-US/docs/Web/API/Document/exitFullscreen | ||
*/ | ||
function exitFullscreen() { | ||
if (document.exitFullscreen) { | ||
document.exitFullscreen(); | ||
} else if (document.webkitExitFullscreen) { | ||
document.webkitExitFullscreen(); | ||
} else if (document.mozCancelFullScreen) { | ||
document.mozCancelFullScreen(); | ||
} else if (document.msExitFullscreen) { | ||
document.msExitFullscreen(); | ||
} | ||
} | ||
/** | ||
* Requests fullscreen mode for the given element | ||
* | ||
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullscreen | ||
*/ | ||
function requestFullscreen(element) { | ||
if (element.requestFullscreen) { | ||
element.requestFullscreen(); | ||
} else if (element.webkitRequestFullscreen) { | ||
element.webkitRequestFullscreen(); | ||
} else if (element.mozRequestFullScreen) { | ||
element.mozRequestFullScreen(); | ||
} else if (element.msRequestFullscreen) { | ||
element.msRequestFullscreen(); | ||
} | ||
} | ||
/** | ||
* Returns true if fullscreen mode is allowed on this device and document. | ||
* | ||
* @returns {boolean} | ||
* @see https://developer.mozilla.org/en-US/docs/Web/API/Document/fullscreenEnabled | ||
*/ | ||
function fullscreenAllowed() { | ||
return document.fullscreenEnabled || document.webkitFullscreenEnabled || document.mozFullScreenEnabled || document.msFullScreenEnabled; | ||
} | ||
/** | ||
* jQuery-style binding to a fullscreenchange event. | ||
* | ||
* @see https://developer.mozilla.org/en-US/docs/Web/API/Document/fullscreenchange_event | ||
*/ | ||
function bindFullscreenChangeListener(data, fullscreenchangeListener) { | ||
var event = 'fullscreenchange '; | ||
var vendor_prefixes = ['webkit', 'moz', 'ms']; | ||
var all_events = $.trim(event + vendor_prefixes.join(event) + event); | ||
$(document).bind(all_events, data, fullscreenchangeListener); | ||
} | ||
/** | ||
* Returns true if current device is mobile | ||
* | ||
* @returns {boolean} | ||
*/ | ||
function isMobile() { | ||
return typeof window.orientation !== 'undefined' || navigator.userAgent.indexOf('IEMobile') !== -1; | ||
} | ||
/***/ }), | ||
/***/ "./node_modules/core-js/internals/string-trim-forced.js": | ||
/*!**************************************************************!*\ | ||
!*** ./node_modules/core-js/internals/string-trim-forced.js ***! | ||
\**************************************************************/ | ||
/*! unknown exports (runtime-defined) */ | ||
/*! runtime requirements: module, __webpack_require__ */ | ||
/*! CommonJS bailout: module.exports is used directly at 8:0-14 */ | ||
/***/ (function(module, __unused_webpack_exports, __webpack_require__) { | ||
var fails = __webpack_require__(/*! ../internals/fails */ "./node_modules/core-js/internals/fails.js"); | ||
var whitespaces = __webpack_require__(/*! ../internals/whitespaces */ "./node_modules/core-js/internals/whitespaces.js"); | ||
var non = '\u200B\u0085\u180E'; | ||
// check that a method works with the correct list | ||
// of whitespaces and has a correct name | ||
module.exports = function (METHOD_NAME) { | ||
return fails(function () { | ||
return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME; | ||
}); | ||
}; | ||
/***/ }), | ||
/***/ "./node_modules/core-js/internals/string-trim.js": | ||
/*!*******************************************************!*\ | ||
!*** ./node_modules/core-js/internals/string-trim.js ***! | ||
\*******************************************************/ | ||
/*! unknown exports (runtime-defined) */ | ||
/*! runtime requirements: module, __webpack_require__ */ | ||
/*! CommonJS bailout: module.exports is used directly at 18:0-14 */ | ||
/***/ (function(module, __unused_webpack_exports, __webpack_require__) { | ||
var requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ "./node_modules/core-js/internals/require-object-coercible.js"); | ||
var whitespaces = __webpack_require__(/*! ../internals/whitespaces */ "./node_modules/core-js/internals/whitespaces.js"); | ||
var whitespace = '[' + whitespaces + ']'; | ||
var ltrim = RegExp('^' + whitespace + whitespace + '*'); | ||
var rtrim = RegExp(whitespace + whitespace + '*$'); | ||
// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation | ||
var createMethod = function (TYPE) { | ||
return function ($this) { | ||
var string = String(requireObjectCoercible($this)); | ||
if (TYPE & 1) string = string.replace(ltrim, ''); | ||
if (TYPE & 2) string = string.replace(rtrim, ''); | ||
return string; | ||
}; | ||
}; | ||
module.exports = { | ||
// `String.prototype.{ trimLeft, trimStart }` methods | ||
// https://tc39.github.io/ecma262/#sec-string.prototype.trimstart | ||
start: createMethod(1), | ||
// `String.prototype.{ trimRight, trimEnd }` methods | ||
// https://tc39.github.io/ecma262/#sec-string.prototype.trimend | ||
end: createMethod(2), | ||
// `String.prototype.trim` method | ||
// https://tc39.github.io/ecma262/#sec-string.prototype.trim | ||
trim: createMethod(3) | ||
}; | ||
/***/ }), | ||
/***/ "./node_modules/core-js/internals/whitespaces.js": | ||
/*!*******************************************************!*\ | ||
!*** ./node_modules/core-js/internals/whitespaces.js ***! | ||
\*******************************************************/ | ||
/*! unknown exports (runtime-defined) */ | ||
/*! runtime requirements: module */ | ||
/*! CommonJS bailout: module.exports is used directly at 3:0-14 */ | ||
/***/ (function(module) { | ||
// a string of all valid unicode whitespaces | ||
// eslint-disable-next-line max-len | ||
module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; | ||
/***/ }), | ||
/***/ "./node_modules/core-js/modules/es.string.trim.js": | ||
/*!********************************************************!*\ | ||
!*** ./node_modules/core-js/modules/es.string.trim.js ***! | ||
\********************************************************/ | ||
/*! unknown exports (runtime-defined) */ | ||
/*! runtime requirements: __webpack_require__ */ | ||
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { | ||
"use strict"; | ||
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js/internals/export.js"); | ||
var $trim = __webpack_require__(/*! ../internals/string-trim */ "./node_modules/core-js/internals/string-trim.js").trim; | ||
var forcedStringTrimMethod = __webpack_require__(/*! ../internals/string-trim-forced */ "./node_modules/core-js/internals/string-trim-forced.js"); | ||
// `String.prototype.trim` method | ||
// https://tc39.github.io/ecma262/#sec-string.prototype.trim | ||
$({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, { | ||
trim: function trim() { | ||
return $trim(this); | ||
} | ||
}); | ||
/***/ }) | ||
}, | ||
0,[["./src/js/plugins/plugin.vendor-fullscreen.js","BookReader.js"]]]); | ||
//# sourceMappingURL=plugin.vendor-fullscreen.js.map |
{ | ||
"name": "@internetarchive/bookreader", | ||
"version": "4.20.0", | ||
"version": "4.20.1-alpha1", | ||
"description": "The Internet Archive BookReader.", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -50,3 +50,7 @@ //@ts-check | ||
} | ||
}).then(xmlMap => xmlMap && $(xmlMap).find("OBJECT")); | ||
}).then(xmlMap => { | ||
console.log("XML MAP", xmlMap); | ||
debugger; | ||
return xmlMap && $(xmlMap).find("OBJECT"); | ||
}); | ||
} | ||
@@ -53,0 +57,0 @@ |
@@ -8,3 +8,3 @@ // @ts-check | ||
{ | ||
mode: 'production', | ||
mode: 'development', | ||
// Output file -> srcfile | ||
@@ -11,0 +11,0 @@ entry: { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
7885219
47112
3