/*see archive.js in same dir for source*/ /* Copyright(c)2008-2018 Internet Archive. Software license AGPL version 3. */ 'use strict'; var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } (function jquery_no_conflict($) { // convenient, no? Stateless function, global to all Play objects // eslint-disable-next-line no-console var log = location.host.substr(0, 4) !== 'www-' ? function () {} : console.log.bind(console); /** * Replaces a BookReader fragment string in a URL path with a new fragment, * or adds the path string to the end of the URL if it's not set * * NOTE: BookReader "fragments" are not necessarily URL hash fragments, * though they may be stored in the hash. * * @param {String} pathString * @param {String} newFragment * @returns {String} */ function replaceBookReaderFragment(pathString, newFragment) { // See http://openlibrary.org/dev/docs/bookurls var fragmentRegex = /(\/((page|mode|search)\/[^/?$]+))+\/?(?=\?|$)/g; if (pathString.match(fragmentRegex)) return pathString.replace(fragmentRegex, '/' + newFragment); return (pathString + '/' + newFragment).replace(/\/+/g, '/'); } // class memnonic: Archive JS var AJS = function () { function AJS() { _classCallCheck(this, AJS); } _createClass(AJS, null, [{ key: 'tvAD', // NOTE: needs to stay in sync w/ archive.less value: function tvAD(elm) { var in_show = $(elm).parents('.shows'); var id = void 0; var chan = void 0; var show = void 0; if (in_show.length) { // see if we've already gotten and displayed the "Air date" section... var opened = $(elm).parent().find('.shows'); if (opened.length) { // ... yes, simply close/open it opened.toggle(); return false; } chan = in_show.attr('data-chan'); show = $(elm).text(); } else { chan = $(elm).text(); id = 'menu-chan-'.concat(chan); var div = $('#' + id); if (div.length) { div.toggle(); return false; } } var url = location.href + '?channel=' + chan; if (in_show.length) url += '&program='.concat(encodeURIComponent(show)); log(url); $.get(url, function (htm) { if (in_show.length) { $(elm).parent().append('