Update jQuery docs

Closes #204.
pull/343/merge
Thibaut Courouble 9 years ago
parent 44e1f216c4
commit 9098ff5275

@ -191,17 +191,17 @@ credits = [
'https://raw.githubusercontent.com/iojs/io.js/v1.x/LICENSE' 'https://raw.githubusercontent.com/iojs/io.js/v1.x/LICENSE'
], [ ], [
'jQuery', 'jQuery',
'2009 Packt Publishing<br>&copy; 2014 jQuery Foundation', 'Packt Publishing<br>&copy; jQuery Foundation and other contributors',
'MIT', 'MIT',
'https://raw.githubusercontent.com/jquery/api.jquery.com/master/LICENSE.txt' 'https://raw.githubusercontent.com/jquery/api.jquery.com/master/LICENSE.txt'
], [ ], [
'jQuery Mobile', 'jQuery Mobile',
'2014 jQuery Foundation', 'jQuery Foundation and other contributors',
'MIT', 'MIT',
'https://raw.githubusercontent.com/jquery/api.jquerymobile.com/master/LICENSE.txt' 'https://raw.githubusercontent.com/jquery/api.jquerymobile.com/master/LICENSE.txt'
], [ ], [
'jQuery UI', 'jQuery UI',
'2014 jQuery Foundation', 'jQuery Foundation and other contributors',
'MIT', 'MIT',
'https://raw.githubusercontent.com/jquery/api.jqueryui.com/master/LICENSE.txt' 'https://raw.githubusercontent.com/jquery/api.jqueryui.com/master/LICENSE.txt'
], [ ], [

@ -1,10 +0,0 @@
module Docs
class Jquery
class CleanUrlsFilter < Filter
def call
html.gsub! 'local.api.jquery', 'api.jquery'
html
end
end
end
end

@ -9,6 +9,7 @@ module Docs
def get_name def get_name
name = at_css('h1').content.strip name = at_css('h1').content.strip
name.gsub!(/ [A-Z]/) { |str| str.downcase! } name.gsub!(/ [A-Z]/) { |str| str.downcase! }
name.gsub! %r{[“”]}, '"'
name name
end end

@ -4,7 +4,6 @@ module Docs
self.type = 'jquery' self.type = 'jquery'
html_filters.push 'jquery/clean_html', 'title' html_filters.push 'jquery/clean_html', 'title'
text_filters.push 'jquery/clean_urls'
options[:title] = false options[:title] = false
options[:container] = '#content' options[:container] = '#content'
@ -12,7 +11,7 @@ module Docs
options[:skip_patterns] = [/category/] options[:skip_patterns] = [/category/]
options[:attribution] = <<-HTML options[:attribution] = <<-HTML
&copy; 2014 The jQuery Foundation<br> &copy; The jQuery Foundation and other contributors<br>
Licensed under the MIT License. Licensed under the MIT License.
HTML HTML
end end

@ -1,19 +1,22 @@
module Docs module Docs
class JqueryCore < Jquery class JqueryCore < Jquery
self.name = 'jQuery' self.name = 'jQuery'
self.release = 'up to 2.1.0' self.release = 'up to 2.2.0'
self.base_url = 'http://local.api.jquery.com' self.base_url = 'https://api.jquery.com/'
self.initial_paths = %w(/index/index)
html_filters.insert_before 'jquery/clean_html', 'jquery_core/entries' html_filters.insert_before 'jquery/clean_html', 'jquery_core/entries'
options[:root_title] = 'jQuery' options[:root_title] = 'jQuery'
# Duplicates options[:fix_urls] = ->(url) do
options[:skip] = %w(/selectors/odd /selectors/even /selectors/event url.sub! 'http://api.jquery.com/', 'https://api.jquery.com/'
/selected /checked) end
options[:replace_paths] = { options[:skip_patterns] += [
'/index/' => '/index/index', /h\/deferred\.reject/i,
'/h/deferred.reject/' => '/deferred.reject' } /Selectors\/odd/i,
/index/i
]
end end
end end

@ -2,15 +2,19 @@ module Docs
class JqueryMobile < Jquery class JqueryMobile < Jquery
self.name = 'jQuery Mobile' self.name = 'jQuery Mobile'
self.slug = 'jquerymobile' self.slug = 'jquerymobile'
self.release = '1.4.0' self.release = '1.4.5'
self.base_url = 'http://local.api.jquerymobile.com' self.base_url = 'https://api.jquerymobile.com'
self.root_path = '/category/all' self.root_path = '/category/all'
html_filters.insert_before 'jquery/clean_html', 'jquery_mobile/entries' html_filters.insert_before 'jquery/clean_html', 'jquery_mobile/entries'
options[:root_title] = 'jQuery Mobile' options[:root_title] = 'jQuery Mobile'
options[:skip] = %w(/tabs /theme) options[:skip] = %w(/tabs /theme)
options[:skip_patterns].concat [/\A\/icons/] options[:skip_patterns].concat [/\A\/icons/, /cdn-cgi/i]
options[:replace_paths] = { '/select/' => '/selectmenu' } options[:replace_paths] = { '/select/' => '/selectmenu' }
options[:fix_urls] = ->(url) do
url.sub! 'http://api.jquerymobile.com/', 'https://api.jquerymobile.com/'
end
end end
end end

@ -2,14 +2,18 @@ module Docs
class JqueryUi < Jquery class JqueryUi < Jquery
self.name = 'jQuery UI' self.name = 'jQuery UI'
self.slug = 'jqueryui' self.slug = 'jqueryui'
self.release = '1.10.4' self.release = '1.11.4'
self.base_url = 'http://local.api.jqueryui.com' self.base_url = 'https://api.jqueryui.com'
self.root_path = '/category/all' self.root_path = '/category/all'
html_filters.insert_before 'jquery/clean_html', 'jquery_ui/entries' html_filters.insert_before 'jquery/clean_html', 'jquery_ui/entries'
options[:root_title] = 'jQuery UI' options[:root_title] = 'jQuery UI'
options[:skip] = %w(/theming) options[:skip] = %w(/theming)
options[:skip_patterns].concat [/\A\/1\./] options[:skip_patterns] += [/\A\/1\./]
options[:fix_urls] = ->(url) do
url.sub! 'http://api.jqueryui.com/', 'https://api.jqueryui.com/'
end
end end
end end

Loading…
Cancel
Save