news_tmpl.coffee 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. app.templates.newsPage = ->
  2. """ <h1 class="_lined-heading">Changelog</h1>
  3. <p class="_note">For the latest news and updates,
  4. subscribe to the <a href="http://eepurl.com/HnLUz">newsletter</a>
  5. or follow <a href="https://twitter.com/DevDocs">@DevDocs</a>.
  6. <div class="_news">#{app.templates.newsList app.news}</div> """
  7. app.templates.newsList = (news) ->
  8. result = ''
  9. result += newsItem new Date(value[0]), value[1..] for value in news
  10. result
  11. MONTHS = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
  12. newsItem = (date, news) ->
  13. date = """<span class="_news-date">#{MONTHS[date.getUTCMonth()]} #{date.getUTCDate()}</span>"""
  14. result = ''
  15. for text, i in news
  16. text = text.split "\n"
  17. title = """<span class="_news-title">#{text.shift()}</span>"""
  18. result += """<div class="_news-row">#{if i is 0 then date else ''} #{title} #{text.join '<br>'}</div>"""
  19. result
  20. app.news = [
  21. [ 1386892800000, # December 13, 2013
  22. """ New <a href="/git/">Git</a> documentation """
  23. ], [
  24. 1385424000000, # November 26, 2013
  25. """ New <a href="/python/">Python</a> documentation """
  26. ], [
  27. 1384819200000, # November 19, 2013
  28. """ New <a href="/rails/">Ruby on Rails</a> documentation """
  29. ], [
  30. 1384560000000, # November 16, 2013
  31. """ New <a href="/ruby/">Ruby</a> documentation """
  32. ], [
  33. 1382572800000, # October 24, 2013
  34. """ DevDocs is now <a href="https://github.com/Thibaut/devdocs">open source</a>. """
  35. ], [
  36. 1381276800000, # October 9, 2013
  37. """ DevDocs is now available as a <a href="https://chrome.google.com/webstore/detail/devdocs/mnfehgbmkapmjnhcnbodoamcioleeooe">Chrome web app</a>. """
  38. ], [
  39. 1379808000000, # September 22, 2013
  40. """ New <a href="/php/">PHP</a> documentation """
  41. ], [
  42. 1378425600000, # September 6, 2013
  43. """ New <a href="/lodash/">Lo-Dash</a> documentation """,
  44. """ On mobile devices you can now search a specific documentation by typing its name and <code class="_label">Space</code>. """
  45. ], [
  46. 1377993600000, # September 1, 2013
  47. """ New <a href="/jqueryui/">jQuery UI</a> and <a href="/jquerymobile/">jQuery Mobile</a> documentations """
  48. ], [
  49. 1377648000000, # August 28, 2013
  50. """ New smartphone interface
  51. Tested on iOS 6+ and Android 4.1+ """
  52. ], [
  53. 1377388800000, # August 25, 2013
  54. """ New <a href="/ember/">Ember.js</a> documentation """
  55. ], [
  56. 1376784000000, # August 18, 2013
  57. """ New <a href="/coffeescript/">CoffeeScript</a> documentation """,
  58. """ URL search now automatically opens the first result. """
  59. ], [
  60. 1376352000000, # August 13, 2013
  61. """ New <a href="/angular/">Angular.js</a> documentation """
  62. ], [
  63. 1376179200000, # August 11, 2013
  64. """ New <a href="/sass/">Sass</a> and <a href="/less/">Less</a> documentations """
  65. ], [
  66. 1375660800000, # August 5, 2013
  67. """ New <a href="/node/">Node.js</a> documentation """
  68. ], [
  69. 1375488000000, # August 3, 2013
  70. """ Added support for OpenSearch """
  71. ], [
  72. 1375142400000, # July 30, 2013
  73. """ New <a href="/backbone/">Backbone.js</a> documentation """
  74. ], [
  75. 1374883200000, # July 27, 2013
  76. """ You can now customize the list of documentations.
  77. New docs will be hidden by default, but you'll see a notification when there are new releases. """,
  78. """ New <a href="/http/">HTTP</a> documentation """
  79. ], [
  80. 1373846400000, # July 15, 2013
  81. """ URL search now works with single documentations: <a href="/#q=js%20sort">devdocs.io/#q=js sort</a> """
  82. ], [
  83. 1373673600000, # July 13, 2013
  84. """ Added syntax highlighting """,
  85. """ Added documentation versions """
  86. ], [
  87. 1373500800000, # July 11, 2013
  88. """ New <a href="/underscore/">Underscore.js</a> documentation """,
  89. """ Improved compatibility with tablets
  90. A mobile version is planned as soon as other high priority features have been implemented. """
  91. ], [
  92. 1373414400000, # July 10, 2013
  93. """ You can now search specific documentations.
  94. Simply type the documentation's name and press <code class="_label">Tab</code>.
  95. The name is fuzzy matched so you can use abbreviations like <code>js</code> for <code>JavaScript</code>. """
  96. ], [
  97. 1373241600000, # July 8, 2013
  98. """ Improved search with fuzzy matching and better results
  99. For example, searching <code>jqmka</code> now returns <code>jQuery.makeArray()</code>. """,
  100. """ DevDocs finally has an icon. """,
  101. """ <code class="_label">space</code> has replaced <code class="_label">alt + space</code> for scrolling down. """
  102. ], [
  103. 1373068800000, # July 6, 2013
  104. """ New <a href="/dom/">DOM</a> and <a href="/dom_events/">DOM Events</a> documentations
  105. DevDocs now includes almost all reference documents available on the Mozilla Developer Network.
  106. Big thank you to Mozilla and all the people that contributed to MDN. """,
  107. """ Implemented URL search: <a href="/#q=sort">devdocs.io/#q=sort</a> """
  108. ], [
  109. 1372723200000, # July 2, 2013
  110. """ New <a href="/javascript/">JavaScript</a> documentation """
  111. ], [
  112. 1372377600000, # June 28, 2013
  113. """ DevDocs made the front page of Hacker News!
  114. Hi everyone — thanks for trying DevDocs.
  115. Please bear with me while I fix bugs and scramble to add more docs.
  116. This is only v1. There's a lot more to come. """
  117. ], [
  118. 1371513600000, # June 18, 2013
  119. """ Initial release """
  120. ]
  121. ]