Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
02df6a61
Commit
02df6a61
authored
Oct 02, 2012
by
Ezio Melotti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix/improve the changelog filtering.
parent
7dce8a2b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
21 deletions
+53
-21
Doc/tools/sphinxext/layout.html
Doc/tools/sphinxext/layout.html
+53
-13
Doc/whatsnew/changelog.rst
Doc/whatsnew/changelog.rst
+0
-8
No files found.
Doc/tools/sphinxext/layout.html
View file @
02df6a61
...
...
@@ -10,19 +10,59 @@
{% if not embedded %}
<script
type=
"text/javascript"
src=
"{{ pathto('_static/copybutton.js', 1) }}"
></script>
{% endif %}
{% if pagename == 'whatsnew/changelog' %}
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
// add the search form and bind the events
$
(
'
h1
'
).
after
([
'
<p>Filter entries by content:
'
,
'
<input type="text" value="" id="searchbox" style="width: 50%">
'
,
'
<input type="submit" id="searchbox-submit" value="Filter"></p>
'
].
join
(
'
\n
'
));
function
dofilter
()
{
var
el
=
document
.
getElementById
(
'
searchbox
'
);
var
string
=
el
.
value
.
toLowerCase
();
var
litags
=
document
.
getElementsByTagName
(
'
li
'
)
for
(
var
idx
=
0
;
idx
<
litags
.
length
;
idx
++
)
{
var
li
=
litags
[
idx
];
if
(
li
.
innerHTML
.
toLowerCase
().
indexOf
(
string
)
>=
0
)
{
li
.
style
.
display
=
''
;
}
else
{
li
.
style
.
display
=
'
none
'
;
try
{
var
query
=
new
RegExp
(
$
(
'
#searchbox
'
).
val
(),
'
i
'
);
}
catch
(
e
)
{
return
;
// not a valid regex (yet)
}
// find headers for the versions (What's new in Python X.Y.Z?)
$
(
'
#changelog h2
'
).
each
(
function
(
index1
,
h2
)
{
var
h2_parent
=
$
(
h2
).
parent
();
var
sections_found
=
0
;
// find headers for the sections (Core, Library, etc.)
h2_parent
.
find
(
'
h3
'
).
each
(
function
(
index2
,
h3
)
{
var
h3_parent
=
$
(
h3
).
parent
();
var
entries_found
=
0
;
// find all the entries
h3_parent
.
find
(
'
li
'
).
each
(
function
(
index3
,
li
)
{
var
li
=
$
(
li
);
// check if the query matches the entry
if
(
query
.
test
(
li
.
text
()))
{
li
.
show
();
entries_found
++
;
}
else
{
li
.
hide
();
}
});
// if there are entries, show the section, otherwise hide it
if
(
entries_found
>
0
)
{
h3_parent
.
show
();
sections_found
++
;
}
else
{
h3_parent
.
hide
();
}
});
if
(
sections_found
>
0
)
h2_parent
.
show
();
else
h2_parent
.
hide
();
});
}
$
(
'
#searchbox
'
).
keyup
(
dofilter
);
$
(
'
#searchbox-submit
'
).
click
(
dofilter
);
});
</script>
{% endif %}
{{ super() }}
...
...
Doc/whatsnew/changelog.rst
View file @
02df6a61
...
...
@@ -2,13 +2,5 @@
Changelog
+++++++++
.. raw:: html
<p>
Filter entries by content:
<input type="text" value="" id="searchbox" style="width: 50%" onchange="dofilter()">
<input type="submit" value="Filter" onclick="dofilter()">
</p>
.. miscnews:: ../../Misc/NEWS
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment