diff --git a/assets/styles/components/_specials.scss b/assets/styles/components/_specials.scss index 9c7b4023c..0343d442b 100644 --- a/assets/styles/components/_specials.scss +++ b/assets/styles/components/_specials.scss @@ -38,8 +38,6 @@ $footnote-blockquote-margin-left: 1.5em !default; $footnote-blockquote-font-size: 0.95em !default; $footnote-number-marker-font-size: $sup-sub-font-size !default; $footnote-number-marker-line-height: $sup-sub-line-height !default; -$footnote-mathjax-width: 3em !default; -$footnote-mathjax-padding-bottom: 0.4em !default; // Endnotes $endnote-margin-left: 1.5em !default; diff --git a/dist/mix-manifest.json b/dist/mix-manifest.json index a886b6806..f04512046 100644 --- a/dist/mix-manifest.json +++ b/dist/mix-manifest.json @@ -1,5 +1,5 @@ { - "/scripts/book.js": "/scripts/book.js?id=93a82497e30e003e18a2733ea64a8897", + "/scripts/book.js": "/scripts/book.js?id=4933ce814a30d618fc3381b04adbc909", "/scripts/pane.js": "/scripts/pane.js?id=7e5b385cb135973c79f77706c6f54cd1", "/scripts/collapse-sections.js": "/scripts/collapse-sections.js?id=b902d882dd21410b4387d805cd8a197f", "/scripts/lightbox.js": "/scripts/lightbox.js?id=cb2b7b2a5fb303c3095de89b8c31a28c", diff --git a/dist/scripts/book.js b/dist/scripts/book.js index 8b46196e3..d65445d35 100644 --- a/dist/scripts/book.js +++ b/dist/scripts/book.js @@ -1 +1 @@ -(()=>{"use strict";var t,e={737:()=>{const t={init:function(){if(document.body.classList.remove("no-js"),document.body.classList.add("js"),function(){for(var t=document.getElementsByTagName("section"),e=0,n=t.length;e p, .dropdown > div.reading-header__toc__title"),Array.prototype.forEach.call(n,(function(t){t.innerHTML='\n\t\t\t\t\n\t\t\t\t');var e=t.nextElementSibling;e.hidden=!0;var n=t.querySelector("button"),o=t.querySelector("button > .arrow"),a=e.querySelectorAll("a");Array.prototype.forEach.call(a,(function(t){t.onblur=function(o){t===a[a.length-1]&&"LI"!==o.relatedTarget.parentNode.nodeName&&(n.setAttribute("aria-expanded",!1),e.hidden=!0)}}));var i=jQuery("button[aria-expanded] > svg"),r=jQuery("button[aria-expanded]");jQuery(r,i).on("click",(function(t){var a="true"===n.getAttribute("aria-expanded")||!1;n===t.target||o===t.target.closest("svg")?(n.setAttribute("aria-expanded",!a),e.hidden=a):(n.setAttribute("aria-expanded",!1),e.hidden=!0)})),document.onclick=function(t){var o="book-header__cover__downloads",a=jQuery(t.target),i=jQuery(".".concat(o)).find("button");0===i.length||a.closest("div").hasClass(o)||a.hasClass("dropdown-item")||"true"===i.attr("aria-expanded")&&(n.setAttribute("aria-expanded",!1),e.hidden=!0)},document.onkeydown=function(t){27!==t.which||e.hidden||(n.setAttribute("aria-expanded",!1),e.hidden=!0)}})),o=document.querySelectorAll(".toc__part--full > .toc__title__container, .toc__chapter--full > .toc__title__container, .toc__front-matter--full > .toc__title__container, .toc__back-matter--full > .toc__title__container"),a=document.body.classList.contains("home"),Array.prototype.forEach.call(o,(function(t){var e=!!(a&&t.parentNode.classList.contains("toc__part")||!a&&t.parentNode.classList.contains("toc__parent")),n="".concat(pressbooksBook.toggle_contents," '").concat(t.innerText,"'");t.innerHTML="\n\t\t\t\t".concat(t.innerHTML,'\n\t\t\t\t\n\t\t\t\t');var o=t.nextElementSibling;!1===e||!a&&!t.parentNode.classList.contains("toc__parent")?o.hidden=!0:a&&t.parentNode.classList.contains("toc__parent")&&(o.hidden=!1);var i=t.querySelector("button");i.onclick=function(){var t="true"===i.getAttribute("aria-expanded")||!1;i.setAttribute("aria-expanded",!t),o.hidden=t}})),jQuery((function(t){var e=t(".h5p-row-item"),n=t(".h5p-activity-container");n.hide(),t("#h5p-show-hide").text(t("#h5p-show-hide").attr("show-all-text")),t(".h5p-row-item").text(t(".h5p-row-item").attr("show-activity-text")),e.on("click",(function(){t(this).text()===t(this).attr("show-activity-text")?(n.hide(),t(this).closest("tr").next(this).show("slow"),t(this).text(t(this).attr("hide-activity-text")),window.dispatchEvent(new Event("resize"))):(t(this).closest("tr").next(this).hide(),t(this).text(t(this).attr("show-activity-text")))})),t("#h5p-show-hide").on("click",(function(){t(this).text()===t(this).attr("show-all-text")?(n.show(),t(this).text(t(this).attr("hide-all-text")),t(".h5p-row-item").text(t(".h5p-row-item").attr("hide-activity-text")),window.dispatchEvent(new Event("resize"))):(n.hide(),t(this).text(t(this).attr("show-all-text")),t(".h5p-row-item").text(t(".h5p-row-item").attr("show-activity-text")))}))}));var i=document.getElementsByClassName("cta"),r=function(t){t[0].classList.toggle("hidden")};!function(t){var e="; ".concat(document.cookie).split("; ".concat(t,"="));if(2===e.length)return e.pop().split(";").shift()}("display_cta")&&i.length>0&&r(i);var c=document.getElementById("close-cta");c&&c.addEventListener("click",(function(t){t.preventDefault();var e=window.location.pathname.split("/")[1];document.cookie="display_cta=1; path=/"+e,r(i)}))},finalize:function(){}},e={init:function(){jQuery((function(t){t(document.body).on("click",".js-toggle-block",(function(e){var n=t(this);n.parents(".js-block").toggleClass("block-toggle--visible"),n.toggleClass("--visible")})),t(document.body).on("click",".toc__toggle #show",(function(e){var n=t(this);t('.toc [class*="--full"]').each((function(e){t(this).find("button").attr("aria-expanded","true"),t(this).find("ol").prop("hidden",!1)})),n.parents(".toc__toggle").attr("data-expanded","true")})),t(document.body).on("click",".toc__toggle #hide",(function(e){var n=t(this);t('.toc [class*="--full"]').each((function(e){t(this).find("button").attr("aria-expanded","false"),t(this).find("ol").attr("hidden","true")})),n.parents(".toc__toggle").attr("data-expanded","false")}))}))},finalize:function(){}},n={init:function(){jQuery((function(t){var e=t(".block-reading-meta__compare__toggle");e.on("click",(function(n){var o=t(".block-reading-meta__compare__activity"),a=t(".alert"),i=t(".block-reading-meta__compare__comparison"),r=t(".block-reading-meta__compare__stats"),c=t(".block-reading-meta__compare__current");if(a.addClass("visually-hidden"),"false"===t(n.currentTarget).attr("aria-expanded"))if(e.attr("aria-expanded",!0),o.prop("hidden",!1),i.hasClass("populated"))i.prop("hidden",!1),o.attr("hidden",!0);else{a.text(pressbooksBook.comparison_loading);var s=c.html(),d=c.attr("data-source-endpoint");fetch(d).then((function(e){if(200!==e.status)return a.addClass("alert--error").removeClass("visually-hidden").text(pressbooksBook.chapter_not_loaded),void o.attr("hidden",!0);e.json().then((function(e){var n=t("
"+e.content.raw+"
").html();t.post(pressbooksBook.ajaxurl,{action:"text_diff",security:pressbooksBook.text_diff_nonce,left:n,right:s},(function(e){if(!0===e.success){var n=JSON.parse(e.data);i.append(n),i.children("table");var c=t(".diff del").length,s=t(".diff ins").length;r.children("ins").children(".num").text(s),r.children("del ").children(".num").text(c),o.attr("hidden",!0),a.text(pressbooksBook.comparison_loaded),i.prop("hidden",!1)}}))}))})).catch((function(t){a.addClass("alert--error").removeClass("visually-hidden").text(pressbooksBook.chapter_not_loaded),o.attr("hidden",!0)}))}else e.attr("aria-expanded",!1),i.attr("hidden",!0),t(".diff").remove()})),t(document).ready((function(){var e;t(window).on("scroll",(function(){t(window).scrollTop()>250&&t(".nav-reading__up").animate({opacity:1},0),t(window).scrollTop()<250&&t(".nav-reading__up").animate({opacity:0},0)})),t(".nav-reading__up").on("click",(function(e){return e.preventDefault(),t(".nav-reading__up").blur().animate({opacity:0},0),t("html, body").animate({scrollTop:0},0),!1})),t(document).on("keydown",(function(e){if(!t("body").hasClass("no-navigation")){var n=!1;37===e.which?n=t(".nav-previous a, .js-nav-previous a").attr("href"):39===e.which&&(n=t(".nav-next a, .js-nav-next a").attr("href")),n&&!t("textarea, input").is(":focus")&&(window.location=n)}})),(e=t("iframe[src*='//player.vimeo.com'], iframe[src*='//www.youtube.com']")).each((function(){t(this).data("aspectRatio",this.height/this.width).removeAttr("height").removeAttr("width")})),t(window).on("resize",(function(){e.each((function(){var e=t(this),n=e.parent().parent().width();e.width(n).height(n*e.data("aspectRatio"))}))})).trigger("resize")}))}))},finalize:function(){}},o=function(t){return"".concat(t.charAt(0).toLowerCase()).concat(t.replace(/[\W_]/g,"|").split("|").map((function(t){return"".concat(t.charAt(0).toUpperCase()).concat(t.slice(1))})).join("").slice(1))};function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function i(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"init",n=arguments.length>2?arguments[2]:void 0,o=""!==t&&this.routes[t]&&"function"==typeof this.routes[t][e];o&&this.routes[t][e](n)}},{key:"loadEvents",value:function(){var t=this;this.fire("common"),document.body.className.toLowerCase().replace(/-/g,"_").split(/\s+/).map(o).forEach((function(e){t.fire(e),t.fire(e,"finalize")})),this.fire("common","finalize")}}],n&&i(e.prototype,n),a&&i(e,a),Object.defineProperty(e,"prototype",{writable:!1}),t}();var c=new r({common:t,home:e,single:n});jQuery(document).ready((function(){return c.loadEvents()}))},340:()=>{},811:()=>{}},n={};function o(t){var a=n[t];if(void 0!==a)return a.exports;var i=n[t]={exports:{}};return e[t](i,i.exports,o),i.exports}o.m=e,t=[],o.O=(e,n,a,i)=>{if(!n){var r=1/0;for(l=0;l=i)&&Object.keys(o.O).every((t=>o.O[t](n[s])))?n.splice(s--,1):(c=!1,i0&&t[l-1][2]>i;l--)t[l]=t[l-1];t[l]=[n,a,i]},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{var t={370:0,97:0,765:0};o.O.j=e=>0===t[e];var e=(e,n)=>{var a,i,[r,c,s]=n,d=0;if(r.some((e=>0!==t[e]))){for(a in c)o.o(c,a)&&(o.m[a]=c[a]);if(s)var l=s(o)}for(e&&e(n);do(737))),o.O(void 0,[97,765],(()=>o(340)));var a=o.O(void 0,[97,765],(()=>o(811)));a=o.O(a)})(); \ No newline at end of file +(()=>{"use strict";var t,e={761:()=>{const t={init:function(){if(document.body.classList.remove("no-js"),document.body.classList.add("js"),function(){for(var t=document.getElementsByTagName("section"),e=0,n=t.length;e p, .dropdown > div.reading-header__toc__title"),Array.prototype.forEach.call(n,(function(t){t.innerHTML='\n\t\t\t\t\n\t\t\t\t');var e=t.nextElementSibling;e.hidden=!0;var n=t.querySelector("button"),o=t.querySelector("button > .arrow"),a=e.querySelectorAll("a");Array.prototype.forEach.call(a,(function(t){t.onblur=function(o){t===a[a.length-1]&&"LI"!==o.relatedTarget.parentNode.nodeName&&(n.setAttribute("aria-expanded",!1),e.hidden=!0)}}));var i=jQuery("button[aria-expanded] > svg"),r=jQuery("button[aria-expanded]");jQuery(r,i).on("click",(function(t){var a="true"===n.getAttribute("aria-expanded")||!1;n===t.target||o===t.target.closest("svg")?(n.setAttribute("aria-expanded",!a),e.hidden=a):(n.setAttribute("aria-expanded",!1),e.hidden=!0)})),document.onclick=function(t){var o="book-header__cover__downloads",a=jQuery(t.target),i=jQuery(".".concat(o)).find("button");0===i.length||a.closest("div").hasClass(o)||a.hasClass("dropdown-item")||"true"===i.attr("aria-expanded")&&(n.setAttribute("aria-expanded",!1),e.hidden=!0)},document.onkeydown=function(t){27!==t.which||e.hidden||(n.setAttribute("aria-expanded",!1),e.hidden=!0)}})),o=document.querySelectorAll(".toc__part--full > .toc__title__container, .toc__chapter--full > .toc__title__container, .toc__front-matter--full > .toc__title__container, .toc__back-matter--full > .toc__title__container"),a=document.body.classList.contains("home"),Array.prototype.forEach.call(o,(function(t){var e=!!(a&&t.parentNode.classList.contains("toc__part")||!a&&t.parentNode.classList.contains("toc__parent")),n="".concat(pressbooksBook.toggle_contents," '").concat(t.innerText,"'");t.innerHTML="\n\t\t\t\t".concat(t.innerHTML,'\n\t\t\t\t\n\t\t\t\t');var o=t.nextElementSibling;!1===e||!a&&!t.parentNode.classList.contains("toc__parent")?o.hidden=!0:a&&t.parentNode.classList.contains("toc__parent")&&(o.hidden=!1);var i=t.querySelector("button");i.onclick=function(){var t="true"===i.getAttribute("aria-expanded")||!1;i.setAttribute("aria-expanded",!t),o.hidden=t}})),jQuery((function(t){var e=t(".h5p-row-item"),n=t(".h5p-activity-container");n.hide(),t("#h5p-show-hide").text(t("#h5p-show-hide").attr("show-all-text")),t(".h5p-row-item").text(t(".h5p-row-item").attr("show-activity-text")),e.on("click",(function(){t(this).text()===t(this).attr("show-activity-text")?(n.hide(),t(this).closest("tr").next(this).show("slow"),t(this).text(t(this).attr("hide-activity-text")),window.dispatchEvent(new Event("resize"))):(t(this).closest("tr").next(this).hide(),t(this).text(t(this).attr("show-activity-text")))})),t("#h5p-show-hide").on("click",(function(){t(this).text()===t(this).attr("show-all-text")?(n.show(),t(this).text(t(this).attr("hide-all-text")),t(".h5p-row-item").text(t(".h5p-row-item").attr("hide-activity-text")),window.dispatchEvent(new Event("resize"))):(n.hide(),t(this).text(t(this).attr("show-all-text")),t(".h5p-row-item").text(t(".h5p-row-item").attr("show-activity-text")))}))}));var i=document.getElementsByClassName("cta"),r=function(t){t[0].classList.toggle("hidden")};!function(t){var e="; ".concat(document.cookie).split("; ".concat(t,"="));if(2===e.length)return e.pop().split(";").shift()}("display_cta")&&i.length>0&&r(i);var c=document.getElementById("close-cta");c&&c.addEventListener("click",(function(t){t.preventDefault();var e=window.location.pathname.split("/")[1];document.cookie="display_cta=1; path=/"+e,r(i)}))},finalize:function(){}},e={init:function(){jQuery((function(t){t(document.body).on("click",".js-toggle-block",(function(e){var n=t(this);n.parents(".js-block").toggleClass("block-toggle--visible"),n.toggleClass("--visible")})),t(document.body).on("click",".toc__toggle #show",(function(e){var n=t(this);t('.toc [class*="--full"]').each((function(e){t(this).find("button").attr("aria-expanded","true"),t(this).find("ol").prop("hidden",!1)})),n.parents(".toc__toggle").attr("data-expanded","true")})),t(document.body).on("click",".toc__toggle #hide",(function(e){var n=t(this);t('.toc [class*="--full"]').each((function(e){t(this).find("button").attr("aria-expanded","false"),t(this).find("ol").attr("hidden","true")})),n.parents(".toc__toggle").attr("data-expanded","false")}))}))},finalize:function(){}},n={init:function(){jQuery((function(t){var e=t(".block-reading-meta__compare__toggle");e.on("click",(function(n){var o=t(".block-reading-meta__compare__activity"),a=t(".alert"),i=t(".block-reading-meta__compare__comparison"),r=t(".block-reading-meta__compare__stats"),c=t(".block-reading-meta__compare__current");if(a.addClass("visually-hidden"),"false"===t(n.currentTarget).attr("aria-expanded"))if(e.attr("aria-expanded",!0),o.prop("hidden",!1),i.hasClass("populated"))i.prop("hidden",!1),o.attr("hidden",!0);else{a.text(pressbooksBook.comparison_loading);var s=c.html(),d=c.attr("data-source-endpoint");fetch(d).then((function(e){if(200!==e.status)return a.addClass("alert--error").removeClass("visually-hidden").text(pressbooksBook.chapter_not_loaded),void o.attr("hidden",!0);e.json().then((function(e){var n=t("
"+e.content.raw+"
").html();t.post(pressbooksBook.ajaxurl,{action:"text_diff",security:pressbooksBook.text_diff_nonce,left:n,right:s},(function(e){if(!0===e.success){var n=JSON.parse(e.data);i.append(n),i.children("table");var c=t(".diff del").length,s=t(".diff ins").length;r.children("ins").children(".num").text(s),r.children("del ").children(".num").text(c),o.attr("hidden",!0),a.text(pressbooksBook.comparison_loaded),i.prop("hidden",!1)}}))}))})).catch((function(t){a.addClass("alert--error").removeClass("visually-hidden").text(pressbooksBook.chapter_not_loaded),o.attr("hidden",!0)}))}else e.attr("aria-expanded",!1),i.attr("hidden",!0),t(".diff").remove()})),t(document).ready((function(){var e;t(window).on("scroll",(function(){t(window).scrollTop()>250&&t(".nav-reading__up").animate({opacity:1},0),t(window).scrollTop()<250&&t(".nav-reading__up").animate({opacity:0},0)})),t(".nav-reading__up").on("click",(function(e){return e.preventDefault(),t(".nav-reading__up").blur().animate({opacity:0},0),t("html, body").animate({scrollTop:0},0),!1})),t(document).on("keydown",(function(e){if(!t("body").hasClass("no-navigation")){var n=!1;37===e.which?n=t(".nav-previous a, .js-nav-previous a").attr("href"):39===e.which&&(n=t(".nav-next a, .js-nav-next a").attr("href")),n&&!t("textarea, input").is(":focus")&&(window.location=n)}})),(e=t("iframe[src*='//player.vimeo.com'], iframe[src*='//www.youtube.com']")).each((function(){t(this).data("aspectRatio",this.height/this.width).removeAttr("height").removeAttr("width")})),t(window).on("resize",(function(){e.each((function(){var e=t(this),n=e.parent().parent().width();e.width(n).height(n*e.data("aspectRatio"))}))})).trigger("resize")}))}))},finalize:function(){}},o=function(t){return"".concat(t.charAt(0).toLowerCase()).concat(t.replace(/[\W_]/g,"|").split("|").map((function(t){return"".concat(t.charAt(0).toUpperCase()).concat(t.slice(1))})).join("").slice(1))};function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function i(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"init",n=arguments.length>2?arguments[2]:void 0,o=""!==t&&this.routes[t]&&"function"==typeof this.routes[t][e];o&&this.routes[t][e](n)}},{key:"loadEvents",value:function(){var t=this;this.fire("common"),document.body.className.toLowerCase().replace(/-/g,"_").split(/\s+/).map(o).forEach((function(e){t.fire(e),t.fire(e,"finalize")})),this.fire("common","finalize")}}],n&&i(e.prototype,n),a&&i(e,a),Object.defineProperty(e,"prototype",{writable:!1}),t}();var c=new r({common:t,home:e,single:n});jQuery(document).ready((function(){return c.loadEvents()}))},283:()=>{},40:()=>{}},n={};function o(t){var a=n[t];if(void 0!==a)return a.exports;var i=n[t]={exports:{}};return e[t](i,i.exports,o),i.exports}o.m=e,t=[],o.O=(e,n,a,i)=>{if(!n){var r=1/0;for(l=0;l=i)&&Object.keys(o.O).every((t=>o.O[t](n[s])))?n.splice(s--,1):(c=!1,i0&&t[l-1][2]>i;l--)t[l]=t[l-1];t[l]=[n,a,i]},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{var t={198:0,119:0,833:0};o.O.j=e=>0===t[e];var e=(e,n)=>{var a,i,[r,c,s]=n,d=0;if(r.some((e=>0!==t[e]))){for(a in c)o.o(c,a)&&(o.m[a]=c[a]);if(s)var l=s(o)}for(e&&e(n);do(761))),o.O(void 0,[119,833],(()=>o(283)));var a=o.O(void 0,[119,833],(()=>o(40)));a=o.O(a)})(); \ No newline at end of file diff --git a/package.json b/package.json index 3d309f936..2fd3e473d 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "aetna": "^1.0.0", - "buckram": "^1.8.2", + "buckram": "^1.8.3", "details-element-polyfill": "^2.4.0", "lity": "^2.4.0", "sharer.js": "^0.5.1", diff --git a/packages/buckram/assets/styles/components/specials/_footnotes.scss b/packages/buckram/assets/styles/components/specials/_footnotes.scss index b72aca688..febd82e93 100644 --- a/packages/buckram/assets/styles/components/specials/_footnotes.scss +++ b/packages/buckram/assets/styles/components/specials/_footnotes.scss @@ -41,11 +41,6 @@ footnote-style-position: outside; } - .mathjax { - width: $footnote-mathjax-width; - padding-bottom: $footnote-mathjax-padding-bottom; - } - // Footnote & Endnote number markers (in body text) .endnote::footnote-call,