mirror of https://github.com/freeCodeCamp/devdocs
parent
bd52c74d1f
commit
f7d1c21bb8
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 75 KiB |
@ -1,28 +0,0 @@
|
||||
#= require views/pages/base
|
||||
|
||||
class app.views.MaxcdnPage extends app.views.BasePage
|
||||
@events:
|
||||
click: 'onClick'
|
||||
|
||||
afterRender: ->
|
||||
@highlightCode @findAll('.tab-pane[id^="ruby"] > pre'), 'ruby'
|
||||
@highlightCode @findAll('.tab-pane[id^="python"] > pre'), 'python'
|
||||
@highlightCode @findAll('.tab-pane[id^="node"] > pre, .tab-pane[id^="resp"] > pre'), 'javascript'
|
||||
return
|
||||
|
||||
onClick: (event) ->
|
||||
return unless (link = event.target).getAttribute('data-toggle') is 'tab'
|
||||
$.stopEvent(event)
|
||||
|
||||
list = link.parentNode.parentNode
|
||||
tabs = list.nextElementSibling
|
||||
|
||||
li = link.parentNode
|
||||
position = 1
|
||||
position++ while li = li.previousElementSibling
|
||||
|
||||
$('.active', list).classList.remove('active')
|
||||
$('.active', tabs).classList.remove('active')
|
||||
|
||||
link.parentNode.classList.add('active')
|
||||
$(".tab-pane:nth-child(#{position})", tabs).classList.add('active')
|
@ -1,43 +0,0 @@
|
||||
._maxcdn {
|
||||
@extend %simple;
|
||||
|
||||
.url {
|
||||
padding: .5rem;
|
||||
white-space: normal;
|
||||
@extend %pre, %note-green;
|
||||
}
|
||||
|
||||
.http_method { @extend %label; }
|
||||
|
||||
.nav-tabs {
|
||||
height: 2rem;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
border-bottom: 1px solid $boxBorder;
|
||||
|
||||
> li {
|
||||
float: left;
|
||||
margin: -1px 0;
|
||||
|
||||
> a {
|
||||
display: block;
|
||||
padding: .5rem 1em;
|
||||
line-height: 1rem;
|
||||
margin-right: 2px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 3px 3px 0 0;
|
||||
}
|
||||
|
||||
&.active > a {
|
||||
color: $textColor;
|
||||
text-decoration: none;
|
||||
background: $contentBackground;
|
||||
border-color: $boxBorder $boxBorder transparent;
|
||||
cursor: default;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tab-pane { display: none; }
|
||||
.tab-pane.active { display: block; }
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
module Docs
|
||||
class Maxcdn
|
||||
class CleanHtmlFilter < Filter
|
||||
def call
|
||||
css('hr', 'td:last-child:empty').remove
|
||||
|
||||
css('h1, h2, h3, h4').each do |node|
|
||||
node.name = node.name.sub(/\d/) { |i| i.to_i + 1 }
|
||||
end
|
||||
|
||||
at_css('h2').name = 'h1'
|
||||
|
||||
css('.path > a').each do |node|
|
||||
node.before(node.children).remove
|
||||
end
|
||||
|
||||
css('[name]').each do |node|
|
||||
node.remove_attribute 'name'
|
||||
end
|
||||
|
||||
doc
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -1,30 +0,0 @@
|
||||
module Docs
|
||||
class Maxcdn
|
||||
class EntriesFilter < Docs::EntriesFilter
|
||||
def additional_entries
|
||||
type = id_prefix = nil
|
||||
|
||||
doc.children.each_with_object [] do |node, entries|
|
||||
if node.name == 'h2'
|
||||
type = node.content.strip
|
||||
type.remove! %r{ API\z}
|
||||
type.remove! ' Custom Domains'
|
||||
id_prefix = type.parameterize
|
||||
type = 'Reports' if type.starts_with? 'Reports'
|
||||
elsif node.name == 'h3'
|
||||
next unless type
|
||||
name = node.content.strip
|
||||
id = "#{id_prefix}-#{name}".parameterize
|
||||
node['id'] = id
|
||||
|
||||
if name.ends_with?('Domain') && ['Push Zone', 'Pull Zone', 'VOD Zone'].include?(type)
|
||||
name << " (#{type})"
|
||||
end
|
||||
|
||||
entries << [name, id, type]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -1,17 +0,0 @@
|
||||
module Docs
|
||||
class Maxcdn < UrlScraper
|
||||
self.name = 'MaxCDN'
|
||||
self.type = 'maxcdn'
|
||||
self.base_url = 'https://docs.maxcdn.com/'
|
||||
|
||||
html_filters.push 'maxcdn/clean_html', 'maxcdn/entries'
|
||||
|
||||
options[:container] = '#readme-docs'
|
||||
options[:skip_links] = true
|
||||
|
||||
options[:attribution] = <<-HTML
|
||||
© 2015 MaxCDN<br>
|
||||
Licensed under the MIT License.
|
||||
HTML
|
||||
end
|
||||
end
|
Before Width: | Height: | Size: 530 B |
Before Width: | Height: | Size: 1.1 KiB |
@ -1 +0,0 @@
|
||||
https://github.com/MaxCDN/media
|
Loading…
Reference in new issue