mno-enterprise-frontend 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (313) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +1 -0
  3. data/Rakefile +12 -0
  4. data/app/assets/images/favicon.ico +0 -0
  5. data/app/assets/images/mno_enterprise/impac/close-widget-pink.png +0 -0
  6. data/app/assets/images/mno_enterprise/impac/close-widget.png +0 -0
  7. data/app/assets/images/mno_enterprise/loader-32x32-bg-inverse.gif +0 -0
  8. data/app/assets/images/mno_enterprise/loader-32x32-bg-main.gif +0 -0
  9. data/app/assets/images/mno_enterprise/maestrano/logo-whitebg.png +0 -0
  10. data/app/assets/javascripts/mno_enterprise/angular/app.js.coffee.erb +173 -0
  11. data/app/assets/javascripts/mno_enterprise/angular/controllers/maestrano-controllers.js.coffee +4 -0
  12. data/app/assets/javascripts/mno_enterprise/angular/controllers/modals/modals-ctrl.js.coffee +62 -0
  13. data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-account.js.coffee +157 -0
  14. data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-app-deletion-request.js.coffee +62 -0
  15. data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-apps-list.js.coffee +127 -0
  16. data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-components.js.coffee +25 -0
  17. data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-marketplace-app.js.coffee +77 -0
  18. data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-marketplace.js.coffee +51 -0
  19. data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/dashboard-menu.js.coffee +174 -0
  20. data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/arrears.js.coffee +70 -0
  21. data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/billing.js.coffee +48 -0
  22. data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/credit-card.js.coffee +142 -0
  23. data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/index.js.coffee +61 -0
  24. data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/invoices.js.coffee +42 -0
  25. data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/members.js.coffee +280 -0
  26. data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/settings.js.coffee +91 -0
  27. data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/team-list.js.coffee +179 -0
  28. data/app/assets/javascripts/mno_enterprise/angular/directives/dashboard/organization/teams.js.coffee +268 -0
  29. data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/file-model.js.coffee +33 -0
  30. data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/maestrano-components.js.coffee +22 -0
  31. data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-autostop-app.js.coffee +123 -0
  32. data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-compile.js.coffee +18 -0
  33. data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-currency-widget.js.coffee +43 -0
  34. data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-current-currency.js.coffee +22 -0
  35. data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-editable.js.coffee +68 -0
  36. data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-flash-msg.js.coffee +40 -0
  37. data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-helptext.js.coffee +38 -0
  38. data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-loading-lounge.js.coffee +184 -0
  39. data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-match.js.coffee +14 -0
  40. data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-message-modal.js.coffee +56 -0
  41. data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-notification-widget.js.coffee +192 -0
  42. data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-partner-code-popup.js.coffee +74 -0
  43. data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-partner-contact.js.coffee +59 -0
  44. data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-password-strength.js.coffee +154 -0
  45. data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-password.js.coffee +40 -0
  46. data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-price-converter.js.coffee +49 -0
  47. data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-scroll-to.js.coffee +14 -0
  48. data/app/assets/javascripts/mno_enterprise/angular/directives/maestrano-components/mno-typeahead.js.coffee +89 -0
  49. data/app/assets/javascripts/mno_enterprise/angular/directives/user-setup/components.js.coffee +7 -0
  50. data/app/assets/javascripts/mno_enterprise/angular/directives/user-setup/index.js.coffee +256 -0
  51. data/app/assets/javascripts/mno_enterprise/angular/filters/maestrano-app-by-category.js.coffee +5 -0
  52. data/app/assets/javascripts/mno_enterprise/angular/filters/maestrano-currency.js.coffee +30 -0
  53. data/app/assets/javascripts/mno_enterprise/angular/filters/maestrano-filters.js.coffee +7 -0
  54. data/app/assets/javascripts/mno_enterprise/angular/filters/maestrano-replace-underscore-with-space.js.coffee +4 -0
  55. data/app/assets/javascripts/mno_enterprise/angular/filters/maestrano-titleize.js.coffee +7 -0
  56. data/app/assets/javascripts/mno_enterprise/angular/filters/maestrano-truncate.js.coffee +24 -0
  57. data/app/assets/javascripts/mno_enterprise/angular/services/dashboard/maestrano-app-instance.js.coffee +15 -0
  58. data/app/assets/javascripts/mno_enterprise/angular/services/dashboard/maestrano-apps-document.js.coffee +83 -0
  59. data/app/assets/javascripts/mno_enterprise/angular/services/dashboard/maestrano-user.js.coffee +27 -0
  60. data/app/assets/javascripts/mno_enterprise/angular/services/dashboard/organization-svc.js.coffee +318 -0
  61. data/app/assets/javascripts/mno_enterprise/angular/services/dashboard/team-svc.js.coffee +180 -0
  62. data/app/assets/javascripts/mno_enterprise/angular/services/dashboard/tickets-svc.js.coffee +109 -0
  63. data/app/assets/javascripts/mno_enterprise/angular/services/impac-config.svc.js.coffee +35 -0
  64. data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-apps-list-helper.js.coffee +337 -0
  65. data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-assets.js.coffee.erb +21 -0
  66. data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-current-currency.js.coffee +7 -0
  67. data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-current-user-svc.js.coffee +99 -0
  68. data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-exchange-rates.js.coffee +102 -0
  69. data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-message-svc.js.coffee +71 -0
  70. data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-miscellaneous.js.coffee.erb +46 -0
  71. data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-modal.js.coffee +67 -0
  72. data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-msg-bus.js.coffee +50 -0
  73. data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-services.js.coffee +21 -0
  74. data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-shopping-cart.js.coffee +361 -0
  75. data/app/assets/javascripts/mno_enterprise/angular/services/maestrano-utilities.js.coffee +61 -0
  76. data/app/assets/javascripts/mno_enterprise/angular/services/marketplace-svc.js.coffee +59 -0
  77. data/app/assets/javascripts/mno_enterprise/application.js +17 -0
  78. data/app/assets/javascripts/mno_enterprise/application_lib.js +14 -0
  79. data/app/assets/javascripts/mno_enterprise/lib/angular-really-click.js +17 -0
  80. data/app/assets/javascripts/mno_enterprise/lib/sortable.js +315 -0
  81. data/app/assets/javascripts/mno_enterprise/lib/ui-bootstrap-tpls-0.13.4.js +5836 -0
  82. data/app/assets/javascripts/mno_enterprise/lib/xeditable.js +1588 -0
  83. data/app/assets/javascripts/mno_enterprise/twitter/bootstrap.js +12 -0
  84. data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/affix.js +162 -0
  85. data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/alert.js +94 -0
  86. data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/button.js +116 -0
  87. data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/carousel.js +237 -0
  88. data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/collapse.js +211 -0
  89. data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/dropdown.js +161 -0
  90. data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/modal.js +324 -0
  91. data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/popover.js +113 -0
  92. data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/scrollspy.js +175 -0
  93. data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/tab.js +153 -0
  94. data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/tooltip.js +472 -0
  95. data/app/assets/javascripts/mno_enterprise/twitter/bootstrap/transition.js +59 -0
  96. data/app/assets/javascripts/ng-performance/ngPerformance.html +109 -0
  97. data/app/assets/javascripts/ng-performance/ngPerformance.js +211 -0
  98. data/app/assets/stylesheets/mno_enterprise/application.css +13 -0
  99. data/app/assets/stylesheets/mno_enterprise/custom/accordion.less +90 -0
  100. data/app/assets/stylesheets/mno_enterprise/custom/alert.less +30 -0
  101. data/app/assets/stylesheets/mno_enterprise/custom/angular-animate.less +42 -0
  102. data/app/assets/stylesheets/mno_enterprise/custom/angular-material.less +56 -0
  103. data/app/assets/stylesheets/mno_enterprise/custom/bootstrap-on-juice.less +22 -0
  104. data/app/assets/stylesheets/mno_enterprise/custom/button.less +84 -0
  105. data/app/assets/stylesheets/mno_enterprise/custom/footer.less +44 -0
  106. data/app/assets/stylesheets/mno_enterprise/custom/form.less +191 -0
  107. data/app/assets/stylesheets/mno_enterprise/custom/header.less +281 -0
  108. data/app/assets/stylesheets/mno_enterprise/custom/impac-variables-override.less +65 -0
  109. data/app/assets/stylesheets/mno_enterprise/custom/modal.less +183 -0
  110. data/app/assets/stylesheets/mno_enterprise/custom/utilities.less +729 -0
  111. data/app/assets/stylesheets/mno_enterprise/custom/utility/app-presentation.less +77 -0
  112. data/app/assets/stylesheets/mno_enterprise/custom/utility/banners.less +145 -0
  113. data/app/assets/stylesheets/mno_enterprise/custom/utility/carousel.less +68 -0
  114. data/app/assets/stylesheets/mno_enterprise/custom/utility/helptext.less +40 -0
  115. data/app/assets/stylesheets/mno_enterprise/custom/utility/miscellaneous.less +134 -0
  116. data/app/assets/stylesheets/mno_enterprise/custom/utility/progress-bar.less +55 -0
  117. data/app/assets/stylesheets/mno_enterprise/custom/utility/step.less +101 -0
  118. data/app/assets/stylesheets/mno_enterprise/custom/utility/tabset.less +87 -0
  119. data/app/assets/stylesheets/mno_enterprise/custom/utility/testimonial.less +118 -0
  120. data/app/assets/stylesheets/mno_enterprise/custom/utility/text.less +23 -0
  121. data/app/assets/stylesheets/mno_enterprise/custom/views/apps.less +243 -0
  122. data/app/assets/stylesheets/mno_enterprise/custom/views/myspace.less +477 -0
  123. data/app/assets/stylesheets/mno_enterprise/custom/views/pages/confirmation_lounge.less +31 -0
  124. data/app/assets/stylesheets/mno_enterprise/custom/views/pages/home.less +57 -0
  125. data/app/assets/stylesheets/mno_enterprise/custom/views/pages/oauth-config-page.less +6 -0
  126. data/app/assets/stylesheets/mno_enterprise/custom/views/registration.less +84 -0
  127. data/app/assets/stylesheets/mno_enterprise/custom/views/star.less +18 -0
  128. data/app/assets/stylesheets/mno_enterprise/custom/views/templates/dashboard/bootstrap-wizard.less +63 -0
  129. data/app/assets/stylesheets/mno_enterprise/custom/views/templates/dashboard/dashboard-marketplace.less +187 -0
  130. data/app/assets/stylesheets/mno_enterprise/custom/views/templates/dashboard/dashboard-organization.less +149 -0
  131. data/app/assets/stylesheets/mno_enterprise/custom/views/templates/dashboard/dashboard-teams.less +119 -0
  132. data/app/assets/stylesheets/mno_enterprise/custom/views/templates/dashboard/support.less +42 -0
  133. data/app/assets/stylesheets/mno_enterprise/custom/views/templates/dashboard/tickets.less +80 -0
  134. data/app/assets/stylesheets/mno_enterprise/custom/views/templates/mno-editable.less +60 -0
  135. data/app/assets/stylesheets/mno_enterprise/custom/views/templates/notification-widget.less +49 -0
  136. data/app/assets/stylesheets/mno_enterprise/custom/views/templates/password-strength.less +28 -0
  137. data/app/assets/stylesheets/mno_enterprise/custom/views/templates/shopping-cart.less +333 -0
  138. data/app/assets/stylesheets/mno_enterprise/custom/views/templates/star-wizard.less +49 -0
  139. data/app/assets/stylesheets/mno_enterprise/custom/views/user-setup.less +10 -0
  140. data/app/assets/stylesheets/mno_enterprise/custom/xeditable.less +40 -0
  141. data/app/assets/stylesheets/mno_enterprise/font-awesome/font-awesome-regular.less +13 -0
  142. data/app/assets/stylesheets/mno_enterprise/font-awesome/font-awesome-sprockets.less +13 -0
  143. data/app/assets/stylesheets/mno_enterprise/font-awesome/font-awesome.less +16 -0
  144. data/app/assets/stylesheets/mno_enterprise/font-awesome/fonts/FontAwesome.otf +0 -0
  145. data/app/assets/stylesheets/mno_enterprise/font-awesome/fonts/fontawesome-webfont.eot +0 -0
  146. data/app/assets/stylesheets/mno_enterprise/font-awesome/fonts/fontawesome-webfont.svg +640 -0
  147. data/app/assets/stylesheets/mno_enterprise/font-awesome/fonts/fontawesome-webfont.ttf +0 -0
  148. data/app/assets/stylesheets/mno_enterprise/font-awesome/fonts/fontawesome-webfont.woff +0 -0
  149. data/app/assets/stylesheets/mno_enterprise/font-awesome/fonts/fontawesome-webfont.woff2 +0 -0
  150. data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/animated.less +34 -0
  151. data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/bordered-pulled.less +25 -0
  152. data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/core.less +12 -0
  153. data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/extras.less +2 -0
  154. data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/fixed-width.less +6 -0
  155. data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/icons.less +677 -0
  156. data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/larger.less +13 -0
  157. data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/list.less +19 -0
  158. data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/mixins.less +26 -0
  159. data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/rotated-flipped.less +20 -0
  160. data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/stacked.less +20 -0
  161. data/app/assets/stylesheets/mno_enterprise/font-awesome/framework/variables.less +687 -0
  162. data/app/assets/stylesheets/mno_enterprise/main.less +132 -0
  163. data/app/assets/stylesheets/mno_enterprise/mixins.less +75 -0
  164. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/alerts.less +73 -0
  165. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/badges.less +65 -0
  166. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/bootstrap.less +50 -0
  167. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/breadcrumbs.less +26 -0
  168. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/button-groups.less +243 -0
  169. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/buttons.less +160 -0
  170. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/carousel.less +269 -0
  171. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/close.less +34 -0
  172. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/code.less +69 -0
  173. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/component-animations.less +34 -0
  174. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/dropdowns.less +214 -0
  175. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/forms.less +566 -0
  176. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/glyphicons.less +301 -0
  177. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/grid.less +84 -0
  178. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/input-groups.less +166 -0
  179. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/jumbotron.less +50 -0
  180. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/labels.less +64 -0
  181. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/list-group.less +124 -0
  182. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/media.less +61 -0
  183. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins.less +39 -0
  184. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/alerts.less +14 -0
  185. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/background-variant.less +8 -0
  186. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/border-radius.less +18 -0
  187. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/buttons.less +52 -0
  188. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/center-block.less +7 -0
  189. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/clearfix.less +22 -0
  190. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/forms.less +85 -0
  191. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/gradients.less +59 -0
  192. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/grid-framework.less +91 -0
  193. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/grid.less +122 -0
  194. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/hide-text.less +21 -0
  195. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/image.less +33 -0
  196. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/labels.less +12 -0
  197. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/list-group.less +29 -0
  198. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/nav-divider.less +10 -0
  199. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/nav-vertical-align.less +9 -0
  200. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/opacity.less +8 -0
  201. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/pagination.less +23 -0
  202. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/panels.less +24 -0
  203. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/progress-bar.less +10 -0
  204. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/reset-filter.less +8 -0
  205. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/resize.less +6 -0
  206. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/responsive-visibility.less +15 -0
  207. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/size.less +10 -0
  208. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/tab-focus.less +9 -0
  209. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/table-row.less +28 -0
  210. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/text-emphasis.less +8 -0
  211. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/text-overflow.less +8 -0
  212. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/mixins/vendor-prefixes.less +227 -0
  213. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/modals.less +148 -0
  214. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/navbar.less +661 -0
  215. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/navs.less +244 -0
  216. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/normalize.less +427 -0
  217. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/pager.less +54 -0
  218. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/pagination.less +88 -0
  219. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/panels.less +265 -0
  220. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/popovers.less +135 -0
  221. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/print.less +107 -0
  222. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/progress-bars.less +87 -0
  223. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/responsive-embed.less +35 -0
  224. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/responsive-utilities.less +194 -0
  225. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/scaffolding.less +150 -0
  226. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/tables.less +234 -0
  227. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/theme.less +273 -0
  228. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/thumbnails.less +36 -0
  229. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/tooltip.less +103 -0
  230. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/type.less +302 -0
  231. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/utilities.less +56 -0
  232. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/variables.less +857 -0
  233. data/app/assets/stylesheets/mno_enterprise/twitter-bootstrap/wells.less +29 -0
  234. data/app/assets/stylesheets/mno_enterprise/variables.less +226 -0
  235. data/app/assets/templates/mno_enterprise/dashboard/account.html +131 -0
  236. data/app/assets/templates/mno_enterprise/dashboard/app_deletion.html +36 -0
  237. data/app/assets/templates/mno_enterprise/dashboard/apps_list.html +103 -0
  238. data/app/assets/templates/mno_enterprise/dashboard/horizontal_menu.html +85 -0
  239. data/app/assets/templates/mno_enterprise/dashboard/marketplace/index.html +60 -0
  240. data/app/assets/templates/mno_enterprise/dashboard/marketplace/show.html +133 -0
  241. data/app/assets/templates/mno_enterprise/dashboard/menu.html +161 -0
  242. data/app/assets/templates/mno_enterprise/dashboard/organization/arrears.html +37 -0
  243. data/app/assets/templates/mno_enterprise/dashboard/organization/billing.html +37 -0
  244. data/app/assets/templates/mno_enterprise/dashboard/organization/credit-card.html +156 -0
  245. data/app/assets/templates/mno_enterprise/dashboard/organization/index.full.html +181 -0
  246. data/app/assets/templates/mno_enterprise/dashboard/organization/index.html +173 -0
  247. data/app/assets/templates/mno_enterprise/dashboard/organization/invoices.html +27 -0
  248. data/app/assets/templates/mno_enterprise/dashboard/organization/members.html +288 -0
  249. data/app/assets/templates/mno_enterprise/dashboard/organization/settings.html +55 -0
  250. data/app/assets/templates/mno_enterprise/dashboard/teams/index.html +175 -0
  251. data/app/assets/templates/mno_enterprise/dashboard/teams/member-add-modal.html +60 -0
  252. data/app/assets/templates/mno_enterprise/dashboard/teams/member-removal-modal.html +35 -0
  253. data/app/assets/templates/mno_enterprise/dashboard/teams/team-add-modal.html +35 -0
  254. data/app/assets/templates/mno_enterprise/dashboard/teams/team-delete-modal.html +35 -0
  255. data/app/assets/templates/mno_enterprise/dashboard/teams/team-list.html +107 -0
  256. data/app/assets/templates/mno_enterprise/default_template.html +20 -0
  257. data/app/assets/templates/mno_enterprise/maestrano-components/autostop_app.html +42 -0
  258. data/app/assets/templates/mno_enterprise/maestrano-components/currency_widget.html +1 -0
  259. data/app/assets/templates/mno_enterprise/maestrano-components/editable.html +28 -0
  260. data/app/assets/templates/mno_enterprise/maestrano-components/loading_lounge.html +63 -0
  261. data/app/assets/templates/mno_enterprise/maestrano-components/modal-messages/congratulations.html +8 -0
  262. data/app/assets/templates/mno_enterprise/maestrano-components/modal-messages/default.html +1 -0
  263. data/app/assets/templates/mno_enterprise/maestrano-components/modal-messages/information.html +8 -0
  264. data/app/assets/templates/mno_enterprise/maestrano-components/notification-widget.html +31 -0
  265. data/app/assets/templates/mno_enterprise/maestrano-components/password.html +55 -0
  266. data/app/assets/templates/mno_enterprise/maestrano-components/star_wizard.html +254 -0
  267. data/app/assets/templates/mno_enterprise/maestrano-components/upload_spreadsheet.html +191 -0
  268. data/app/assets/templates/mno_enterprise/modals/new-organization-reseller-req.html +35 -0
  269. data/app/assets/templates/mno_enterprise/modals/new-organization.html +35 -0
  270. data/app/assets/templates/mno_enterprise/user-setup/index.html +312 -0
  271. data/app/controllers/mno_enterprise/invoices_controller.rb +22 -0
  272. data/app/controllers/mno_enterprise/pages_controller.rb +9 -0
  273. data/app/controllers/mno_enterprise/user_setup_controller.rb +11 -0
  274. data/app/views/layouts/mno_enterprise/_application_js.html.haml +17 -0
  275. data/app/views/layouts/mno_enterprise/_common_cdn_lib_js.html.haml +19 -0
  276. data/app/views/layouts/mno_enterprise/_footer_files.html.haml +5 -0
  277. data/app/views/layouts/mno_enterprise/_header_files.html.haml +31 -0
  278. data/app/views/layouts/mno_enterprise/_impersonate_header.html.haml +7 -0
  279. data/app/views/layouts/mno_enterprise/_public_page_header.html.haml +2 -0
  280. data/app/views/layouts/mno_enterprise/application.html.haml +18 -0
  281. data/app/views/layouts/mno_enterprise/application_dashboard.html.haml +22 -0
  282. data/app/views/layouts/mno_enterprise/third_party/_google_tag_container.html.haml +10 -0
  283. data/app/views/mno_enterprise/pages/app_access_unauthorized.html.haml +19 -0
  284. data/app/views/mno_enterprise/pages/app_logout.html.haml +18 -0
  285. data/app/views/mno_enterprise/pages/billing_details_required.html.haml +19 -0
  286. data/app/views/mno_enterprise/pages/loading.html.haml +3 -0
  287. data/app/views/mno_enterprise/pages/myspace.html.haml +6 -0
  288. data/app/views/mno_enterprise/provision/_provision_apps.html.haml +43 -0
  289. data/app/views/mno_enterprise/provision/_select_organization.html.haml +17 -0
  290. data/app/views/mno_enterprise/provision/new.html.haml +4 -0
  291. data/app/views/mno_enterprise/user_setup/index.html.haml +2 -0
  292. data/config/initializers/ng-annotate.rb +3 -0
  293. data/config/initializers/ng-performance.rb +3 -0
  294. data/config/routes.rb +19 -0
  295. data/lib/assets/javascripts/impac-angular.js +8719 -0
  296. data/lib/assets/stylesheets/impac-angular.less +2352 -0
  297. data/lib/mno-enterprise-frontend.rb +1 -0
  298. data/lib/mno_enterprise/frontend.rb +13 -0
  299. data/lib/mno_enterprise/frontend/assets_util.rb +47 -0
  300. data/lib/mno_enterprise/frontend/concerns/README.md +6 -0
  301. data/lib/mno_enterprise/frontend/concerns/controllers/pages_controller.rb +25 -0
  302. data/lib/mno_enterprise/frontend/engine.rb +13 -0
  303. data/spec/controllers/mno_enterprise/auth/confirmations_controller_spec.rb +84 -0
  304. data/spec/controllers/mno_enterprise/invoices_controller_spec.rb +34 -0
  305. data/spec/controllers/mno_enterprise/pages_controller_spec.rb +42 -0
  306. data/spec/controllers/mno_enterprise/user_setup_controller_spec.rb +33 -0
  307. data/spec/controllers/mno_enterprise/webhook/o_auth_controller_spec.rb +76 -0
  308. data/spec/rails_helper.rb +92 -0
  309. data/spec/routing/mno_enterprise/invoices_controller_routing_spec.rb +11 -0
  310. data/spec/routing/mno_enterprise/pages_controller_routing_spec.rb +18 -0
  311. data/spec/routing/mno_enterprise/user_setup_controller_routing_spec.rb +11 -0
  312. data/spec/spec_helper.rb +78 -0
  313. metadata +464 -0
