news_tmpl.coffee 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. app.templates.newsPage = ->
  2. """ <h1 class="_lined-heading">Changelog</h1>
  3. <p class="_note">For the latest news,
  4. subscribe to the <a href="http://eepurl.com/HnLUz">newsletter</a>
  5. or follow <a href="https://twitter.com/DevDocs">@DevDocs</a>.<br>
  6. For development updates, follow the project on <a href="https://github.com/Thibaut/devdocs">GitHub</a>.
  7. <div class="_news">#{app.templates.newsList app.news}</div> """
  8. app.templates.newsList = (news) ->
  9. year = new Date().getUTCFullYear()
  10. result = ''
  11. for value in news
  12. date = new Date(value[0])
  13. if year isnt date.getUTCFullYear()
  14. year = date.getUTCFullYear()
  15. result += "<h4>#{year}</h4>"
  16. result += newsItem(date, value[1..])
  17. result
  18. MONTHS = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
  19. newsItem = (date, news) ->
  20. date = """<span class="_news-date">#{MONTHS[date.getUTCMonth()]} #{date.getUTCDate()}</span>"""
  21. result = ''
  22. for text, i in news
  23. text = text.split "\n"
  24. title = """<span class="_news-title">#{text.shift()}</span>"""
  25. result += """<div class="_news-row">#{if i is 0 then date else ''} #{title} #{text.join '<br>'}</div>"""
  26. result
  27. app.news = [
  28. [ 1413676800000, # October 19, 2014
  29. """ New <a href="/svg/">SVG</a> documentation """,
  30. ], [
  31. 1413590400000, # October 18, 2014
  32. """ New <a href="/nginx/">nginx</a> documentation """,
  33. ], [
  34. 1413158400000, # October 13, 2014
  35. """ New <a href="/xpath/">XPath</a> documentation """,
  36. ], [
  37. 1410048000000, # September 7, 2014
  38. """ Updated the HTML, CSS, JavaScript, and DOM documentations with additional content. """,
  39. ], [
  40. 1407110400000, # August 4, 2014
  41. """ New <a href="/django/">Django</a> documentation """,
  42. ], [
  43. 1406419200000, # July 27, 2014
  44. """ New <a href="/markdown/">Markdown</a> documentation """,
  45. ], [
  46. 1404518400000, # July 5, 2014
  47. """ New <a href="/cordova/">Cordova</a> documentation """,
  48. ], [
  49. 1404172800000, # July 1, 2014
  50. """ New <a href="/chai/">Chai</a> and <a href="/sinon/">Sinon</a> documentations """,
  51. ], [
  52. 1402790400000, # June 15, 2014
  53. """ New <a href="/requirejs/">RequireJS</a> documentation """,
  54. ], [
  55. 1402704000000, # June 14, 2014
  56. """ New <a href="/haskell/">Haskell</a> documentation """,
  57. ], [
  58. 1400976000000, # May 25, 2014
  59. """ New <a href="/laravel/">Laravel</a> documentation """,
  60. ], [
  61. 1399161600000, # May 4, 2014
  62. """ New <a href="/express/">Express</a>, <a href="/grunt/">Grunt</a>, and <a href="/maxcdn/">MaxCDN</a> documentations """,
  63. ], [
  64. 1396742400000, # April 6, 2014
  65. """ New <a href="/go/">Go</a> documentation """,
  66. ], [
  67. 1396137600000, # March 30, 2014
  68. """ New <a href="/cpp/">C++</a> documentation """,
  69. ], [
  70. 1394928000000, # March 16, 2014
  71. """ New <a href="/yii/">Yii</a> documentation """,
  72. ], [
  73. 1394236800000, # March 8, 2014
  74. """ Added path bar. """,
  75. ], [
  76. 1393027200000, # February 22, 2014
  77. """ New <a href="/c/">C</a> documentation """,
  78. ], [
  79. 1392508800000, # February 16, 2014
  80. """ New <a href="/moment/">Moment.js</a> documentation """,
  81. ], [
  82. 1392163200000, # February 12, 2014
  83. """ The root/category pages are now included in the search index (e.g. <a href="/#q=CSS">CSS</a>) """,
  84. ], [
  85. 1390694400000, # January 26, 2014
  86. """ Updated <a href="/angular/">Angular.js</a> documentation """,
  87. ], [
  88. 1390089600000, # January 19, 2014
  89. """ New <a href="/d3/">D3.js</a> and <a href="/knockout/">Knockout.js</a> documentations """,
  90. ], [
  91. 1390003200000, # January 18, 2014
  92. """ DevDocs is now available as a <a href="https://marketplace.firefox.com/app/devdocs/">Firefox web app</a> (currently requires Aurora). """,
  93. ], [
  94. 1389484800000, # January 12, 2014
  95. """ Added <code class="_label">alt + g</code> shortcut for searching on Google. """,
  96. """ Added <code class="_label">alt + r</code> shortcut for revealing the current page in the sidebar. """
  97. ], [
  98. 1386979200000, # December 14, 2013
  99. """ New <a href="/postgresql/">PostgreSQL</a> documentation """
  100. ], [
  101. 1386892800000, # December 13, 2013
  102. """ New <a href="/git/">Git</a> and <a href="/redis/">Redis</a> documentations """
  103. ], [
  104. 1385424000000, # November 26, 2013
  105. """ New <a href="/python/">Python</a> documentation """
  106. ], [
  107. 1384819200000, # November 19, 2013
  108. """ New <a href="/rails/">Ruby on Rails</a> documentation """
  109. ], [
  110. 1384560000000, # November 16, 2013
  111. """ New <a href="/ruby/">Ruby</a> documentation """
  112. ], [
  113. 1382572800000, # October 24, 2013
  114. """ DevDocs is now <a href="https://github.com/Thibaut/devdocs">open source</a>. """
  115. ], [
  116. 1381276800000, # October 9, 2013
  117. """ DevDocs is now available as a <a href="https://chrome.google.com/webstore/detail/devdocs/mnfehgbmkapmjnhcnbodoamcioleeooe">Chrome web app</a>. """
  118. ], [
  119. 1379808000000, # September 22, 2013
  120. """ New <a href="/php/">PHP</a> documentation """
  121. ], [
  122. 1378425600000, # September 6, 2013
  123. """ New <a href="/lodash/">Lo-Dash</a> documentation """,
  124. """ On mobile devices you can now search a specific documentation by typing its name and <code class="_label">Space</code>. """
  125. ], [
  126. 1377993600000, # September 1, 2013
  127. """ New <a href="/jqueryui/">jQuery UI</a> and <a href="/jquerymobile/">jQuery Mobile</a> documentations """
  128. ], [
  129. 1377648000000, # August 28, 2013
  130. """ New smartphone interface
  131. Tested on iOS 6+ and Android 4.1+ """
  132. ], [
  133. 1377388800000, # August 25, 2013
  134. """ New <a href="/ember/">Ember.js</a> documentation """
  135. ], [
  136. 1376784000000, # August 18, 2013
  137. """ New <a href="/coffeescript/">CoffeeScript</a> documentation """,
  138. """ URL search now automatically opens the first result. """
  139. ], [
  140. 1376352000000, # August 13, 2013
  141. """ New <a href="/angular/">Angular.js</a> documentation """
  142. ], [
  143. 1376179200000, # August 11, 2013
  144. """ New <a href="/sass/">Sass</a> and <a href="/less/">Less</a> documentations """
  145. ], [
  146. 1375660800000, # August 5, 2013
  147. """ New <a href="/node/">Node.js</a> documentation """
  148. ], [
  149. 1375488000000, # August 3, 2013
  150. """ Added support for OpenSearch """
  151. ], [
  152. 1375142400000, # July 30, 2013
  153. """ New <a href="/backbone/">Backbone.js</a> documentation """
  154. ], [
  155. 1374883200000, # July 27, 2013
  156. """ You can now customize the list of documentations.
  157. New docs will be hidden by default, but you'll see a notification when there are new releases. """,
  158. """ New <a href="/http/">HTTP</a> documentation """
  159. ], [
  160. 1373846400000, # July 15, 2013
  161. """ URL search now works with single documentations: <a href="/#q=js%20sort">devdocs.io/#q=js sort</a> """
  162. ], [
  163. 1373673600000, # July 13, 2013
  164. """ Added syntax highlighting """,
  165. """ Added documentation versions """
  166. ], [
  167. 1373500800000, # July 11, 2013
  168. """ New <a href="/underscore/">Underscore.js</a> documentation """,
  169. """ Improved compatibility with tablets
  170. A mobile version is planned as soon as other high priority features have been implemented. """
  171. ], [
  172. 1373414400000, # July 10, 2013
  173. """ You can now search specific documentations.
  174. Simply type the documentation's name and press <code class="_label">Tab</code>.
  175. The name is fuzzy matched so you can use abbreviations like <code>js</code> for <code>JavaScript</code>. """
  176. ], [
  177. 1373241600000, # July 8, 2013
  178. """ Improved search with fuzzy matching and better results
  179. For example, searching <code>jqmka</code> now returns <code>jQuery.makeArray()</code>. """,
  180. """ DevDocs finally has an icon. """,
  181. """ <code class="_label">space</code> has replaced <code class="_label">alt + space</code> for scrolling down. """
  182. ], [
  183. 1373068800000, # July 6, 2013
  184. """ New <a href="/dom/">DOM</a> and <a href="/dom_events/">DOM Events</a> documentations
  185. DevDocs now includes almost all reference documents available on the Mozilla Developer Network.
  186. Big thank you to Mozilla and all the people that contributed to MDN. """,
  187. """ Implemented URL search: <a href="/#q=sort">devdocs.io/#q=sort</a> """
  188. ], [
  189. 1372723200000, # July 2, 2013
  190. """ New <a href="/javascript/">JavaScript</a> documentation """
  191. ], [
  192. 1372377600000, # June 28, 2013
  193. """ DevDocs made the front page of Hacker News!
  194. Hi everyone &mdash; thanks for trying DevDocs.
  195. Please bear with me while I fix bugs and scramble to add more docs.
  196. This is only v1. There's a lot more to come. """
  197. ], [
  198. 1371513600000, # June 18, 2013
  199. """ Initial release """
  200. ]
  201. ]