[issue26246] Code output toggle button uses removed jQuery method

2016-03-19 Thread Ezio Melotti

Ezio Melotti added the comment:

Thanks both for spotting the bug and fixing it!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26246] Code output toggle button uses removed jQuery method

2016-03-02 Thread Berker Peksag

Berker Peksag added the comment:

Good catch, thanks!

--
nosy: +berker.peksag

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26246] Code output toggle button uses removed jQuery method

2016-03-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 305ae007899b by Berker Peksag in branch '2.7':
Issue #26246: Set initial value of the hidden attr when creating copy button.
https://hg.python.org/cpython/rev/305ae007899b

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26246] Code output toggle button uses removed jQuery method

2016-03-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7444bdd400cd by Berker Peksag in branch '3.4':
Issue #26246: Set initial value of the hidden attr when creating copy button.
https://hg.python.org/cpython/rev/7444bdd400cd

New changeset 256339c28d42 by Berker Peksag in branch '3.5':
Issue #26246: Set initial value of the hidden attr when creating copy button.
https://hg.python.org/cpython/rev/256339c28d42

New changeset 3e897eef0fac by Berker Peksag in branch 'default':
Issue #26246: Set initial value of the hidden attr when creating copy button.
https://hg.python.org/cpython/rev/3e897eef0fac

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26246] Code output toggle button uses removed jQuery method

2016-02-26 Thread Liang-Bo Wang

Liang-Bo Wang added the comment:

Thanks for the merge. 

I pulled the change and checked the result, but I found the patch missing a 
line to initiate the correct display state when the button was created. That 
is, it forgot to set `button.data('hidden', 'false');` when adding the button. 

This causes the first click on the button to have no effect. But the following 
clicks will work.

I filed the new patch to add this line back. I'm so sorry I missed this line :(

--
Added file: http://bugs.python.org/file42036/copybutton_js_2.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26246] Code output toggle button uses removed jQuery method

2016-02-26 Thread Ezio Melotti

Ezio Melotti added the comment:

I applied the patch -- it should go live the next time the docs are updated.  
Thanks for the report and the patch!

--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26246] Code output toggle button uses removed jQuery method

2016-02-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f0e20d942760 by Ezio Melotti in branch '3.4':
#26246: update copybutton.js after JQuery update.  Patch by Liang-Bo Wang.
https://hg.python.org/cpython/rev/f0e20d942760

New changeset ac175a7af60b by Ezio Melotti in branch '3.5':
#26246: merge with 3.4.
https://hg.python.org/cpython/rev/ac175a7af60b

New changeset 8c0761260d22 by Ezio Melotti in branch 'default':
#26246: merge with 3.5.
https://hg.python.org/cpython/rev/8c0761260d22

New changeset 20b5d153b894 by Ezio Melotti in branch '2.7':
#26246: update copybutton.js after JQuery update.  Patch by Liang-Bo Wang.
https://hg.python.org/cpython/rev/20b5d153b894

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26246] Code output toggle button uses removed jQuery method

2016-02-26 Thread Liang-Bo Wang

Liang-Bo Wang added the comment:

Just FYI, I applied the patch to the zh-hant translation of the documentation 
and the code output toggle button is back and works as expected.

https://docs.python.org.tw/3/tutorial/introduction.html#numbers

You can see the result of any other page by changing the URL domain from 
docs.python.org to docs.python.org.tw

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26246] Code output toggle button uses removed jQuery method

2016-01-31 Thread Liang Bo Wang

New submission from Liang Bo Wang:

The code output toggle button (the `>>>` button on the top right) has been 
disappeared and not functional on the current online documentation (both 3.4+ 
and 2.7). 


For example, see any doc page that has interpreter outputs:

https://docs.python.org/3/tutorial/introduction.html#numbers
https://docs.python.org/3.5/tutorial/introduction.html#numbers
https://docs.python.org/3.4/tutorial/introduction.html#numbers
https://docs.python.org/2/tutorial/introduction.html#numbers


These toggle buttons are created dynamically using jQuery by the script at 
Doc/tools/static/copybutton.js. However, the method .toggle() it used for click 
event handling has been deprecated since jQuery 1.8 and removed since jQuery 
1.9.

https://api.jquery.com/toggle-event/


Current Python documentation ships with jQuery v1.11.1 and it has a new 
.toggle() method with totally different behavior, which controls animation and 
hide the element. Therefore those buttons are invisible and has no effect.

https://api.jquery.com/toggle/


To achieve the old behavior, one now needs to create this toggle event on one's 
own. The most popular way to store the toggle state is by jQuery's .data() data 
storage.

A patch is attached to make the button functional again.

--
assignee: docs@python
components: Documentation
files: copybutton_js.patch
keywords: patch
messages: 259279
nosy: Liang Bo Wang, docs@python, eric.araujo, ezio.melotti, georg.brandl
priority: normal
severity: normal
status: open
title: Code output toggle button uses removed jQuery method
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file41764/copybutton_js.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com