pressbooks / pressbooks-book

McLuhan is the default book theme for Pressbooks.
https://pressbooks.org
GNU General Public License v3.0
20 stars 16 forks source link

'Sidebar open by default' setting no longer working as expected for Hypothesis plugin #380

Closed SteelWagstaff closed 5 years ago

SteelWagstaff commented 5 years ago

Description

Jim Paradiso from UCF reported an issue encountered on the Unizin staging instance. He cloned a book and checked the 'sidebar open by default' setting in 'Settings'-'Hypothesis.'

screen shot 2018-11-21 at 4 54 33 pm

Expected behavior: When I visit a chapter in the book, the hypothesis client should appear open by default.

Actual behavior: The hypothesis client does not open by default. It can be manually opened, however. See https://unizin.staging.pressbooks.network/amnatgovstaging/chapter/who-governs-elitism-pluralism-and-tradeoffs/ for example (screen shot below). The annotation pane is collapsed by default.

screen shot 2018-11-21 at 4 56 43 pm

System Information

Book Info

Book ID: 4 Book URL: https://unizin.staging.pressbooks.network/amnatgovstaging/ Book Privacy: Public

Browser

Platform: OS X Browser Name: Chrome Browser Version: 70.0.3538.102 User Agent String: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36

WordPress Configuration

Network URL: http://unizin.staging.pressbooks.network/ Network Type: Subdirectory Version: 4.9.8 Language: en_US WP_ENV: staging WP_DEBUG: Disabled Memory Limit: 64M

Pressbooks Configuration

Version: 5.6.0-dev Book Theme: McLuhan Book Theme Version: 2.5.2 Root Theme: Aldine Root Theme Version: 1.5.0

Pressbooks Dependencies

Epubcheck: Installed Kindlegen: Installed xmllint: Installed PrinceXML: Not Installed Saxon-HE: Installed

Must-Use Plugins

Bedrock Autoloader: 1.0.0 hm-autoloader.php: n/a telemetry.php: n/a Unizin Allow Plugins: 1.0.0 Unizin Allow Upload Extensions: 1.0.0 Unizin Mail From: 1.0.0

Network Active Plugins

Hypothesis: 0.5.0 Pressbooks: 5.6.0-dev Pressbooks BISAC: 2.0.0 Pressbooks Stats: 1.6.2 Pressbooks Whitelabel: 1.3.0 Redis Object Cache: 1.3.9 User Activation Keys: 4.6

Book Active Plugins

Hypothesis: 0.5.0 Pressbooks: 5.6.0-dev Pressbooks BISAC: 2.0.0 Pressbooks Stats: 1.6.2 Pressbooks Whitelabel: 1.3.0 Redis Object Cache: 1.3.9 User Activation Keys: 4.6

Inactive Plugins

Akismet Anti-Spam: 4.1 H5P: 1.11.2 iframe: 4.3 Regenerate Thumbnails: 3.0.2 TablePress Extension: DataTables Buttons: 1.2 WP QuickLaTeX: 3.8.5

Server Configuration

PHP Version: 7.1.23-2+ubuntu16.04.1+deb.sury.org+1 MySQL Version: 5.6.10 Webserver Info: nginx/1.15.5

PHP Configuration

Safe Mode: Disabled Memory Limit: 256M Upload Max Size: 50M Post Max Size: 50M Upload Max Filesize: 50M Time Limit: 180 Max Input Vars: 1000 URL-aware fopen: On (1) Display Errors: N/A

PHP Extensions

OPcache: Zend XDebug: Disabled cURL: Supported cURL Version: 7.47.0 imagick: Not Installed xsl: Installed

SteelWagstaff commented 5 years ago

I think that what should happen is that if this setting is checked, then a js/sidebaropen.js file should be enqueued. This file contains a window.hypothesisConfig = function () { return { openSidebar: true This file is indeed being enqueued, but I think the new pane.js is overriding the existing hypothesisConfig settings (the default value of openSidebar appears to be false, for example). Notice the first three lines of https://github.com/hypothesis/wp-hypothesis/blob/master/js/sidebaropen.js. Might be helpful in fixing? More documentation on configuring the client available at https://h.readthedocs.io/projects/client/en/latest/publishers/config/