Showing the changes to assets/javascripts (3 of 14 files). Show all
Unified · Split
| @@ -165,6 +165,11 @@ credits = [ · 164 unmodified lines | ||
| 165 | 165 | '2009-2013 The Dojo Foundation', |
| 166 | 166 | 'MIT', |
| 167 | 167 | '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' | |
| 168 | 173 | ], [ |
| 169 | 174 | 'Moment.js', |
| 170 | 175 | '2011-2014 Tim Wood, Iskren Chernev, Moment.js contributors', |
| @@ -24,8 +24,8 @@ newsItem = (date, news) -> · 23 unmodified lines | ||
| 24 | 24 | result |
| 25 | 25 | |
| 26 | 26 | 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 """, | |
| 29 | 29 | ], [ |
| 30 | 30 | 1396742400000, # April 6, 2014 |
| 31 | 31 | """ New <a href="/go/">Go</a> documentation """, |
| @@ -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') | |