Browse files

Adding branch with node-traceur, require-hm experiments.

  • Loading branch information...
1 parent 3e11f29 commit 682eda0a3afcfed354810d5a5045ce4f3d1f479a @addyosmani committed Jun 1, 2012
Showing with 11,597 additions and 101,568 deletions.
  1. +3 −1 .gitignore
  2. +0 −3 VERSION
  3. +0 −8 client/Gemfile
  4. +0 −48 client/Gemfile.lock
  5. +0 −22 client/app/controllers/item-controllers.js
  6. +0 −43 client/app/core.js
  7. +0 −36 client/app/models/item.js
  8. +0 −11 client/app/models/user.js
  9. +0 −12 client/app/templates/access.handlebars
  10. +0 −24 client/app/templates/list.handlebars
  11. +0 −42 client/app/views/access-views.js
  12. +0 −50 client/app/views/item-views.js
  13. +0 −32 client/app/views/main-views.js
  14. +0 −141 client/css/style.css
  15. BIN client/favicon.ico
  16. +0 −17 client/index.html
  17. +0 −17,384 client/lib/ember/ember-0.9.6.js
  18. +0 −14 client/lib/ember/ember-0.9.6.min.js
  19. +0 −1,180 client/lib/ember/ember-addon-datetime.js
  20. +0 −12 client/lib/ember/load.js
  21. +0 −11,229 client/lib/require-jquery.js
  22. +0 −17 client/lib/utils.js
  23. +0 −10 client/main.js
  24. +0 −7 client/plugins/domReady.js
  25. +0 −8 client/plugins/order.js
  26. +0 −11 client/plugins/text.js
  27. +0 −26 client/profiles/normal.build.json
  28. +3 −0 demo/README
  29. +11 −0 demo/app.html
  30. +30 −0 demo/es5/es6/dommunger.js
  31. +21 −0 demo/es5/es6/mathstuff.js
  32. +24 −0 demo/es5/es6/sharedstate.js
  33. +38 −0 demo/es5/es6/widgets.js
  34. +21 −0 demo/es6/dommunger.js
  35. +8 −0 demo/es6/mathstuff.js
  36. +5 −0 demo/es6/sharedstate.js
  37. +5 −0 demo/es6/widgets.js
  38. +27 −0 demo/scripts/app.build.js
  39. +11 −0 demo/scripts/main.js
  40. +11,390 −0 demo/scripts/require-jquery.js
  41. +0 −73 metrics/api.py
  42. +0 −48 metrics/app.yaml
  43. +0 −24 metrics/config.rb
  44. +0 −11 metrics/index.yaml
  45. +0 −178 metrics/insight.py
  46. +0 −57 metrics/main.py
  47. +0 −36 metrics/models.py
  48. +0 −42 metrics/settings.py
  49. +0 −81 metrics/shardedcounter.py
  50. +0 −1 metrics/static/css/app.css
  51. BIN metrics/static/img/favicon.ico
  52. +0 −39 metrics/static/js/app.js
  53. +0 −14 metrics/static/js/controllers.js
  54. +0 −13,823 metrics/static/js/libs/angular-1.0.0rc8/angular-1.0.0rc8.js
  55. +0 −153 metrics/static/js/libs/angular-1.0.0rc8/angular-1.0.0rc8.min.js
  56. +0 −166 metrics/static/js/libs/angular-1.0.0rc8/angular-bootstrap-1.0.0rc8.js
  57. +0 −9 metrics/static/js/libs/angular-1.0.0rc8/angular-bootstrap-1.0.0rc8.min.js
  58. +0 −1,809 metrics/static/js/libs/angular-1.0.0rc8/angular-bootstrap-prettify-1.0.0rc8.js
  59. +0 −40 metrics/static/js/libs/angular-1.0.0rc8/angular-bootstrap-prettify-1.0.0rc8.min.js
  60. +0 −171 metrics/static/js/libs/angular-1.0.0rc8/angular-cookies-1.0.0rc8.js
  61. +0 −7 metrics/static/js/libs/angular-1.0.0rc8/angular-cookies-1.0.0rc8.min.js
  62. +0 −276 metrics/static/js/libs/angular-1.0.0rc8/angular-loader-1.0.0rc8.js
  63. +0 −7 metrics/static/js/libs/angular-1.0.0rc8/angular-loader-1.0.0rc8.min.js
  64. +0 −1,669 metrics/static/js/libs/angular-1.0.0rc8/angular-mocks-1.0.0rc8.js
  65. +0 −428 metrics/static/js/libs/angular-1.0.0rc8/angular-resource-1.0.0rc8.js
  66. +0 −10 metrics/static/js/libs/angular-1.0.0rc8/angular-resource-1.0.0rc8.min.js
  67. +0 −532 metrics/static/js/libs/angular-1.0.0rc8/angular-sanitize-1.0.0rc8.js
  68. +0 −13 metrics/static/js/libs/angular-1.0.0rc8/angular-sanitize-1.0.0rc8.min.js
  69. +0 −25,433 metrics/static/js/libs/angular-1.0.0rc8/angular-scenario-1.0.0rc8.js
  70. +0 −18 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/.htaccess
  71. +0 −263 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/appcache-offline.manifest
  72. +0 −20 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/appcache.manifest
  73. +0 −689 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/css/bootstrap.min.css
  74. +0 −172 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/css/docs.css
  75. +0 −10 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/docs-scenario.html
  76. +0 −4,592 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/docs-scenario.js
  77. BIN metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/img/AngularJS-small.png
  78. BIN metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/img/One_Way_Data_Binding.png
  79. BIN metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/img/Two_Way_Data_Binding.png
  80. BIN metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/img/angular_parts.png
  81. BIN metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/img/bullet.png
  82. BIN metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/img/form_data_flow.png
  83. BIN metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/img/glyphicons-halflings-white.png
  84. BIN metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/img/glyphicons-halflings.png
  85. BIN metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/img/guide/about_model_final.png
  86. BIN metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/img/guide/about_view_final.png
  87. BIN metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/img/guide/di_sequence_final.png
  88. BIN metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/img/guide/dom_scope_final.png
  89. BIN metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/img/guide/hashbang_vs_regular_url.jpg
  90. BIN metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/img/guide/scenario_runner.png
  91. BIN metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/img/guide/simple_scope_final.png
  92. BIN metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/img/helloworld.png
  93. BIN metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/img/helloworld_2way.png
  94. BIN metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/img/tutorial/catalog_screen.png
  95. BIN metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/img/tutorial/tutorial_00.png
  96. BIN metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/img/tutorial/tutorial_00_final.png
  97. BIN metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/img/tutorial/tutorial_02.png
  98. BIN metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/img/tutorial/tutorial_03.png
  99. BIN metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/img/tutorial/tutorial_04.png
  100. BIN metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/img/tutorial/tutorial_07_final.png
  101. BIN metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/img/tutorial/tutorial_08-09_final.png
  102. BIN metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/img/tutorial/tutorial_10-11_final.png
  103. BIN metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/img/tutorial/xhr_service_final.png
  104. +0 −320 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/index-debug.html
  105. +0 −320 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/index-jq-debug.html
  106. +0 −320 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/index-jq-nocache.html
  107. +0 −320 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/index-jq.html
  108. +0 −320 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/index-nocache.html
  109. +0 −320 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/index.html
  110. +0 −212 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/js/docs-keywords.js
  111. +0 −516 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/js/docs.js
  112. +0 −9,404 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/js/jquery.js
  113. +0 −4 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/offline.html
  114. +0 −116 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.IModule.html
  115. +0 −23 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.bind.html
  116. +0 −21 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.bootstrap.html
  117. +0 −31 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.copy.html
  118. +0 −79 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.element.html
  119. +0 −33 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.equals.html
  120. +0 −17 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.extend.html
  121. +0 −35 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.forEach.html
  122. +0 −17 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.fromJson.html
  123. +0 −17 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.identity.html
  124. +0 −32 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.injector.html
  125. +0 −17 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.isArray.html
  126. +0 −17 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.isDate.html
  127. +0 −17 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.isDefined.html
  128. +0 −17 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.isElement.html
  129. +0 −17 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.isFunction.html
  130. +0 −17 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.isNumber.html
  131. +0 −18 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.isObject.html
  132. +0 −17 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.isString.html
  133. +0 −17 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.isUndefined.html
  134. +0 −17 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.lowercase.html
  135. +0 −40 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.mock.TzDate.html
  136. +0 −20 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.mock.debug.html
  137. +0 −5 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.mock.html
  138. +0 −58 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.mock.inject.html
  139. +0 −22 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.mock.module.html
  140. +0 −84 ...ics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.AUTO.$injector.html
  141. +0 −138 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.AUTO.$provide.html
  142. +0 −4 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.AUTO.html
  143. +0 −54 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.html
  144. +0 −23 ...s/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$anchorScroll.html
  145. +0 −109 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$browser.html
  146. +0 −32 ...s/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$cacheFactory.html
  147. +0 −139 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compile.html
  148. +0 −35 .../docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.form.FormController.html
  149. +0 −112 ...ngular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.form.html
  150. +0 −69 ....0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.input.checkbox.html
  151. +0 −87 ...1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.input.email.html
  152. +0 −123 ...gular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.input.html
  153. +0 −98 ....0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.input.number.html
  154. +0 −61 ...1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.input.radio.html
  155. +0 −92 ...-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.input.text.html
  156. +0 −91 ...r-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.input.url.html
  157. +0 −40 ...gular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngApp.html
  158. +0 −66 ...ular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngBind.html
  159. +0 −24 ...rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngBindHtmlUnsafe.html
  160. +0 −67 ....0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngBindTemplate.html
  161. +0 −60 ...ar-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngChange.html
  162. +0 −41 ...r-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngChecked.html
  163. +0 −68 ...lar-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngClass.html
  164. +0 −64 ...1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngClassEven.html
  165. +0 −64 ...-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngClassOdd.html
  166. +0 −45 ...lar-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngClick.html
  167. +0 −65 ...lar-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngCloak.html
  168. +0 −120 ....0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngController.html
  169. +0 −25 ...gular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngCsp.html
  170. +0 −22 ...-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngDblclick.html
  171. +0 −48 ...-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngDisabled.html
  172. +0 −25 ...ular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngForm.html
  173. +0 −48 ...ular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngHide.html
  174. +0 −91 ...ular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngHref.html
  175. +0 −116 ...r-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngInclude.html
  176. +0 −42 ...ular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngInit.html
  177. +0 −64 ...ular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngList.html
  178. +0 −72 ...1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngModel.NgModelController.html
  179. +0 −41 ...lar-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngModel.html
  180. +0 −22 ...1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngMousedown.html
  181. +0 −22 ....0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngMouseenter.html
  182. +0 −22 ....0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngMouseleave.html
  183. +0 −22 ...1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngMousemove.html
  184. +0 −22 ...1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngMouseover.html
  185. +0 −22 ...r-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngMouseup.html
  186. +0 −46 ...-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngMultiple.html
  187. +0 −42 ...0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngNonBindable.html
  188. +0 −197 ...1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngPluralize.html
  189. +0 −42 ...-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngReadonly.html
  190. +0 −79 ...ar-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngRepeat.html
  191. +0 −45 ...-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngSelected.html
  192. +0 −48 ...ular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngShow.html
  193. +0 −29 ...gular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngSrc.html
  194. +0 −56 ...lar-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngStyle.html
  195. +0 −71 ...ar-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngSubmit.html
  196. +0 −70 ...ar-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngSwitch.html
  197. +0 −65 ....0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngTransclude.html
  198. +0 −131 ...ular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.ngView.html
  199. +0 −42 ...ular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.script.html
  200. +0 −141 ...ular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.select.html
  201. +0 −45 ...ar-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.directive.textarea.html
  202. +0 −21 ...tatic/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$compileProvider.html
  203. +0 −31 ...ics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$controller.html
  204. +0 −24 ...ic/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$controllerProvider.html
  205. +0 −40 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$defer.html
  206. +0 −12 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$document.html
  207. +0 −26 ...atic/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$exceptionHandler.html
  208. +0 −63 ...tatic/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$filter.currency.html
  209. +0 −102 ...cs/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$filter.date.html
  210. +0 −97 .../static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$filter.filter.html
  211. +0 −19 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$filter.html
  212. +0 −44 ...cs/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$filter.json.html
  213. +0 −71 ...static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$filter.limitTo.html
  214. +0 −15 ...atic/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$filter.lowercase.html
  215. +0 −68 .../static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$filter.number.html
  216. +0 −106 ...static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$filter.orderBy.html
  217. +0 −15 ...atic/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$filter.uppercase.html
  218. +0 −59 ...static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$filterProvider.html
  219. +0 −453 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$http.html
  220. +0 −21 ...cs/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$httpBackend.html
  221. +0 −41 ...cs/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$interpolate.html
  222. +0 −19 ...c/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$interpolateProvider.html
  223. +0 −12 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$locale.html
  224. +0 −108 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$location.html
  225. +0 −30 ...atic/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$locationProvider.html
  226. +0 −63 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$log.html
  227. +0 −204 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$q.html
  228. +0 −400 ...tatic/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$rootScope.Scope.html
  229. +0 −9 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$rootScope.html
  230. +0 −20 ...tic/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$rootScopeProvider.html
  231. +0 −180 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$route.html
  232. +0 −27 ...cs/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$routeParams.html
  233. +0 −64 .../static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$routeProvider.html
  234. +0 −9 .../static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$templateCache.html
  235. +0 −30 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.$window.html
  236. +0 −4 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ng.html
  237. +0 −44 ...ic/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ngCookies.$cookieStore.html
  238. +0 −16 ...static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ngCookies.$cookies.html
  239. +0 −4 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ngCookies.html
  240. +0 −35 ...cs/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ngMock.$browser.html
  241. +0 −9 .../js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ngMock.$exceptionHandler.html
  242. +0 −28 .../angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ngMock.$exceptionHandlerProvider.html
  243. +0 −433 ...tatic/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ngMock.$httpBackend.html
  244. +0 −33 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ngMock.$log.html
  245. +0 −5 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ngMock.html
  246. +0 −174 ...ic/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ngMockE2E.$httpBackend.html
  247. +0 −6 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ngMockE2E.html
  248. +0 −225 ...atic/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ngResource.$resource.html
  249. +0 −4 metrics/static/js/libs/angular-1.0.0rc8/docs-1.0.0rc8/partials/api/angular.module.ngResource.html
