Skip to content

Commit

Permalink
Update version & pressbooks-build-tools compatibility (#795)
Browse files Browse the repository at this point in the history
* Update version & changelog

* Fix typo

* Update Buckram version

* Update to use Mix 6 and lint

* Disable eslint nags

* Update localizations

* Update style.css

Update version for next release

* Update README.md

Update readme

* Update localizations

Co-authored-by: Ho Man Chan <[email protected]>
  • Loading branch information
SteelWagstaff and ho-man-chan authored Jul 6, 2021
1 parent 57c26d2 commit 8fc6e15
Show file tree
Hide file tree
Showing 51 changed files with 209 additions and 284 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ This theme is named after Canadian media theorist Marshall McLuhan, who coined t
## Requirements

* PHP >= 7.3
* WordPress >= 5.6.2
* Pressbooks >= 5.20.0
* WordPress >= 5.7.2
* Pressbooks >= 5.24.0

## Installation

Expand All @@ -41,7 +41,7 @@ Then, from the GitHub Updater interface, navigate to the "Install Theme" tab. En

## Changelog

### 2.11.2
### 2.11.3

* See: https://github.com/pressbooks/pressbooks-book/releases/tag/2.11.2
* See: https://github.com/pressbooks/pressbooks-book/releases/tag/2.11.3
* Full release history available at: https://github.com/pressbooks/pressbooks-book/releases
2 changes: 1 addition & 1 deletion assets/src/scripts/book.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// import external dependencies

// import local dependencies
import Router from './util/Router';
import common from './routes/common';
import home from './routes/home';
import single from './routes/single';
import Router from './util/Router';

/** Populate Router instance with DOM routes */
const routes = new Router( {
Expand Down
6 changes: 6 additions & 0 deletions assets/src/scripts/collapse-sections.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ document.addEventListener( 'DOMContentLoaded', function () {

// Function to create a node list
// of the content between this <h1> and the next
/**
* @param elem
*/
const getContent = elem => {
let elems = [];
while (
Expand Down Expand Up @@ -82,6 +85,9 @@ document.addEventListener( 'DOMContentLoaded', function () {
// Assign the button
let btn = heading.querySelector( 'button' );

/**
*
*/
btn.onclick = () => {
// Cast the state as a boolean
let expanded = btn.getAttribute( 'aria-expanded' ) === 'true' || false;
Expand Down
8 changes: 7 additions & 1 deletion assets/src/scripts/pane.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
/**
*
*/
window.hypothesisConfig = () => {
return {
openSidebar: ( pressbooksHypothesis.openSidebar === '1' ) ? true : false,
showHighlights: ( pressbooksHypothesis.showHighlights === '1' ) ? true : false,
/**
* @param layoutParams
*/
onLayoutChange: layoutParams => {
const navReading = document.querySelector( '.nav-reading' );
if ( layoutParams.expanded === true ) {
Expand All @@ -20,5 +26,5 @@ window.hypothesisConfig = () => {
}
}
},
}
};
};
19 changes: 19 additions & 0 deletions assets/src/scripts/routes/common.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/* eslint import/no-anonymous-default-export: [2, {"allowObject": true}] */
export default {
/**
*
*/
init() {
// JavaScript to be fired on all pages
document.body.classList.remove( 'no-js' );
Expand Down Expand Up @@ -66,6 +70,9 @@ export default {
// Handle list items and events
Array.prototype.forEach.call( links, link => {
// Collapse the content menu if user tabs out.
/**
* @param e
*/
link.onblur = e => {
if ( link === links[links.length - 1] && e.relatedTarget.parentNode.nodeName !== 'LI' ) {
btn.setAttribute( 'aria-expanded', false );
Expand All @@ -92,6 +99,9 @@ export default {
}
} );

/**
* @param e
*/
document.onclick = e => {
const downloadClass = 'book-header__cover__downloads';
const $target = jQuery( e.target );
Expand All @@ -109,6 +119,9 @@ export default {
}
};

/**
* @param e
*/
document.onkeydown = e => {
// Hide the content when 'Esc' key is pressed (and content is showing)
if ( e.which === 27 && ! content.hidden ) {
Expand Down Expand Up @@ -154,6 +167,9 @@ export default {
// Assign the button
let btn = entityTitle.querySelector( 'button' );

/**
*
*/
btn.onclick = () => {
// Cast the state as a boolean
let expanded = btn.getAttribute( 'aria-expanded' ) === 'true' || false;
Expand Down Expand Up @@ -201,6 +217,9 @@ export default {
} );

},
/**
*
*/
finalize() {
// JavaScript to be fired on all pages, after page specific JS is fired
},
Expand Down
12 changes: 7 additions & 5 deletions assets/src/scripts/util/Router.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ import camelCase from './camelCase';
class Router {
/**
* Create a new Router
* @param {Object} routes
*
* @param {object} routes
*/
constructor( routes ) {
this.routes = routes;
}

/**
* Fire Router events
*
* @param {string} route DOM-based route derived from body classes (`<body class="...">`)
* @param {string} [event] Events on the route. By default, `init` and `finalize` events are called.
* @param {string} [arg] Any custom argument to be passed to the event.
Expand All @@ -37,10 +39,10 @@ class Router {
* Automatically load and fire Router events
*
* Events are fired in the following order:
* * common init
* * page-specific init
* * page-specific finalize
* * common finalize
* common init
* page-specific init
* page-specific finalize
* common finalize
*/
loadEvents() {
// Fire common init JS
Expand Down
4 changes: 3 additions & 1 deletion assets/src/scripts/util/camelCase.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/* eslint import/no-anonymous-default-export: [2, {"allowArrowFunction": true}] */
/**
* the most terrible camelizer on the internet, guaranteed!
*
* @param {string} str String that isn't camel-case, e.g., CAMeL_CaSEiS-harD
* @return {string} String converted to camel-case, e.g., camelCaseIsHard
* @returns {string} String converted to camel-case, e.g., camelCaseIsHard
*/
export default str => `${str.charAt( 0 ).toLowerCase()}${str.replace( /[\W_]/g, '|' ).split( '|' )
.map( part => `${part.charAt( 0 ).toUpperCase()}${part.slice( 1 )}` )
Expand Down
108 changes: 101 additions & 7 deletions dist/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,106 @@
{
"/scripts/book.js": "/scripts/book.js?id=af07185482a38384a7bf",
"/styles/book.css": "/styles/book.css?id=3cbb775c3b4e63c64468",
"/styles/web-house-style.css": "/styles/web-house-style.css?id=d3c1aedc7525b0f30ccd",
"/scripts/collapse-sections.js": "/scripts/collapse-sections.js?id=ba8eb815cea5fd273013",
"/scripts/lightbox.js": "/scripts/lightbox.js?id=f3698731576f981b3aa8",
"/scripts/pane.js": "/scripts/pane.js?id=4173f00e886097d83339",
"/scripts/book.js": "/scripts/book.js?id=f97a2577f4e0b419ab12",
"/scripts/pane.js": "/scripts/pane.js?id=7e5b385cb135973c79f7",
"/scripts/collapse-sections.js": "/scripts/collapse-sections.js?id=83a9f50d491bda850fbc",
"/scripts/lightbox.js": "/scripts/lightbox.js?id=cb2b7b2a5fb303c3095d",
"/styles/web-house-style.css": "/styles/web-house-style.css?id=f2ec506de7eae2e9ddc5",
"/styles/book.css": "/styles/book.css?id=4bdd582985aebfe20328",
"/scripts/sharer.js": "/scripts/sharer.js?id=40da80ac58b2606eaedf",
"/scripts/lity.js": "/scripts/lity.js?id=57482ac9aa162ba60708",
"/scripts/details-element-polyfill.js": "/scripts/details-element-polyfill.js?id=60ad7c2161011e153d53",
"/styles/lity.css": "/styles/lity.css?id=9fc32fbde0b6f07a3ced"
"/styles/lity.css": "/styles/lity.css?id=9fc32fbde0b6f07a3ced",
"/images/amazon.png": "/images/amazon.png?id=800edd49516c95950aaf",
"/images/android-chrome-192x192.png": "/images/android-chrome-192x192.png?id=d3a1f2244b2f7abba374",
"/images/android-chrome-512x512.png": "/images/android-chrome-512x512.png?id=e5ca2f211159d7d43b26",
"/images/apple-touch-icon-120x120.png": "/images/apple-touch-icon-120x120.png?id=0056597639528e87f658",
"/images/apple-touch-icon-152x152.png": "/images/apple-touch-icon-152x152.png?id=19875d7ed3bc5c0ee970",
"/images/apple-touch-icon-180x180.png": "/images/apple-touch-icon-180x180.png?id=649d9918ed6dc0385895",
"/images/apple-touch-icon-60x60.png": "/images/apple-touch-icon-60x60.png?id=1a84de4d2c1f6c6bab46",
"/images/apple-touch-icon-76x76.png": "/images/apple-touch-icon-76x76.png?id=337b96a38827de76d2af",
"/images/apple-touch-icon.png": "/images/apple-touch-icon.png?id=649d9918ed6dc0385895",
"/images/asterisk.png": "/images/asterisk.png?id=574f731dcd3c5a4a462c",
"/images/barnes-and-noble.png": "/images/barnes-and-noble.png?id=3d0eb1de8fcf7f7705e3",
"/images/bg.png": "/images/bg.png?id=be16824e61a1c68f60a9",
"/images/blockquote-close.png": "/images/blockquote-close.png?id=7a2e053ceb8d0aee35c2",
"/images/blockquote-open.png": "/images/blockquote-open.png?id=900534c5c993f32d75fc",
"/images/book-info-detail.png": "/images/book-info-detail.png?id=41a1a3f3b73417c7b984",
"/images/book-info-stroke.png": "/images/book-info-stroke.png?id=ba2ffb1983ef06bb2b63",
"/images/buy-page-border-bottom-stroke.png": "/images/buy-page-border-bottom-stroke.png?id=5965d387f2781b3872b8",
"/images/by.svg": "/images/by.svg?id=7813b5794d8ba96aec20",
"/images/cc.svg": "/images/cc.svg?id=e3defa79f640d165173a",
"/images/em-dash.png": "/images/em-dash.png?id=e1962cf9acd587c8e8de",
"/images/epub-36.png": "/images/epub-36.png?id=75abde76f471b3f876cc",
"/images/epub-48.png": "/images/epub-48.png?id=74455b89af304d08cf1a",
"/images/epub-72.png": "/images/epub-72.png?id=cf929c4b6062eda850b9",
"/images/epub-96.png": "/images/epub-96.png?id=323850d19c2aaf13c568",
"/images/epub3-36.png": "/images/epub3-36.png?id=f1d1c2f13ac265913d1c",
"/images/epub3-48.png": "/images/epub3-48.png?id=acbd1ebb656d94d6b63d",
"/images/epub3-72.png": "/images/epub3-72.png?id=59467439597843410ebc",
"/images/epub3-96.png": "/images/epub3-96.png?id=55a03ff97534a7074b0b",
"/images/facebook-icon.png": "/images/facebook-icon.png?id=a0073ec3a8c90a012bc5",
"/images/favicon-16x16.png": "/images/favicon-16x16.png?id=454616a9f8584e8da1f0",
"/images/favicon-32x32.png": "/images/favicon-32x32.png?id=a6aaebb716b6ea46273f",
"/images/favicon.ico": "/images/favicon.ico?id=0c56238d5180176e5917",
"/images/footer-inner.png": "/images/footer-inner.png?id=b6238761317ce72ac352",
"/images/footer-shadow.png": "/images/footer-shadow.png?id=a1212f13533bbd741fbe",
"/images/google-plus-icon.png": "/images/google-plus-icon.png?id=3a8b54c93cc8975f0d9e",
"/images/ibooks.png": "/images/ibooks.png?id=a8a2dbb70773853ebc6b",
"/images/icml-36.png": "/images/icml-36.png?id=2d89e18440d4b8da476a",
"/images/icml-48.png": "/images/icml-48.png?id=5beaa6e95ab74a585dff",
"/images/icml-72.png": "/images/icml-72.png?id=624b62758f11d5eda43a",
"/images/icml-96.png": "/images/icml-96.png?id=e237bb6dc0c9d3d2da57",
"/images/jpg-36.png": "/images/jpg-36.png?id=21cb4555794bb1a611d5",
"/images/jpg-48.png": "/images/jpg-48.png?id=818f82c0f89155af5504",
"/images/jpg-72.png": "/images/jpg-72.png?id=ee928eee12b33af39c34",
"/images/jpg-96.png": "/images/jpg-96.png?id=46b82276430d098f27de",
"/images/kobo.png": "/images/kobo.png?id=1d0affb385b3b0dfd081",
"/images/login-formwrap.png": "/images/login-formwrap.png?id=47b07b7de9597420046f",
"/images/logo-login.png": "/images/logo-login.png?id=59b5464065612a7221d4",
"/images/mobi-36.png": "/images/mobi-36.png?id=49f06b9a43a158122ee5",
"/images/mobi-48.png": "/images/mobi-48.png?id=525046825b33acfff52d",
"/images/mobi-72.png": "/images/mobi-72.png?id=53512bd9f520a8886aae",
"/images/mobi-96.png": "/images/mobi-96.png?id=06ee2b29236fdf919af2",
"/images/mstile-144x144.png": "/images/mstile-144x144.png?id=94ba7618c01973460be6",
"/images/mstile-150x150.png": "/images/mstile-150x150.png?id=0471d5dac60a846dddfd",
"/images/mstile-310x150.png": "/images/mstile-310x150.png?id=7d2e1d9397bfa34b44e3",
"/images/mstile-310x310.png": "/images/mstile-310x310.png?id=a0ebc01ec5b581e4a012",
"/images/mstile-70x70.png": "/images/mstile-70x70.png?id=18d3275b663e12fe7534",
"/images/nc.svg": "/images/nc.svg?id=e378f908a7f49e2a3812",
"/images/nd.svg": "/images/nd.svg?id=81b46c341b114ea96a5c",
"/images/odt-36.png": "/images/odt-36.png?id=f11a0f89bd448fc7742f",
"/images/odt-48.png": "/images/odt-48.png?id=45b80fb4b9184d5a75d5",
"/images/odt-72.png": "/images/odt-72.png?id=0a1db47f9479358d3883",
"/images/odt-96.png": "/images/odt-96.png?id=d0d502a47b1d6aeef3c7",
"/images/oreilly.png": "/images/oreilly.png?id=11cc749c91fdf936cd2c",
"/images/pdf-36.png": "/images/pdf-36.png?id=c6d9e4fd7bbd0d81f33a",
"/images/pdf-48.png": "/images/pdf-48.png?id=0652db008a130af18473",
"/images/pdf-72.png": "/images/pdf-72.png?id=4af572cf75d29b9efb24",
"/images/pdf-96.png": "/images/pdf-96.png?id=6a7b4a0041cf18aaca6b",
"/images/pressbooks-branding-2x.png": "/images/pressbooks-branding-2x.png?id=55fa2aae7decbf404ade",
"/images/pressbooks-branding.png": "/images/pressbooks-branding.png?id=0ae8f99cf89bd9ed301d",
"/images/pressbooks-logo.svg": "/images/pressbooks-logo.svg?id=54f98c061a5ecdfd77d3",
"/images/print-pdf-36.png": "/images/print-pdf-36.png?id=378d2a9d718dbcabee64",
"/images/print-pdf-48.png": "/images/print-pdf-48.png?id=100556ba19e22bbdc7a7",
"/images/print-pdf-72.png": "/images/print-pdf-72.png?id=40a454e46c7e77b50cf5",
"/images/print-pdf-96.png": "/images/print-pdf-96.png?id=b041015b682dcab185df",
"/images/publicdomain.svg": "/images/publicdomain.svg?id=c2b57d946c5ce46a5fd2",
"/images/remix.svg": "/images/remix.svg?id=5d817e37e145f6a5b3af",
"/images/sa.svg": "/images/sa.svg?id=978acd9d54dfd3c39cd9",
"/images/safari-pinned-tab.svg": "/images/safari-pinned-tab.svg?id=fdc3041c7198fae52920",
"/images/share.svg": "/images/share.svg?id=fb8bd57a03731cfffe4d",
"/images/sprite-book-info.png": "/images/sprite-book-info.png?id=f0e7ea508b404bc5ca24",
"/images/sprite.png": "/images/sprite.png?id=6eb2205118e5005c1828",
"/images/twitter-icon.png": "/images/twitter-icon.png?id=e9d2e24ba38f498c4840",
"/images/vanillawxr-36.png": "/images/vanillawxr-36.png?id=699096f1ea666ec48bd9",
"/images/vanillawxr-48.png": "/images/vanillawxr-48.png?id=7bfb2dcbb3398aef9628",
"/images/vanillawxr-72.png": "/images/vanillawxr-72.png?id=6bde3554e180a05e8609",
"/images/vanillawxr-96.png": "/images/vanillawxr-96.png?id=6f248dbfbe525efeac75",
"/images/wxr-36.png": "/images/wxr-36.png?id=a0eecf15ffa491bb55d0",
"/images/wxr-48.png": "/images/wxr-48.png?id=907e785a36ffb5634962",
"/images/wxr-72.png": "/images/wxr-72.png?id=aad01763ee5c8754eaa3",
"/images/wxr-96.png": "/images/wxr-96.png?id=461e358f0757be252cf2",
"/images/xhtml-36.png": "/images/xhtml-36.png?id=f151cb946ae36f9ac65a",
"/images/xhtml-48.png": "/images/xhtml-48.png?id=09837d9c9a18ea6c6b1f",
"/images/xhtml-72.png": "/images/xhtml-72.png?id=c3182b3d50e84d79cd23",
"/images/xhtml-96.png": "/images/xhtml-96.png?id=a722bb0e5a6e6b1748fb"
}
Loading

0 comments on commit 8fc6e15

Please sign in to comment.