sw2at-ui 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (387) hide show
  1. checksums.yaml +7 -0
  2. data/.document +5 -0
  3. data/Gemfile +21 -0
  4. data/LICENSE.txt +20 -0
  5. data/README.rdoc +19 -0
  6. data/Rakefile +51 -0
  7. data/VERSION +1 -0
  8. data/app/assets/images/swat/loading-green.gif +0 -0
  9. data/app/assets/javascripts/swat/.bowerrc +3 -0
  10. data/app/assets/javascripts/swat/app/app.coffee +38 -0
  11. data/app/assets/javascripts/swat/app/controllers/revision.coffee +25 -0
  12. data/app/assets/javascripts/swat/app/controllers/revisions.coffee +10 -0
  13. data/app/assets/javascripts/swat/app/controllers/root.coffee +8 -0
  14. data/app/assets/javascripts/swat/app/factories/response.coffee +9 -0
  15. data/app/assets/javascripts/swat/app/factories/revision_model.coffee +20 -0
  16. data/app/assets/javascripts/swat/app/services/revision.coffee +16 -0
  17. data/app/assets/javascripts/swat/app/services/test_case.coffee +8 -0
  18. data/app/assets/javascripts/swat/application.coffee +5 -0
  19. data/app/assets/javascripts/swat/bower.json +16 -0
  20. data/app/assets/javascripts/swat/bower_components/angular/angular-csp.css +21 -0
  21. data/app/assets/javascripts/swat/bower_components/angular/angular.js +28133 -0
  22. data/app/assets/javascripts/swat/bower_components/angular/angular.min.js +289 -0
  23. data/app/assets/javascripts/swat/bower_components/angular/index.js +2 -0
  24. data/app/assets/javascripts/swat/bower_components/angular-animate/angular-animate.js +2137 -0
  25. data/app/assets/javascripts/swat/bower_components/angular-animate/angular-animate.min.js +33 -0
  26. data/app/assets/javascripts/swat/bower_components/angular-aria/angular-aria.js +339 -0
  27. data/app/assets/javascripts/swat/bower_components/angular-aria/angular-aria.min.js +12 -0
  28. data/app/assets/javascripts/swat/bower_components/angular-bootstrap/ui-bootstrap-csp.css +6 -0
  29. data/app/assets/javascripts/swat/bower_components/angular-bootstrap/ui-bootstrap-tpls.js +4840 -0
  30. data/app/assets/javascripts/swat/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js +10 -0
  31. data/app/assets/javascripts/swat/bower_components/angular-bootstrap/ui-bootstrap.js +4461 -0
  32. data/app/assets/javascripts/swat/bower_components/angular-bootstrap/ui-bootstrap.min.js +9 -0
  33. data/app/assets/javascripts/swat/bower_components/angular-material/LICENSE.txt +21 -0
  34. data/app/assets/javascripts/swat/bower_components/angular-material/angular-material.css +6228 -0
  35. data/app/assets/javascripts/swat/bower_components/angular-material/angular-material.js +8602 -0
  36. data/app/assets/javascripts/swat/bower_components/angular-material/angular-material.min.css +6 -0
  37. data/app/assets/javascripts/swat/bower_components/angular-material/angular-material.min.js +277 -0
  38. data/app/assets/javascripts/swat/bower_components/angular-material/default-theme.css +394 -0
  39. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/backdrop/backdrop-default-theme.css +8 -0
  40. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/backdrop/backdrop.css +54 -0
  41. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/backdrop/backdrop.js +40 -0
  42. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/bottomSheet/bottomSheet-default-theme.css +15 -0
  43. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/bottomSheet/bottomSheet.css +161 -0
  44. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/bottomSheet/bottomSheet.js +263 -0
  45. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/button/button-default-theme.css +49 -0
  46. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/button/button.css +134 -0
  47. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/button/button.js +101 -0
  48. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/card/card-default-theme.css +10 -0
  49. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/card/card.css +26 -0
  50. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/card/card.js +60 -0
  51. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/checkbox/checkbox-default-theme.css +38 -0
  52. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/checkbox/checkbox.css +78 -0
  53. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/checkbox/checkbox.js +135 -0
  54. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/content/content-default-theme.css +8 -0
  55. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/content/content.css +24 -0
  56. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/content/content.js +87 -0
  57. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/core/core.css +2736 -0
  58. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/core/core.js +3090 -0
  59. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/core/default-theme.js +1 -0
  60. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/dialog/dialog-default-theme.css +11 -0
  61. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/dialog/dialog.css +75 -0
  62. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/dialog/dialog.js +500 -0
  63. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/divider/divider-default-theme.css +8 -0
  64. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/divider/divider.css +12 -0
  65. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/divider/divider.js +50 -0
  66. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/icon/icon.css +24 -0
  67. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/icon/icon.js +52 -0
  68. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/input/input-default-theme.css +39 -0
  69. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/input/input.css +113 -0
  70. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/input/input.js +355 -0
  71. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/list/list.css +56 -0
  72. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/list/list.js +96 -0
  73. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/menu/menu.css +6 -0
  74. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/menu/menu.js +29 -0
  75. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/progressCircular/progressCircular-default-theme.css +35 -0
  76. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/progressCircular/progressCircular.css +1395 -0
  77. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/progressCircular/progressCircular.js +129 -0
  78. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/progressLinear/progressLinear-default-theme.css +26 -0
  79. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/progressLinear/progressLinear.css +366 -0
  80. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/progressLinear/progressLinear.js +130 -0
  81. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/radioButton/radioButton-default-theme.css +39 -0
  82. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/radioButton/radioButton.css +66 -0
  83. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/radioButton/radioButton.js +302 -0
  84. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/sidenav/sidenav-default-theme.css +8 -0
  85. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/sidenav/sidenav.css +86 -0
  86. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/sidenav/sidenav.js +320 -0
  87. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/slider/slider-default-theme.css +55 -0
  88. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/slider/slider.css +210 -0
  89. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/slider/slider.js +391 -0
  90. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/sticky/sticky.css +20 -0
  91. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/sticky/sticky.js +314 -0
  92. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/subheader/subheader-default-theme.css +15 -0
  93. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/subheader/subheader.css +62 -0
  94. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/subheader/subheader.js +89 -0
  95. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/swipe/swipe.js +79 -0
  96. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/switch/switch-default-theme.css +29 -0
  97. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/switch/switch.css +81 -0
  98. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/switch/switch.js +171 -0
  99. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/tabs/tabs-default-theme.css +34 -0
  100. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/tabs/tabs.css +171 -0
  101. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/tabs/tabs.js +1009 -0
  102. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/textField/textField-default-theme.css +29 -0
  103. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/textField/textField.css +72 -0
  104. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/textField/textField.js +145 -0
  105. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/toast/toast-default-theme.css +17 -0
  106. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/toast/toast.css +110 -0
  107. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/toast/toast.js +236 -0
  108. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/toolbar/toolbar-default-theme.css +17 -0
  109. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/toolbar/toolbar.css +69 -0
  110. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/toolbar/toolbar.js +161 -0
  111. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/tooltip/tooltip-default-theme.css +10 -0
  112. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/tooltip/tooltip.css +133 -0
  113. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/tooltip/tooltip.js +199 -0
  114. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/whiteframe/whiteframe.css +20 -0
  115. data/app/assets/javascripts/swat/bower_components/angular-material/modules/closure/whiteframe/whiteframe.js +17 -0
  116. data/app/assets/javascripts/swat/bower_components/angular-material/modules/css/angular-material-layout.css +2582 -0
  117. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/backdrop/backdrop-default-theme.css +8 -0
  118. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/backdrop/backdrop-default-theme.min.css +6 -0
  119. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/backdrop/backdrop.css +54 -0
  120. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/backdrop/backdrop.js +38 -0
  121. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/backdrop/backdrop.min.css +6 -0
  122. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/backdrop/backdrop.min.js +7 -0
  123. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/backdrop/bower.json +7 -0
  124. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/bottomSheet/bottomSheet-default-theme.css +15 -0
  125. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/bottomSheet/bottomSheet-default-theme.min.css +6 -0
  126. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/bottomSheet/bottomSheet.css +188 -0
  127. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/bottomSheet/bottomSheet.js +293 -0
  128. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/bottomSheet/bottomSheet.min.css +6 -0
  129. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/bottomSheet/bottomSheet.min.js +7 -0
  130. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/bottomSheet/bower.json +8 -0
  131. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/button/bower.json +7 -0
  132. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/button/button-default-theme.css +42 -0
  133. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/button/button-default-theme.min.css +6 -0
  134. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/button/button.css +132 -0
  135. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/button/button.js +94 -0
  136. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/button/button.min.css +6 -0
  137. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/button/button.min.js +7 -0
  138. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/card/bower.json +7 -0
  139. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/card/card-default-theme.css +10 -0
  140. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/card/card-default-theme.min.css +6 -0
  141. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/card/card.css +31 -0
  142. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/card/card.js +58 -0
  143. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/card/card.min.css +6 -0
  144. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/card/card.min.js +7 -0
  145. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/checkbox/bower.json +7 -0
  146. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/checkbox/checkbox-default-theme.css +38 -0
  147. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/checkbox/checkbox-default-theme.min.css +6 -0
  148. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/checkbox/checkbox.css +79 -0
  149. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/checkbox/checkbox.js +133 -0
  150. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/checkbox/checkbox.min.css +6 -0
  151. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/checkbox/checkbox.min.js +7 -0
  152. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/content/bower.json +7 -0
  153. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/content/content-default-theme.css +8 -0
  154. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/content/content-default-theme.min.css +6 -0
  155. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/content/content.css +24 -0
  156. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/content/content.js +60 -0
  157. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/content/content.min.css +6 -0
  158. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/content/content.min.js +7 -0
  159. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/core/bower.json +7 -0
  160. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/core/core.css +3067 -0
  161. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/core/core.js +2780 -0
  162. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/core/core.min.css +6 -0
  163. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/core/core.min.js +7 -0
  164. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/core/default-theme.js +1 -0
  165. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/dialog/bower.json +8 -0
  166. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/dialog/dialog-default-theme.css +11 -0
  167. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/dialog/dialog-default-theme.min.css +6 -0
  168. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/dialog/dialog.css +88 -0
  169. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/dialog/dialog.js +495 -0
  170. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/dialog/dialog.min.css +6 -0
  171. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/dialog/dialog.min.js +7 -0
  172. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/divider/bower.json +7 -0
  173. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/divider/divider-default-theme.css +8 -0
  174. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/divider/divider-default-theme.min.css +6 -0
  175. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/divider/divider.css +12 -0
  176. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/divider/divider.js +48 -0
  177. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/divider/divider.min.css +6 -0
  178. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/divider/divider.min.js +7 -0
  179. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/icon/bower.json +7 -0
  180. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/icon/icon.css +24 -0
  181. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/icon/icon.js +50 -0
  182. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/icon/icon.min.css +6 -0
  183. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/icon/icon.min.js +7 -0
  184. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/input/bower.json +7 -0
  185. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/input/input-default-theme.css +40 -0
  186. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/input/input-default-theme.min.css +6 -0
  187. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/input/input.css +102 -0
  188. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/input/input.js +333 -0
  189. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/input/input.min.css +6 -0
  190. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/input/input.min.js +7 -0
  191. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/list/bower.json +7 -0
  192. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/list/list.css +61 -0
  193. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/list/list.js +94 -0
  194. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/list/list.min.css +6 -0
  195. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/list/list.min.js +7 -0
  196. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/menu/bower.json +5 -0
  197. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/menu/menu.css +6 -0
  198. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/menu/menu.js +27 -0
  199. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/menu/menu.min.css +6 -0
  200. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/menu/menu.min.js +7 -0
  201. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/progressCircular/bower.json +7 -0
  202. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/progressCircular/progressCircular-default-theme.css +35 -0
  203. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/progressCircular/progressCircular-default-theme.min.css +6 -0
  204. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/progressCircular/progressCircular.css +1445 -0
  205. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/progressCircular/progressCircular.js +127 -0
  206. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/progressCircular/progressCircular.min.css +6 -0
  207. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/progressCircular/progressCircular.min.js +7 -0
  208. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/progressLinear/bower.json +7 -0
  209. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/progressLinear/progressLinear-default-theme.css +28 -0
  210. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/progressLinear/progressLinear-default-theme.min.css +6 -0
  211. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/progressLinear/progressLinear.css +368 -0
  212. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/progressLinear/progressLinear.js +128 -0
  213. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/progressLinear/progressLinear.min.css +6 -0
  214. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/progressLinear/progressLinear.min.js +7 -0
  215. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/radioButton/bower.json +7 -0
  216. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/radioButton/radioButton-default-theme.css +39 -0
  217. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/radioButton/radioButton-default-theme.min.css +6 -0
  218. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/radioButton/radioButton.css +67 -0
  219. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/radioButton/radioButton.js +296 -0
  220. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/radioButton/radioButton.min.css +6 -0
  221. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/radioButton/radioButton.min.js +7 -0
  222. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/sidenav/bower.json +8 -0
  223. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/sidenav/sidenav-default-theme.css +8 -0
  224. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/sidenav/sidenav-default-theme.min.css +6 -0
  225. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/sidenav/sidenav.css +90 -0
  226. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/sidenav/sidenav.js +302 -0
  227. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/sidenav/sidenav.min.css +6 -0
  228. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/sidenav/sidenav.min.js +7 -0
  229. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/slider/bower.json +7 -0
  230. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/slider/slider-default-theme.css +55 -0
  231. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/slider/slider-default-theme.min.css +6 -0
  232. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/slider/slider.css +218 -0
  233. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/slider/slider.js +411 -0
  234. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/slider/slider.min.css +6 -0
  235. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/slider/slider.min.js +7 -0
  236. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/sticky/bower.json +8 -0
  237. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/sticky/sticky.css +20 -0
  238. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/sticky/sticky.js +309 -0
  239. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/sticky/sticky.min.css +6 -0
  240. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/sticky/sticky.min.js +7 -0
  241. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/subheader/bower.json +8 -0
  242. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/subheader/subheader-default-theme.css +15 -0
  243. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/subheader/subheader-default-theme.min.css +6 -0
  244. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/subheader/subheader.css +61 -0
  245. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/subheader/subheader.js +86 -0
  246. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/subheader/subheader.min.css +6 -0
  247. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/subheader/subheader.min.js +7 -0
  248. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/swipe/bower.json +5 -0
  249. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/swipe/swipe.js +213 -0
  250. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/swipe/swipe.min.js +7 -0
  251. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/switch/bower.json +8 -0
  252. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/switch/switch-default-theme.css +29 -0
  253. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/switch/switch-default-theme.min.css +6 -0
  254. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/switch/switch.css +77 -0
  255. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/switch/switch.js +144 -0
  256. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/switch/switch.min.css +6 -0
  257. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/switch/switch.min.js +7 -0
  258. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/tabs/bower.json +7 -0
  259. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/tabs/tabs-default-theme.css +34 -0
  260. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/tabs/tabs-default-theme.min.css +6 -0
  261. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/tabs/tabs.css +181 -0
  262. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/tabs/tabs.js +992 -0
  263. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/tabs/tabs.min.css +6 -0
  264. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/tabs/tabs.min.js +7 -0
  265. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/textField/bower.json +7 -0
  266. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/textField/textField-default-theme.css +29 -0
  267. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/textField/textField-default-theme.min.css +6 -0
  268. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/textField/textField.css +76 -0
  269. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/textField/textField.js +143 -0
  270. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/textField/textField.min.css +6 -0
  271. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/textField/textField.min.js +7 -0
  272. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/toast/bower.json +9 -0
  273. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/toast/toast-default-theme.css +17 -0
  274. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/toast/toast-default-theme.min.css +6 -0
  275. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/toast/toast.css +115 -0
  276. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/toast/toast.js +235 -0
  277. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/toast/toast.min.css +6 -0
  278. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/toast/toast.min.js +7 -0
  279. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/toolbar/bower.json +8 -0
  280. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/toolbar/toolbar-default-theme.css +17 -0
  281. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/toolbar/toolbar-default-theme.min.css +6 -0
  282. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/toolbar/toolbar.css +78 -0
  283. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/toolbar/toolbar.js +158 -0
  284. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/toolbar/toolbar.min.css +6 -0
  285. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/toolbar/toolbar.min.js +7 -0
  286. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/tooltip/bower.json +7 -0
  287. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/tooltip/tooltip-default-theme.css +10 -0
  288. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/tooltip/tooltip-default-theme.min.css +6 -0
  289. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/tooltip/tooltip.css +136 -0
  290. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/tooltip/tooltip.js +197 -0
  291. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/tooltip/tooltip.min.css +6 -0
  292. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/tooltip/tooltip.min.js +7 -0
  293. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/whiteframe/bower.json +5 -0
  294. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/whiteframe/whiteframe.css +20 -0
  295. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/whiteframe/whiteframe.js +15 -0
  296. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/whiteframe/whiteframe.min.css +6 -0
  297. data/app/assets/javascripts/swat/bower_components/angular-material/modules/js/whiteframe/whiteframe.min.js +7 -0
  298. data/app/assets/javascripts/swat/bower_components/angular-resource/angular-resource.js +668 -0
  299. data/app/assets/javascripts/swat/bower_components/angular-resource/angular-resource.min.js +13 -0
  300. data/app/assets/javascripts/swat/bower_components/angular-resource/index.js +2 -0
  301. data/app/assets/javascripts/swat/bower_components/angular-route/angular-route.js +991 -0
  302. data/app/assets/javascripts/swat/bower_components/angular-route/angular-route.min.js +15 -0
  303. data/app/assets/javascripts/swat/bower_components/angular-route/index.js +2 -0
  304. data/app/assets/javascripts/swat/bower_components/angular-ui-router/LICENSE.txt +21 -0
  305. data/app/assets/javascripts/swat/bower_components/angular-ui-router/api/angular-ui-router.d.ts +126 -0
  306. data/app/assets/javascripts/swat/bower_components/angular-ui-router/release/angular-ui-router.js +4370 -0
  307. data/app/assets/javascripts/swat/bower_components/angular-ui-router/release/angular-ui-router.min.js +7 -0
  308. data/app/assets/javascripts/swat/bower_components/angular-ui-router/src/common.js +292 -0
  309. data/app/assets/javascripts/swat/bower_components/angular-ui-router/src/resolve.js +252 -0
  310. data/app/assets/javascripts/swat/bower_components/angular-ui-router/src/state.js +1465 -0
  311. data/app/assets/javascripts/swat/bower_components/angular-ui-router/src/stateDirectives.js +285 -0
  312. data/app/assets/javascripts/swat/bower_components/angular-ui-router/src/stateFilters.js +39 -0
  313. data/app/assets/javascripts/swat/bower_components/angular-ui-router/src/templateFactory.js +110 -0
  314. data/app/assets/javascripts/swat/bower_components/angular-ui-router/src/urlMatcherFactory.js +1050 -0
  315. data/app/assets/javascripts/swat/bower_components/angular-ui-router/src/urlRouter.js +427 -0
  316. data/app/assets/javascripts/swat/bower_components/angular-ui-router/src/view.js +71 -0
  317. data/app/assets/javascripts/swat/bower_components/angular-ui-router/src/viewDirective.js +303 -0
  318. data/app/assets/javascripts/swat/bower_components/angular-ui-router/src/viewScroll.js +52 -0
  319. data/app/assets/javascripts/swat/bower_components/lodash/lodash.js +12235 -0
  320. data/app/assets/javascripts/swat/bower_components/lodash/lodash.min.js +98 -0
  321. data/app/assets/javascripts/swat/bower_components/ng-clip/.editorconfig +10 -0
  322. data/app/assets/javascripts/swat/bower_components/ng-clip/.gitignore +3 -0
  323. data/app/assets/javascripts/swat/bower_components/ng-clip/Gruntfile.js +96 -0
  324. data/app/assets/javascripts/swat/bower_components/ng-clip/dest/ng-clip.min.js +2 -0
  325. data/app/assets/javascripts/swat/bower_components/ng-clip/example/bootstrap-tooltip.html +49 -0
  326. data/app/assets/javascripts/swat/bower_components/ng-clip/example/index.html +68 -0
  327. data/app/assets/javascripts/swat/bower_components/ng-clip/example/ng-repeat.html +44 -0
  328. data/app/assets/javascripts/swat/bower_components/ng-clip/npm-debug.log +145 -0
  329. data/app/assets/javascripts/swat/bower_components/ng-clip/src/ngClip.js +84 -0
  330. data/app/assets/javascripts/swat/bower_components/zeroclipboard/dist/.jshintrc +70 -0
  331. data/app/assets/javascripts/swat/bower_components/zeroclipboard/dist/ZeroClipboard.Core.js +2017 -0
  332. data/app/assets/javascripts/swat/bower_components/zeroclipboard/dist/ZeroClipboard.Core.min.js +10 -0
  333. data/app/assets/javascripts/swat/bower_components/zeroclipboard/dist/ZeroClipboard.js +2581 -0
  334. data/app/assets/javascripts/swat/bower_components/zeroclipboard/dist/ZeroClipboard.min.js +10 -0
  335. data/app/assets/javascripts/swat/bower_components/zeroclipboard/dist/ZeroClipboard.swf +0 -0
  336. data/app/assets/javascripts/swat/bower_components.coffee +12 -0
  337. data/app/assets/stylesheets/swat/application.sass +59 -0
  338. data/app/assets/stylesheets/swat/default-theme.css +394 -0
  339. data/app/assets/stylesheets/swat/font-awesome.css +1801 -0
  340. data/app/assets/stylesheets/swat/fonts/FontAwesome.otf +0 -0
  341. data/app/assets/stylesheets/swat/fonts/fontawesome-webfont.eot +0 -0
  342. data/app/assets/stylesheets/swat/fonts/fontawesome-webfont.svg +565 -0
  343. data/app/assets/stylesheets/swat/fonts/fontawesome-webfont.ttf +0 -0
  344. data/app/assets/stylesheets/swat/fonts/fontawesome-webfont.woff +0 -0
  345. data/app/assets/stylesheets/swat/fonts/fontawesome-webfont.woff2 +0 -0
  346. data/app/assets/stylesheets/swat/swat_theme.sass +177 -0
  347. data/app/controllers/swat/api/revisions_controller.rb +27 -0
  348. data/app/controllers/swat/api/test_cases_controller.rb +20 -0
  349. data/app/controllers/swat/application_controller.rb +4 -0
  350. data/app/controllers/swat/info/states_controller.rb +12 -0
  351. data/app/controllers/swat/pages/base_pages_controller.rb +7 -0
  352. data/app/controllers/swat/pages/revisions_controller.rb +8 -0
  353. data/app/controllers/swat/revisions_controller.rb +4 -0
  354. data/app/helpers/swat/application_helper.rb +4 -0
  355. data/app/models/concerns/root_revision_ext.rb +14 -0
  356. data/app/models/full_revision.rb +88 -0
  357. data/app/models/revision.rb +84 -0
  358. data/app/models/revision_status_calculator.rb +98 -0
  359. data/app/models/test_case.rb +25 -0
  360. data/app/views/layouts/swat/application.slim +36 -0
  361. data/app/views/layouts/swat/page.slim +2 -0
  362. data/app/views/swat/application/index.slim +0 -0
  363. data/app/views/swat/pages/revisions/index.slim +25 -0
  364. data/app/views/swat/pages/revisions/show.slim +43 -0
  365. data/app/views/swat/shared/_footer.slim +5 -0
  366. data/app/views/swat/shared/_header.slim +9 -0
  367. data/bin/rails +12 -0
  368. data/config/routes.rb +38 -0
  369. data/fixtures/firebase_collection.rb +97 -0
  370. data/lib/sw2at-ui.rb +19 -0
  371. data/lib/swat/engine.rb +5 -0
  372. data/lib/swat/ui/config.rb +28 -0
  373. data/lib/swat/ui/rspec_commands.rb +191 -0
  374. data/lib/swat/ui/rspec_setup.rb +42 -0
  375. data/lib/swat/ui/stats_collector.rb +90 -0
  376. data/lib/swat/ui/version.rb +5 -0
  377. data/lib/tasks/swat_tasks.rake +36 -0
  378. data/spec/lib/commands_spec.rb +88 -0
  379. data/spec/models/calculator_spec.rb +130 -0
  380. data/spec/models/full_revision_spec.rb +263 -0
  381. data/spec/models/revision_spec.rb +59 -0
  382. data/spec/models/testcase_spec.rb +94 -0
  383. data/spec/spec_helper.rb +45 -0
  384. data/sw2at-ui.gemspec +465 -0
  385. data/test/helper.rb +34 -0
  386. data/test/test_sw2at-ui.rb +7 -0
  387. metadata +628 -0
