History

Add MaxCDN documentation

Thibaut committed 12 years ago

Commit 013eff41 parent 50dfc9114 files · +155 −-2Browse files

Showing the changes to assets/javascripts (3 of 14 files). Show all

Unified · Split

3 files
  1. assets/javascripts/templates/pages/about_tmpl.coffee +5 −0
  2. assets/javascripts/templates/pages/news_tmpl.coffee +2 −2
  3. assets/javascripts/views/pages/maxcdn.coffee +28 −0
assets/javascripts/templates/pages/about_tmpl.coffee+5−0
@@ -165,6 +165,11 @@ credits = [ · 164 unmodified lines
165165 '2009-2013 The Dojo Foundation',
166166 'MIT',
167167 'https://raw.github.com/lodash/lodash/master/LICENSE.txt'
168+ ], [
169+ 'MaxCDN',
170+ '2014 MaxCDN',
171+ 'MIT',
172+ 'https://raw.githubusercontent.com/MaxCDN/api-docs/master/LICENSE'
168173 ], [
169174 'Moment.js',
170175 '2011-2014 Tim Wood, Iskren Chernev, Moment.js contributors',
assets/javascripts/templates/pages/news_tmpl.coffee+2−2
@@ -24,8 +24,8 @@ newsItem = (date, news) -> · 23 unmodified lines
2424 result
2525
2626 app.news = [
27− [ 1399075200000, # May 3, 2014
28− """ New <a href="/express/">Express</a> and <a href="/grunt/">Grunt</a> documentations """,
27+ [ 1399161600000, # May 4, 2014
28+ """ New <a href="/express/">Express</a>, <a href="/grunt/">Grunt</a>, and <a href="/maxcdn/">MaxCDN</a> documentations """,
2929 ], [
3030 1396742400000, # April 6, 2014
3131 """ New <a href="/go/">Go</a> documentation """,
assets/javascripts/views/pages/maxcdn.coffee+28−0
@@ -0,0 +1,28 @@
1+#= require views/pages/base
2+
3+class app.views.MaxcdnPage extends app.views.BasePage
4+ @events:
5+ click: 'onClick'
6+
7+ afterRender: ->
8+ @highlightCode @findAll('.tab-pane[id^="ruby"] > pre'), 'ruby'
9+ @highlightCode @findAll('.tab-pane[id^="python"] > pre'), 'python'
10+ @highlightCode @findAll('.tab-pane[id^="node"] > pre, .tab-pane[id^="resp"] > pre'), 'javascript'
11+ return
12+
13+ onClick: (event) ->
14+ return unless (link = event.target).getAttribute('data-toggle') is 'tab'
15+ $.stopEvent(event)
16+
17+ list = link.parentNode.parentNode
18+ tabs = list.nextElementSibling
19+
20+ li = link.parentNode
21+ position = 1
22+ position++ while li = li.previousElementSibling
23+
24+ $('.active', list).classList.remove('active')
25+ $('.active', tabs).classList.remove('active')
26+
27+ link.parentNode.classList.add('active')
28+ $(".tab-pane:nth-child(#{position})", tabs).classList.add('active')

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t