Sorry, we could not display the entire diff because too many files (3,278) changed.
View
4 .gitignore
@@ -4,4 +4,6 @@
*.min.css
#*.min.js
.sass-cache/*
-node_modules
+node_modules
+cli/tasks/init/remotes/_cache/
+cli/tasks/init/yeoman/root/
View
3 VERSION
@@ -1,3 +0,0 @@
-MAJOR=0
-MINOR=0
-BUILD=0
View
8 client/Gemfile
@@ -1,8 +0,0 @@
-source :rubygems
-
-gem "bpm"
-gem "compass"
-
-group :development do
-
-end
View
48 client/Gemfile.lock
@@ -1,48 +0,0 @@
-GEM
- remote: http://rubygems.org/
- specs:
- bpm (1.0.0)
- eventmachine (~> 1.0.0.beta.4)
- execjs (~> 1.2.4)
- gemcutter (~> 0.6.1)
- highline (~> 1.6.1)
- json_pure (~> 1.4.6)
- libgems (~> 0.1.3)
- sprockets (~> 2.0.0)
- thin (~> 1.2)
- thor (~> 0.14.3)
- chunky_png (1.2.5)
- compass (0.12.1)
- chunky_png (~> 1.2)
- fssm (>= 0.2.7)
- sass (~> 3.1)
- daemons (1.1.8)
- eventmachine (1.0.0.beta.4)
- execjs (1.2.13)
- multi_json (~> 1.0)
- fssm (0.2.9)
- gemcutter (0.6.1)
- highline (1.6.11)
- hike (1.2.1)
- json_pure (1.4.6)
- libgems (0.1.3)
- multi_json (1.2.0)
- rack (1.4.1)
- sass (3.1.15)
- sprockets (2.0.3)
- hike (~> 1.2)
- rack (~> 1.0)
- tilt (~> 1.1, != 1.3.0)
- thin (1.3.1)
- daemons (>= 1.0.9)
- eventmachine (>= 0.12.6)
- rack (>= 1.0.0)
- thor (0.14.6)
- tilt (1.3.3)
-
-PLATFORMS
- ruby
-
-DEPENDENCIES
- bpm
- compass
View
22 client/app/controllers/item-controllers.js
@@ -1,22 +0,0 @@
-
-define([
- 'lib/ember/load',
- 'app/models/item'
-], function(em, Item) {
-
- var itemsArray = em.ArrayProxy.create({
- content: [],
- createItem: function(name) {
- var item = Item.create({
- name: name
- });
- this.pushObject(item);
- }
- });
-
- return {
- itemsArray: itemsArray
- }
-
-});
-
View
43 client/app/core.js
@@ -1,43 +0,0 @@
-
-define([
- 'lib/ember/load',
- 'app/models/user',
- "app/views/main-views",
- "app/views/access-views",
- "app/views/item-views"
-], function(em, User, mainViews, accessViews, itemViews) {
-
- var user = User.create();
-
- // Create a local namespace for the app
- var MyApp = em.Application.create({
- VERSION: "0.0.1",
- user: User.create({
- name: ""
- })
- });
-
- // Instantiate the main view
- var mainView = mainViews.MainView.create();
- mainView.appendTo("#main");
- MyApp.set("mainView", mainView);
- var accessView = accessViews.AccessView.create();
- mainView.switchView(accessView);
-
- // Expose the views to the handlebars templates
- MyApp.set("AccessView", accessViews.AccessView);
- MyApp.set("AccessButton", accessViews.AccessButton);
- MyApp.set("UsernameField", accessViews.UsernameField);
- MyApp.set("ItemView", itemViews.ItemView);
- MyApp.set("CreateItemView", itemViews.CreateItemView);
- MyApp.set("ListItemsView", itemViews.ListItemsView);
-
- // Add the application's namespace to Ember so we can access it
- // from within handlebars templates.
- em.MyApp = MyApp;
-
- // Export it from the module.
- return MyApp;
-
-});
-
View
36 client/app/models/item.js
@@ -1,36 +0,0 @@
-
-define([
- 'lib/ember/load'
-], function(em) {
-
- return em.Object.extend({
-
- name: "",
-
- createdAt: null,
- modifiedAt: null,
- createdBy: null,
-
- // Change the createdAt and modifiedAt value when the record is initialized.
- init: function(object) {
- this._super(object);
- this.set('createdAt', em.DateTime.create());
- this.set('modifiedAt', em.DateTime.create());
- this.set('createdBy', em.MyApp.user);
- },
-
- // Change the modifiedAt value when some attribute is being modified.
- set: function(key, value) {
- if (key == 'modifiedAt') {
- this._super(key, value)
- } else {
- this.set('modifiedAt', Em.DateTime.create());
- this._super(key, value);
- }
- }
- });
-
-});
-
-
-
View
11 client/app/models/user.js
@@ -1,11 +0,0 @@
-
-define([
- 'lib/ember/load'
-], function(em) {
-
- return em.Object.extend({
- name: ""
- });
-
-});
-
View
12 client/app/templates/access.handlebars
@@ -1,12 +0,0 @@
-<div id="top">
- {{#if Em.MyApp.user.name}}Entering as {{Em.MyApp.user.name}}{{else}}Please come in...{{/if}}
-</div>
-<div id="access">
- Who are you? {{#view Em.MyApp.UsernameField valueBinding="Em.MyApp.user.name" placeholder="Enter your user name" id="username-field"}}{{/view}}
- {{#view Em.MyApp.AccessButton action="login"}}Log in{{/view}}
-
-</div>
-<div id="bottom">
- MyApp v{{Em.MyApp.VERSION}}
-</div>
-
View
24 client/app/templates/list.handlebars
@@ -1,24 +0,0 @@
-
-<div id="top">
- {{Em.MyApp.user.name}} {{#view Em.MyApp.AccessButton action="logout"}}Log out{{/view}}
-</div>
-
-<div id="create-item">
- {{#view Em.MyApp.CreateItemView}}{{/view}}
-</div>
-
-<div id="items-list">
- <ul>
- {{#each items}}
- {{#view Em.MyApp.ItemView contentBinding="this"}}
- <li><span class="label">{{content.name}}</span>
- [{{createdAtString}} by {{createdByName}}]</li>
- {{/view}}
- {{/each}}
- </ul>
-</div>
-
-<div id="bottom">
- MyApp v{{Em.MyApp.VERSION}}.
-</div>
-
View
42 client/app/views/access-views.js
@@ -1,42 +0,0 @@
-
-define([
- 'lib/ember/load',
- 'plugins/text!app/templates/access.handlebars'
-], function(em, accessTemplateSource) {
-
- var AccessView = em.View.extend({
- template: em.Handlebars.compile(accessTemplateSource),
- didInsertElement: function() {
- this.$("#username-field").focus();
- }
- });
-
- var actions = em.Object.create({
- login: function() {
- em.MyApp.get("mainView").login();
- },
-
- logout: function() {
- em.MyApp.get("mainView").logout();
- }
- });
-
- var UsernameField = em.TextField.extend({
- insertNewline: function() {
- actions.login();
- }
- });
-
- var AccessButton = em.Button.extend({
- target: actions
- });
-
- // Export them also from the module to be used elsewhere.
- return {
- AccessView: AccessView,
- AccessButton: AccessButton,
- UsernameField: UsernameField
- }
-
-});
-
View
50 client/app/views/item-views.js
@@ -1,50 +0,0 @@
-
-define([
- 'lib/ember/load',
- 'lib/utils',
- 'app/controllers/item-controllers',
- 'plugins/text!app/templates/list.handlebars'
-], function(em, utils, itemControllers, listTemplateSource) {
-
- var ItemView = em.View.extend({
- createdAtString: function() {
- return utils.formatAsDateAndTime(this.getPath('content.createdAt'));
- }.property('content.createdAt'),
- createdByName: function() {
- var creator = this.getPath('content.createdBy');
- if (creator) {
- return creator.name;
- } else {
- return "Unknown";
- }
- }.property('content.createdBy')
- });
-
- var CreateItemView = em.TextField.extend({
- classNames: ['create-item-input'], // CSS class name
- insertNewline: function() {
- var value = this.get('value');
- if (value) {
- itemControllers.itemsArray.createItem(value);
- this.set('value', ''); // Reset the field
- }
- },
- didInsertElement: function() {
- this.$().focus();
- }
- });
-
- var ListItemsView = em.View.extend({
- template: em.Handlebars.compile(listTemplateSource),
- ItemView: ItemView,
- items: itemControllers.itemsArray
- });
-
- return {
- ItemView: ItemView,
- CreateItemView: CreateItemView,
- ListItemsView: ListItemsView
- }
- }
-);
-
View
32 client/app/views/main-views.js
@@ -1,32 +0,0 @@
-
-define([
- 'jquery',
- 'lib/ember/load',
- 'app/models/user'
-], function($, em, User) {
-
- var MainView = em.ContainerView.extend({
- switchView: function(view) {
- var childViews = this.get("childViews");
- childViews.popObject();
- childViews.pushObject(view);
- },
-
- logout: function() {
- var access = em.MyApp.get("AccessView").create();
- em.MyApp.set("user", User.create({name: ""}));
- this.switchView(access);
- },
-
- login: function() {
- var access = em.MyApp.get("ListItemsView").create();
- this.switchView(access);
- }
- });
-
- return {
- MainView: MainView
- }
-
-});
-
View
141 client/css/style.css
@@ -1,141 +0,0 @@
-
-/* ==== Scroll down to find where to put your styles :) ==== */
-
-/* HTML5 ✰ Boilerplate */
-
-html, body, div, span, object, iframe,
-h1, h2, h3, h4, h5, h6, p, blockquote, pre,
-abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp,
-small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li,
-fieldset, form, label, legend,
-table, caption, tbody, tfoot, thead, tr, th, td,
-article, aside, canvas, details, figcaption, figure,
-footer, header, hgroup, menu, nav, section, summary,
-time, mark, audio, video {
- margin: 0;
- padding: 0;
- border: 0;
- font-size: 100%;
- font: inherit;
- vertical-align: baseline;
-}
-
-article, aside, details, figcaption, figure,
-footer, header, hgroup, menu, nav, section {
- display: block;
-}
-
-blockquote, q { quotes: none; }
-blockquote:before, blockquote:after,
-q:before, q:after { content: ''; content: none; }
-ins { background-color: #ff9; color: #000; text-decoration: none; }
-mark { background-color: #ff9; color: #000; font-style: italic; font-weight: bold; }
-del { text-decoration: line-through; }
-abbr[title], dfn[title] { border-bottom: 1px dotted; cursor: help; }
-table { border-collapse: collapse; border-spacing: 0; }
-hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; }
-input, select { vertical-align: middle; }
-
-body { font:13px/1.231 sans-serif; *font-size:small; }
-select, input, textarea, button { font:99% sans-serif; }
-pre, code, kbd, samp { font-family: monospace, sans-serif; }
-
-html { overflow-y: scroll; }
-a:hover, a:active { outline: none; }
-ul, ol { margin-left: 2em; }
-ol { list-style-type: decimal; }
-nav ul, nav li { margin: 0; list-style:none; list-style-image: none; }
-small { font-size: 85%; }
-strong, th { font-weight: bold; }
-td { vertical-align: top; }
-
-sub, sup { font-size: 75%; line-height: 0; position: relative; }
-sup { top: -0.5em; }
-sub { bottom: -0.25em; }
-
-pre { white-space: pre; white-space: pre-wrap; word-wrap: break-word; padding: 15px; }
-textarea { overflow: auto; }
-.ie6 legend, .ie7 legend { margin-left: -7px; }
-input[type="radio"] { vertical-align: text-bottom; }
-input[type="checkbox"] { vertical-align: bottom; }
-.ie7 input[type="checkbox"] { vertical-align: baseline; }
-.ie6 input { vertical-align: text-bottom; }
-label, input[type="button"], input[type="submit"], input[type="image"], button { cursor: pointer; }
-button, input, select, textarea { margin: 0; }
-input:valid, textarea:valid { }
-input:invalid, textarea:invalid { border-radius: 1px; -moz-box-shadow: 0px 0px 5px red; -webkit-box-shadow: 0px 0px 5px red; box-shadow: 0px 0px 5px red; }
-.no-boxshadow input:invalid, .no-boxshadow textarea:invalid { background-color: #f0dddd; }
-
-::-moz-selection{ background: #FF5E99; color:#fff; text-shadow: none; }
-::selection { background:#FF5E99; color:#fff; text-shadow: none; }
-a:link { -webkit-tap-highlight-color: #FF5E99; }
-
-button { width: auto; overflow: visible; }
-.ie7 img { -ms-interpolation-mode: bicubic; }
-
-body, select, input, textarea { color: #444; }
-h1, h2, h3, h4, h5, h6 { font-weight: bold; }
-a, a:active, a:visited { color: #607890; }
-a:hover { color: #036; }
-
-/*
- // ========================================== \\
- || ||
- || Your styles ! ||
- || ||
- \\ ========================================== //
-*/
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-.ir { display: block; text-indent: -999em; overflow: hidden; background-repeat: no-repeat; text-align: left; direction: ltr; }
-.hidden { display: none; visibility: hidden; }
-.visuallyhidden { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; }
-.visuallyhidden.focusable:active,
-.visuallyhidden.focusable:focus { clip: auto; height: auto; margin: 0; overflow: visible; position: static; width: auto; }
-.invisible { visibility: hidden; }
-.clearfix:before, .clearfix:after { content: "\0020"; display: block; height: 0; overflow: hidden; }
-.clearfix:after { clear: both; }
-.clearfix { zoom: 1; }
-
-
-@media all and (orientation:portrait) {
-
-}
-
-@media all and (orientation:landscape) {
-
-}
-
-@media screen and (max-device-width: 480px) {
-
- /* html { -webkit-text-size-adjust:none; -ms-text-size-adjust:none; } */
-}
-
-
-@media print {
- * { background: transparent !important; color: black !important; text-shadow: none !important; filter:none !important;
- -ms-filter: none !important; }
- a, a:visited { color: #444 !important; text-decoration: underline; }
- a[href]:after { content: " (" attr(href) ")"; }
- abbr[title]:after { content: " (" attr(title) ")"; }
- .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; }
- pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
- thead { display: table-header-group; }
- tr, img { page-break-inside: avoid; }
- @page { margin: 0.5cm; }
- p, h2, h3 { orphans: 3; widows: 3; }
- h2, h3{ page-break-after: avoid; }
-}
View
BIN client/favicon.ico
Binary file not shown.
View
17 client/index.html
@@ -1,17 +0,0 @@
-<!doctype html>
-<!--[if lte IE 9 ]> <html class="oldie" lang="en"> <![endif]-->
-<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en"> <!--<![endif]-->
-
-<meta charset="UTF-8">
-<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
-
-<title></title>
-<meta name="description" content="">
-<meta name="viewport" content="width=device-width, initial-scale=1.0">
-<link rel="stylesheet" href="css/style.css">
-
-<!-- Holds the Ember application (see states/manager.js) -->
-<div id="main"></div>
-
-<script data-main="main" src="lib/require-jquery.js"></script>
-
View
17,384 client/lib/ember/ember-0.9.6.js
0 additions, 17,384 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
14 client/lib/ember/ember-0.9.6.min.js
0 additions, 14 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
1,180 client/lib/ember/ember-addon-datetime.js
@@ -1,1180 +0,0 @@
-// ==========================================================================
-// Project: Ember - JavaScript Application Framework
-// Copyright: ©2006-2011 Strobe Inc. and contributors.
-// Portions ©2008-2011 Apple Inc. All rights reserved.
-// License: Licensed under MIT license (see license.js)
-// ==========================================================================
-
-//require('ember-runtime');
-
-var get = Ember.get, set = Ember.set;
-
-// simple copy op needed for just this code.
-function copy(opts) {
- var ret = {};
- for(var key in opts) {
- if (opts.hasOwnProperty(key)) ret[key] = opts[key];
- }
- return ret;
-}
-
-/**
- Standard error thrown by `Ember.Scanner` when it runs out of bounds
-
- @static
- @constant
- @type Error
-*/
-Ember.SCANNER_OUT_OF_BOUNDS_ERROR = "Out of bounds.";
-
-/**
- Standard error thrown by `Ember.Scanner` when you pass a value not an integer.
-
- @static
- @constant
- @type Error
-*/
-Ember.SCANNER_INT_ERROR = "Not an int.";
-
-/**
- Standard error thrown by `Ember.Scanner` when it cannot find a string to skip.
-
- @static
- @constant
- @type Error
-*/
-Ember.SCANNER_SKIP_ERROR = "Did not find the string to skip.";
-
-/**
- Standard error thrown by `Ember.Scanner` when it can any kind a string in the
- matching array.
-
- @static
- @constant
- @type Error
-*/
-Ember.SCANNER_SCAN_ARRAY_ERROR = "Did not find any string of the given array to scan.";
-
-/**
- Standard error thrown when trying to compare two dates in different
- timezones.
-
- @static
- @constant
- @type Error
-*/
-Ember.DATETIME_COMPAREDATE_TIMEZONE_ERROR = "Can't compare the dates of two DateTimes that don't have the same timezone.";
-
-/**
- Standard ISO8601 date format
-
- @static
- @type String
- @default '%Y-%m-%dT%H:%M:%S%Z'
- @constant
-*/
-Ember.DATETIME_ISO8601 = '%Y-%m-%dT%H:%M:%S%Z';
-
-
-/**
- @ignore
- @private
-
- A Scanner reads a string and interprets the characters into numbers. You
- assign the scanner's string on initialization and the scanner progresses
- through the characters of that string from beginning to end as you request
- items.
-
- Scanners are used by `DateTime` to convert strings into `DateTime` objects.
-
- @extends Ember.Object
- @since Ember 0.9
- @author Martin Ottenwaelter
-*/
-var Scanner = Ember.Object.extend({
-
- /**
- The string to scan. You usually pass it to the create method:
-
- Scanner.create({string: 'May, 8th'});
-
- @type String
- */
- string: null,
-
- /**
- The current scan location. It is incremented by the scanner as the
- characters are processed.
- The default is 0: the beginning of the string.
-
- @type Integer
- */
- scanLocation: 0,
-
- /**
- Reads some characters from the string, and increments the scan location
- accordingly.
-
- @param {Integer} len The amount of characters to read
- @throws {Ember.SCANNER_OUT_OF_BOUNDS_ERROR} If asked to read too many characters
- @returns {String} The characters
- */
- scan: function(len) {
- if (this.scanLocation + len > this.length) {
- throw new Error(Ember.SCANNER_OUT_OF_BOUNDS_ERROR);
- }
- var str = this.string.substr(this.scanLocation, len);
- this.scanLocation += len;
- return str;
- },
-
- /**
- Reads some characters from the string and interprets it as an integer.
-
- @param {Integer} min_len The minimum amount of characters to read
- @param {Integer} [max_len] The maximum amount of characters to read (defaults to the minimum)
- @throws {Ember.SCANNER_INT_ERROR} If asked to read non numeric characters
- @returns {Integer} The scanned integer
- */
- scanInt: function(min_len, max_len) {
- if (max_len === undefined) max_len = min_len;
- var str = this.scan(max_len);
- var re = new RegExp("^\\d{" + min_len + "," + max_len + "}");
- var match = str.match(re);
- if (!match) throw new Error(Ember.SCANNER_INT_ERROR);
- if (match[0].length < max_len) {
- this.scanLocation += match[0].length - max_len;
- }
- return parseInt(match[0], 10);
- },
-
- /**
- Attempts to skip a given string.
-
- @param {String} str The string to skip
- @throws {Ember.SCANNER_SKIP_ERROR} If the given string could not be scanned
- @returns {Boolean} YES if the given string was successfully scanned, NO otherwise
- */
- skipString: function(str) {
- if (this.scan(str.length) !== str) {
- throw new Error(Ember.SCANNER_SKIP_ERROR);
- }
-
- return YES;
- },
-
- /**
- Attempts to scan any string in a given array.
-
- @param {Array} ary the array of strings to scan
- @throws {Ember.SCANNER_SCAN_ARRAY_ERROR} If no string of the given array is found
- @returns {Integer} The index of the scanned string of the given array
- */
- scanArray: function(ary) {
- for (var i = 0, len = ary.length; i < len; i++) {
- if (this.scan(ary[i].length) === ary[i]) {
- return i;
- }
- this.scanLocation -= ary[i].length;
- }
- throw new Error(Ember.SCANNER_SCAN_ARRAY_ERROR);
- }
-
-});
-
-
-/** @class
-
- A class representation of a date and time. It's basically a wrapper around
- the Date javascript object, KVO-friendly and with common date/time
- manipulation methods.
-
- This object differs from the standard JS Date object, however, in that it
- supports time zones other than UTC and that local to the machine on which
- it is running. Any time zone can be specified when creating an
- `Ember.DateTime` object, e.g.
-
- // Creates a DateTime representing 5am in Washington, DC and 10am in
- // London
- var d = Ember.DateTime.create({ hour: 5, timezone: 300 }); // -5 hours from UTC
- var e = Ember.DateTime.create({ hour: 10, timezone: 0 }); // same time, specified in UTC
-
- and it is true that `d.isEqual(e)`.
-
- The time zone specified upon creation is permanent, and any calls to
- `get()` on that instance will return values expressed in that time zone. So,
-
- d.hour returns 5.
- e.hour returns 10.
-
- but
-
- d.milliseconds === e.milliseconds
-
- is true, since they are technically the same position in time.
-
- @extends Ember.Object
- @extends Ember.Freezable
- @extends Ember.Copyable
- @author Martin Ottenwaelter
- @author Jonathan Lewis
- @author Josh Holt
- @since Ember 1.0
-*/
-Ember.DateTime = Ember.Object.extend(Ember.Freezable, Ember.Copyable,
-/** @scope Ember.DateTime.prototype */ {
-
- /**
- @private
-
- Internal representation of a date: the number of milliseconds
- since January, 1st 1970 00:00:00.0 UTC.
-
- @property
- @type {Integer}
- */
- _ms: 0,
-
- /** @read-only
- The offset, in minutes, between UTC and the object's timezone.
- All calls to `get()` will use this time zone to translate date/time
- values into the zone specified here.
-
- @type Integer
- */
- timezone: 0,
-
- /**
- A `Ember.DateTime` instance is frozen by default for better performance.
-
- @type Boolean
- */
- isFrozen: true,
-
- /**
- Returns a new `Ember.DateTime` object where one or more of the elements have
- been changed according to the options parameter. The time options (hour,
- minute, sec, usec) reset cascadingly, so if only the hour is passed, then
- minute, sec, and usec is set to 0. If the hour and minute is passed, then
- sec and usec is set to 0.
-
- If a time zone is passed in the options hash, all dates and times are
- assumed to be local to it, and the returned `Ember.DateTime` instance has
- that time zone. If none is passed, it defaults to `Ember.DateTime.timezone`.
-
- Note that passing only a time zone does not affect the actual milliseconds
- since Jan 1, 1970, only the time zone in which it is expressed when
- displayed.
-
- @see Ember.DateTime#create for the list of options you can pass
- @returns {Ember.DateTime} copy of receiver
- */
- adjust: function(options, resetCascadingly) {
- var timezone;
-
- options = options ? copy(options) : {};
- timezone = (options.timezone !== undefined) ? options.timezone : (this.timezone !== undefined) ? this.timezone : 0;
-
- return this.constructor._adjust(options, this._ms, timezone, resetCascadingly)._createFromCurrentState();
- },
-
- /**
- Returns a new `Ember.DateTime` object advanced according the the given
- parameters. Don't use floating point values, it might give unpredicatble results.
-
- @see Ember.DateTime#create for the list of options you can pass
- @param {Hash} options the amount of date/time to advance the receiver
- @returns {DateTime} copy of the receiver
- */
- advance: function(options) {
- return this.constructor._advance(options, this._ms, this.timezone)._createFromCurrentState();
- },
-
- /**
- Generic getter.
-
- The properties you can get are:
- - `year`
- - `month` (January is 1, contrary to JavaScript Dates for which January is 0)
- - `day`
- - `dayOfWeek` (Sunday is 0)
- - `hour`
- - `minute`
- - `second`
- - `millisecond`
- - `milliseconds`, the number of milliseconds since
- January, 1st 1970 00:00:00.0 UTC
- - `isLeapYear`, a boolean value indicating whether the receiver's year
- is a leap year
- - `daysInMonth`, the number of days of the receiver's current month
- - `dayOfYear`, January 1st is 1, December 31th is 365 for a common year
- - `week` or `week1`, the week number of the current year, starting with
- the first Sunday as the first day of the first week (00..53)
- - `week0`, the week number of the current year, starting with
- the first Monday as the first day of the first week (00..53)
- - `lastMonday`, `lastTuesday`, etc., `nextMonday`,
- `nextTuesday`, etc., the date of the last or next weekday in
- comparison to the receiver.
-
- @param {String} key the property name to get
- @return the value asked for
- */
- unknownProperty: function(key) {
- return this.constructor._get(key, this._ms, this.timezone);
- },
-
- /**
- Formats the receiver according to the given format string. Should behave
- like the C strftime function.
-
- The format parameter can contain the following characters:
- - %a -- The abbreviated weekday name (``Sun'')
- - %A -- The full weekday name (``Sunday'')
- - %b -- The abbreviated month name (``Jan'')
- - %B -- The full month name (``January'')
- - %c -- The preferred local date and time representation
- - %d -- Day of the month (01..31)
- - %D -- Day of the month (0..31)
- - %h -- Hour of the day, 24-hour clock (0..23)
- - %H -- Hour of the day, 24-hour clock (00..23)
- - %i -- Hour of the day, 12-hour clock (1..12)
- - %I -- Hour of the day, 12-hour clock (01..12)
- - %j -- Day of the year (001..366)
- - %m -- Month of the year (01..12)
- - %M -- Minute of the hour (00..59)
- - %p -- Meridian indicator (``AM'' or ``PM'')
- - %S -- Second of the minute (00..60)
- - %s -- Milliseconds of the second (000..999)
- - %U -- Week number of the current year,
- starting with the first Sunday as the first
- day of the first week (00..53)
- - %W -- Week number of the current year,
- starting with the first Monday as the first
- day of the first week (00..53)
- - %w -- Day of the week (Sunday is 0, 0..6)
- - %x -- Preferred representation for the date alone, no time
- - %X -- Preferred representation for the time alone, no date
- - %y -- Year without a century (00..99)
- - %Y -- Year with century
- - %Z -- Time zone (ISO 8601 formatted)
- - %% -- Literal ``%'' character
-
- @param {String} format the format string
- @return {String} the formatted string
- */
- toFormattedString: function(fmt) {
- return this.constructor._toFormattedString(fmt, this._ms, this.timezone);
- },
-
- /**
- Formats the receiver according ISO 8601 standard. It is equivalent to
- calling toFormattedString with the `'%Y-%m-%dT%H:%M:%S%Z'` format string.
-
- @return {String} the formatted string
- */
- toISO8601: function(){
- return this.constructor._toFormattedString(Ember.DATETIME_ISO8601, this._ms, this.timezone);
- },
-
- /**
- @private
-
- Creates a string representation of the receiver.
-
- (Debuggers often call the `toString` method. Because of the way
- `Ember.DateTime` is designed, calling `Ember.DateTime._toFormattedString` would
- have a nasty side effect. We shouldn't therefore call any of
- `Ember.DateTime`'s methods from `toString`)
-
- @returns {String}
- */
- toString: function() {
- return "UTC: " +
- new Date(this._ms).toUTCString() +
- ", timezone: " +
- this.timezone;
- },
-
- /**
- Returns `YES` if the passed `Ember.DateTime` is equal to the receiver, ie: if their
- number of milliseconds since January, 1st 1970 00:00:00.0 UTC are equal.
- This is the preferred method for testing equality.
-
- @see Ember.DateTime#compare
- @param {Ember.DateTime} aDateTime the DateTime to compare to
- @returns {Boolean}
- */
- isEqual: function(aDateTime) {
- return this.constructor.compare(this, aDateTime) === 0;
- },
-
- /**
- Returns a copy of the receiver. Because of the way `Ember.DateTime` is designed,
- it just returns the receiver.
-
- @returns {Ember.DateTime}
- */
- copy: function() {
- return this;
- },
-
- /**
- Returns a copy of the receiver with the timezone set to the passed
- timezone. The returned value is equal to the receiver (ie `Ember.Compare`
- returns 0), it is just the timezone representation that changes.
-
- If you don't pass any argument, the target timezone is assumed to be 0,
- ie UTC.
-
- Note that this method does not change the underlying position in time,
- but only the time zone in which it is displayed. In other words, the underlying
- number of milliseconds since Jan 1, 1970 does not change.
-
- @return {Ember.DateTime}
- */
- toTimezone: function(timezone) {
- if (timezone === undefined) timezone = 0;
- return this.advance({ timezone: timezone - this.timezone });
- }
-
-});
-
-Ember.DateTime.reopenClass(Ember.Comparable,
-/** @scope Ember.DateTime */ {
-
- /**
- The default format (ISO 8601) in which DateTimes are stored in a record.
- Change this value if your backend sends and receives dates in another
- format.
-
- This value can also be customized on a per-attribute basis with the format
- property. For example:
-
- Ember.Record.attr(Ember.DateTime, { format: '%d/%m/%Y %H:%M:%S' })
-
- @type String
- @default Ember.DATETIME_ISO8601
- */
- recordFormat: Ember.DATETIME_ISO8601,
-
- /**
- @type Array
- @default ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
- */
- dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
-
- /**
- @private
-
- The English day names used for the 'lastMonday', 'nextTuesday', etc., getters.
-
- @type Array
- */
- _englishDayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
-
- /**
- @type Array
- @default ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
- */
- abbreviatedDayNames: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
-
- /**
- @type Array
- @default ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
- */
- monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
-
- /**
- @type Array
- @default ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
- */
- abbreviatedMonthNames: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
-
- /**
- @private
-
- The unique internal `Date` object used to make computations. Better
- performance is obtained by having only one Date object for the whole
- application and manipulating it with `setTime()` and `getTime()`.
-
- Note that since this is used for internal calculations across many
- `Ember.DateTime` instances, it is not guaranteed to store the date/time that
- any one `Ember.DateTime` instance represents. So it might be that
-
- this._date.getTime() !== this._ms
-
- Be sure to set it before using for internal calculations if necessary.
-
- @type Date
- */
- _date: new Date(),
-
- /**
- @private
-
- The offset, in minutes, between UTC and the currently manipulated
- `Ember.DateTime` instance.
-
- @type Integer
- */
- _tz: 0,
-
- /**
- The offset, in minutes, between UTC and the local system time. This
- property is computed at loading time and should never be changed.
-
- @type Integer
- @default new Date().getTimezoneOffset()
- @constant
- */
- timezone: new Date().getTimezoneOffset(),
-
- /**
- @private
-
- A cache of `Ember.DateTime` instances. If you attempt to create a `Ember.DateTime`
- instance that has already been created, then it will return the cached
- value.
-
- @type Array
- */
- _dt_cache: {},
-
- /**
- @private
-
- The index of the lastest cached value. Used with `_DT_CACHE_MAX_LENGTH` to
- limit the size of the cache.
-
- @type Integer
- */
- _dt_cache_index: -1,
-
- /**
- @private
-
- The maximum length of `_dt_cache`. If this limit is reached, then the cache
- is overwritten, starting with the oldest element.
-
- @type Integer
- */
- _DT_CACHE_MAX_LENGTH: 1000,
-
- /**
- @private
-
- Both args are optional, but will only overwrite `_date` and `_tz` if
- defined. This method does not affect the DateTime instance's actual time,
- but simply initializes the one `_date` instance to a time relevant for a
- calculation. (`this._date` is just a resource optimization)
-
- This is mainly used as a way to store a recursion starting state during
- internal calculations.
-
- 'milliseconds' is time since Jan 1, 1970.
- 'timezone' is the current time zone we want to be working in internally.
-
- Returns a hash of the previous milliseconds and time zone in case they
- are wanted for later restoration.
- */
- _setCalcState: function(ms, timezone) {
- var previous = {
- milliseconds: this._date.getTime(),
- timezone: this._tz
- };
-
- if (ms !== undefined) this._date.setTime(ms);
- if (timezone !== undefined) this._tz = timezone;
-
- return previous;
- },
-
- /**
- @private
-
- By this time, any time zone setting on 'hash' will be ignored.
- 'timezone' will be used, or the last this._tz.
- */
- _setCalcStateFromHash: function(hash, timezone) {
- var tz = (timezone !== undefined) ? timezone : this._tz; // use the last-known time zone if necessary
- var ms = this._toMilliseconds(hash, this._ms, tz); // convert the hash (local to specified time zone) to milliseconds (in UTC)
- return this._setCalcState(ms, tz); // now call the one we really wanted
- },
-
- /**
- @private
- @see Ember.DateTime#unknownProperty
- */
- _get: function(key, start, timezone) {
- var ms, tz, doy, m, y, firstDayOfWeek, dayOfWeek, dayOfYear, prefix, suffix;
- var currentWeekday, targetWeekday;
- var d = this._date;
- var originalTime, v = null;
-
- // Set up an absolute date/time using the given milliseconds since Jan 1, 1970.
- // Only do it if we're given a time value, though, otherwise we want to use the
- // last one we had because this `_get()` method is recursive.
- //
- // Note that because these private time calc methods are recursive, and because all DateTime instances
- // share an internal this._date and `this._tz` state for doing calculations, methods
- // that modify `this._date` or `this._tz` should restore the last state before exiting
- // to avoid obscure calculation bugs. So we save the original state here, and restore
- // it before returning at the end.
- originalTime = this._setCalcState(start, timezone); // save so we can restore it to how it was before we got here
-
- // Check this first because it is an absolute value -- no tweaks necessary when calling for milliseconds
- if (key === 'milliseconds') {
- v = d.getTime();
- }
- else if (key === 'timezone') {
- v = this._tz;
- }
-
- // 'nextWeekday' or 'lastWeekday'.
- // We want to do this calculation in local time, before shifting UTC below.
- if (v === null) {
- prefix = key.slice(0, 4);
- suffix = key.slice(4);
- if (prefix === 'last' || prefix === 'next') {
- currentWeekday = this._get('dayOfWeek', start, timezone);
- targetWeekday = this._englishDayNames.indexOf(suffix);
- if (targetWeekday >= 0) {
- var delta = targetWeekday - currentWeekday;
- if (prefix === 'last' && delta >= 0) delta -= 7;
- if (prefix === 'next' && delta < 0) delta += 7;
- this._advance({ day: delta }, start, timezone);
- v = this._createFromCurrentState();
- }
- }
- }
-
- if (v === null) {
- // need to adjust for alternate display time zone.
- // Before calculating, we need to get everything into a common time zone to
- // negate the effects of local machine time (so we can use all the 'getUTC...() methods on Date).
- if (timezone !== undefined) {
- this._setCalcState(d.getTime() - (timezone * 60000), 0); // make this instance's time zone the new UTC temporarily
- }
-
- // simple keys
- switch (key) {
- case 'year':
- v = d.getUTCFullYear(); //TODO: investigate why some libraries do getFullYear().toString() or getFullYear()+""
- break;
- case 'month':
- v = d.getUTCMonth()+1; // January is 0 in JavaScript
- break;
- case 'day':
- v = d.getUTCDate();
- break;
- case 'dayOfWeek':
- v = d.getUTCDay();
- break;
- case 'hour':
- v = d.getUTCHours();
- break;
- case 'minute':
- v = d.getUTCMinutes();
- break;
- case 'second':
- v = d.getUTCSeconds();
- break;
- case 'millisecond':
- v = d.getUTCMilliseconds();
- break;
- }
-
- // isLeapYear
- if ((v === null) && (key === 'isLeapYear')) {
- y = this._get('year');
- v = (y%4 === 0 && y%100 !== 0) || y%400 === 0;
- }
-
- // daysInMonth
- if ((v === null) && (key === 'daysInMonth')) {
- switch (this._get('month')) {
- case 4:
- case 6:
- case 9:
- case 11:
- v = 30;
- break;
- case 2:
- v = this._get('isLeapYear') ? 29 : 28;
- break;
- default:
- v = 31;
- break;
- }
- }
-
- // dayOfYear
- if ((v === null) && (key === 'dayOfYear')) {
- ms = d.getTime(); // save time
- doy = this._get('day');
- this._setCalcStateFromHash({ day: 1 });
- for (m = this._get('month') - 1; m > 0; m--) {
- this._setCalcStateFromHash({ month: m });
- doy += this._get('daysInMonth');
- }
- d.setTime(ms); // restore time
- v = doy;
- }
-
- // week, week0 or week1
- if ((v === null) && (key.slice(0, 4) === 'week')) {
- // firstDayOfWeek should be 0 (Sunday) or 1 (Monday)
- firstDayOfWeek = key.length === 4 ? 1 : parseInt(key.slice('4'), 10);
- dayOfWeek = this._get('dayOfWeek');
- dayOfYear = this._get('dayOfYear') - 1;
- if (firstDayOfWeek === 0) {
- v = parseInt((dayOfYear - dayOfWeek + 7) / 7, 10);
- }
- else {
- v = parseInt((dayOfYear - (dayOfWeek - 1 + 7) % 7 + 7) / 7, 10);
- }
- }
- }
-
- // restore the internal calculation state in case someone else was in the
- // middle of a calculation (we might be recursing).
- this._setCalcState(originalTime.milliseconds, originalTime.timezone);
-
- return v;
- },
-
- /**
- @private
-
- Sets the internal calculation state to something specified.
- */
- _adjust: function(options, start, timezone, resetCascadingly) {
- var opts = options ? copy(options) : {};
- var ms = this._toMilliseconds(options, start, timezone, resetCascadingly);
- this._setCalcState(ms, timezone);
- return this; // for chaining
- },
-
- /**
- @private
- @see Ember.DateTime#advance
- */
- _advance: function(options, start, timezone) {
- var opts = options ? copy(options) : {};
- var tz;
-
- for (var key in opts) {
- opts[key] += this._get(key, start, timezone);
- }
-
- // The time zone can be advanced by a delta as well, so try to use the
- // new value if there is one.
- tz = (opts.timezone !== undefined) ? opts.timezone : timezone; // watch out for zero, which is acceptable as a time zone
-
- return this._adjust(opts, start, tz, NO);
- },
-
- /*
- @private
-
- Converts a standard date/time options hash to an integer representing that position
- in time relative to Jan 1, 1970
- */
- _toMilliseconds: function(options, start, timezone, resetCascadingly) {
- var opts = options ? copy(options) : {};
- var d = this._date;
- var previousMilliseconds = d.getTime(); // rather than create a new Date object, we'll reuse the instance we have for calculations, then restore it
- var ms, tz;
-
- // Initialize our internal for-calculations Date object to our current date/time.
- // Note that this object was created in the local machine time zone, so when we set
- // its params later, it will be assuming these values to be in the same time zone as it is.
- // It's ok for start to be null, in which case we'll just keep whatever we had in 'd' before.
- if (!Ember.none(start)) {
- d.setTime(start); // using milliseconds here specifies an absolute location in time, regardless of time zone, so that's nice
- }
-
- // We have to get all time expressions, both in 'options' (assume to be in time zone 'timezone')
- // and in 'd', to the same time zone before we can any calculations correctly. So because the Date object provides
- // a suite of UTC getters and setters, we'll temporarily redefine 'timezone' as our new
- // 'UTC', so we don't have to worry about local machine time. We do this by subtracting
- // milliseconds for the time zone offset. Then we'll do all our calculations, then convert
- // it back to real UTC.
-
- // (Zero time zone is considered a valid value.)
- tz = (timezone !== undefined) ? timezone : (this.timezone !== undefined) ? this.timezone : 0;
- d.setTime(d.getTime() - (tz * 60000)); // redefine 'UTC' to establish a new local absolute so we can use all the 'getUTC...()' Date methods
-
- // the time options (hour, minute, sec, millisecond)
- // reset cascadingly (see documentation)
- if (resetCascadingly === undefined || resetCascadingly === YES) {
- if (!Ember.none(opts.hour) && Ember.none(opts.minute)) {
- opts.minute = 0;
- }
- if (!(Ember.none(opts.hour) && Ember.none(opts.minute)) &&
- Ember.none(opts.second)) {
- opts.second = 0;
- }
- if (!(Ember.none(opts.hour) && Ember.none(opts.minute) &&
- Ember.none(opts.second)) &&
- Ember.none(opts.millisecond)) {
- opts.millisecond = 0;
- }
- }
-
- // Get the current values for any not provided in the options hash.
- // Since everything is in 'UTC' now, use the UTC accessors. We do this because,
- // according to javascript Date spec, you have to set year, month, and day together
- // if you're setting any one of them. So we'll use the provided Date.UTC() method
- // to get milliseconds, and we need to get any missing values first...
- if (Ember.none(opts.year)) opts.year = d.getUTCFullYear();
- if (Ember.none(opts.month)) opts.month = d.getUTCMonth() + 1; // January is 0 in JavaScript
- if (Ember.none(opts.day)) opts.day = d.getUTCDate();
- if (Ember.none(opts.hour)) opts.hour = d.getUTCHours();
- if (Ember.none(opts.minute)) opts.minute = d.getUTCMinutes();
- if (Ember.none(opts.second)) opts.second = d.getUTCSeconds();
- if (Ember.none(opts.millisecond)) opts.millisecond = d.getUTCMilliseconds();
-
- // Ask the JS Date to calculate milliseconds for us (still in redefined UTC). It
- // is best to set them all together because, for example, a day value means different things
- // to the JS Date object depending on which month or year it is. It can now handle that stuff
- // internally as it's made to do.
- ms = Date.UTC(opts.year, opts.month - 1, opts.day, opts.hour, opts.minute, opts.second, opts.millisecond);
-
- // Now that we've done all our calculations in a common time zone, add back the offset
- // to move back to real UTC.
- d.setTime(ms + (tz * 60000));
- ms = d.getTime(); // now get the corrected milliseconds value
-
- // Restore what was there previously before leaving in case someone called this method
- // in the middle of another calculation.
- d.setTime(previousMilliseconds);
-
- return ms;
- },
-
- /**
- Returns a new `Ember.DateTime` object advanced according the the given parameters.
- The parameters can be:
-
- - none, to create a `Ember.DateTime` instance initialized to the current
- date and time in the local timezone,
- - a integer, the number of milliseconds since
- January, 1st 1970 00:00:00.0 UTC
- - a options hash that can contain any of the following properties: year,
- month, day, hour, minute, second, millisecond, timezone
-
- Note that if you attempt to create a `Ember.DateTime` instance that has already
- been created, then, for performance reasons, a cached value may be
- returned.
-
- The timezone option is the offset, in minutes, between UTC and local time.
- If you don't pass a timezone option, the date object is created in the
- local timezone. If you want to create a UTC+2 (CEST) date, for example,
- then you should pass a timezone of -120.
-
- @param options one of the three kind of parameters descibed above
- @returns {Ember.DateTime} the Ember.DateTime instance that corresponds to the
- passed parameters, possibly fetched from cache
- */
- create: function() {
- var arg = arguments.length === 0 ? {} : arguments[0];
- var timezone;
-
- // if simply milliseconds since Jan 1, 1970 are given, just use those
- if (Ember.typeOf(arg) === 'number') {
- arg = { milliseconds: arg };
- }
-
- // Default to local machine time zone if none is given
- timezone = (arg.timezone !== undefined) ? arg.timezone : this.timezone;
- if (timezone === undefined) timezone = 0;
-
- // Desired case: create with milliseconds if we have them.
- // If we don't, convert what we have to milliseconds and recurse.
- if (!Ember.none(arg.milliseconds)) {
-
- // quick implementation of a FIFO set for the cache
- var key = 'nu' + arg.milliseconds + timezone, cache = this._dt_cache;
- var ret = cache[key];
- if (!ret) {
- var previousKey, idx = this._dt_cache_index;
- ret = cache[key] = this._super({ _ms: arg.milliseconds, timezone: timezone });
- idx = this._dt_cache_index = (idx + 1) % this._DT_CACHE_MAX_LENGTH;
- previousKey = cache[idx];
- if (previousKey !== undefined && cache[previousKey]) delete cache[previousKey];
- cache[idx] = key;
- }
- return ret;
- }
- // otherwise, convert what we have to milliseconds and try again
- else {
- var now = new Date();
-
- return this.create({ // recursive call with new arguments
- milliseconds: this._toMilliseconds(arg, now.getTime(), timezone, arg.resetCascadingly),
- timezone: timezone
- });
- }
- },
-
- /**
- @private
-
- Calls the `create()` method with the current internal `_date` value.
-
- @return {Ember.DateTime} the Ember.DateTime instance returned by create()
- */
- _createFromCurrentState: function() {
- return this.create({
- milliseconds: this._date.getTime(),
- timezone: this._tz
- });
- },
-
- /**
- Returns a `Ember.DateTime` object created from a given string parsed with a given
- format. Returns `null` if the parsing fails.
-
- @see Ember.DateTime#toFormattedString for a description of the format parameter
- @param {String} str the string to parse
- @param {String} fmt the format to parse the string with
- @returns {DateTime} the DateTime corresponding to the string parameter
- */
- parse: function(str, fmt) {
- // Declared as an object not a literal since in some browsers the literal
- // retains state across function calls
- var re = new RegExp('(?:%([aAbBcdDhHiIjmMpsSUWwxXyYZ%])|(.))', "g");
- var d, parts, opts = {}, check = {}, scanner = Scanner.create({string: str});
-
- if (Ember.none(fmt)) fmt = Ember.DATETIME_ISO8601;
-
- try {
- while ((parts = re.exec(fmt)) !== null) {
- switch(parts[1]) {
- case 'a': check.dayOfWeek = scanner.scanArray(this.abbreviatedDayNames); break;
- case 'A': check.dayOfWeek = scanner.scanArray(this.dayNames); break;
- case 'b': opts.month = scanner.scanArray(this.abbreviatedMonthNames) + 1; break;
- case 'B': opts.month = scanner.scanArray(this.monthNames) + 1; break;
- case 'c': throw new Error("%c is not implemented");
- case 'd':
- case 'D': opts.day = scanner.scanInt(1, 2); break;
- case 'h':
- case 'H': opts.hour = scanner.scanInt(1, 2); break;
- case 'i':
- case 'I': opts.hour = scanner.scanInt(1, 2); break;
- case 'j': throw new Error("%j is not implemented");
- case 'm': opts.month = scanner.scanInt(1, 2); break;
- case 'M': opts.minute = scanner.scanInt(1, 2); break;
- case 'p': opts.meridian = scanner.scanArray(['AM', 'PM']); break;
- case 'S': opts.second = scanner.scanInt(1, 2); break;
- case 's': opts.millisecond = scanner.scanInt(1, 3); break;
- case 'U': throw new Error("%U is not implemented");
- case 'W': throw new Error("%W is not implemented");
- case 'w': throw new Error("%w is not implemented");
- case 'x': throw new Error("%x is not implemented");
- case 'X': throw new Error("%X is not implemented");
- case 'y': opts.year = scanner.scanInt(2); opts.year += (opts.year > 70 ? 1900 : 2000); break;
- case 'Y': opts.year = scanner.scanInt(4); break;
- case 'Z':
- var modifier = scanner.scan(1);
- if (modifier === 'Z') {
- opts.timezone = 0;
- } else if (modifier === '+' || modifier === '-' ) {
- var h = scanner.scanInt(2);
- if (scanner.scan(1) !== ':') scanner.scan(-1);
- var m = scanner.scanInt(2);
- opts.timezone = (modifier === '+' ? -1 : 1) * (h*60 + m);
- }
- break;
- case '%': scanner.skipString('%'); break;
- default: scanner.skipString(parts[0]); break;
- }
- }
- } catch (e) {
- Ember.Logger.log('Ember.DateTime.createFromString ' + e.toString());
- return null;
- }
-
- if (!Ember.none(opts.meridian) && !Ember.none(opts.hour)) {
- if ((opts.meridian === 1 && opts.hour !== 12)
- || (opts.meridian === 0 && opts.hour === 12)) {
- opts.hour = (opts.hour + 12) % 24;
- }
- delete opts.meridian;
- }
-
- if (!Ember.none(opts.day) && (opts.day < 1 || opts.day > 31)){
- return null;
- }
-
- // Check the month and day are valid and within bounds
- if (!Ember.none(opts.month)){
- if (opts.month < 1 || opts.month > 12){
- return null;
- }
- if (!Ember.none(opts.day)){
- if ( opts.month === 2 && opts.day > 29 ){
- return null;
- }
- if (jQuery.inArray(opts.month, [4,6,9,11]) > -1 && opts.day > 30) {
- return null;
- }
- }
- }
-
- d = this.create(opts);
-
- if (!Ember.none(check.dayOfWeek) && get(d,'dayOfWeek') !== check.dayOfWeek) {
- return null;
- }
-
- return d;
- },
-
- /**
- @private
-
- Converts the x parameter into a string padded with 0s so that the string’s
- length is at least equal to the len parameter.
-
- @param {Object} x the object to convert to a string
- @param {Integer} the minimum length of the returned string
- @returns {String} the padded string
- */
- _pad: function(x, len) {
- var str = '' + x;
- if (len === undefined) len = 2;
- while (str.length < len) str = '0' + str;
- return str;
- },
-
- /**
- @private
- @see Ember.DateTime#_toFormattedString
- */
- __toFormattedString: function(part, start, timezone) {
- var hour, offset;
-
- // Note: all calls to _get() here should include only one
- // argument, since _get() is built for recursion and behaves differently
- // if arguments 2 and 3 are included.
- //
- // This method is simply a helper for this._toFormattedString() (one underscore);
- // this is only called from there, and _toFormattedString() has already
- // set up the appropriate internal date/time/timezone state for it.
-
- switch(part[1]) {
- case 'a': return this.abbreviatedDayNames[this._get('dayOfWeek')];
- case 'A': return this.dayNames[this._get('dayOfWeek')];
- case 'b': return this.abbreviatedMonthNames[this._get('month')-1];
- case 'B': return this.monthNames[this._get('month')-1];
- case 'c': return this._date.toString();
- case 'd': return this._pad(this._get('day'));
- case 'D': return this._get('day');
- case 'h': return this._get('hour');
- case 'H': return this._pad(this._get('hour'));
- case 'i':
- hour = this._get('hour');
- return (hour === 12 || hour === 0) ? 12 : (hour + 12) % 12;
- case 'I':
- hour = this._get('hour');
- return this._pad((hour === 12 || hour === 0) ? 12 : (hour + 12) % 12);
- case 'j': return this._pad(this._get('dayOfYear'), 3);
- case 'm': return this._pad(this._get('month'));
- case 'M': return this._pad(this._get('minute'));
- case 'p': return this._get('hour') > 11 ? 'PM' : 'AM';
- case 'S': return this._pad(this._get('second'));
- case 's': return this._pad(this._get('millisecond'), 3);
- case 'u': return this._pad(this._get('utc')); //utc
- case 'U': return this._pad(this._get('week0'));
- case 'W': return this._pad(this._get('week1'));
- case 'w': return this._get('dayOfWeek');
- case 'x': return this._date.toDateString();
- case 'X': return this._date.toTimeString();
- case 'y': return this._pad(this._get('year') % 100);
- case 'Y': return this._get('year');
- case 'Z':
- offset = -1 * timezone;
- return (offset >= 0 ? '+' : '-') +
- this._pad(parseInt(Math.abs(offset)/60, 10)) + ':' +
- this._pad(Math.abs(offset)%60);
- case '%': return '%';
- }
- },
-
- /**
- @private
- @see Ember.DateTime#toFormattedString
- */
- _toFormattedString: function(format, start, timezone) {
- var that = this;
- var tz = (timezone !== undefined) ? timezone : (this.timezone !== undefined) ? this.timezone : 0;
-
- // need to move into local time zone for these calculations
- this._setCalcState(start - (timezone * 60000), 0); // so simulate a shifted 'UTC' time
-
- return format.replace(/\%([aAbBcdDhHiIjmMpsSUWwxXyYZ\%])/g, function() {
- var v = that.__toFormattedString.call(that, arguments, start, timezone);
- return v;
- });
- },
-
- /**
- This will tell you which of the two passed `DateTime` is greater by
- comparing their number of milliseconds since
- January, 1st 1970 00:00:00.0 UTC.
-
- @param {Ember.DateTime} a the first DateTime instance
- @param {Ember.DateTime} b the second DateTime instance
- @returns {Integer} -1 if a < b,
- +1 if a > b,
- 0 if a == b
- */
- compare: function(a, b) {
- var ma = get(a, 'milliseconds');
- var mb = get(b, 'milliseconds');
- return ma < mb ? -1 : ma === mb ? 0 : 1;
- },
-
- /**
- This will tell you which of the two passed DateTime is greater
- by only comparing the date parts of the passed objects. Only dates
- with the same timezone can be compared.
-
- @param {Ember.DateTime} a the first DateTime instance
- @param {Ember.DateTime} b the second DateTime instance
- @returns {Integer} -1 if a < b,
- +1 if a > b,
- 0 if a == b
- @throws {Ember.DATETIME_COMPAREDATE_TIMEZONE_ERROR} if the passed arguments
- don't have the same timezone
- */
- compareDate: function(a, b) {
- if (get(a, 'timezone') !== get(b,'timezone')) {
- throw new Error(Ember.DATETIME_COMPAREDATE_TIMEZONE_ERROR);
- }
-
- var ma = get(a.adjust({hour: 0}), 'milliseconds');
- var mb = get(b.adjust({hour: 0}), 'milliseconds');
- return ma < mb ? -1 : ma === mb ? 0 : 1;
- }
-
-});
-
-/**
- Adds a transform to format the DateTime value to a String value according
- to the passed format string.
-
- valueBinding: Ember.Binding.dateTime('%Y-%m-%d %H:%M:%S')
- .from('MyApp.myController.myDateTime');
-
- @param {String} format format string
- @returns {Ember.Binding} this
-*/
-Ember.Binding.dateTime = function(format) {
- return this.transform(function(value, binding) {
- return value ? value.toFormattedString(format) : null;
- });
-};
-
View
12 client/lib/ember/load.js
@@ -1,12 +0,0 @@
-
-define([
- 'plugins/order!jquery',
- 'plugins/order!lib/ember/ember-0.9.6.js',
- 'plugins/order!lib/ember/ember-addon-datetime.js'
-], function() {
-
- return Ember;
-
-});
-
-
View
11,229 client/lib/require-jquery.js
0 additions, 11,229 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
17 client/lib/utils.js
@@ -1,17 +0,0 @@
-
-define(function() {
- return {
- formatAsDateAndTime: function(dateTime) {
- return dateTime.toFormattedString("%Y-%m-%d %Hh%M");
- },
-
- for