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,992 @@
1
+ /*!
2
+ * Angular Material Design
3
+ * https://github.com/angular/material
4
+ * @license MIT
5
+ * v0.7.0-rc3
6
+ */
7
+ (function() {
8
+ 'use strict';
9
+
10
+ /**
11
+ * @ngdoc module
12
+ * @name material.components.tabs
13
+ * @description
14
+ *
15
+ * Tabs, created with the `<md-tabs>` directive provide *tabbed* navigation with different styles.
16
+ * The Tabs component consists of clickable tabs that are aligned horizontally side-by-side.
17
+ *
18
+ * Features include support for:
19
+ *
20
+ * - static or dynamic tabs,
21
+ * - responsive designs,
22
+ * - accessibility support (ARIA),
23
+ * - tab pagination,
24
+ * - external or internal tab content,
25
+ * - focus indicators and arrow-key navigations,
26
+ * - programmatic lookup and access to tab controllers, and
27
+ * - dynamic transitions through different tab contents.
28
+ *
29
+ */
30
+ /*
31
+ * @see js folder for tabs implementation
32
+ */
33
+ angular.module('material.components.tabs', [
34
+ 'material.core'
35
+ ]);
36
+ })();
37
+
38
+ (function() {
39
+ 'use strict';
40
+
41
+ /**
42
+ * Conditionally configure ink bar animations when the
43
+ * tab selection changes. If `mdNoBar` then do not show the
44
+ * bar nor animate.
45
+ */
46
+ angular.module('material.components.tabs')
47
+ .directive('mdTabsInkBar', MdTabInkDirective);
48
+
49
+ function MdTabInkDirective($$rAF) {
50
+
51
+ var lastIndex = 0;
52
+
53
+ return {
54
+ restrict: 'E',
55
+ require: ['^?mdNoBar', '^mdTabs'],
56
+ link: postLink
57
+ };
58
+
59
+ function postLink(scope, element, attr, ctrls) {
60
+ if (ctrls[0]) return;
61
+
62
+ var tabsCtrl = ctrls[1],
63
+ debouncedUpdateBar = $$rAF.debounce(updateBar);
64
+
65
+ tabsCtrl.inkBarElement = element;
66
+
67
+ scope.$on('$mdTabsPaginationChanged', debouncedUpdateBar);
68
+
69
+ function updateBar() {
70
+ var selected = tabsCtrl.getSelectedItem();
71
+ var hideInkBar = !selected || tabsCtrl.count() < 2;
72
+
73
+ element.css('display', hideInkBar ? 'none' : 'block');
74
+
75
+ if (hideInkBar) return;
76
+
77
+ if (scope.pagination && scope.pagination.tabData) {
78
+ var index = tabsCtrl.getSelectedIndex();
79
+ var data = scope.pagination.tabData.tabs[index] || { left: 0, right: 0, width: 0 };
80
+ var right = element.parent().prop('offsetWidth') - data.right;
81
+ var classNames = ['md-transition-left', 'md-transition-right', 'md-no-transition'];
82
+ var classIndex = lastIndex > index ? 0 : lastIndex < index ? 1 : 2;
83
+
84
+ element
85
+ .removeClass(classNames.join(' '))
86
+ .addClass(classNames[classIndex])
87
+ .css({ left: (data.left + 1) + 'px', right: right + 'px' });
88
+
89
+ lastIndex = index;
90
+ }
91
+ }
92
+ }
93
+ }
94
+ MdTabInkDirective.$inject = ["$$rAF"];
95
+ })();
96
+
97
+ (function() {
98
+ 'use strict';
99
+
100
+ angular.module('material.components.tabs')
101
+ .directive('mdTabsPagination', TabPaginationDirective);
102
+
103
+ function TabPaginationDirective($mdConstant, $window, $$rAF, $$q, $timeout, $mdMedia) {
104
+
105
+ // Must match (2 * width of paginators) in scss
106
+ var PAGINATORS_WIDTH = (8 * 4) * 2;
107
+
108
+ return {
109
+ restrict: 'A',
110
+ require: '^mdTabs',
111
+ link: postLink
112
+ };
113
+
114
+ function postLink(scope, element, attr, tabsCtrl) {
115
+
116
+ var tabs = element[0].getElementsByTagName('md-tab');
117
+ var debouncedUpdatePagination = $$rAF.debounce(updatePagination);
118
+ var tabsParent = element.children();
119
+ var state = scope.pagination = {
120
+ page: -1,
121
+ active: false,
122
+ clickNext: function() { userChangePage(+1); },
123
+ clickPrevious: function() { userChangePage(-1); }
124
+ };
125
+
126
+ scope.$on('$mdTabsChanged', debouncedUpdatePagination);
127
+ angular.element($window).on('resize', debouncedUpdatePagination);
128
+
129
+ scope.$on('$destroy', function() {
130
+ angular.element($window).off('resize', debouncedUpdatePagination);
131
+ });
132
+
133
+ scope.$watch(function() { return tabsCtrl.tabToFocus; }, onTabFocus);
134
+
135
+ // Make sure we don't focus an element on the next page
136
+ // before it's in view
137
+ function onTabFocus(tab, oldTab) {
138
+ if (!tab) return;
139
+
140
+ var pageIndex = getPageForTab(tab);
141
+ if (!state.active || pageIndex === state.page) {
142
+ tab.element.focus();
143
+ } else {
144
+ // Go to the new page, wait for the page transition to end, then focus.
145
+ oldTab && oldTab.element.blur();
146
+ setPage(pageIndex).then(function() { tab.element.focus(); });
147
+ }
148
+ }
149
+
150
+ // Called when page is changed by a user action (click)
151
+ function userChangePage(increment) {
152
+ var sizeData = state.tabData;
153
+ var newPage = Math.max(0, Math.min(sizeData.pages.length - 1, state.page + increment));
154
+ var newTabIndex = sizeData.pages[newPage][ increment > 0 ? 'firstTabIndex' : 'lastTabIndex' ];
155
+ var newTab = tabsCtrl.itemAt(newTabIndex);
156
+ onTabFocus(newTab);
157
+ }
158
+
159
+ function updatePagination() {
160
+ if (!element.prop('offsetParent')) {
161
+ var watcher = waitForVisible();
162
+ return;
163
+ }
164
+
165
+ var tabs = element.find('md-tab');
166
+
167
+ disablePagination();
168
+
169
+ var sizeData = state.tabData = calculateTabData();
170
+ var needPagination = state.active = sizeData.pages.length > 1;
171
+
172
+ if (needPagination) { enablePagination(); }
173
+
174
+ scope.$evalAsync(function () { scope.$broadcast('$mdTabsPaginationChanged'); });
175
+
176
+ function enablePagination() {
177
+ tabsParent.css('width', '9999px');
178
+
179
+ //-- apply filler margins
180
+ angular.forEach(sizeData.tabs, function (tab) {
181
+ angular.element(tab.element).css('margin-left', tab.filler + 'px');
182
+ });
183
+
184
+ setPage(getPageForTab(tabsCtrl.getSelectedItem()));
185
+ }
186
+
187
+ function disablePagination() {
188
+ slideTabButtons(0);
189
+ tabsParent.css('width', '');
190
+ tabs.css('width', '');
191
+ tabs.css('margin-left', '');
192
+ state.page = null;
193
+ state.active = false;
194
+ }
195
+
196
+ function waitForVisible() {
197
+ return watcher || scope.$watch(
198
+ function () {
199
+ $timeout(function () {
200
+ if (element[0].offsetParent) {
201
+ if (angular.isFunction(watcher)) {
202
+ watcher();
203
+ }
204
+ debouncedUpdatePagination();
205
+ watcher = null;
206
+ }
207
+ }, 0, false);
208
+ }
209
+ );
210
+ }
211
+ }
212
+
213
+ function slideTabButtons(x) {
214
+ if (tabsCtrl.pagingOffset === x) {
215
+ // Resolve instantly if no change
216
+ return $$q.when();
217
+ }
218
+
219
+ var deferred = $$q.defer();
220
+
221
+ tabsCtrl.$$pagingOffset = x;
222
+ tabsParent.css($mdConstant.CSS.TRANSFORM, 'translate3d(' + x + 'px,0,0)');
223
+ tabsParent.on($mdConstant.CSS.TRANSITIONEND, onTabsParentTransitionEnd);
224
+
225
+ return deferred.promise;
226
+
227
+ function onTabsParentTransitionEnd(ev) {
228
+ // Make sure this event didn't bubble up from an animation in a child element.
229
+ if (ev.target === tabsParent[0]) {
230
+ tabsParent.off($mdConstant.CSS.TRANSITIONEND, onTabsParentTransitionEnd);
231
+ deferred.resolve();
232
+ }
233
+ }
234
+ }
235
+
236
+ function shouldStretchTabs() {
237
+ switch (scope.stretchTabs) {
238
+ case 'never': return false;
239
+ case 'always': return true;
240
+ default: return $mdMedia('sm');
241
+ }
242
+ }
243
+
244
+ function calculateTabData(noAdjust) {
245
+ var clientWidth = element.parent().prop('offsetWidth');
246
+ var tabsWidth = clientWidth - PAGINATORS_WIDTH - 1;
247
+ var $tabs = angular.element(tabs);
248
+ var totalWidth = 0;
249
+ var max = 0;
250
+ var tabData = [];
251
+ var pages = [];
252
+ var currentPage;
253
+
254
+ $tabs.css('max-width', '');
255
+ angular.forEach(tabs, function (tab, index) {
256
+ var tabWidth = Math.min(tabsWidth, tab.offsetWidth);
257
+ var data = {
258
+ element: tab,
259
+ left: totalWidth,
260
+ width: tabWidth,
261
+ right: totalWidth + tabWidth,
262
+ filler: 0
263
+ };
264
+
265
+ //-- This calculates the page for each tab. The first page will use the clientWidth, which
266
+ // does not factor in the pagination items. After the first page, tabsWidth is used
267
+ // because at this point, we know that the pagination buttons will be shown.
268
+ data.page = Math.ceil(data.right / ( pages.length === 1 && index === tabs.length - 1 ? clientWidth : tabsWidth )) - 1;
269
+
270
+ if (data.page >= pages.length) {
271
+ data.filler = (tabsWidth * data.page) - data.left;
272
+ data.right += data.filler;
273
+ data.left += data.filler;
274
+ currentPage = {
275
+ left: data.left,
276
+ firstTabIndex: index,
277
+ lastTabIndex: index,
278
+ tabs: [ data ]
279
+ };
280
+ pages.push(currentPage);
281
+ } else {
282
+ currentPage.lastTabIndex = index;
283
+ currentPage.tabs.push(data);
284
+ }
285
+ totalWidth = data.right;
286
+ max = Math.max(max, tabWidth);
287
+ tabData.push(data);
288
+ });
289
+ $tabs.css('max-width', tabsWidth + 'px');
290
+
291
+ if (!noAdjust && shouldStretchTabs()) {
292
+ return adjustForStretchedTabs();
293
+ } else {
294
+ return {
295
+ width: totalWidth,
296
+ max: max,
297
+ tabs: tabData,
298
+ pages: pages,
299
+ tabElements: tabs
300
+ };
301
+ }
302
+
303
+
304
+ function adjustForStretchedTabs() {
305
+ var canvasWidth = pages.length === 1 ? clientWidth : tabsWidth;
306
+ var tabsPerPage = Math.min(Math.floor(canvasWidth / max), tabs.length);
307
+ var tabWidth = Math.floor(canvasWidth / tabsPerPage);
308
+ $tabs.css('width', tabWidth + 'px');
309
+ return calculateTabData(true);
310
+ }
311
+ }
312
+
313
+ function getPageForTab(tab) {
314
+ var tabIndex = tabsCtrl.indexOf(tab);
315
+ if (tabIndex === -1) return 0;
316
+
317
+ var sizeData = state.tabData;
318
+
319
+ return sizeData ? sizeData.tabs[tabIndex].page : 0;
320
+ }
321
+
322
+ function setPage(page) {
323
+ if (page === state.page) return;
324
+
325
+ var lastPage = state.tabData.pages.length - 1;
326
+
327
+ if (page < 0) page = 0;
328
+ if (page > lastPage) page = lastPage;
329
+
330
+ state.hasPrev = page > 0;
331
+ state.hasNext = page < lastPage;
332
+
333
+ state.page = page;
334
+
335
+ scope.$broadcast('$mdTabsPaginationChanged');
336
+
337
+ return slideTabButtons(-state.tabData.pages[page].left);
338
+ }
339
+ }
340
+
341
+ }
342
+ TabPaginationDirective.$inject = ["$mdConstant", "$window", "$$rAF", "$$q", "$timeout", "$mdMedia"];
343
+ })();
344
+
345
+ (function() {
346
+ 'use strict';
347
+
348
+
349
+ angular.module('material.components.tabs')
350
+ .controller('$mdTab', TabItemController);
351
+
352
+ function TabItemController($scope, $element, $attrs, $compile, $animate, $mdUtil, $parse, $timeout) {
353
+ var self = this;
354
+
355
+ // Properties
356
+ self.contentContainer = angular.element('<div class="md-tab-content ng-hide">');
357
+ self.hammertime = new Hammer(self.contentContainer[0]);
358
+ self.element = $element;
359
+
360
+ // Methods
361
+ self.isDisabled = isDisabled;
362
+ self.onAdd = onAdd;
363
+ self.onRemove = onRemove;
364
+ self.onSelect = onSelect;
365
+ self.onDeselect = onDeselect;
366
+
367
+ var disabledParsed = $parse($attrs.ngDisabled);
368
+ function isDisabled() {
369
+ return disabledParsed($scope.$parent);
370
+ }
371
+
372
+ /**
373
+ * Add the tab's content to the DOM container area in the tabs,
374
+ * @param contentArea the contentArea to add the content of the tab to
375
+ */
376
+ function onAdd(contentArea, shouldDisconnectScope) {
377
+ if (self.content.length) {
378
+ self.contentContainer.append(self.content);
379
+ self.contentScope = $scope.$parent.$new();
380
+ contentArea.append(self.contentContainer);
381
+
382
+ $compile(self.contentContainer)(self.contentScope);
383
+ if (shouldDisconnectScope === true) {
384
+ $timeout(function () {
385
+ $mdUtil.disconnectScope(self.contentScope);
386
+ }, 0, false);
387
+ }
388
+ }
389
+ }
390
+
391
+ function onRemove() {
392
+ self.hammertime.destroy();
393
+ $animate.leave(self.contentContainer).then(function() {
394
+ self.contentScope && self.contentScope.$destroy();
395
+ self.contentScope = null;
396
+ });
397
+ }
398
+
399
+ function toggleAnimationClass(rightToLeft) {
400
+ self.contentContainer[rightToLeft ? 'addClass' : 'removeClass']('md-transition-rtl');
401
+ }
402
+
403
+ function onSelect(rightToLeft) {
404
+ // Resume watchers and events firing when tab is selected
405
+ $mdUtil.reconnectScope(self.contentScope);
406
+ self.hammertime.on('swipeleft swiperight', $scope.onSwipe);
407
+
408
+ $element.addClass('active');
409
+ $element.attr('aria-selected', true);
410
+ $element.attr('tabIndex', 0);
411
+ toggleAnimationClass(rightToLeft);
412
+ $animate.removeClass(self.contentContainer, 'ng-hide');
413
+
414
+ $scope.onSelect();
415
+ }
416
+
417
+ function onDeselect(rightToLeft) {
418
+ // Stop watchers & events from firing while tab is deselected
419
+ $mdUtil.disconnectScope(self.contentScope);
420
+ self.hammertime.off('swipeleft swiperight', $scope.onSwipe);
421
+
422
+ $element.removeClass('active');
423
+ $element.attr('aria-selected', false);
424
+ // Only allow tabbing to the active tab
425
+ $element.attr('tabIndex', -1);
426
+ toggleAnimationClass(rightToLeft);
427
+ $animate.addClass(self.contentContainer, 'ng-hide');
428
+
429
+ $scope.onDeselect();
430
+ }
431
+
432
+ }
433
+ TabItemController.$inject = ["$scope", "$element", "$attrs", "$compile", "$animate", "$mdUtil", "$parse", "$timeout"];
434
+
435
+ })();
436
+
437
+ (function() {
438
+ 'use strict';
439
+
440
+ angular.module('material.components.tabs')
441
+ .directive('mdTab', MdTabDirective);
442
+
443
+ /**
444
+ * @ngdoc directive
445
+ * @name mdTab
446
+ * @module material.components.tabs
447
+ *
448
+ * @restrict E
449
+ *
450
+ * @description
451
+ * `<md-tab>` is the nested directive used [within `<md-tabs>`] to specify each tab with a **label** and optional *view content*.
452
+ *
453
+ * If the `label` attribute is not specified, then an optional `<md-tab-label>` tag can be used to specify more
454
+ * complex tab header markup. If neither the **label** nor the **md-tab-label** are specified, then the nested
455
+ * markup of the `<md-tab>` is used as the tab header markup.
456
+ *
457
+ * If a tab **label** has been identified, then any **non-**`<md-tab-label>` markup
458
+ * will be considered tab content and will be transcluded to the internal `<div class="md-tabs-content">` container.
459
+ *
460
+ * This container is used by the TabsController to show/hide the active tab's content view. This synchronization is
461
+ * automatically managed by the internal TabsController whenever the tab selection changes. Selection changes can
462
+ * be initiated via data binding changes, programmatic invocation, or user gestures.
463
+ *
464
+ * @param {string=} label Optional attribute to specify a simple string as the tab label
465
+ * @param {boolean=} md-active When evaluteing to true, selects the tab.
466
+ * @param {boolean=} disabled If present, disabled tab selection.
467
+ * @param {expression=} md-on-deselect Expression to be evaluated after the tab has been de-selected.
468
+ * @param {expression=} md-on-select Expression to be evaluated after the tab has been selected.
469
+ *
470
+ *
471
+ * @usage
472
+ *
473
+ * <hljs lang="html">
474
+ * <md-tab label="" disabled="" md-on-select="" md-on-deselect="" >
475
+ * <h3>My Tab content</h3>
476
+ * </md-tab>
477
+ *
478
+ * <md-tab >
479
+ * <md-tab-label>
480
+ * <h3>My Tab content</h3>
481
+ * </md-tab-label>
482
+ * <p>
483
+ * Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium,
484
+ * totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae
485
+ * dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit,
486
+ * sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.
487
+ * </p>
488
+ * </md-tab>
489
+ * </hljs>
490
+ *
491
+ */
492
+ function MdTabDirective($mdInkRipple, $compile, $mdUtil, $mdConstant, $timeout) {
493
+ return {
494
+ restrict: 'E',
495
+ require: ['mdTab', '^mdTabs'],
496
+ controller: '$mdTab',
497
+ scope: {
498
+ onSelect: '&mdOnSelect',
499
+ onDeselect: '&mdOnDeselect',
500
+ label: '@'
501
+ },
502
+ compile: compile
503
+ };
504
+
505
+ function compile(element, attr) {
506
+ var tabLabel = element.find('md-tab-label');
507
+
508
+ if (tabLabel.length) {
509
+ // If a tab label element is found, remove it for later re-use.
510
+ tabLabel.remove();
511
+
512
+ } else if (angular.isDefined(attr.label)) {
513
+ // Otherwise, try to use attr.label as the label
514
+ tabLabel = angular.element('<md-tab-label>').html(attr.label);
515
+
516
+ } else {
517
+ // If nothing is found, use the tab's content as the label
518
+ tabLabel = angular.element('<md-tab-label>')
519
+ .append(element.contents().remove());
520
+ }
521
+
522
+ // Everything that's left as a child is the tab's content.
523
+ var tabContent = element.contents().remove();
524
+
525
+ return function postLink(scope, element, attr, ctrls) {
526
+
527
+ var tabItemCtrl = ctrls[0]; // Controller for THIS tabItemCtrl
528
+ var tabsCtrl = ctrls[1]; // Controller for ALL tabs
529
+
530
+ scope.$watch(
531
+ function () { return attr.label; },
532
+ function () { $timeout(function () { tabsCtrl.scope.$broadcast('$mdTabsChanged'); }, 0, false); }
533
+ );
534
+
535
+ transcludeTabContent();
536
+ configureAria();
537
+
538
+ var detachRippleFn = $mdInkRipple.attachTabBehavior(scope, element, {
539
+ colorElement: tabsCtrl.inkBarElement
540
+ });
541
+ tabsCtrl.add(tabItemCtrl);
542
+ scope.$on('$destroy', function() {
543
+ detachRippleFn();
544
+ tabsCtrl.remove(tabItemCtrl);
545
+ });
546
+ element.on('$destroy', function () {
547
+ //-- wait for item to be removed from the dom
548
+ $timeout(function () {
549
+ tabsCtrl.scope.$broadcast('$mdTabsChanged');
550
+ }, 0, false);
551
+ });
552
+
553
+ if (!angular.isDefined(attr.ngClick)) {
554
+ element.on('click', defaultClickListener);
555
+ }
556
+ element.on('keydown', keydownListener);
557
+ scope.onSwipe = onSwipe;
558
+
559
+ if (angular.isNumber(scope.$parent.$index)) {
560
+ watchNgRepeatIndex();
561
+ }
562
+ if (angular.isDefined(attr.mdActive)) {
563
+ watchActiveAttribute();
564
+ }
565
+ watchDisabled();
566
+
567
+ function transcludeTabContent() {
568
+ // Clone the label we found earlier, and $compile and append it
569
+ var label = tabLabel.clone();
570
+ element.append(label);
571
+ $compile(label)(scope.$parent);
572
+
573
+ // Clone the content we found earlier, and mark it for later placement into
574
+ // the proper content area.
575
+ tabItemCtrl.content = tabContent.clone();
576
+ }
577
+
578
+ //defaultClickListener isn't applied if the user provides an ngClick expression.
579
+ function defaultClickListener() {
580
+ scope.$apply(function() {
581
+ tabsCtrl.select(tabItemCtrl);
582
+ tabsCtrl.focus(tabItemCtrl);
583
+ });
584
+ }
585
+ function keydownListener(ev) {
586
+ if (ev.keyCode == $mdConstant.KEY_CODE.SPACE || ev.keyCode == $mdConstant.KEY_CODE.ENTER ) {
587
+ // Fire the click handler to do normal selection if space is pressed
588
+ element.triggerHandler('click');
589
+ ev.preventDefault();
590
+ } else if (ev.keyCode === $mdConstant.KEY_CODE.LEFT_ARROW) {
591
+ scope.$evalAsync(function() {
592
+ tabsCtrl.focus(tabsCtrl.previous(tabItemCtrl));
593
+ });
594
+ } else if (ev.keyCode === $mdConstant.KEY_CODE.RIGHT_ARROW) {
595
+ scope.$evalAsync(function() {
596
+ tabsCtrl.focus(tabsCtrl.next(tabItemCtrl));
597
+ });
598
+ }
599
+ }
600
+
601
+ function onSwipe(ev) {
602
+ scope.$apply(function() {
603
+ if (ev.type === 'swipeleft') {
604
+ tabsCtrl.select(tabsCtrl.next());
605
+ } else {
606
+ tabsCtrl.select(tabsCtrl.previous());
607
+ }
608
+ });
609
+ }
610
+
611
+ // If tabItemCtrl is part of an ngRepeat, move the tabItemCtrl in our internal array
612
+ // when its $index changes
613
+ function watchNgRepeatIndex() {
614
+ // The tabItemCtrl has an isolate scope, so we watch the $index on the parent.
615
+ scope.$watch('$parent.$index', function $indexWatchAction(newIndex) {
616
+ tabsCtrl.move(tabItemCtrl, newIndex);
617
+ });
618
+ }
619
+
620
+ function watchActiveAttribute() {
621
+ var unwatch = scope.$parent.$watch('!!(' + attr.mdActive + ')', activeWatchAction);
622
+ scope.$on('$destroy', unwatch);
623
+
624
+ function activeWatchAction(isActive) {
625
+ var isSelected = tabsCtrl.getSelectedItem() === tabItemCtrl;
626
+
627
+ if (isActive && !isSelected) {
628
+ tabsCtrl.select(tabItemCtrl);
629
+ } else if (!isActive && isSelected) {
630
+ tabsCtrl.deselect(tabItemCtrl);
631
+ }
632
+ }
633
+ }
634
+
635
+ function watchDisabled() {
636
+ scope.$watch(tabItemCtrl.isDisabled, disabledWatchAction);
637
+
638
+ function disabledWatchAction(isDisabled) {
639
+ element.attr('aria-disabled', isDisabled);
640
+
641
+ // Auto select `next` tab when disabled
642
+ var isSelected = (tabsCtrl.getSelectedItem() === tabItemCtrl);
643
+ if (isSelected && isDisabled) {
644
+ tabsCtrl.select(tabsCtrl.next() || tabsCtrl.previous());
645
+ }
646
+
647
+ }
648
+ }
649
+
650
+ function configureAria() {
651
+ // Link together the content area and tabItemCtrl with an id
652
+ var tabId = attr.id || ('tab_' + $mdUtil.nextUid());
653
+
654
+ element.attr({
655
+ id: tabId,
656
+ role: 'tab',
657
+ tabIndex: -1 //this is also set on select/deselect in tabItemCtrl
658
+ });
659
+
660
+ // Only setup the contentContainer's aria attributes if tab content is provided
661
+ if (tabContent.length) {
662
+ var tabContentId = 'content_' + tabId;
663
+ if (!element.attr('aria-controls')) {
664
+ element.attr('aria-controls', tabContentId);
665
+ }
666
+ tabItemCtrl.contentContainer.attr({
667
+ id: tabContentId,
668
+ role: 'tabpanel',
669
+ 'aria-labelledby': tabId
670
+ });
671
+ }
672
+ }
673
+
674
+ };
675
+
676
+ }
677
+
678
+ }
679
+ MdTabDirective.$inject = ["$mdInkRipple", "$compile", "$mdUtil", "$mdConstant", "$timeout"];
680
+
681
+ })();
682
+
683
+ (function() {
684
+ 'use strict';
685
+
686
+ angular.module('material.components.tabs')
687
+ .controller('$mdTabs', MdTabsController);
688
+
689
+ function MdTabsController($scope, $element, $mdUtil, $timeout) {
690
+
691
+ var tabsList = $mdUtil.iterator([], false);
692
+ var self = this;
693
+
694
+ // Properties
695
+ self.$element = $element;
696
+ self.scope = $scope;
697
+ // The section containing the tab content $elements
698
+ var contentArea = self.contentArea = angular.element($element[0].querySelector('.md-tabs-content'));
699
+
700
+ // Methods from iterator
701
+ var inRange = self.inRange = tabsList.inRange;
702
+ var indexOf = self.indexOf = tabsList.indexOf;
703
+ var itemAt = self.itemAt = tabsList.itemAt;
704
+ self.count = tabsList.count;
705
+
706
+ self.getSelectedItem = getSelectedItem;
707
+ self.getSelectedIndex = getSelectedIndex;
708
+ self.add = add;
709
+ self.remove = remove;
710
+ self.move = move;
711
+ self.select = select;
712
+ self.focus = focus;
713
+ self.deselect = deselect;
714
+
715
+ self.next = next;
716
+ self.previous = previous;
717
+
718
+ $scope.$on('$destroy', function() {
719
+ deselect(getSelectedItem());
720
+ for (var i = tabsList.count() - 1; i >= 0; i--) {
721
+ remove(tabsList[i], true);
722
+ }
723
+ });
724
+
725
+ // Get the selected tab
726
+ function getSelectedItem() {
727
+ return itemAt($scope.selectedIndex);
728
+ }
729
+
730
+ function getSelectedIndex() {
731
+ return $scope.selectedIndex;
732
+ }
733
+
734
+ // Add a new tab.
735
+ // Returns a method to remove the tab from the list.
736
+ function add(tab, index) {
737
+ tabsList.add(tab, index);
738
+
739
+ // Select the new tab if we don't have a selectedIndex, or if the
740
+ // selectedIndex we've been waiting for is this tab
741
+ if (!angular.isDefined(tab.element.attr('md-active')) && ($scope.selectedIndex === -1 || !angular.isNumber($scope.selectedIndex) ||
742
+ $scope.selectedIndex === self.indexOf(tab))) {
743
+ tab.onAdd(self.contentArea, false);
744
+ self.select(tab);
745
+ } else {
746
+ tab.onAdd(self.contentArea, true);
747
+ }
748
+
749
+ $scope.$broadcast('$mdTabsChanged');
750
+ }
751
+
752
+ function remove(tab, noReselect) {
753
+ if (!tabsList.contains(tab)) return;
754
+ if (noReselect) return;
755
+ var isSelectedItem = getSelectedItem() === tab,
756
+ newTab = previous() || next();
757
+
758
+ deselect(tab);
759
+ tabsList.remove(tab);
760
+ tab.onRemove();
761
+
762
+ $scope.$broadcast('$mdTabsChanged');
763
+
764
+ if (isSelectedItem) { select(newTab); }
765
+ }
766
+
767
+ // Move a tab (used when ng-repeat order changes)
768
+ function move(tab, toIndex) {
769
+ var isSelected = getSelectedItem() === tab;
770
+
771
+ tabsList.remove(tab);
772
+ tabsList.add(tab, toIndex);
773
+ if (isSelected) select(tab);
774
+
775
+ $scope.$broadcast('$mdTabsChanged');
776
+ }
777
+
778
+ function select(tab, rightToLeft) {
779
+ if (!tab || tab.isSelected || tab.isDisabled()) return;
780
+ if (!tabsList.contains(tab)) return;
781
+
782
+ if (!angular.isDefined(rightToLeft)) {
783
+ rightToLeft = indexOf(tab) < $scope.selectedIndex;
784
+ }
785
+ deselect(getSelectedItem(), rightToLeft);
786
+
787
+ $scope.selectedIndex = indexOf(tab);
788
+ tab.isSelected = true;
789
+ tab.onSelect(rightToLeft);
790
+
791
+ $scope.$broadcast('$mdTabsChanged');
792
+ }
793
+
794
+ function focus(tab) {
795
+ // this variable is watched by pagination
796
+ self.tabToFocus = tab;
797
+ }
798
+
799
+ function deselect(tab, rightToLeft) {
800
+ if (!tab || !tab.isSelected) return;
801
+ if (!tabsList.contains(tab)) return;
802
+
803
+ $scope.selectedIndex = -1;
804
+ tab.isSelected = false;
805
+ tab.onDeselect(rightToLeft);
806
+ }
807
+
808
+ function next(tab, filterFn) {
809
+ return tabsList.next(tab || getSelectedItem(), filterFn || isTabEnabled);
810
+ }
811
+ function previous(tab, filterFn) {
812
+ return tabsList.previous(tab || getSelectedItem(), filterFn || isTabEnabled);
813
+ }
814
+
815
+ function isTabEnabled(tab) {
816
+ return tab && !tab.isDisabled();
817
+ }
818
+
819
+ }
820
+ MdTabsController.$inject = ["$scope", "$element", "$mdUtil", "$timeout"];
821
+ })();
822
+
823
+ (function() {
824
+ 'use strict';
825
+
826
+ angular.module('material.components.tabs')
827
+ .directive('mdTabs', TabsDirective);
828
+
829
+ /**
830
+ * @ngdoc directive
831
+ * @name mdTabs
832
+ * @module material.components.tabs
833
+ *
834
+ * @restrict E
835
+ *
836
+ * @description
837
+ * The `<md-tabs>` directive serves as the container for 1..n `<md-tab>` child directives to produces a Tabs components.
838
+ * In turn, the nested `<md-tab>` directive is used to specify a tab label for the **header button** and a [optional] tab view
839
+ * content that will be associated with each tab button.
840
+ *
841
+ * Below is the markup for its simplest usage:
842
+ *
843
+ * <hljs lang="html">
844
+ * <md-tabs>
845
+ * <md-tab label="Tab #1"></md-tab>
846
+ * <md-tab label="Tab #2"></md-tab>
847
+ * <md-tab label="Tab #3"></md-tab>
848
+ * <md-tabs>
849
+ * </hljs>
850
+ *
851
+ * Tabs supports three (3) usage scenarios:
852
+ *
853
+ * 1. Tabs (buttons only)
854
+ * 2. Tabs with internal view content
855
+ * 3. Tabs with external view content
856
+ *
857
+ * **Tab-only** support is useful when tab buttons are used for custom navigation regardless of any other components, content, or views.
858
+ * **Tabs with internal views** are the traditional usages where each tab has associated view content and the view switching is managed internally by the Tabs component.
859
+ * **Tabs with external view content** is often useful when content associated with each tab is independently managed and data-binding notifications announce tab selection changes.
860
+ *
861
+ * > As a performance bonus, if the tab content is managed internally then the non-active (non-visible) tab contents are temporarily disconnected from the `$scope.$digest()` processes; which restricts and optimizes DOM updates to only the currently active tab.
862
+ *
863
+ * Additional features also include:
864
+ *
865
+ * * Content can include any markup.
866
+ * * If a tab is disabled while active/selected, then the next tab will be auto-selected.
867
+ * * If the currently active tab is the last tab, then next() action will select the first tab.
868
+ * * Any markup (other than **`<md-tab>`** tags) will be transcluded into the tab header area BEFORE the tab buttons.
869
+ *
870
+ * ### Explanation of tab stretching
871
+ *
872
+ * Initially, tabs will have an inherent size. This size will either be defined by how much space is needed to accommodate their text or set by the user through CSS. Calculations will be based on this size.
873
+ *
874
+ * On mobile devices, tabs will be expanded to fill the available horizontal space. When this happens, all tabs will become the same size.
875
+ *
876
+ * On desktops, by default, stretching will never occur.
877
+ *
878
+ * This default behavior can be overridden through the `md-stretch-tabs` attribute. Here is a table showing when stretching will occur:
879
+ *
880
+ * `md-stretch-tabs` | mobile | desktop
881
+ * ------------------|-----------|--------
882
+ * `auto` | stretched | ---
883
+ * `always` | stretched | stretched
884
+ * `never` | --- | ---
885
+ *
886
+ * @param {integer=} md-selected Index of the active/selected tab
887
+ * @param {boolean=} md-no-ink If present, disables ink ripple effects.
888
+ * @param {boolean=} md-no-bar If present, disables the selection ink bar.
889
+ * @param {string=} md-align-tabs Attribute to indicate position of tab buttons: `bottom` or `top`; default is `top`
890
+ * @param {string=} md-stretch-tabs Attribute to indicate whether or not to stretch tabs: `auto`, `always`, or `never`; default is `auto`
891
+ *
892
+ * @usage
893
+ * <hljs lang="html">
894
+ * <md-tabs md-selected="selectedIndex" >
895
+ * <img ng-src="img/angular.png" class="centered">
896
+ *
897
+ * <md-tab
898
+ * ng-repeat="tab in tabs | orderBy:predicate:reversed"
899
+ * md-on-select="onTabSelected(tab)"
900
+ * md-on-deselect="announceDeselected(tab)"
901
+ * disabled="tab.disabled" >
902
+ *
903
+ * <md-tab-label>
904
+ * {{tab.title}}
905
+ * <img src="img/removeTab.png"
906
+ * ng-click="removeTab(tab)"
907
+ * class="delete" >
908
+ * </md-tab-label>
909
+ *
910
+ * {{tab.content}}
911
+ *
912
+ * </md-tab>
913
+ *
914
+ * </md-tabs>
915
+ * </hljs>
916
+ *
917
+ */
918
+ function TabsDirective($mdTheming) {
919
+ return {
920
+ restrict: 'E',
921
+ controller: '$mdTabs',
922
+ require: 'mdTabs',
923
+ transclude: true,
924
+ scope: {
925
+ selectedIndex: '=?mdSelected'
926
+ },
927
+ template:
928
+ '<section class="md-header" ' +
929
+ 'ng-class="{\'md-paginating\': pagination.active}">' +
930
+
931
+ '<button class="md-paginator md-prev" ' +
932
+ 'ng-if="pagination.active && pagination.hasPrev" ' +
933
+ 'ng-click="pagination.clickPrevious()" ' +
934
+ 'aria-hidden="true">' +
935
+ '</button>' +
936
+
937
+ // overflow: hidden container when paginating
938
+ '<div class="md-header-items-container" md-tabs-pagination>' +
939
+ // flex container for <md-tab> elements
940
+ '<div class="md-header-items">' +
941
+ '<md-tabs-ink-bar></md-tabs-ink-bar>' +
942
+ '</div>' +
943
+ '</div>' +
944
+
945
+ '<button class="md-paginator md-next" ' +
946
+ 'ng-if="pagination.active && pagination.hasNext" ' +
947
+ 'ng-click="pagination.clickNext()" ' +
948
+ 'aria-hidden="true">' +
949
+ '</button>' +
950
+
951
+ '</section>' +
952
+ '<section class="md-tabs-content"></section>',
953
+ link: postLink
954
+ };
955
+
956
+ function postLink(scope, element, attr, tabsCtrl, transclude) {
957
+
958
+ scope.stretchTabs = attr.hasOwnProperty('mdStretchTabs') ? attr.mdStretchTabs || 'always' : 'auto';
959
+
960
+ $mdTheming(element);
961
+ configureAria();
962
+ watchSelected();
963
+
964
+ transclude(scope.$parent, function(clone) {
965
+ angular.element(element[0].querySelector('.md-header-items')).append(clone);
966
+ });
967
+
968
+ function configureAria() {
969
+ element.attr('role', 'tablist');
970
+ }
971
+
972
+ function watchSelected() {
973
+ scope.$watch('selectedIndex', function watchSelectedIndex(newIndex, oldIndex) {
974
+ if (oldIndex == newIndex) return;
975
+ var rightToLeft = oldIndex > newIndex;
976
+ tabsCtrl.deselect(tabsCtrl.itemAt(oldIndex), rightToLeft);
977
+
978
+ if (tabsCtrl.inRange(newIndex)) {
979
+ var newTab = tabsCtrl.itemAt(newIndex);
980
+ while (newTab && newTab.isDisabled()) {
981
+ newTab = newIndex > oldIndex
982
+ ? tabsCtrl.next(newTab)
983
+ : tabsCtrl.previous(newTab);
984
+ }
985
+ tabsCtrl.select(newTab, rightToLeft);
986
+ }
987
+ });
988
+ }
989
+ }
990
+ }
991
+ TabsDirective.$inject = ["$mdTheming"];
992
+ })();