@@ -0,0 +1,14 @@
1
+ module = angular.module('maestrano.components.mno-match',[])
2
+
3
+ module.directive("mnoMatch", ['$parse', ($parse) ->
4
+ return {
5
+ require: "ngModel",
6
+ link: (scope, elem, attrs, ctrl) ->
7
+ scope.$watch(
8
+ () ->
9
+ return $parse(attrs.mnoMatch)(scope) == ctrl.$modelValue
10
+ , (currentValue) ->
11
+ ctrl.$setValidity('mismatch', currentValue)
12
+ )
13
+ }
14
+ ])
@@ -0,0 +1,56 @@
1
+ module = angular.module('maestrano.components.mno-message-modal',['maestrano.assets'])
2
+
3
+ #============================================
4
+ #
5
+ #============================================
6
+ module.controller('MnoMessageModalCtrl',[
7
+ '$scope','$modal','MessageSvc','$location','TemplatePath','AssetPath',
8
+ ($scope, $modal, MessageSvc, $location, TemplatePath, AssetPath) ->
9
+ $scope.assetPath = AssetPath
10
+
11
+ $scope.modal = {}
12
+ message = null
13
+
14
+ $scope.modal.title = ->
15
+ return message.title || "Congratulations!"
16
+
17
+ $scope.modal.body = ->
18
+ return message.body
19
+
20
+ $scope.templateUrl = ->
21
+ return message.templateUrl
22
+
23
+ $scope.modal.open = ->
24
+ $scope.modal.$instance = $modal.open(templateUrl:'internal-message-modal.html',scope:$scope, size:'lg')
25
+ $scope.modal.$instance.result.finally ->
26
+ $scope.modal.$instance = null
27
+ MessageSvc.next()
28
+
29
+
30
+ $scope.modal.close = ->
31
+ $scope.modal.$instance.close()
32
+
33
+ $scope.modal.goBackToDashboard = ->
34
+ $scope.modal.close()
35
+ $location.path("/")
36
+
37
+
38
+ $scope.$watch(( -> MessageSvc.count),
39
+ () ->
40
+ if MessageSvc.count > 0
41
+ message = MessageSvc.pullMessage()
42
+ $scope.modal.open()
43
+ )
44
+
45
+
46
+ ])
47
+
48
+ module.directive('mnoMessageModal', ['TemplatePath', (TemplatePath) ->
49
+ return {
50
+ restrict: 'A',
51
+ scope: {
52
+ },
53
+ templateUrl: TemplatePath['mno_enterprise/default_template.html'],
54
+ controller: 'MnoMessageModalCtrl'
55
+ }
56
+ ])
@@ -0,0 +1,192 @@
1
+ module = angular.module('maestrano.components.mno-notification-widget',['maestrano.assets'])
2
+
3
+ #============================================
4
+ # Component 'Notification Widget'
5
+ #============================================
6
+ # Messages sent to the notificationQueue will be
7
+ # displayed on screen
8
+ # ---
9
+ # A message can be a string or a js object
10
+ # If string (can be html) then it will be displayed as 'info'
11
+ # If object then the expect format is:
12
+ # {
13
+ # type: 'success'/'info'/'warning'/'danger' (default: 'info')
14
+ # msg: a string object (can be html)
15
+ # timeout: a number of milliseconds after which the msg will
16
+ # be discarded (default: 10 minutes). Use -1 for never.
17
+ # popup: false/(true | object), display a popup in addition (default: false)
18
+ # If object then the structure should be:
19
+ # {
20
+ # title: Popup title (default: '')
21
+ # content: Popup content (default to msg attribute above)
22
+ # dismissText: Dismiss button text
23
+ # }
24
+ # }
25
+ #
26
+ module.controller('MnoNotificationWidgetCtrl',[
27
+ '$scope', '$rootScope', 'Utilities', 'MsgBus', '$timeout', '$window','$modal', '$sce',
28
+ ($scope, $rootScope, Utilities, MsgBus, $timeout, $window, $modal, $sce) ->
29
+ $scope.assetPath = $rootScope.assetPath
30
+ $scope.windowHeight = $window.innerHeight
31
+
32
+ #===================================
33
+ # Load Scope
34
+ #===================================
35
+ $scope.notifWidget = notifWidget = {}
36
+ $scope.notifPopup = notifPopup = {}
37
+
38
+ # These are the messages received via the bus
39
+ # Note the return value is a *function*
40
+ notifWidget.inboundQueue = MsgBus.subscribe('notificationQueue')
41
+
42
+ # These are the messages currently displayed
43
+ notifWidget.outboundQueue = []
44
+
45
+ # These are messages in the popupQueue
46
+ notifWidget.popupQueue = []
47
+
48
+ #===================================
49
+ # notifWidget methods
50
+ #===================================
51
+ notifWidget.jqAlertElem = (msgIndex) ->
52
+ $(".notification-widget #notification#{msgIndex}")
53
+
54
+ notifWidget.classFor = (messageObject) ->
55
+ return "alert alert-#{messageObject.type}"
56
+
57
+ notifWidget.pushMsg = (messageObject) ->
58
+ self = this
59
+ if angular.isObject(messageObject) || (angular.isString(messageObject) && messageObject != '')
60
+ if angular.isObject(messageObject)
61
+ if messageObject.msg && messageObject.msg != ''
62
+ realMsgObj = {
63
+ type: (messageObject.type || 'info'),
64
+ msg: $sce.trustAsHtml(messageObject.msg),
65
+ timeout: (messageObject.timeout || 10*60*1000),
66
+ popup: (messageObject.popup || false)
67
+ }
68
+ else if angular.isString(messageObject)
69
+ realMsgObj = {
70
+ type: 'info',
71
+ msg: $sce.trustAsHtml(messageObject),
72
+ timeout: 10*60*1000,
73
+ popup: false
74
+ }
75
+
76
+ # Push message
77
+ if realMsgObj
78
+ # Push to outbound queue
79
+ msgIndex = self.outboundQueue.push(realMsgObj) - 1
80
+
81
+ # Push to popupQueue if popup requested
82
+ if realMsgObj.popup
83
+ self.popupQueue.push(realMsgObj)
84
+
85
+ # Animate
86
+ # Need to wait for ng-repeat to take the new element
87
+ # into account
88
+ $timeout(
89
+ () ->
90
+ self.jqAlertElem(msgIndex).animate({'right': '0px'},500)
91
+ ,400
92
+ )
93
+
94
+ # Configure auto discard
95
+ if angular.isNumber(realMsgObj.timeout) && realMsgObj.timeout > 0
96
+ $timeout(
97
+ () ->
98
+ self.closeMsg(realMsgObj)
99
+ ,realMsgObj.timeout
100
+ )
101
+
102
+
103
+ notifWidget.closeMsg = (messageObject) ->
104
+ self = this
105
+ msgIndex = self.outboundQueue.indexOf(messageObject)
106
+ if msgIndex >= 0
107
+ self.jqAlertElem(msgIndex).animate(
108
+ { 'right': '-300px'}
109
+ , 500
110
+ ,() ->
111
+ self.outboundQueue.splice(msgIndex,1)
112
+ $scope.$apply()
113
+ )
114
+ return true
115
+
116
+ #===================================
117
+ # notifPopup methods
118
+ #===================================
119
+ notifPopup.open = () ->
120
+ self = this
121
+ self.$instance = $modal.open(templateUrl: 'internal-notif-popup-modal.html', scope: $scope)
122
+ self.isOpen = true
123
+ self.msgObject = notifWidget.popupQueue[0]
124
+ self.model = {}
125
+
126
+ # Build model
127
+ if angular.isObject(self.msgObject.popup)
128
+ self.model.title = (self.msgObject.popup.title || 'Notification')
129
+ self.model.content = (self.msgObject.popup.content || self.msgObject.msg)
130
+ self.model.dismissText = (self.msgObject.popup.dismissText || 'Dismiss')
131
+ else
132
+ self.model.title = 'Notification'
133
+ self.model.content = self.msgObject.msg
134
+ self.model.dismissText = 'Dismiss'
135
+
136
+ notifPopup.close = () ->
137
+ self = this
138
+ self.$instance.close()
139
+ self.isOpen = false
140
+ self.msgObject = undefined
141
+ self.model = {}
142
+ notifWidget.popupQueue.shift()
143
+
144
+ #===================================
145
+ # Pop items from the inboundQueue
146
+ # and push them to the outbound one
147
+ # ---
148
+ # Wait 1.5 seconds before displaying
149
+ # messages so that page gets properly
150
+ # loaded
151
+ #===================================
152
+ # Process the initial messages
153
+ if angular.isArray($scope.mnoNotificationWidget()) && $scope.mnoNotificationWidget().length > 0
154
+ _.each($scope.mnoNotificationWidget(),
155
+ (msgObject) ->
156
+ notifWidget.pushMsg(msgObject)
157
+ )
158
+
159
+ $timeout(() ->
160
+ # Watch the inboundQueue
161
+ $scope.$watch(
162
+ () ->
163
+ if notifWidget.inboundQueue().length > 0
164
+ notifWidget.pushMsg(notifWidget.inboundQueue().shift())
165
+ ,(->)
166
+ )
167
+
168
+ ,1500
169
+ )
170
+
171
+ #===================================
172
+ # Watch the popupQueue and open modals
173
+ # successively until empty
174
+ #===================================
175
+ $scope.$watch(
176
+ () ->
177
+ if !notifPopup.isOpen && notifWidget.popupQueue.length > 0
178
+ notifPopup.open()
179
+ ,(->))
180
+ ])
181
+
182
+ module.directive('mnoNotificationWidget', ['TemplatePath', (TemplatePath) ->
183
+ return {
184
+ restrict: 'A',
185
+ scope: {
186
+ mnoNotificationWidget: '&',
187
+ userLoggedIn: '&'
188
+ },
189
+ templateUrl: TemplatePath['mno_enterprise/maestrano-components/notification-widget.html'],
190
+ controller: 'MnoNotificationWidgetCtrl',
191
+ }
192
+ ])
@@ -0,0 +1,74 @@
1
+ module = angular.module('maestrano.components.mno-partner-code-popup',['maestrano.assets'])
2
+
3
+ #============================================
4
+ # Component 'Select App'
5
+ #============================================
6
+ module.controller('MnoPartnerCodePopupCtrl',[
7
+ '$scope', '$rootScope', '$window', 'Utilities', '$modal','DashboardUser','CurrentUserSvc',
8
+ ($scope, $rootScope, $window, Utilities, $modal, DashboardUser, CurrentUserSvc) ->
9
+ $scope.assetPath = $rootScope.assetPath
10
+
11
+ #===================================
12
+ # Load Scope
13
+ #===================================
14
+ $scope.partnerCodeModal = partnerCodeModal= {}
15
+
16
+
17
+ #===================================
18
+ # partnerCodeModal
19
+ #===================================
20
+ # Open the partnerCodeModal and reset the proceed action
21
+ partnerCodeModal.open = () ->
22
+ self = partnerCodeModal
23
+ self.$instance = $modal.open(templateUrl: 'internal-partner-code-popup.html', scope: $scope)
24
+ self.isSaveInProgress = false
25
+ self.model = {}
26
+ self.errors = null
27
+ self.$instance.result.finally ->
28
+ self.$instance = null
29
+
30
+ partnerCodeModal.proceedEnabled = () ->
31
+ self = partnerCodeModal
32
+ return self.model.resellerCode && !self.model.resellerCode.match(/\s+/)
33
+
34
+ # Close the transferModal and reset its values
35
+ partnerCodeModal.close = () ->
36
+ self = partnerCodeModal
37
+ self.$instance.close()
38
+ self.$instance = null
39
+
40
+
41
+ partnerCodeModal.proceed = () ->
42
+ self = partnerCodeModal
43
+ self.isSaveInProgress = true
44
+ # TODO: we should create a custom action for that that would check
45
+ # if the reseller exists before updating the reseller code
46
+ DashboardUser.update({reseller_code:self.model.resellerCode}).then(
47
+ (success) ->
48
+ self.isSaveInProgress = false
49
+ self.close()
50
+ ,(error) ->
51
+ self.errors = Utilities.processRailsError(error)
52
+ self.isSaveInProgress = false
53
+ )
54
+
55
+
56
+ #===================================
57
+ # Init Code
58
+ #===================================
59
+ # Listener for the modal opening
60
+ CurrentUserSvc.loadDocument().then (data) ->
61
+ resellerCode = CurrentUserSvc.document.current_user.reseller_code
62
+ if (!resellerCode || resellerCode == '')
63
+ partnerCodeModal.open()
64
+ ])
65
+
66
+ module.directive('mnoPartnerCodePopup', ['TemplatePath', (TemplatePath) ->
67
+ return {
68
+ restrict: 'A',
69
+ scope: {
70
+ },
71
+ templateUrl: TemplatePath['mno_enterprise/maestrano-components/partner_code_popup.html'],
72
+ controller: 'MnoPartnerCodePopupCtrl'
73
+ }
74
+ ])
@@ -0,0 +1,59 @@
1
+ module = angular.module('maestrano.components.mno-partner-contact',['maestrano.assets'])
2
+
3
+ #============================================
4
+ # Component 'partner contact'
5
+ #============================================
6
+ module.controller('MnoPartnerContactCtrl',[
7
+ '$scope', '$rootScope', '$http','$modal',
8
+ ($scope, $rootScope, $http, $modal) ->
9
+ $scope.assetPath = $rootScope.assetPath
10
+
11
+ $scope.templateParameter = {}
12
+ $scope.templateParameter.modalOpen = false
13
+ $scope.templateParameter.feedbackMessage = ""
14
+ $scope.templateParameter.errorMessage = ""
15
+
16
+ $scope.openCloseModal = ->
17
+ if $scope.templateParameter.modalOpen
18
+ $scope.templateParameterInstance.close()
19
+ $scope.templateParameter.modalOpen = false
20
+ else
21
+ $scope.templateParameterInstance = $modal.open(templateUrl: 'internal-template-param-modal.html', scope: $scope)
22
+ $scope.templateParameter.modalOpen = true
23
+
24
+ $scope.form = {}
25
+
26
+ $scope.sendRequest = ->
27
+ $scope.form.partner_id = $scope.partnerId
28
+ $scope.form.inProgress = true
29
+ $http.post('/mnoe/jpi/v1/partners/contact', { form: $scope.form }).then(
30
+ (success) ->
31
+ $scope.form.inProgress = false
32
+ $scope.form.first_name = ""
33
+ $scope.form.last_name = ""
34
+ $scope.form.email = ""
35
+ $scope.form.message = ""
36
+ $scope.templateParameter.feedbackMessage = "Your message has been successfully sent"
37
+ ,(errors) ->
38
+ $scope.templateParameter.errorMessage = "Your message couldn't be sent. Please try again later."
39
+
40
+ )
41
+
42
+
43
+ $scope.openCloseModalFun = $scope.openCloseModal
44
+
45
+ ])
46
+
47
+ module.directive('mnoPartnerContact', ['TemplatePath', (TemplatePath) ->
48
+ return {
49
+ restrict: 'A',
50
+ scope: {
51
+ openCloseModalFun: '=',
52
+ partnerName: '@',
53
+ partnerId: '@',
54
+ },
55
+ templateUrl: TemplatePath['mno_enterprise/maestrano-components/partner_contact.html'],
56
+ controller: 'MnoPartnerContactCtrl',
57
+ }
58
+ ])
59
+
@@ -0,0 +1,154 @@
1
+ "use strict"
2
+
3
+ angular.module("maestrano.components.mno-password-strength", [
4
+ ]).directive "mnoPasswordStrength", ->
5
+ require: "ngModel"
6
+ restrict: "A"
7
+ scope:
8
+ passwordScore: '=' # outject score
9
+
10
+ link: (scope,elem, attrs, ctrl) ->
11
+ mesureStrength = (p) ->
12
+ matches =
13
+ pos: {}
14
+ neg: {}
15
+
16
+ counts =
17
+ pos: {}
18
+ neg:
19
+ seqLetter: 0
20
+ seqNumber: 0
21
+ seqSymbol: 0
22
+
23
+ tmp = undefined
24
+ strength = 0
25
+ letters = "abcdefghijklmnopqrstuvwxyz"
26
+ numbers = "01234567890"
27
+ symbols = "\\!@#$%&/()=?¿"
28
+ back = undefined
29
+ forth = undefined
30
+ i = undefined
31
+ if p
32
+
33
+ # Benefits
34
+ matches.pos.lower = p.match(/[a-z]/g)
35
+ matches.pos.upper = p.match(/[A-Z]/g)
36
+ matches.pos.numbers = p.match(/\d/g)
37
+ matches.pos.symbols = p.match(/[$-/:-?{-~!^_`\[\]]/g)
38
+ matches.pos.middleNumber = p.slice(1, -1).match(/\d/g)
39
+ matches.pos.middleSymbol = p.slice(1, -1).match(/[$-/:-?{-~!^_`\[\]]/g)
40
+ counts.pos.lower = (if matches.pos.lower then matches.pos.lower.length else 0)
41
+ counts.pos.upper = (if matches.pos.upper then matches.pos.upper.length else 0)
42
+ counts.pos.numbers = (if matches.pos.numbers then matches.pos.numbers.length else 0)
43
+ counts.pos.symbols = (if matches.pos.symbols then matches.pos.symbols.length else 0)
44
+ tmp = _.reduce(counts.pos, (memo, val) ->
45
+
46
+ # if has count will add 1
47
+ memo + Math.min(1, val)
48
+ , 0)
49
+ counts.pos.numChars = p.length
50
+ tmp += (if (counts.pos.numChars >= 8) then 1 else 0)
51
+ counts.pos.requirements = (if (tmp >= 3) then tmp else 0)
52
+ counts.pos.middleNumber = (if matches.pos.middleNumber then matches.pos.middleNumber.length else 0)
53
+ counts.pos.middleSymbol = (if matches.pos.middleSymbol then matches.pos.middleSymbol.length else 0)
54
+
55
+ # Deductions
56
+ matches.neg.consecLower = p.match(/(?=([a-z]{2}))/g)
57
+ matches.neg.consecUpper = p.match(/(?=([A-Z]{2}))/g)
58
+ matches.neg.consecNumbers = p.match(/(?=(\d{2}))/g)
59
+ matches.neg.onlyNumbers = p.match(/^[0-9]*$/g)
60
+ matches.neg.onlyLetters = p.match(/^([a-z]|[A-Z])*$/g)
61
+ counts.neg.consecLower = (if matches.neg.consecLower then matches.neg.consecLower.length else 0)
62
+ counts.neg.consecUpper = (if matches.neg.consecUpper then matches.neg.consecUpper.length else 0)
63
+ counts.neg.consecNumbers = (if matches.neg.consecNumbers then matches.neg.consecNumbers.length else 0)
64
+
65
+ # sequential letters (back and forth)
66
+ i = 0
67
+ while i < letters.length - 2
68
+ p2 = p.toLowerCase()
69
+ forth = letters.substring(i, parseInt(i + 3))
70
+ back = _(forth).split("").reverse()
71
+ counts.neg.seqLetter++ if p2.indexOf(forth) isnt -1 or p2.indexOf(back) isnt -1
72
+ i++
73
+
74
+ # sequential numbers (back and forth)
75
+ i = 0
76
+ while i < numbers.length - 2
77
+ forth = numbers.substring(i, parseInt(i + 3))
78
+ back = _(forth).split("").reverse()
79
+ counts.neg.seqNumber++ if p.indexOf(forth) isnt -1 or p.toLowerCase().indexOf(back) isnt -1
80
+ i++
81
+
82
+ # sequential symbols (back and forth)
83
+ i = 0
84
+ while i < symbols.length - 2
85
+ forth = symbols.substring(i, parseInt(i + 3))
86
+ back = _(forth).split("").reverse()
87
+ counts.neg.seqSymbol++ if p.indexOf(forth) isnt -1 or p.toLowerCase().indexOf(back) isnt -1
88
+ i++
89
+
90
+ # repeated chars
91
+ counts.neg.repeated = _.chain(p.toLowerCase().split("")).countBy((val) ->
92
+ val
93
+ ).reject((val) ->
94
+ val is 1
95
+ ).reduce((memo, val) ->
96
+ memo + val
97
+ , 0).value()
98
+
99
+ # Calculations
100
+ strength += counts.pos.numChars * 4
101
+ strength += (counts.pos.numChars - counts.pos.upper) * 2 if counts.pos.upper
102
+ strength += (counts.pos.numChars - counts.pos.lower) * 2 if counts.pos.lower
103
+ strength += counts.pos.numbers * 4 if counts.pos.upper or counts.pos.lower
104
+ strength += counts.pos.symbols * 6
105
+ strength += (counts.pos.middleSymbol + counts.pos.middleNumber) * 2
106
+ strength += counts.pos.requirements * 2
107
+ strength -= counts.neg.consecLower * 2
108
+ strength -= counts.neg.consecUpper * 2
109
+ strength -= counts.neg.consecNumbers * 2
110
+ strength -= counts.neg.seqNumber * 3
111
+ strength -= counts.neg.seqLetter * 3
112
+ strength -= counts.neg.seqSymbol * 3
113
+ strength -= counts.pos.numChars if matches.neg.onlyNumbers
114
+ strength -= counts.pos.numChars if matches.neg.onlyLetters
115
+ strength -= (counts.neg.repeated / counts.pos.numChars) * 10 if counts.neg.repeated
116
+ Math.max 0, Math.min(100, Math.round(strength))
117
+
118
+ getPwStrength = (s) ->
119
+ switch Math.round(s / 20)
120
+ when 0, 1
121
+ "weak"
122
+ when 2,3
123
+ "good"
124
+ when 4,5
125
+ "secure"
126
+
127
+ getClass = (s) ->
128
+ switch getPwStrength(s)
129
+ when 'weak'
130
+ "danger"
131
+ when 'good'
132
+ "warning"
133
+ when 'secure'
134
+ "success"
135
+
136
+ isPwStrong = (s) ->
137
+ switch getPwStrength(s)
138
+ when 'weak'
139
+ false
140
+ else
141
+ true
142
+
143
+ scope.$watch (-> ctrl.$modelValue), ->
144
+ scope.value = mesureStrength(ctrl.$modelValue)
145
+ scope.pwStrength = getPwStrength(scope.value)
146
+ ctrl.$setValidity('password-strength', isPwStrong(scope.value))
147
+
148
+ if scope.passwordScore?
149
+ scope.passwordScore.value = scope.pwStrength
150
+ scope.passwordScore.class = getClass(scope.value)
151
+ scope.passwordScore.showTip = (ctrl.$modelValue? && ctrl.$modelValue != '' && !isPwStrong(scope.value))
152
+
153
+
154
+ return