This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: 2.7.3rc1 chm gives JS error
Type: behavior Stage: resolved
Components: Versions: Python 3.2, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ezio.melotti Nosy List: benjamin.peterson, ezio.melotti, georg.brandl, loewis, python-dev
Priority: release blocker Keywords:

Created on 2012-02-24 20:15 by loewis, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (12)
msg154154 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2012-02-24 20:15
The 2.7.3rc1 chm give the following error when opened

Line: 1 Char: 1
The Value of the property "$" is null or undefined, not a function (translated from German)
Code: 0
URL: mk:@MSITStore:C:\Users\martin\27\python\Doc\build\htmlhelp\python273rc1.chm::/_static/copybutton.js

Clicking "yes" lets me proceed to the contents of the file.
msg154199 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2012-02-25 07:37
"$" refers to JQuery, and should be defined in http://docs.python.org/_static/jquery.js.
Maybe you have to import/include that file before http://docs.python.org/_static/copybutton.js?
There are also other js scripts there that use JQuery so I'm not sure why it's failing with the copybutton.

The copy button (the one on the top-right in the code examples) is a fairly new addition and it's not vital for the docs, so if we can't find a solution we can probably just skip that file and build the chm without copy button.
msg154220 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2012-02-25 09:31
In the generated htmlhelp\index.html, there is a line

    <script type="text/javascript" src="_static/copybutton.js"></script>

That's the only script tag in that file; jquery is not loaded at all.
msg154221 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2012-02-25 09:34
For the record: this issue blocks 3.2 as well.
msg154223 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2012-02-25 09:45
18bbfed9aafa is the changeset that introduced the copy button.
Maybe the part in the "extrahead" (in Doc/tools/sphinxext/layout.html, see also first chunk of the diff) block shouldn't be included in chm?
msg154226 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2012-02-25 09:51
Either that, or jquery should be included as well. I wonder why the life version has

    <script type="text/javascript" src="_static/jquery.js"></script>

but the htmlhelp version does not. Not including the copy button seems safe, though.
msg154229 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2012-02-25 09:56
JQuery and the other scripts (like sidebar.js) are part of Sphinx, whereas the copy button is something that was added to our instances only, by changing the template.
msg154275 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-02-25 17:26
New changeset 64b9ff3c91bb by Ezio Melotti in branch '2.7':
#14114: don't include copybutton.js in the htmlhelp output.
http://hg.python.org/cpython/rev/64b9ff3c91bb

New changeset 7f651187b25c by Ezio Melotti in branch '3.2':
#14114: don't include copybutton.js in the htmlhelp output.
http://hg.python.org/cpython/rev/7f651187b25c

New changeset 39ddcc5c7fb9 by Ezio Melotti in branch 'default':
#14114: merge with 3.2.
http://hg.python.org/cpython/rev/39ddcc5c7fb9
msg154276 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2012-02-25 17:28
Should be fixed now, let me know if it works.
(Thanks Georg for the help.)
msg154928 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2012-03-05 06:06
It worked fine in the 3.3a1 chm, so I consider it indeed fixed.
msg155920 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-03-15 18:01
New changeset 11a11e5cac0f by Ezio Melotti in branch '2.7':
#14114: don't include copybutton.js in the htmlhelp output.
http://hg.python.org/cpython/rev/11a11e5cac0f

New changeset 36ec90b6b5e5 by Ezio Melotti in branch '2.7':
#14114: don't include copybutton.js in the htmlhelp output.
http://hg.python.org/cpython/rev/36ec90b6b5e5
msg156271 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-03-18 19:40
New changeset b585c33077d2 by Ezio Melotti in branch '3.2':
#14114: don't include copybutton.js in the htmlhelp output.
http://hg.python.org/cpython/rev/b585c33077d2
History
Date User Action Args
2022-04-11 14:57:27adminsetgithub: 58322
2012-03-18 19:40:14python-devsetmessages: + msg156271
2012-03-17 22:04:40loewislinkissue14351 superseder
2012-03-15 18:01:17python-devsetmessages: + msg155920
2012-03-05 06:06:16loewissetstatus: open -> closed
resolution: fixed
messages: + msg154928
2012-02-25 17:28:18ezio.melottisettype: behavior
messages: + msg154276
stage: resolved
2012-02-25 17:26:53python-devsetnosy: + python-dev
messages: + msg154275
2012-02-25 09:56:51ezio.melottisetmessages: + msg154229
2012-02-25 09:51:24loewissetmessages: + msg154226
2012-02-25 09:45:32ezio.melottisetmessages: + msg154223
2012-02-25 09:34:50loewissetnosy: + georg.brandl, benjamin.peterson

messages: + msg154221
versions: + Python 2.7, Python 3.2
2012-02-25 09:31:29loewissetmessages: + msg154220
2012-02-25 07:37:12ezio.melottisetmessages: + msg154199
2012-02-24 20:18:04georg.brandlsetpriority: normal -> release blocker
assignee: ezio.melotti

nosy: + ezio.melotti
2012-02-24 20:15:29loewiscreate