1
0
mirror of https://github.com/github/choosealicense.com synced 2024-07-06 02:09:36 +02:00

Merge pull request #408 from github/apendix-hover

Add rule tooltips to the appendix
This commit is contained in:
Mike Linksvayer 2016-05-10 10:46:05 -07:00
commit 4d3acb603a
2 changed files with 13 additions and 10 deletions

View File

@ -8,14 +8,15 @@ class: license-types
All licenses described in the choosealicense.com [repository](https://github.com/github/choosealicense.com), in a table. All licenses described in the choosealicense.com [repository](https://github.com/github/choosealicense.com), in a table.
<table border style="font-size: xx-small"> <table border style="font-size: xx-small">
<tr><th>License</th> <tr>
{% assign types = "permissions|conditions|limitations" | split: "|" %} <th>License</th>
{% for type in types %} {% assign types = "permissions|conditions|limitations" | split: "|" %}
{% assign rules = site.data.rules[type] | sort: "label" %} {% for type in types %}
{% for rule_obj in rules %} {% assign rules = site.data.rules[type] | sort: "label" %}
<th style="text-align: center; width:7%">{{ rule_obj.label }}</th> {% for rule_obj in rules %}
<th style="text-align: center; width:7%">{{ rule_obj.label }}</th>
{% endfor %}
{% endfor %} {% endfor %}
{% endfor %}
</tr> </tr>
{% for license in site.licenses | sort: 'path' %} {% for license in site.licenses | sort: 'path' %}
<tr style="height: 3em"><td><a href="{{ license.id }}">{{ license.title }}</a></td> <tr style="height: 3em"><td><a href="{{ license.id }}">{{ license.title }}</a></td>
@ -24,7 +25,9 @@ All licenses described in the choosealicense.com [repository](https://github.com
{% for rule_obj in rules %} {% for rule_obj in rules %}
<td class="license-{{ type }}" style="text-align:center">{% assign req = rule_obj.tag %} <td class="license-{{ type }}" style="text-align:center">{% assign req = rule_obj.tag %}
{% if license[type] contains req %} {% if license[type] contains req %}
<span class="license-sprite {{ req }}"></span> <span class="{{ req }}">
<span class="license-sprite {{ req }}"></span>
</span>
{% endif %}</td> {% endif %}</td>
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}

View File

@ -38,11 +38,11 @@ class Choosealicense
# Dynamically add annotations as title attribute to rule list items # Dynamically add annotations as title attribute to rule list items
for ruletype, rules of window.annotations for ruletype, rules of window.annotations
for rule in rules for rule in rules
$(".license-rules ul.license-#{ruletype} li.#{rule["tag"]}").attr "title", rule["description"] $(".license-#{ruletype} .#{rule["tag"]}").attr "title", rule["description"]
# Init tooltips on all rule list items # Init tooltips on all rule list items
for ruletype, label of @ruletypes for ruletype, label of @ruletypes
$(".license-#{ruletype} li").qtip $(".license-#{ruletype} li, .license-#{ruletype} .license-sprite").qtip
content: content:
text: false text: false
title: title: