History

mdn: update CSS, HTML, JavaScript, SVG, XSLT&XPath

Simon Legner committed 5 years ago

Commit 04db81e1 parent b5032413 files · +6 −7Browse files

Unified · Split

3 files
  1. assets/javascripts/templates/pages/about_tmpl.coffee +1 −1
  2. lib/docs/scrapers/mdn/mdn.rb +4 −2
  3. lib/docs/scrapers/mdn/xslt_xpath.rb +1 −4
assets/javascripts/templates/pages/about_tmpl.coffee+1−1
@@ -203,7 +203,7 @@ credits = [ · 202 unmodified lines
203203 'https://raw.githubusercontent.com/apache/cordova-docs/master/LICENSE'
204204 ], [
205205 'CSS<br>DOM<br>HTTP<br>HTML<br>JavaScript<br>SVG<br>XPath',
206− '2005-2017 Mozilla Developer Network and individual contributors',
206+ '2005-2020 Mozilla and individual contributors',
207207 'CC BY-SA',
208208 'https://creativecommons.org/licenses/by-sa/2.5/'
209209 ], [
lib/docs/scrapers/mdn/mdn.rb+4−2
@@ -17,18 +17,20 @@ module Docs · 16 unmodified lines
1717 }
1818
1919 options[:attribution] = <<-HTML
20− &copy; 2005&ndash;2018 Mozilla Developer Network and individual contributors.<br>
20+ &copy; 2005&ndash;2020 Mozilla and individual contributors.<br>
2121 Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
2222 HTML
2323
2424 def get_latest_version(opts)
2525 json = fetch_json("https://developer.mozilla.org/en-US/docs/feeds/json/tag/#{options[:mdn_tag]}", opts)
26− DateTime.parse(json[0]['pubdate']).to_time.to_i
26+ dates = json.map { |i| i['pubdate'] }
27+ DateTime.parse(dates.max).to_time.to_i
2728 end
2829
2930 private
3031
3132 def process_response?(response)
33+ response.effective_url.host = 'developer.mozilla.org' if response.effective_url.host == 'wiki.developer.mozilla.org'
3234 super && response.effective_url.query == 'raw=1&macros=1'
3335 end
3436 end
lib/docs/scrapers/mdn/xslt_xpath.rb+1−4
@@ -15,10 +15,7 @@ module Docs · 14 unmodified lines
1515 options[:only_patterns] = [/\A\/XSLT/, /\A\/XPath/]
1616
1717 options[:fix_urls] = ->(url) do
18− url.sub! 'https://developer.mozilla.org/en/XPath', "#{XsltXpath.base_url}/XPath"
19− url.sub! 'https://developer.mozilla.org/en/XSLT', "#{XsltXpath.base_url}/XSLT"
20− url.sub! 'https://developer.mozilla.org/en-US/docs/XPath', "#{XsltXpath.base_url}/XPath"
21− url.sub! 'https://developer.mozilla.org/en-US/docs/XSLT', "#{XsltXpath.base_url}/XSLT"
18+ url.sub! 'https://developer.mozilla.org/en-US/docs/Web/XSLT/Element', "#{XsltXpath.base_url}/XSLT"
2219 url
2320 end
2421 end