Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion _layouts/feature.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ <h1 class="feature-title">
{% comment %}
4. Let's start the loop!
{% endcomment %}
{% assign has-unsupported = false -%}
{% for family in page-families-in-order %}
{% assign family-key = family -%}
{% assign family-values = page.stats[family] -%}
Expand Down Expand Up @@ -107,6 +108,7 @@ <h4 class="data-platform-name">
{% assign stat-class-name = 'supported' -%}
{% when 'n' %}
{% assign stat-class-name = 'unsupported' -%}
{% assign has-unsupported = true -%}
{% when 'a' %}
{% assign stat-class-name = 'mitigated' -%}
{% when 'u' %}
Expand Down Expand Up @@ -167,6 +169,9 @@ <h4 class="data-platform-name">
{% endfor %}
</div>
</div>
{% if has-unsupported and page.has_impl_urls %}
<p class="hint-tracker">Please check the <a href="#resources">resources section</a> for links to the issue tracker. They often provide a feature to upvote issues and show your support.</p>
{% endif %}
<footer class="feature-footer">
{% assign has-page-notes = false -%}
{% if page.notes != nil and page.notes != "" %}
Expand Down Expand Up @@ -199,7 +204,7 @@ <h3 class="list-subtitle">Unsupported keys in WebViews</h3>
{% endif %}
{% endif %}
{% if page.links.size > 0 %}
<h2 class="list-title">Resources</h2>
<h2 class="list-title" id="resources">Resources</h2>
<ul class="list">
{% for link in page.links %}
{% assign link-title = link | first -%}
Expand Down
45 changes: 44 additions & 1 deletion _plugins/generated_features.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,46 @@ module Generated
class FeaturesGenerator < Jekyll::Generator
safe true

def getBugTrackerLabel(url)
if url.include?('crbug.com') || url.include?('bugs.chromium.org')
"Chromium issue tracker"
elsif url.include?('webkit.org') || url.include?('bugs.webkit.org')
"WebKit issue tracker"
elsif url.include?('bugzil.la') || url.include?('bugzilla.mozilla.org')
"Firefox issue tracker"
else
"Issue tracker"
end
end

def getImplUrls(feature)
platforms = ['webview_ios', 'webview_android', 'chrome_android', 'safari_ios']
urls = []

platforms.each do |platform|
next unless feature['__compat']['support'].key?(platform)
support = feature['__compat']['support'][platform]
entries = support.kind_of?(Array) ? support : [support]
entries.each do |entry|
next unless entry.kind_of?(Hash) && entry.key?('impl_url')
url_list = entry['impl_url'].kind_of?(Array) ? entry['impl_url'] : [entry['impl_url']]
urls.concat(url_list)
end
end

urls.uniq!
tracker_counts = Hash.new(0)
result = {}
urls.each do |url|
base_label = getBugTrackerLabel(url)
tracker_counts[base_label] += 1
count = tracker_counts[base_label]
label = count > 1 ? "#{base_label} (#{count})" : base_label
result[label] = url
end
result
end

def getVersions(feature, platform)
if !feature['__compat']["support"].key?(platform) then
return {
Expand Down Expand Up @@ -68,9 +108,12 @@ def generate_bcd_from_section(site, section, timestamp, category, appended_title
doc.data['keywords'] = 'todo'
doc.data['last_test_date'] = timestamp
doc.data['notes'] = data_source
doc.data['links'] = feature["__compat"].key?("mdn_url") ? {
links = feature["__compat"].key?("mdn_url") ? {
"MDN reference" => feature["__compat"]["mdn_url"]
} : {}
impl_urls = getImplUrls(feature)
doc.data['links'] = links.merge(impl_urls)
doc.data['has_impl_urls'] = !impl_urls.empty?
doc.data['stats'] = {
"wkwebview" => {
"macos" => {
Expand Down
17 changes: 17 additions & 0 deletions _sass/_pages/_feature.scss
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,23 @@
}
}

.hint-tracker {
padding: rem(12px) rem(32px);
font-size: rem(14px);
line-height: 1.5;
color: rgba(255, 255, 255, 0.7);
border-top: 1px solid #3c3c3d;

a {
color: inherit;
text-decoration: underline;

&:hover, &:focus {
color: #fff;
}
}
}

.data-version-notes {
position: absolute;
left: 0;
Expand Down