/doc/*: allow direct links to tabs/individual comments

- Legacy-Id: 2147
This commit is contained in:
Pasi Eronen 2010-03-21 01:27:43 +00:00
parent ee1c16d6eb
commit 8e9b58cc09
2 changed files with 22 additions and 4 deletions

View file

@ -37,7 +37,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<tr><th class="comment_date">Date</th><th>Version</th><th>By</th><th>Text</th></tr>
{% for c in history %}
<tr class="{% cycle oddrow,evenrow %}">
<tr class="{% cycle oddrow,evenrow %}"{% if c.is_com %} id="history-{{c.comment.id }}"{% endif %}>
<td class="comment_date">{{ c.date|date:"Y-m-d" }}</td>
{% if c.is_rev %}
@ -59,9 +59,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[Ballot {{ c.comment.get_ballot_display }}]<br />
{% endif %}
{% if c.info.snipped %}
<div id="commentS{{forloop.counter}}">{{ c.info.textSnippet|safe }}</div>
<span class="comment_toggle" onclick="toggleComment({{forloop.counter}})" id="commentT{{forloop.counter}}">[show all]</span>
<div id="commentF{{forloop.counter}}" style="display:none;">
<div id="commentS{{c.comment.id}}">{{ c.info.textSnippet|safe }}</div>
<span class="comment_toggle" onclick="toggleComment({{c.comment.id}})" id="commentT{{c.comment.id}}">[show all]</span>
<div id="commentF{{c.comment.id}}" style="display:none;">
{{c.info.text|fill:"80"|format_textarea|safe}}
</div>
{% else %}

View file

@ -185,4 +185,22 @@ function toggleComment(n) {
<div id="rfcText2">
{% block doc_text2 %}{% endblock %}
</div>
<script type="text/javascript">
//<![CDATA[
// based on http://blog.davglass.com/files/yui/tab7/
var url = location.href.split('#');
if (url[1]) {
url[1] = "#"+url[1];
var tabs = tabView.get('tabs');
for (var i = 0; i < tabs.length; i++) {
if (url[1].indexOf(tabs[i].get('href')) == 0) {
tabView.set('activeIndex', i);
break;
}
}
}
//]]>
</script>
{% endblock content_end %}