Showing the changes to assets/javascripts (3 of 17 files). Show all
Unified · Split
| @@ -138,6 +138,11 @@ credits = [ · 137 unmodified lines | |||
| 138 | '1997-2013 The PHP Documentation Group', | 138 | '1997-2013 The PHP Documentation Group', |
| 139 | 'CC BY', | 139 | 'CC BY', |
| 140 | 'http://creativecommons.org/licenses/by/3.0/' | 140 | 'http://creativecommons.org/licenses/by/3.0/' |
| 141 | ], [ | ||
| 142 | 'Ruby', | ||
| 143 | '1993-2013 Yukihiro Matsumoto', | ||
| 144 | 'Ruby', | ||
| 145 | 'https://www.ruby-lang.org/en/about/license.txt' | ||
| 141 | ], [ | 146 | ], [ |
| 142 | 'Sass', | 147 | 'Sass', |
| 143 | '2006-2013 Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein', | 148 | '2006-2013 Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein', |
| @@ -24,7 +24,10 @@ newsItem = (date, news) -> · 23 unmodified lines | |||
| 24 | result | 24 | result |
| 25 | 25 | ||
| 26 | app.news = [ | 26 | app.news = [ |
| 27 | [ 1382572800000, # October 24, 2013 | 27 | [ 1384560000000, # November 16, 2013 |
| 28 | """ New <a href="/ruby/">Ruby</a> documentation """ | ||
| 29 | ], [ | ||
| 30 | 1382572800000, # October 24, 2013 | ||
| 28 | """ DevDocs is now <a href="https://github.com/Thibaut/devdocs">open source</a>. """ | 31 | """ DevDocs is now <a href="https://github.com/Thibaut/devdocs">open source</a>. """ |
| 29 | ], [ | 32 | ], [ |
| 30 | 1381276800000, # October 9, 2013 | 33 | 1381276800000, # October 9, 2013 |
| @@ -0,0 +1,20 @@ | |||
| 1 | #= require views/pages/base | ||
| 2 | |||
| 3 | class app.views.RdocPage extends app.views.BasePage | ||
| 4 | @events: | ||
| 5 | click: 'onClick' | ||
| 6 | |||
| 7 | afterRender: -> | ||
| 8 | @highlightCode @findAll('pre.ruby'), 'ruby' | ||
| 9 | @highlightCode @findAll('pre.c'), 'clike' | ||
| 10 | return | ||
| 11 | |||
| 12 | onClick: (event) -> | ||
| 13 | return unless event.target.classList.contains 'method-click-advice' | ||
| 14 | $.stopEvent(event) | ||
| 15 | |||
| 16 | source = $ '.method-source-code', event.target.parentNode.parentNode | ||
| 17 | isShown = source.style.display is 'block' | ||
| 18 | |||
| 19 | source.style.display = if isShown then 'none' else 'block' | ||
| 20 | event.target.textContent = if isShown then 'Show source' else 'Hide source' | ||