From d6168cf7abc2ac12007c9e099fce41b937104ce5 Mon Sep 17 00:00:00 2001 From: Thibaut Date: Sun, 7 Sep 2014 15:09:52 -0400 Subject: [PATCH] Update DOM events documentation --- lib/docs/filters/dom_events/clean_html.rb | 2 +- lib/docs/filters/dom_events/entries.rb | 8 ++++++-- lib/docs/scrapers/mdn/dom_events.rb | 3 ++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/docs/filters/dom_events/clean_html.rb b/lib/docs/filters/dom_events/clean_html.rb index 4e23d5fc..21ab5792 100644 --- a/lib/docs/filters/dom_events/clean_html.rb +++ b/lib/docs/filters/dom_events/clean_html.rb @@ -16,7 +16,7 @@ module Docs # Remove events we don't want css('tr').each do |tr| if td = tr.at_css('td:nth-child(3)') - tr.remove if td.content =~ /IndexedDB|Media|Audio|SVG|Battery|Gamepad|Sensor/i + tr.remove if td.content =~ /SVG|Battery|Gamepad|Sensor/i end end end diff --git a/lib/docs/filters/dom_events/entries.rb b/lib/docs/filters/dom_events/entries.rb index eb23c11b..7870ce41 100644 --- a/lib/docs/filters/dom_events/entries.rb +++ b/lib/docs/filters/dom_events/entries.rb @@ -7,8 +7,11 @@ module Docs 'CSS' => 'CSS', 'Drag' => 'Drag & Drop', 'Focus' => 'Focus', + 'Fullscreen' => 'Fullscreen', 'HashChange' => 'History', + 'IndexedDB' => 'IndexedDB', 'Keyboard' => 'Keyboard', + 'edia' => 'Media', 'Mouse' => 'Mouse', 'Offline' => 'Offline', 'Orientation' => 'Device', @@ -24,6 +27,7 @@ module Docs 'Transition' => 'CSS', 'PageTransition' => 'History', 'WebSocket' => 'WebSocket', + 'Web Audio' => 'Web Audio', 'Web Messaging' => 'Web Messaging', 'Wheel' => 'Mouse', 'Worker' => 'Web Workers' } @@ -33,8 +37,8 @@ module Docs LOAD_SLUGS = %w(abort beforeunload DOMContentLoaded error load readystatechange unload) - APPEND_TYPE = %w(Application\ Cache Progress Server\ Sent\ Events - WebSocket Web\ Messaging Web\ Workers) + APPEND_TYPE = %w(Application\ Cache IndexedDB Progress + Server\ Sent\ Events WebSocket Web\ Messaging Web\ Workers) def get_name name = super.split.first diff --git a/lib/docs/scrapers/mdn/dom_events.rb b/lib/docs/scrapers/mdn/dom_events.rb index 2ba21d31..ddc2b1c7 100644 --- a/lib/docs/scrapers/mdn/dom_events.rb +++ b/lib/docs/scrapers/mdn/dom_events.rb @@ -2,7 +2,7 @@ module Docs class DomEvents < Mdn self.name = 'DOM Events' self.slug = 'dom_events' - self.base_url = 'https://developer.mozilla.org/en-US/docs/Web/Reference/Events' + self.base_url = 'https://developer.mozilla.org/en-US/docs/Web/Events' html_filters.insert_after 'clean_html', 'dom_events/clean_html' html_filters.push 'dom_events/entries', 'title' @@ -11,6 +11,7 @@ module Docs options[:fix_urls] = ->(url) do url.sub! 'https://developer.mozilla.org/en-US/Mozilla_event_reference', DomEvents.base_url url.sub! 'https://developer.mozilla.org/en-US/docs/Mozilla_event_reference', DomEvents.base_url + url.sub! 'https://developer.mozilla.org/en-US/docs/Web/Reference/Events', DomEvents.base_url url end end