Skip to content

Commit 8e9b58c

Browse files
committed
/doc/*: allow direct links to tabs/individual comments
- Legacy-Id: 2147
1 parent ee1c16d commit 8e9b58c

2 files changed

Lines changed: 22 additions & 4 deletions

File tree

ietf/templates/idrfc/doc_history.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<tr><th class="comment_date">Date</th><th>Version</th><th>By</th><th>Text</th></tr>
3838

3939
{% for c in history %}
40-
<tr class="{% cycle oddrow,evenrow %}">
40+
<tr class="{% cycle oddrow,evenrow %}"{% if c.is_com %} id="history-{{c.comment.id }}"{% endif %}>
4141
<td class="comment_date">{{ c.date|date:"Y-m-d" }}</td>
4242

4343
{% if c.is_rev %}
@@ -59,9 +59,9 @@
5959
[Ballot {{ c.comment.get_ballot_display }}]<br />
6060
{% endif %}
6161
{% if c.info.snipped %}
62-
<div id="commentS{{forloop.counter}}">{{ c.info.textSnippet|safe }}</div>
63-
<span class="comment_toggle" onclick="toggleComment({{forloop.counter}})" id="commentT{{forloop.counter}}">[show all]</span>
64-
<div id="commentF{{forloop.counter}}" style="display:none;">
62+
<div id="commentS{{c.comment.id}}">{{ c.info.textSnippet|safe }}</div>
63+
<span class="comment_toggle" onclick="toggleComment({{c.comment.id}})" id="commentT{{c.comment.id}}">[show all]</span>
64+
<div id="commentF{{c.comment.id}}" style="display:none;">
6565
{{c.info.text|fill:"80"|format_textarea|safe}}
6666
</div>
6767
{% else %}

ietf/templates/idrfc/doc_main.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,4 +185,22 @@ <h2 style="margin-top:1em;">Document history</h2>
185185
<div id="rfcText2">
186186
{% block doc_text2 %}{% endblock %}
187187
</div>
188+
189+
<script type="text/javascript">
190+
//<![CDATA[
191+
// based on http://blog.davglass.com/files/yui/tab7/
192+
var url = location.href.split('#');
193+
if (url[1]) {
194+
url[1] = "#"+url[1];
195+
var tabs = tabView.get('tabs');
196+
for (var i = 0; i < tabs.length; i++) {
197+
if (url[1].indexOf(tabs[i].get('href')) == 0) {
198+
tabView.set('activeIndex', i);
199+
break;
200+
}
201+
}
202+
}
203+
//]]>
204+
</script>
205+
188206
{% endblock content_end %}

0 commit comments

Comments
 (0)