Ticket #7126 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

[with patch, positive review] Doc sidebar broken by Sphinx 0.6.3 JS compression

Reported by: timdumol Owned by: tba
Priority: minor Milestone: sage-4.2
Component: documentation Keywords:
Cc: Work issues:
Report Upstream: Reviewers: Mitesh Patel, Mike Hansen
Authors: Tim Dumol Merged in: sage-4.2.alpha0
Dependencies: Stopgaps:

Description

The doc sidebar provided by #6507 is broken by the JS compression applied by Sphinx 0.6.3 (#6586). This patch changes line comments to block comments, and adds some missing semicolons.

Attachments

trac_7126-doc-sidebar-fix.patch Download (2.6 KB) - added by timdumol 4 years ago.
Changes line comments to block comments. Adds missing semicolons.
trac_7126-doc-sidebar-fix_v2.patch Download (5.9 KB) - added by mpatel 4 years ago.
v2: Added JSLint tweaks. Apply only this patch.

Change History

Changed 4 years ago by timdumol

Changes line comments to block comments. Adds missing semicolons.

comment:1 Changed 4 years ago by timdumol

  • Priority changed from major to minor
  • Summary changed from Doc sidebar broken by Sphinx 0.6.3 JS compression to [with patch, needs review] Doc sidebar broken by Sphinx 0.6.3 JS compression

comment:2 Changed 4 years ago by mpatel

  • Reviewers set to Mitesh Patel
  • Summary changed from [with patch, needs review] Doc sidebar broken by Sphinx 0.6.3 JS compression to [with patch, partial positive review, needs review] Doc sidebar broken by Sphinx 0.6.3 JS compression

Thanks very much for finding these problems. I ran the JS code in layout.html through  JSLint on the "The Good Parts" setting and made the attached changes. Note: I didn't add  "use strict";, since ECMAScript5 is not in widespread use. I also prepended a "global" comment for jQuery and window, the latter for its  resize event.

I don't think Sphinx does any JS compression. I think a lone $ in Sphinx's layout.html causes misc.html.math_parse() and notebook.docHTMLProcessor.process_doc_html() effectively to strip the \n's from the toggle code.

We should still fix the $ problem, since Firebug and Opera's DragonFly complain about it. Worse yet, it makes Chromium's Developer Tools hang.

Changed 4 years ago by mpatel

v2: Added JSLint tweaks. Apply only this patch.

comment:3 Changed 4 years ago by mhansen

  • Status changed from needs_review to positive_review
  • Reviewers changed from Mitesh Patel to Mitesh Patel, Mike Hansen

Looks good to me.

comment:4 Changed 4 years ago by mhansen

  • Status changed from positive_review to closed
  • Resolution set to fixed
  • Merged in set to sage-4.2.alpha0
  • Summary changed from [with patch, partial positive review, needs review] Doc sidebar broken by Sphinx 0.6.3 JS compression to [with patch, positive review] Doc sidebar broken by Sphinx 0.6.3 JS compression
Note: See TracTickets for help on using tickets.