@@ -0,0 +1,991 @@
1
+ /**
2
+ * @license AngularJS v1.3.16
3
+ * (c) 2010-2014 Google, Inc. http://angularjs.org
4
+ * License: MIT
5
+ */
6
+ (function(window, angular, undefined) {'use strict';
7
+
8
+ /**
9
+ * @ngdoc module
10
+ * @name ngRoute
11
+ * @description
12
+ *
13
+ * # ngRoute
14
+ *
15
+ * The `ngRoute` module provides routing and deeplinking services and directives for angular apps.
16
+ *
17
+ * ## Example
18
+ * See {@link ngRoute.$route#example $route} for an example of configuring and using `ngRoute`.
19
+ *
20
+ *
21
+ * <div doc-module-components="ngRoute"></div>
22
+ */
23
+ /* global -ngRouteModule */
24
+ var ngRouteModule = angular.module('ngRoute', ['ng']).
25
+ provider('$route', $RouteProvider),
26
+ $routeMinErr = angular.$$minErr('ngRoute');
27
+
28
+ /**
29
+ * @ngdoc provider
30
+ * @name $routeProvider
31
+ *
32
+ * @description
33
+ *
34
+ * Used for configuring routes.
35
+ *
36
+ * ## Example
37
+ * See {@link ngRoute.$route#example $route} for an example of configuring and using `ngRoute`.
38
+ *
39
+ * ## Dependencies
40
+ * Requires the {@link ngRoute `ngRoute`} module to be installed.
41
+ */
42
+ function $RouteProvider() {
43
+ function inherit(parent, extra) {
44
+ return angular.extend(Object.create(parent), extra);
45
+ }
46
+
47
+ var routes = {};
48
+
49
+ /**
50
+ * @ngdoc method
51
+ * @name $routeProvider#when
52
+ *
53
+ * @param {string} path Route path (matched against `$location.path`). If `$location.path`
54
+ * contains redundant trailing slash or is missing one, the route will still match and the
55
+ * `$location.path` will be updated to add or drop the trailing slash to exactly match the
56
+ * route definition.
57
+ *
58
+ * * `path` can contain named groups starting with a colon: e.g. `:name`. All characters up
59
+ * to the next slash are matched and stored in `$routeParams` under the given `name`
60
+ * when the route matches.
61
+ * * `path` can contain named groups starting with a colon and ending with a star:
62
+ * e.g.`:name*`. All characters are eagerly stored in `$routeParams` under the given `name`
63
+ * when the route matches.
64
+ * * `path` can contain optional named groups with a question mark: e.g.`:name?`.
65
+ *
66
+ * For example, routes like `/color/:color/largecode/:largecode*\/edit` will match
67
+ * `/color/brown/largecode/code/with/slashes/edit` and extract:
68
+ *
69
+ * * `color: brown`
70
+ * * `largecode: code/with/slashes`.
71
+ *
72
+ *
73
+ * @param {Object} route Mapping information to be assigned to `$route.current` on route
74
+ * match.
75
+ *
76
+ * Object properties:
77
+ *
78
+ * - `controller` – `{(string|function()=}` – Controller fn that should be associated with
79
+ * newly created scope or the name of a {@link angular.Module#controller registered
80
+ * controller} if passed as a string.
81
+ * - `controllerAs` – `{string=}` – A controller alias name. If present the controller will be
82
+ * published to scope under the `controllerAs` name.
83
+ * - `template` – `{string=|function()=}` – html template as a string or a function that
84
+ * returns an html template as a string which should be used by {@link
85
+ * ngRoute.directive:ngView ngView} or {@link ng.directive:ngInclude ngInclude} directives.
86
+ * This property takes precedence over `templateUrl`.
87
+ *
88
+ * If `template` is a function, it will be called with the following parameters:
89
+ *
90
+ * - `{Array.<Object>}` - route parameters extracted from the current
91
+ * `$location.path()` by applying the current route
92
+ *
93
+ * - `templateUrl` – `{string=|function()=}` – path or function that returns a path to an html
94
+ * template that should be used by {@link ngRoute.directive:ngView ngView}.
95
+ *
96
+ * If `templateUrl` is a function, it will be called with the following parameters:
97
+ *
98
+ * - `{Array.<Object>}` - route parameters extracted from the current
99
+ * `$location.path()` by applying the current route
100
+ *
101
+ * - `resolve` - `{Object.<string, function>=}` - An optional map of dependencies which should
102
+ * be injected into the controller. If any of these dependencies are promises, the router
103
+ * will wait for them all to be resolved or one to be rejected before the controller is
104
+ * instantiated.
105
+ * If all the promises are resolved successfully, the values of the resolved promises are
106
+ * injected and {@link ngRoute.$route#$routeChangeSuccess $routeChangeSuccess} event is
107
+ * fired. If any of the promises are rejected the
108
+ * {@link ngRoute.$route#$routeChangeError $routeChangeError} event is fired. The map object
109
+ * is:
110
+ *
111
+ * - `key` – `{string}`: a name of a dependency to be injected into the controller.
112
+ * - `factory` - `{string|function}`: If `string` then it is an alias for a service.
113
+ * Otherwise if function, then it is {@link auto.$injector#invoke injected}
114
+ * and the return value is treated as the dependency. If the result is a promise, it is
115
+ * resolved before its value is injected into the controller. Be aware that
116
+ * `ngRoute.$routeParams` will still refer to the previous route within these resolve
117
+ * functions. Use `$route.current.params` to access the new route parameters, instead.
118
+ *
119
+ * - `redirectTo` – {(string|function())=} – value to update
120
+ * {@link ng.$location $location} path with and trigger route redirection.
121
+ *
122
+ * If `redirectTo` is a function, it will be called with the following parameters:
123
+ *
124
+ * - `{Object.<string>}` - route parameters extracted from the current
125
+ * `$location.path()` by applying the current route templateUrl.
126
+ * - `{string}` - current `$location.path()`
127
+ * - `{Object}` - current `$location.search()`
128
+ *
129
+ * The custom `redirectTo` function is expected to return a string which will be used
130
+ * to update `$location.path()` and `$location.search()`.
131
+ *
132
+ * - `[reloadOnSearch=true]` - {boolean=} - reload route when only `$location.search()`
133
+ * or `$location.hash()` changes.
134
+ *
135
+ * If the option is set to `false` and url in the browser changes, then
136
+ * `$routeUpdate` event is broadcasted on the root scope.
137
+ *
138
+ * - `[caseInsensitiveMatch=false]` - {boolean=} - match routes without being case sensitive
139
+ *
140
+ * If the option is set to `true`, then the particular route can be matched without being
141
+ * case sensitive
142
+ *
143
+ * @returns {Object} self
144
+ *
145
+ * @description
146
+ * Adds a new route definition to the `$route` service.
147
+ */
148
+ this.when = function(path, route) {
149
+ //copy original route object to preserve params inherited from proto chain
150
+ var routeCopy = angular.copy(route);
151
+ if (angular.isUndefined(routeCopy.reloadOnSearch)) {
152
+ routeCopy.reloadOnSearch = true;
153
+ }
154
+ if (angular.isUndefined(routeCopy.caseInsensitiveMatch)) {
155
+ routeCopy.caseInsensitiveMatch = this.caseInsensitiveMatch;
156
+ }
157
+ routes[path] = angular.extend(
158
+ routeCopy,
159
+ path && pathRegExp(path, routeCopy)
160
+ );
161
+
162
+ // create redirection for trailing slashes
163
+ if (path) {
164
+ var redirectPath = (path[path.length - 1] == '/')
165
+ ? path.substr(0, path.length - 1)
166
+ : path + '/';
167
+
168
+ routes[redirectPath] = angular.extend(
169
+ {redirectTo: path},
170
+ pathRegExp(redirectPath, routeCopy)
171
+ );
172
+ }
173
+
174
+ return this;
175
+ };
176
+
177
+ /**
178
+ * @ngdoc property
179
+ * @name $routeProvider#caseInsensitiveMatch
180
+ * @description
181
+ *
182
+ * A boolean property indicating if routes defined
183
+ * using this provider should be matched using a case insensitive
184
+ * algorithm. Defaults to `false`.
185
+ */
186
+ this.caseInsensitiveMatch = false;
187
+
188
+ /**
189
+ * @param path {string} path
190
+ * @param opts {Object} options
191
+ * @return {?Object}
192
+ *
193
+ * @description
194
+ * Normalizes the given path, returning a regular expression
195
+ * and the original path.
196
+ *
197
+ * Inspired by pathRexp in visionmedia/express/lib/utils.js.
198
+ */
199
+ function pathRegExp(path, opts) {
200
+ var insensitive = opts.caseInsensitiveMatch,
201
+ ret = {
202
+ originalPath: path,
203
+ regexp: path
204
+ },
205
+ keys = ret.keys = [];
206
+
207
+ path = path
208
+ .replace(/([().])/g, '\\$1')
209
+ .replace(/(\/)?:(\w+)([\?\*])?/g, function(_, slash, key, option) {
210
+ var optional = option === '?' ? option : null;
211
+ var star = option === '*' ? option : null;
212
+ keys.push({ name: key, optional: !!optional });
213
+ slash = slash || '';
214
+ return ''
215
+ + (optional ? '' : slash)
216
+ + '(?:'
217
+ + (optional ? slash : '')
218
+ + (star && '(.+?)' || '([^/]+)')
219
+ + (optional || '')
220
+ + ')'
221
+ + (optional || '');
222
+ })
223
+ .replace(/([\/$\*])/g, '\\$1');
224
+
225
+ ret.regexp = new RegExp('^' + path + '$', insensitive ? 'i' : '');
226
+ return ret;
227
+ }
228
+
229
+ /**
230
+ * @ngdoc method
231
+ * @name $routeProvider#otherwise
232
+ *
233
+ * @description
234
+ * Sets route definition that will be used on route change when no other route definition
235
+ * is matched.
236
+ *
237
+ * @param {Object|string} params Mapping information to be assigned to `$route.current`.
238
+ * If called with a string, the value maps to `redirectTo`.
239
+ * @returns {Object} self
240
+ */
241
+ this.otherwise = function(params) {
242
+ if (typeof params === 'string') {
243
+ params = {redirectTo: params};
244
+ }
245
+ this.when(null, params);
246
+ return this;
247
+ };
248
+
249
+
250
+ this.$get = ['$rootScope',
251
+ '$location',
252
+ '$routeParams',
253
+ '$q',
254
+ '$injector',
255
+ '$templateRequest',
256
+ '$sce',
257
+ function($rootScope, $location, $routeParams, $q, $injector, $templateRequest, $sce) {
258
+
259
+ /**
260
+ * @ngdoc service
261
+ * @name $route
262
+ * @requires $location
263
+ * @requires $routeParams
264
+ *
265
+ * @property {Object} current Reference to the current route definition.
266
+ * The route definition contains:
267
+ *
268
+ * - `controller`: The controller constructor as define in route definition.
269
+ * - `locals`: A map of locals which is used by {@link ng.$controller $controller} service for
270
+ * controller instantiation. The `locals` contain
271
+ * the resolved values of the `resolve` map. Additionally the `locals` also contain:
272
+ *
273
+ * - `$scope` - The current route scope.
274
+ * - `$template` - The current route template HTML.
275
+ *
276
+ * @property {Object} routes Object with all route configuration Objects as its properties.
277
+ *
278
+ * @description
279
+ * `$route` is used for deep-linking URLs to controllers and views (HTML partials).
280
+ * It watches `$location.url()` and tries to map the path to an existing route definition.
281
+ *
282
+ * Requires the {@link ngRoute `ngRoute`} module to be installed.
283
+ *
284
+ * You can define routes through {@link ngRoute.$routeProvider $routeProvider}'s API.
285
+ *
286
+ * The `$route` service is typically used in conjunction with the
287
+ * {@link ngRoute.directive:ngView `ngView`} directive and the
288
+ * {@link ngRoute.$routeParams `$routeParams`} service.
289
+ *
290
+ * @example
291
+ * This example shows how changing the URL hash causes the `$route` to match a route against the
292
+ * URL, and the `ngView` pulls in the partial.
293
+ *
294
+ * <example name="$route-service" module="ngRouteExample"
295
+ * deps="angular-route.js" fixBase="true">
296
+ * <file name="index.html">
297
+ * <div ng-controller="MainController">
298
+ * Choose:
299
+ * <a href="Book/Moby">Moby</a> |
300
+ * <a href="Book/Moby/ch/1">Moby: Ch1</a> |
301
+ * <a href="Book/Gatsby">Gatsby</a> |
302
+ * <a href="Book/Gatsby/ch/4?key=value">Gatsby: Ch4</a> |
303
+ * <a href="Book/Scarlet">Scarlet Letter</a><br/>
304
+ *
305
+ * <div ng-view></div>
306
+ *
307
+ * <hr />
308
+ *
309
+ * <pre>$location.path() = {{$location.path()}}</pre>
310
+ * <pre>$route.current.templateUrl = {{$route.current.templateUrl}}</pre>
311
+ * <pre>$route.current.params = {{$route.current.params}}</pre>
312
+ * <pre>$route.current.scope.name = {{$route.current.scope.name}}</pre>
313
+ * <pre>$routeParams = {{$routeParams}}</pre>
314
+ * </div>
315
+ * </file>
316
+ *
317
+ * <file name="book.html">
318
+ * controller: {{name}}<br />
319
+ * Book Id: {{params.bookId}}<br />
320
+ * </file>
321
+ *
322
+ * <file name="chapter.html">
323
+ * controller: {{name}}<br />
324
+ * Book Id: {{params.bookId}}<br />
325
+ * Chapter Id: {{params.chapterId}}
326
+ * </file>
327
+ *
328
+ * <file name="script.js">
329
+ * angular.module('ngRouteExample', ['ngRoute'])
330
+ *
331
+ * .controller('MainController', function($scope, $route, $routeParams, $location) {
332
+ * $scope.$route = $route;
333
+ * $scope.$location = $location;
334
+ * $scope.$routeParams = $routeParams;
335
+ * })
336
+ *
337
+ * .controller('BookController', function($scope, $routeParams) {
338
+ * $scope.name = "BookController";
339
+ * $scope.params = $routeParams;
340
+ * })
341
+ *
342
+ * .controller('ChapterController', function($scope, $routeParams) {
343
+ * $scope.name = "ChapterController";
344
+ * $scope.params = $routeParams;
345
+ * })
346
+ *
347
+ * .config(function($routeProvider, $locationProvider) {
348
+ * $routeProvider
349
+ * .when('/Book/:bookId', {
350
+ * templateUrl: 'book.html',
351
+ * controller: 'BookController',
352
+ * resolve: {
353
+ * // I will cause a 1 second delay
354
+ * delay: function($q, $timeout) {
355
+ * var delay = $q.defer();
356
+ * $timeout(delay.resolve, 1000);
357
+ * return delay.promise;
358
+ * }
359
+ * }
360
+ * })
361
+ * .when('/Book/:bookId/ch/:chapterId', {
362
+ * templateUrl: 'chapter.html',
363
+ * controller: 'ChapterController'
364
+ * });
365
+ *
366
+ * // configure html5 to get links working on jsfiddle
367
+ * $locationProvider.html5Mode(true);
368
+ * });
369
+ *
370
+ * </file>
371
+ *
372
+ * <file name="protractor.js" type="protractor">
373
+ * it('should load and compile correct template', function() {
374
+ * element(by.linkText('Moby: Ch1')).click();
375
+ * var content = element(by.css('[ng-view]')).getText();
376
+ * expect(content).toMatch(/controller\: ChapterController/);
377
+ * expect(content).toMatch(/Book Id\: Moby/);
378
+ * expect(content).toMatch(/Chapter Id\: 1/);
379
+ *
380
+ * element(by.partialLinkText('Scarlet')).click();
381
+ *
382
+ * content = element(by.css('[ng-view]')).getText();
383
+ * expect(content).toMatch(/controller\: BookController/);
384
+ * expect(content).toMatch(/Book Id\: Scarlet/);
385
+ * });
386
+ * </file>
387
+ * </example>
388
+ */
389
+
390
+ /**
391
+ * @ngdoc event
392
+ * @name $route#$routeChangeStart
393
+ * @eventType broadcast on root scope
394
+ * @description
395
+ * Broadcasted before a route change. At this point the route services starts
396
+ * resolving all of the dependencies needed for the route change to occur.
397
+ * Typically this involves fetching the view template as well as any dependencies
398
+ * defined in `resolve` route property. Once all of the dependencies are resolved
399
+ * `$routeChangeSuccess` is fired.
400
+ *
401
+ * The route change (and the `$location` change that triggered it) can be prevented
402
+ * by calling `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on}
403
+ * for more details about event object.
404
+ *
405
+ * @param {Object} angularEvent Synthetic event object.
406
+ * @param {Route} next Future route information.
407
+ * @param {Route} current Current route information.
408
+ */
409
+
410
+ /**
411
+ * @ngdoc event
412
+ * @name $route#$routeChangeSuccess
413
+ * @eventType broadcast on root scope
414
+ * @description
415
+ * Broadcasted after a route dependencies are resolved.
416
+ * {@link ngRoute.directive:ngView ngView} listens for the directive
417
+ * to instantiate the controller and render the view.
418
+ *
419
+ * @param {Object} angularEvent Synthetic event object.
420
+ * @param {Route} current Current route information.
421
+ * @param {Route|Undefined} previous Previous route information, or undefined if current is
422
+ * first route entered.
423
+ */
424
+
425
+ /**
426
+ * @ngdoc event
427
+ * @name $route#$routeChangeError
428
+ * @eventType broadcast on root scope
429
+ * @description
430
+ * Broadcasted if any of the resolve promises are rejected.
431
+ *
432
+ * @param {Object} angularEvent Synthetic event object
433
+ * @param {Route} current Current route information.
434
+ * @param {Route} previous Previous route information.
435
+ * @param {Route} rejection Rejection of the promise. Usually the error of the failed promise.
436
+ */
437
+
438
+ /**
439
+ * @ngdoc event
440
+ * @name $route#$routeUpdate
441
+ * @eventType broadcast on root scope
442
+ * @description
443
+ * The `reloadOnSearch` property has been set to false, and we are reusing the same
444
+ * instance of the Controller.
445
+ *
446
+ * @param {Object} angularEvent Synthetic event object
447
+ * @param {Route} current Current/previous route information.
448
+ */
449
+
450
+ var forceReload = false,
451
+ preparedRoute,
452
+ preparedRouteIsUpdateOnly,
453
+ $route = {
454
+ routes: routes,
455
+
456
+ /**
457
+ * @ngdoc method
458
+ * @name $route#reload
459
+ *
460
+ * @description
461
+ * Causes `$route` service to reload the current route even if
462
+ * {@link ng.$location $location} hasn't changed.
463
+ *
464
+ * As a result of that, {@link ngRoute.directive:ngView ngView}
465
+ * creates new scope and reinstantiates the controller.
466
+ */
467
+ reload: function() {
468
+ forceReload = true;
469
+ $rootScope.$evalAsync(function() {
470
+ // Don't support cancellation of a reload for now...
471
+ prepareRoute();
472
+ commitRoute();
473
+ });
474
+ },
475
+
476
+ /**
477
+ * @ngdoc method
478
+ * @name $route#updateParams
479
+ *
480
+ * @description
481
+ * Causes `$route` service to update the current URL, replacing
482
+ * current route parameters with those specified in `newParams`.
483
+ * Provided property names that match the route's path segment
484
+ * definitions will be interpolated into the location's path, while
485
+ * remaining properties will be treated as query params.
486
+ *
487
+ * @param {!Object<string, string>} newParams mapping of URL parameter names to values
488
+ */
489
+ updateParams: function(newParams) {
490
+ if (this.current && this.current.$$route) {
491
+ newParams = angular.extend({}, this.current.params, newParams);
492
+ $location.path(interpolate(this.current.$$route.originalPath, newParams));
493
+ // interpolate modifies newParams, only query params are left
494
+ $location.search(newParams);
495
+ } else {
496
+ throw $routeMinErr('norout', 'Tried updating route when with no current route');
497
+ }
498
+ }
499
+ };
500
+
501
+ $rootScope.$on('$locationChangeStart', prepareRoute);
502
+ $rootScope.$on('$locationChangeSuccess', commitRoute);
503
+
504
+ return $route;
505
+
506
+ /////////////////////////////////////////////////////
507
+
508
+ /**
509
+ * @param on {string} current url
510
+ * @param route {Object} route regexp to match the url against
511
+ * @return {?Object}
512
+ *
513
+ * @description
514
+ * Check if the route matches the current url.
515
+ *
516
+ * Inspired by match in
517
+ * visionmedia/express/lib/router/router.js.
518
+ */
519
+ function switchRouteMatcher(on, route) {
520
+ var keys = route.keys,
521
+ params = {};
522
+
523
+ if (!route.regexp) return null;
524
+
525
+ var m = route.regexp.exec(on);
526
+ if (!m) return null;
527
+
528
+ for (var i = 1, len = m.length; i < len; ++i) {
529
+ var key = keys[i - 1];
530
+
531
+ var val = m[i];
532
+
533
+ if (key && val) {
534
+ params[key.name] = val;
535
+ }
536
+ }
537
+ return params;
538
+ }
539
+
540
+ function prepareRoute($locationEvent) {
541
+ var lastRoute = $route.current;
542
+
543
+ preparedRoute = parseRoute();
544
+ preparedRouteIsUpdateOnly = preparedRoute && lastRoute && preparedRoute.$$route === lastRoute.$$route
545
+ && angular.equals(preparedRoute.pathParams, lastRoute.pathParams)
546
+ && !preparedRoute.reloadOnSearch && !forceReload;
547
+
548
+ if (!preparedRouteIsUpdateOnly && (lastRoute || preparedRoute)) {
549
+ if ($rootScope.$broadcast('$routeChangeStart', preparedRoute, lastRoute).defaultPrevented) {
550
+ if ($locationEvent) {
551
+ $locationEvent.preventDefault();
552
+ }
553
+ }
554
+ }
555
+ }
556
+
557
+ function commitRoute() {
558
+ var lastRoute = $route.current;
559
+ var nextRoute = preparedRoute;
560
+
561
+ if (preparedRouteIsUpdateOnly) {
562
+ lastRoute.params = nextRoute.params;
563
+ angular.copy(lastRoute.params, $routeParams);
564
+ $rootScope.$broadcast('$routeUpdate', lastRoute);
565
+ } else if (nextRoute || lastRoute) {
566
+ forceReload = false;
567
+ $route.current = nextRoute;
568
+ if (nextRoute) {
569
+ if (nextRoute.redirectTo) {
570
+ if (angular.isString(nextRoute.redirectTo)) {
571
+ $location.path(interpolate(nextRoute.redirectTo, nextRoute.params)).search(nextRoute.params)
572
+ .replace();
573
+ } else {
574
+ $location.url(nextRoute.redirectTo(nextRoute.pathParams, $location.path(), $location.search()))
575
+ .replace();
576
+ }
577
+ }
578
+ }
579
+
580
+ $q.when(nextRoute).
581
+ then(function() {
582
+ if (nextRoute) {
583
+ var locals = angular.extend({}, nextRoute.resolve),
584
+ template, templateUrl;
585
+
586
+ angular.forEach(locals, function(value, key) {
587
+ locals[key] = angular.isString(value) ?
588
+ $injector.get(value) : $injector.invoke(value, null, null, key);
589
+ });
590
+
591
+ if (angular.isDefined(template = nextRoute.template)) {
592
+ if (angular.isFunction(template)) {
593
+ template = template(nextRoute.params);
594
+ }
595
+ } else if (angular.isDefined(templateUrl = nextRoute.templateUrl)) {
596
+ if (angular.isFunction(templateUrl)) {
597
+ templateUrl = templateUrl(nextRoute.params);
598
+ }
599
+ templateUrl = $sce.getTrustedResourceUrl(templateUrl);
600
+ if (angular.isDefined(templateUrl)) {
601
+ nextRoute.loadedTemplateUrl = templateUrl;
602
+ template = $templateRequest(templateUrl);
603
+ }
604
+ }
605
+ if (angular.isDefined(template)) {
606
+ locals['$template'] = template;
607
+ }
608
+ return $q.all(locals);
609
+ }
610
+ }).
611
+ // after route change
612
+ then(function(locals) {
613
+ if (nextRoute == $route.current) {
614
+ if (nextRoute) {
615
+ nextRoute.locals = locals;
616
+ angular.copy(nextRoute.params, $routeParams);
617
+ }
618
+ $rootScope.$broadcast('$routeChangeSuccess', nextRoute, lastRoute);
619
+ }
620
+ }, function(error) {
621
+ if (nextRoute == $route.current) {
622
+ $rootScope.$broadcast('$routeChangeError', nextRoute, lastRoute, error);
623
+ }
624
+ });
625
+ }
626
+ }
627
+
628
+
629
+ /**
630
+ * @returns {Object} the current active route, by matching it against the URL
631
+ */
632
+ function parseRoute() {
633
+ // Match a route
634
+ var params, match;
635
+ angular.forEach(routes, function(route, path) {
636
+ if (!match && (params = switchRouteMatcher($location.path(), route))) {
637
+ match = inherit(route, {
638
+ params: angular.extend({}, $location.search(), params),
639
+ pathParams: params});
640
+ match.$$route = route;
641
+ }
642
+ });
643
+ // No route matched; fallback to "otherwise" route
644
+ return match || routes[null] && inherit(routes[null], {params: {}, pathParams:{}});
645
+ }
646
+
647
+ /**
648
+ * @returns {string} interpolation of the redirect path with the parameters
649
+ */
650
+ function interpolate(string, params) {
651
+ var result = [];
652
+ angular.forEach((string || '').split(':'), function(segment, i) {
653
+ if (i === 0) {
654
+ result.push(segment);
655
+ } else {
656
+ var segmentMatch = segment.match(/(\w+)(?:[?*])?(.*)/);
657
+ var key = segmentMatch[1];
658
+ result.push(params[key]);
659
+ result.push(segmentMatch[2] || '');
660
+ delete params[key];
661
+ }
662
+ });
663
+ return result.join('');
664
+ }
665
+ }];
666
+ }
667
+
668
+ ngRouteModule.provider('$routeParams', $RouteParamsProvider);
669
+
670
+
671
+ /**
672
+ * @ngdoc service
673
+ * @name $routeParams
674
+ * @requires $route
675
+ *
676
+ * @description
677
+ * The `$routeParams` service allows you to retrieve the current set of route parameters.
678
+ *
679
+ * Requires the {@link ngRoute `ngRoute`} module to be installed.
680
+ *
681
+ * The route parameters are a combination of {@link ng.$location `$location`}'s
682
+ * {@link ng.$location#search `search()`} and {@link ng.$location#path `path()`}.
683
+ * The `path` parameters are extracted when the {@link ngRoute.$route `$route`} path is matched.
684
+ *
685
+ * In case of parameter name collision, `path` params take precedence over `search` params.
686
+ *
687
+ * The service guarantees that the identity of the `$routeParams` object will remain unchanged
688
+ * (but its properties will likely change) even when a route change occurs.
689
+ *
690
+ * Note that the `$routeParams` are only updated *after* a route change completes successfully.
691
+ * This means that you cannot rely on `$routeParams` being correct in route resolve functions.
692
+ * Instead you can use `$route.current.params` to access the new route's parameters.
693
+ *
694
+ * @example
695
+ * ```js
696
+ * // Given:
697
+ * // URL: http://server.com/index.html#/Chapter/1/Section/2?search=moby
698
+ * // Route: /Chapter/:chapterId/Section/:sectionId
699
+ * //
700
+ * // Then
701
+ * $routeParams ==> {chapterId:'1', sectionId:'2', search:'moby'}
702
+ * ```
703
+ */
704
+ function $RouteParamsProvider() {
705
+ this.$get = function() { return {}; };
706
+ }
707
+
708
+ ngRouteModule.directive('ngView', ngViewFactory);
709
+ ngRouteModule.directive('ngView', ngViewFillContentFactory);
710
+
711
+
712
+ /**
713
+ * @ngdoc directive
714
+ * @name ngView
715
+ * @restrict ECA
716
+ *
717
+ * @description
718
+ * # Overview
719
+ * `ngView` is a directive that complements the {@link ngRoute.$route $route} service by
720
+ * including the rendered template of the current route into the main layout (`index.html`) file.
721
+ * Every time the current route changes, the included view changes with it according to the
722
+ * configuration of the `$route` service.
723
+ *
724
+ * Requires the {@link ngRoute `ngRoute`} module to be installed.
725
+ *
726
+ * @animations
727
+ * enter - animation is used to bring new content into the browser.
728
+ * leave - animation is used to animate existing content away.
729
+ *
730
+ * The enter and leave animation occur concurrently.
731
+ *
732
+ * @scope
733
+ * @priority 400
734
+ * @param {string=} onload Expression to evaluate whenever the view updates.
735
+ *
736
+ * @param {string=} autoscroll Whether `ngView` should call {@link ng.$anchorScroll
737
+ * $anchorScroll} to scroll the viewport after the view is updated.
738
+ *
739
+ * - If the attribute is not set, disable scrolling.
740
+ * - If the attribute is set without value, enable scrolling.
741
+ * - Otherwise enable scrolling only if the `autoscroll` attribute value evaluated
742
+ * as an expression yields a truthy value.
743
+ * @example
744
+ <example name="ngView-directive" module="ngViewExample"
745
+ deps="angular-route.js;angular-animate.js"
746
+ animations="true" fixBase="true">
747
+ <file name="index.html">
748
+ <div ng-controller="MainCtrl as main">
749
+ Choose:
750
+ <a href="Book/Moby">Moby</a> |
751
+ <a href="Book/Moby/ch/1">Moby: Ch1</a> |
752
+ <a href="Book/Gatsby">Gatsby</a> |
753
+ <a href="Book/Gatsby/ch/4?key=value">Gatsby: Ch4</a> |
754
+ <a href="Book/Scarlet">Scarlet Letter</a><br/>
755
+
756
+ <div class="view-animate-container">
757
+ <div ng-view class="view-animate"></div>
758
+ </div>
759
+ <hr />
760
+
761
+ <pre>$location.path() = {{main.$location.path()}}</pre>
762
+ <pre>$route.current.templateUrl = {{main.$route.current.templateUrl}}</pre>
763
+ <pre>$route.current.params = {{main.$route.current.params}}</pre>
764
+ <pre>$routeParams = {{main.$routeParams}}</pre>
765
+ </div>
766
+ </file>
767
+
768
+ <file name="book.html">
769
+ <div>
770
+ controller: {{book.name}}<br />
771
+ Book Id: {{book.params.bookId}}<br />
772
+ </div>
773
+ </file>
774
+
775
+ <file name="chapter.html">
776
+ <div>
777
+ controller: {{chapter.name}}<br />
778
+ Book Id: {{chapter.params.bookId}}<br />
779
+ Chapter Id: {{chapter.params.chapterId}}
780
+ </div>
781
+ </file>
782
+
783
+ <file name="animations.css">
784
+ .view-animate-container {
785
+ position:relative;
786
+ height:100px!important;
787
+ background:white;
788
+ border:1px solid black;
789
+ height:40px;
790
+ overflow:hidden;
791
+ }
792
+
793
+ .view-animate {
794
+ padding:10px;
795
+ }
796
+
797
+ .view-animate.ng-enter, .view-animate.ng-leave {
798
+ -webkit-transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 1.5s;
799
+ transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 1.5s;
800
+
801
+ display:block;
802
+ width:100%;
803
+ border-left:1px solid black;
804
+
805
+ position:absolute;
806
+ top:0;
807
+ left:0;
808
+ right:0;
809
+ bottom:0;
810
+ padding:10px;
811
+ }
812
+
813
+ .view-animate.ng-enter {
814
+ left:100%;
815
+ }
816
+ .view-animate.ng-enter.ng-enter-active {
817
+ left:0;
818
+ }
819
+ .view-animate.ng-leave.ng-leave-active {
820
+ left:-100%;
821
+ }
822
+ </file>
823
+
824
+ <file name="script.js">
825
+ angular.module('ngViewExample', ['ngRoute', 'ngAnimate'])
826
+ .config(['$routeProvider', '$locationProvider',
827
+ function($routeProvider, $locationProvider) {
828
+ $routeProvider
829
+ .when('/Book/:bookId', {
830
+ templateUrl: 'book.html',
831
+ controller: 'BookCtrl',
832
+ controllerAs: 'book'
833
+ })
834
+ .when('/Book/:bookId/ch/:chapterId', {
835
+ templateUrl: 'chapter.html',
836
+ controller: 'ChapterCtrl',
837
+ controllerAs: 'chapter'
838
+ });
839
+
840
+ $locationProvider.html5Mode(true);
841
+ }])
842
+ .controller('MainCtrl', ['$route', '$routeParams', '$location',
843
+ function($route, $routeParams, $location) {
844
+ this.$route = $route;
845
+ this.$location = $location;
846
+ this.$routeParams = $routeParams;
847
+ }])
848
+ .controller('BookCtrl', ['$routeParams', function($routeParams) {
849
+ this.name = "BookCtrl";
850
+ this.params = $routeParams;
851
+ }])
852
+ .controller('ChapterCtrl', ['$routeParams', function($routeParams) {
853
+ this.name = "ChapterCtrl";
854
+ this.params = $routeParams;
855
+ }]);
856
+
857
+ </file>
858
+
859
+ <file name="protractor.js" type="protractor">
860
+ it('should load and compile correct template', function() {
861
+ element(by.linkText('Moby: Ch1')).click();
862
+ var content = element(by.css('[ng-view]')).getText();
863
+ expect(content).toMatch(/controller\: ChapterCtrl/);
864
+ expect(content).toMatch(/Book Id\: Moby/);
865
+ expect(content).toMatch(/Chapter Id\: 1/);
866
+
867
+ element(by.partialLinkText('Scarlet')).click();
868
+
869
+ content = element(by.css('[ng-view]')).getText();
870
+ expect(content).toMatch(/controller\: BookCtrl/);
871
+ expect(content).toMatch(/Book Id\: Scarlet/);
872
+ });
873
+ </file>
874
+ </example>
875
+ */
876
+
877
+
878
+ /**
879
+ * @ngdoc event
880
+ * @name ngView#$viewContentLoaded
881
+ * @eventType emit on the current ngView scope
882
+ * @description
883
+ * Emitted every time the ngView content is reloaded.
884
+ */
885
+ ngViewFactory.$inject = ['$route', '$anchorScroll', '$animate'];
886
+ function ngViewFactory($route, $anchorScroll, $animate) {
887
+ return {
888
+ restrict: 'ECA',
889
+ terminal: true,
890
+ priority: 400,
891
+ transclude: 'element',
892
+ link: function(scope, $element, attr, ctrl, $transclude) {
893
+ var currentScope,
894
+ currentElement,
895
+ previousLeaveAnimation,
896
+ autoScrollExp = attr.autoscroll,
897
+ onloadExp = attr.onload || '';
898
+
899
+ scope.$on('$routeChangeSuccess', update);
900
+ update();
901
+
902
+ function cleanupLastView() {
903
+ if (previousLeaveAnimation) {
904
+ $animate.cancel(previousLeaveAnimation);
905
+ previousLeaveAnimation = null;
906
+ }
907
+
908
+ if (currentScope) {
909
+ currentScope.$destroy();
910
+ currentScope = null;
911
+ }
912
+ if (currentElement) {
913
+ previousLeaveAnimation = $animate.leave(currentElement);
914
+ previousLeaveAnimation.then(function() {
915
+ previousLeaveAnimation = null;
916
+ });
917
+ currentElement = null;
918
+ }
919
+ }
920
+
921
+ function update() {
922
+ var locals = $route.current && $route.current.locals,
923
+ template = locals && locals.$template;
924
+
925
+ if (angular.isDefined(template)) {
926
+ var newScope = scope.$new();
927
+ var current = $route.current;
928
+
929
+ // Note: This will also link all children of ng-view that were contained in the original
930
+ // html. If that content contains controllers, ... they could pollute/change the scope.
931
+ // However, using ng-view on an element with additional content does not make sense...
932
+ // Note: We can't remove them in the cloneAttchFn of $transclude as that
933
+ // function is called before linking the content, which would apply child
934
+ // directives to non existing elements.
935
+ var clone = $transclude(newScope, function(clone) {
936
+ $animate.enter(clone, null, currentElement || $element).then(function onNgViewEnter() {
937
+ if (angular.isDefined(autoScrollExp)
938
+ && (!autoScrollExp || scope.$eval(autoScrollExp))) {
939
+ $anchorScroll();
940
+ }
941
+ });
942
+ cleanupLastView();
943
+ });
944
+
945
+ currentElement = clone;
946
+ currentScope = current.scope = newScope;
947
+ currentScope.$emit('$viewContentLoaded');
948
+ currentScope.$eval(onloadExp);
949
+ } else {
950
+ cleanupLastView();
951
+ }
952
+ }
953
+ }
954
+ };
955
+ }
956
+
957
+ // This directive is called during the $transclude call of the first `ngView` directive.
958
+ // It will replace and compile the content of the element with the loaded template.
959
+ // We need this directive so that the element content is already filled when
960
+ // the link function of another directive on the same element as ngView
961
+ // is called.
962
+ ngViewFillContentFactory.$inject = ['$compile', '$controller', '$route'];
963
+ function ngViewFillContentFactory($compile, $controller, $route) {
964
+ return {
965
+ restrict: 'ECA',
966
+ priority: -400,
967
+ link: function(scope, $element) {
968
+ var current = $route.current,
969
+ locals = current.locals;
970
+
971
+ $element.html(locals.$template);
972
+
973
+ var link = $compile($element.contents());
974
+
975
+ if (current.controller) {
976
+ locals.$scope = scope;
977
+ var controller = $controller(current.controller, locals);
978
+ if (current.controllerAs) {
979
+ scope[current.controllerAs] = controller;
980
+ }
981
+ $element.data('$ngControllerController', controller);
982
+ $element.children().data('$ngControllerController', controller);
983
+ }
984
+
985
+ link(scope);
986
+ }
987
+ };
988
+ }
989
+
990
+
991
+ })(window, window.angular);