dune-dashboard 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (561) hide show
  1. checksums.yaml +7 -0
  2. data/.bowerrc +3 -0
  3. data/.gitignore +22 -0
  4. data/.rspec +2 -0
  5. data/.travis.yml +13 -0
  6. data/CHANGELOG.md +6 -0
  7. data/Gemfile +12 -0
  8. data/Gemfile.lock +392 -0
  9. data/LICENSE.txt +22 -0
  10. data/README.md +58 -0
  11. data/Rakefile +23 -0
  12. data/app/assets/images/dune/dashboard/logo@2x.png +0 -0
  13. data/app/assets/javascripts/adapters/channel_adapter.coffee +1 -0
  14. data/app/assets/javascripts/adapters/form_data.coffee +26 -0
  15. data/app/assets/javascripts/adapters/press_asset_adapter.coffee +1 -0
  16. data/app/assets/javascripts/configs.coffee +10 -0
  17. data/app/assets/javascripts/controllers/.gitkeep +0 -0
  18. data/app/assets/javascripts/controllers/channels.coffee +40 -0
  19. data/app/assets/javascripts/controllers/contributions.coffee +26 -0
  20. data/app/assets/javascripts/controllers/press_assets.coffee +24 -0
  21. data/app/assets/javascripts/controllers/projects.coffee +36 -0
  22. data/app/assets/javascripts/controllers/sessions.coffee +2 -0
  23. data/app/assets/javascripts/controllers/tags.coffee +24 -0
  24. data/app/assets/javascripts/controllers/users.coffee +8 -0
  25. data/app/assets/javascripts/dashboard.coffee +5 -0
  26. data/app/assets/javascripts/dune-dashboard-application.js +16 -0
  27. data/app/assets/javascripts/dune-dashboard-libs.js +25 -0
  28. data/app/assets/javascripts/dune-dashboard-templates.js +1 -0
  29. data/app/assets/javascripts/helpers/daterangepicker.coffee +1 -0
  30. data/app/assets/javascripts/helpers/format-date.coffee +5 -0
  31. data/app/assets/javascripts/helpers/loading.coffee +14 -0
  32. data/app/assets/javascripts/helpers/number-to-currency.coffee +5 -0
  33. data/app/assets/javascripts/helpers/pagination.coffee +1 -0
  34. data/app/assets/javascripts/helpers/show-boolean.coffee +5 -0
  35. data/app/assets/javascripts/i18n/translations_en.js +165 -0
  36. data/app/assets/javascripts/initializers/authentication.coffee +50 -0
  37. data/app/assets/javascripts/mixins/modal-controller.coffee +7 -0
  38. data/app/assets/javascripts/mixins/modal-view.coffee +15 -0
  39. data/app/assets/javascripts/mixins/paginable.coffee +25 -0
  40. data/app/assets/javascripts/mixins/searchable.coffee +58 -0
  41. data/app/assets/javascripts/models/.gitkeep +0 -0
  42. data/app/assets/javascripts/models/channel.coffee +25 -0
  43. data/app/assets/javascripts/models/contributions.coffee +15 -0
  44. data/app/assets/javascripts/models/press_asset.coffee +5 -0
  45. data/app/assets/javascripts/models/project.coffee +16 -0
  46. data/app/assets/javascripts/models/reward.coffee +4 -0
  47. data/app/assets/javascripts/models/tag.coffee +4 -0
  48. data/app/assets/javascripts/models/user.coffee +13 -0
  49. data/app/assets/javascripts/router.coffee +36 -0
  50. data/app/assets/javascripts/routes/.gitkeep +0 -0
  51. data/app/assets/javascripts/routes/application.coffee +35 -0
  52. data/app/assets/javascripts/routes/channels-edit.coffee +4 -0
  53. data/app/assets/javascripts/routes/channels-new.coffee +4 -0
  54. data/app/assets/javascripts/routes/channels.coffee +21 -0
  55. data/app/assets/javascripts/routes/contributions.coffee +29 -0
  56. data/app/assets/javascripts/routes/index.coffee +4 -0
  57. data/app/assets/javascripts/routes/press_assets-edit.coffee +4 -0
  58. data/app/assets/javascripts/routes/press_assets-new.coffee +5 -0
  59. data/app/assets/javascripts/routes/press_assets.coffee +13 -0
  60. data/app/assets/javascripts/routes/projects.coffee +23 -0
  61. data/app/assets/javascripts/routes/sessions.coffee +3 -0
  62. data/app/assets/javascripts/routes/tags-edit.coffee +4 -0
  63. data/app/assets/javascripts/routes/tags-new.coffee +5 -0
  64. data/app/assets/javascripts/routes/tags.coffee +15 -0
  65. data/app/assets/javascripts/routes/users.coffee +17 -0
  66. data/app/assets/javascripts/serializers/channel.coffee +10 -0
  67. data/app/assets/javascripts/serializers/file.coffee +6 -0
  68. data/app/assets/javascripts/serializers/object.coffee +6 -0
  69. data/app/assets/javascripts/serializers/project.coffee +4 -0
  70. data/app/assets/javascripts/store.coffee +5 -0
  71. data/app/assets/javascripts/templates/.gitkeep +0 -0
  72. data/app/assets/javascripts/templates/channels/_form.emblem +256 -0
  73. data/app/assets/javascripts/templates/channels/edit.emblem +1 -0
  74. data/app/assets/javascripts/templates/channels/index.emblem +66 -0
  75. data/app/assets/javascripts/templates/channels/new.emblem +1 -0
  76. data/app/assets/javascripts/templates/channels/search-form.emblem +13 -0
  77. data/app/assets/javascripts/templates/contributions/index.emblem +111 -0
  78. data/app/assets/javascripts/templates/contributions/search-form.emblem +27 -0
  79. data/app/assets/javascripts/templates/contributions/show.emblem +79 -0
  80. data/app/assets/javascripts/templates/daterangepicker.emblem +5 -0
  81. data/app/assets/javascripts/templates/layouts/application.emblem +19 -0
  82. data/app/assets/javascripts/templates/layouts/header.emblem +25 -0
  83. data/app/assets/javascripts/templates/layouts/sidebar.emblem +32 -0
  84. data/app/assets/javascripts/templates/pagination.emblem +10 -0
  85. data/app/assets/javascripts/templates/press_assets/_form.emblem +33 -0
  86. data/app/assets/javascripts/templates/press_assets/edit.emblem +1 -0
  87. data/app/assets/javascripts/templates/press_assets/index.emblem +45 -0
  88. data/app/assets/javascripts/templates/press_assets/new.emblem +1 -0
  89. data/app/assets/javascripts/templates/projects/index.emblem +119 -0
  90. data/app/assets/javascripts/templates/projects/search-form.emblem +19 -0
  91. data/app/assets/javascripts/templates/search-tab.emblem +6 -0
  92. data/app/assets/javascripts/templates/sessions/new.emblem +17 -0
  93. data/app/assets/javascripts/templates/tags/_form.emblem +24 -0
  94. data/app/assets/javascripts/templates/tags/edit.emblem +1 -0
  95. data/app/assets/javascripts/templates/tags/index.emblem +46 -0
  96. data/app/assets/javascripts/templates/tags/new.emblem +1 -0
  97. data/app/assets/javascripts/templates/users/index.emblem +51 -0
  98. data/app/assets/javascripts/templates/users/search-form.emblem +13 -0
  99. data/app/assets/javascripts/views/auto-save-checkbox.coffee +14 -0
  100. data/app/assets/javascripts/views/contributions/show.coffee +1 -0
  101. data/app/assets/javascripts/views/daterangepicker.coffee +60 -0
  102. data/app/assets/javascripts/views/file.coffee +7 -0
  103. data/app/assets/javascripts/views/layouts/header.coffee +23 -0
  104. data/app/assets/javascripts/views/layouts/sidebar.coffee +6 -0
  105. data/app/assets/javascripts/views/page-title.coffee +45 -0
  106. data/app/assets/javascripts/views/pagination.coffee +51 -0
  107. data/app/assets/javascripts/views/projects/index.coffee +5 -0
  108. data/app/assets/javascripts/views/search-tab.coffee +24 -0
  109. data/app/assets/stylesheets/core/core.sass +299 -0
  110. data/app/assets/stylesheets/core/mixins.sass +83 -0
  111. data/app/assets/stylesheets/core/settings.sass +75 -0
  112. data/app/assets/stylesheets/dune-dashboard-application.sass +12 -0
  113. data/app/assets/stylesheets/modules/alerts.sass +21 -0
  114. data/app/assets/stylesheets/modules/avatar.sass +13 -0
  115. data/app/assets/stylesheets/modules/boxes.sass +274 -0
  116. data/app/assets/stylesheets/modules/buttons.sass +160 -0
  117. data/app/assets/stylesheets/modules/dl-details.sass +13 -0
  118. data/app/assets/stylesheets/modules/forms.sass +53 -0
  119. data/app/assets/stylesheets/modules/generic.sass +9 -0
  120. data/app/assets/stylesheets/modules/header.sass +153 -0
  121. data/app/assets/stylesheets/modules/labels.sass +3 -0
  122. data/app/assets/stylesheets/modules/navs.sass +98 -0
  123. data/app/assets/stylesheets/modules/pagination.sass +19 -0
  124. data/app/assets/stylesheets/modules/sidebar.sass +147 -0
  125. data/app/assets/stylesheets/modules/small-box.sass +78 -0
  126. data/app/assets/stylesheets/pages/login.sass +42 -0
  127. data/app/controllers/dune/dashboard/ember_controller.rb +7 -0
  128. data/app/views/layouts/dune/dashboard/application.html.erb +15 -0
  129. data/bower.json +28 -0
  130. data/config/ember-i18n.yml +2 -0
  131. data/config/ember_locales/channels.en.yml +49 -0
  132. data/config/ember_locales/contributions.en.yml +42 -0
  133. data/config/ember_locales/en.yml +1 -0
  134. data/config/ember_locales/layouts.en.yml +16 -0
  135. data/config/ember_locales/press_assets.en.yml +14 -0
  136. data/config/ember_locales/projects.en.yml +33 -0
  137. data/config/ember_locales/sessions.en.yml +11 -0
  138. data/config/ember_locales/tags.en.yml +12 -0
  139. data/config/ember_locales/titles.en.yml +22 -0
  140. data/config/ember_locales/users.en.yml +12 -0
  141. data/config/ember_locales/words.en.yml +12 -0
  142. data/config/routes.rb +4 -0
  143. data/dune-dashboard.gemspec +28 -0
  144. data/lib/dune/dashboard.rb +11 -0
  145. data/lib/dune/dashboard/engine.rb +12 -0
  146. data/lib/dune/dashboard/i18n.rb +108 -0
  147. data/lib/dune/dashboard/version.rb +5 -0
  148. data/spec/dummy/README.rdoc +28 -0
  149. data/spec/dummy/Rakefile +6 -0
  150. data/spec/dummy/app/assets/images/.keep +0 -0
  151. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  152. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  153. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  154. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  155. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  156. data/spec/dummy/app/mailers/.keep +0 -0
  157. data/spec/dummy/app/models/.keep +0 -0
  158. data/spec/dummy/app/models/concerns/.keep +0 -0
  159. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  160. data/spec/dummy/bin/bundle +3 -0
  161. data/spec/dummy/bin/rails +4 -0
  162. data/spec/dummy/bin/rake +4 -0
  163. data/spec/dummy/config.ru +4 -0
  164. data/spec/dummy/config/application.rb +30 -0
  165. data/spec/dummy/config/boot.rb +5 -0
  166. data/spec/dummy/config/environment.rb +5 -0
  167. data/spec/dummy/config/environments/development.rb +29 -0
  168. data/spec/dummy/config/environments/production.rb +80 -0
  169. data/spec/dummy/config/environments/test.rb +38 -0
  170. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  171. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  172. data/spec/dummy/config/initializers/inflections.rb +16 -0
  173. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  174. data/spec/dummy/config/initializers/secret_token.rb +12 -0
  175. data/spec/dummy/config/initializers/session_store.rb +3 -0
  176. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  177. data/spec/dummy/config/locales/en.yml +23 -0
  178. data/spec/dummy/config/routes.rb +3 -0
  179. data/spec/dummy/lib/assets/.keep +0 -0
  180. data/spec/dummy/log/.keep +0 -0
  181. data/spec/dummy/public/404.html +58 -0
  182. data/spec/dummy/public/422.html +58 -0
  183. data/spec/dummy/public/500.html +57 -0
  184. data/spec/dummy/public/favicon.ico +0 -0
  185. data/spec/javascripts/controllers/channels_spec.coffee +16 -0
  186. data/spec/javascripts/controllers/press_assets_spec.coffee +5 -0
  187. data/spec/javascripts/controllers/projects_spec.coffee +16 -0
  188. data/spec/javascripts/controllers/users_spec.coffee +16 -0
  189. data/spec/javascripts/fixtures/channels.coffee +49 -0
  190. data/spec/javascripts/fixtures/contributions.coffee +46 -0
  191. data/spec/javascripts/fixtures/press_assets.coffee +15 -0
  192. data/spec/javascripts/fixtures/projects.coffee +108 -0
  193. data/spec/javascripts/fixtures/tags.coffee +15 -0
  194. data/spec/javascripts/fixtures/users.coffee +26 -0
  195. data/spec/javascripts/helpers/auththentication.coffee +11 -0
  196. data/spec/javascripts/integration/channels_spec.coffee +109 -0
  197. data/spec/javascripts/integration/contributions_spec.coffee +108 -0
  198. data/spec/javascripts/integration/press_assets_spec.coffee +66 -0
  199. data/spec/javascripts/integration/projects_spec.coffee +110 -0
  200. data/spec/javascripts/integration/sessions_spec.coffee +71 -0
  201. data/spec/javascripts/integration/tags_spec.coffee +65 -0
  202. data/spec/javascripts/integration/users_spec.coffee +108 -0
  203. data/spec/javascripts/models/channel_spec.coffee +4 -0
  204. data/spec/javascripts/models/contribution_spec.coffee +4 -0
  205. data/spec/javascripts/models/press_asset_spec.coffee +5 -0
  206. data/spec/javascripts/models/project_spec.coffee +4 -0
  207. data/spec/javascripts/models/reward_spec.coffee +4 -0
  208. data/spec/javascripts/models/tag_spec.coffee +4 -0
  209. data/spec/javascripts/models/user_spec.coffee +4 -0
  210. data/spec/javascripts/spec_helper.coffee +56 -0
  211. data/spec/javascripts/support/jquery.mockjax.js +598 -0
  212. data/spec/teaspoon_env.rb +183 -0
  213. data/vendor/assets/components/cldr/.bower.json +14 -0
  214. data/vendor/assets/components/cldr/README.md +47 -0
  215. data/vendor/assets/components/cldr/plurals.js +240 -0
  216. data/vendor/assets/components/ember-i18n/.bower.json +46 -0
  217. data/vendor/assets/components/ember-i18n/CONTRIBUTING.md +13 -0
  218. data/vendor/assets/components/ember-i18n/Changelog.md +82 -0
  219. data/vendor/assets/components/ember-i18n/LICENSE +10 -0
  220. data/vendor/assets/components/ember-i18n/README.md +148 -0
  221. data/vendor/assets/components/ember-i18n/VERSION +1 -0
  222. data/vendor/assets/components/ember-i18n/bower.json +34 -0
  223. data/vendor/assets/components/ember-i18n/lib/i18n.js +215 -0
  224. data/vendor/assets/components/ember-i18n/package.json +27 -0
  225. data/vendor/assets/components/ember-i18n/script/buildSuite.js +34 -0
  226. data/vendor/assets/components/ember-i18n/script/fetch_vendor.js +66 -0
  227. data/vendor/assets/components/ember-i18n/script/run.js +24 -0
  228. data/vendor/assets/components/ember-simple-auth/.bower.json +31 -0
  229. data/vendor/assets/components/ember-simple-auth/LICENSE +20 -0
  230. data/vendor/assets/components/ember-simple-auth/README.md +15 -0
  231. data/vendor/assets/components/ember-simple-auth/bower.json +21 -0
  232. data/vendor/assets/components/ember-simple-auth/simple-auth-cookie-store.amd.js +220 -0
  233. data/vendor/assets/components/ember-simple-auth/simple-auth-cookie-store.js +284 -0
  234. data/vendor/assets/components/ember-simple-auth/simple-auth-devise.amd.js +243 -0
  235. data/vendor/assets/components/ember-simple-auth/simple-auth-devise.js +312 -0
  236. data/vendor/assets/components/ember-simple-auth/simple-auth-oauth2.amd.js +386 -0
  237. data/vendor/assets/components/ember-simple-auth/simple-auth-oauth2.js +455 -0
  238. data/vendor/assets/components/ember-simple-auth/simple-auth-testing.amd.js +79 -0
  239. data/vendor/assets/components/ember-simple-auth/simple-auth-testing.js +137 -0
  240. data/vendor/assets/components/ember-simple-auth/simple-auth-torii.amd.js +142 -0
  241. data/vendor/assets/components/ember-simple-auth/simple-auth-torii.js +199 -0
  242. data/vendor/assets/components/ember-simple-auth/simple-auth.amd.js +1450 -0
  243. data/vendor/assets/components/ember-simple-auth/simple-auth.js +1548 -0
  244. data/vendor/assets/components/ember/.bower.json +21 -0
  245. data/vendor/assets/components/ember/.gitignore +5 -0
  246. data/vendor/assets/components/ember/Makefile +9 -0
  247. data/vendor/assets/components/ember/README.md +12 -0
  248. data/vendor/assets/components/ember/bower.json +11 -0
  249. data/vendor/assets/components/ember/component.json +13 -0
  250. data/vendor/assets/components/ember/composer.json +27 -0
  251. data/vendor/assets/components/ember/ember-template-compiler.js +336 -0
  252. data/vendor/assets/components/ember/ember.js +46762 -0
  253. data/vendor/assets/components/ember/ember.min.js +20 -0
  254. data/vendor/assets/components/ember/ember.prod.js +46319 -0
  255. data/vendor/assets/components/ember/package.json +11 -0
  256. data/vendor/assets/components/handlebars/.bower.json +16 -0
  257. data/vendor/assets/components/handlebars/.gitignore +2 -0
  258. data/vendor/assets/components/handlebars/README.md +11 -0
  259. data/vendor/assets/components/handlebars/bower.json +6 -0
  260. data/vendor/assets/components/handlebars/component.json +9 -0
  261. data/vendor/assets/components/handlebars/composer.json +35 -0
  262. data/vendor/assets/components/handlebars/handlebars-source.gemspec +21 -0
  263. data/vendor/assets/components/handlebars/handlebars.amd.js +2719 -0
  264. data/vendor/assets/components/handlebars/handlebars.amd.min.js +28 -0
  265. data/vendor/assets/components/handlebars/handlebars.js +2746 -0
  266. data/vendor/assets/components/handlebars/handlebars.js.nuspec +17 -0
  267. data/vendor/assets/components/handlebars/handlebars.min.js +28 -0
  268. data/vendor/assets/components/handlebars/handlebars.runtime.amd.js +515 -0
  269. data/vendor/assets/components/handlebars/handlebars.runtime.amd.min.js +27 -0
  270. data/vendor/assets/components/handlebars/handlebars.runtime.js +530 -0
  271. data/vendor/assets/components/handlebars/handlebars.runtime.min.js +27 -0
  272. data/vendor/assets/components/handlebars/lib/handlebars/source.rb +11 -0
  273. data/vendor/assets/components/jquery/.bower.json +37 -0
  274. data/vendor/assets/components/jquery/MIT-LICENSE.txt +21 -0
  275. data/vendor/assets/components/jquery/bower.json +27 -0
  276. data/vendor/assets/components/jquery/dist/jquery.js +9111 -0
  277. data/vendor/assets/components/jquery/dist/jquery.min.js +5 -0
  278. data/vendor/assets/components/jquery/dist/jquery.min.map +1 -0
  279. data/vendor/assets/components/jquery/src/ajax.js +806 -0
  280. data/vendor/assets/components/jquery/src/ajax/jsonp.js +89 -0
  281. data/vendor/assets/components/jquery/src/ajax/load.js +75 -0
  282. data/vendor/assets/components/jquery/src/ajax/parseJSON.js +13 -0
  283. data/vendor/assets/components/jquery/src/ajax/parseXML.js +28 -0
  284. data/vendor/assets/components/jquery/src/ajax/script.js +64 -0
  285. data/vendor/assets/components/jquery/src/ajax/var/nonce.js +5 -0
  286. data/vendor/assets/components/jquery/src/ajax/var/rquery.js +3 -0
  287. data/vendor/assets/components/jquery/src/ajax/xhr.js +130 -0
  288. data/vendor/assets/components/jquery/src/attributes.js +11 -0
  289. data/vendor/assets/components/jquery/src/attributes/attr.js +143 -0
  290. data/vendor/assets/components/jquery/src/attributes/classes.js +158 -0
  291. data/vendor/assets/components/jquery/src/attributes/prop.js +96 -0
  292. data/vendor/assets/components/jquery/src/attributes/support.js +35 -0
  293. data/vendor/assets/components/jquery/src/attributes/val.js +153 -0
  294. data/vendor/assets/components/jquery/src/callbacks.js +205 -0
  295. data/vendor/assets/components/jquery/src/core.js +500 -0
  296. data/vendor/assets/components/jquery/src/core/access.js +60 -0
  297. data/vendor/assets/components/jquery/src/core/init.js +123 -0
  298. data/vendor/assets/components/jquery/src/core/parseHTML.js +39 -0
  299. data/vendor/assets/components/jquery/src/core/ready.js +96 -0
  300. data/vendor/assets/components/jquery/src/core/var/rsingleTag.js +4 -0
  301. data/vendor/assets/components/jquery/src/css.js +455 -0
  302. data/vendor/assets/components/jquery/src/css/addGetHookIf.js +24 -0
  303. data/vendor/assets/components/jquery/src/css/curCSS.js +57 -0
  304. data/vendor/assets/components/jquery/src/css/defaultDisplay.js +69 -0
  305. data/vendor/assets/components/jquery/src/css/hiddenVisibleSelectors.js +15 -0
  306. data/vendor/assets/components/jquery/src/css/support.js +83 -0
  307. data/vendor/assets/components/jquery/src/css/swap.js +28 -0
  308. data/vendor/assets/components/jquery/src/css/var/cssExpand.js +3 -0
  309. data/vendor/assets/components/jquery/src/css/var/getStyles.js +5 -0
  310. data/vendor/assets/components/jquery/src/css/var/isHidden.js +13 -0
  311. data/vendor/assets/components/jquery/src/css/var/rmargin.js +3 -0
  312. data/vendor/assets/components/jquery/src/css/var/rnumnonpx.js +5 -0
  313. data/vendor/assets/components/jquery/src/data.js +175 -0
  314. data/vendor/assets/components/jquery/src/data/Data.js +181 -0
  315. data/vendor/assets/components/jquery/src/data/accepts.js +20 -0
  316. data/vendor/assets/components/jquery/src/data/var/data_priv.js +5 -0
  317. data/vendor/assets/components/jquery/src/data/var/data_user.js +5 -0
  318. data/vendor/assets/components/jquery/src/deferred.js +149 -0
  319. data/vendor/assets/components/jquery/src/deprecated.js +13 -0
  320. data/vendor/assets/components/jquery/src/dimensions.js +50 -0
  321. data/vendor/assets/components/jquery/src/effects.js +642 -0
  322. data/vendor/assets/components/jquery/src/effects/Tween.js +114 -0
  323. data/vendor/assets/components/jquery/src/effects/animatedSelector.js +13 -0
  324. data/vendor/assets/components/jquery/src/event.js +859 -0
  325. data/vendor/assets/components/jquery/src/event/alias.js +39 -0
  326. data/vendor/assets/components/jquery/src/event/support.js +9 -0
  327. data/vendor/assets/components/jquery/src/exports/amd.js +18 -0
  328. data/vendor/assets/components/jquery/src/exports/global.js +32 -0
  329. data/vendor/assets/components/jquery/src/intro.js +44 -0
  330. data/vendor/assets/components/jquery/src/jquery.js +36 -0
  331. data/vendor/assets/components/jquery/src/manipulation.js +583 -0
  332. data/vendor/assets/components/jquery/src/manipulation/_evalUrl.js +18 -0
  333. data/vendor/assets/components/jquery/src/manipulation/support.js +24 -0
  334. data/vendor/assets/components/jquery/src/manipulation/var/rcheckableType.js +3 -0
  335. data/vendor/assets/components/jquery/src/offset.js +204 -0
  336. data/vendor/assets/components/jquery/src/outro.js +1 -0
  337. data/vendor/assets/components/jquery/src/queue.js +142 -0
  338. data/vendor/assets/components/jquery/src/queue/delay.js +22 -0
  339. data/vendor/assets/components/jquery/src/selector-native.js +171 -0
  340. data/vendor/assets/components/jquery/src/selector-sizzle.js +14 -0
  341. data/vendor/assets/components/jquery/src/selector.js +1 -0
  342. data/vendor/assets/components/jquery/src/serialize.js +111 -0
  343. data/vendor/assets/components/jquery/src/sizzle/dist/sizzle.js +2015 -0
  344. data/vendor/assets/components/jquery/src/sizzle/dist/sizzle.min.js +3 -0
  345. data/vendor/assets/components/jquery/src/sizzle/dist/sizzle.min.map +1 -0
  346. data/vendor/assets/components/jquery/src/traversing.js +200 -0
  347. data/vendor/assets/components/jquery/src/traversing/findFilter.js +100 -0
  348. data/vendor/assets/components/jquery/src/traversing/var/rneedsContext.js +6 -0
  349. data/vendor/assets/components/jquery/src/var/arr.js +3 -0
  350. data/vendor/assets/components/jquery/src/var/class2type.js +4 -0
  351. data/vendor/assets/components/jquery/src/var/concat.js +5 -0
  352. data/vendor/assets/components/jquery/src/var/hasOwn.js +5 -0
  353. data/vendor/assets/components/jquery/src/var/indexOf.js +5 -0
  354. data/vendor/assets/components/jquery/src/var/pnum.js +3 -0
  355. data/vendor/assets/components/jquery/src/var/push.js +5 -0
  356. data/vendor/assets/components/jquery/src/var/rnotwhite.js +3 -0
  357. data/vendor/assets/components/jquery/src/var/slice.js +5 -0
  358. data/vendor/assets/components/jquery/src/var/strundefined.js +3 -0
  359. data/vendor/assets/components/jquery/src/var/support.js +4 -0
  360. data/vendor/assets/components/jquery/src/var/toString.js +5 -0
  361. data/vendor/assets/components/jquery/src/var/trim.js +3 -0
  362. data/vendor/assets/components/jquery/src/wrap.js +78 -0
  363. data/vendor/assets/components/moment/.bower.json +30 -0
  364. data/vendor/assets/components/moment/LICENSE +22 -0
  365. data/vendor/assets/components/moment/bower.json +20 -0
  366. data/vendor/assets/components/moment/lang/ar-ma.js +56 -0
  367. data/vendor/assets/components/moment/lang/ar-sa.js +96 -0
  368. data/vendor/assets/components/moment/lang/ar.js +97 -0
  369. data/vendor/assets/components/moment/lang/az.js +102 -0
  370. data/vendor/assets/components/moment/lang/bg.js +86 -0
  371. data/vendor/assets/components/moment/lang/bn.js +106 -0
  372. data/vendor/assets/components/moment/lang/br.js +107 -0
  373. data/vendor/assets/components/moment/lang/bs.js +139 -0
  374. data/vendor/assets/components/moment/lang/ca.js +66 -0
  375. data/vendor/assets/components/moment/lang/cs.js +155 -0
  376. data/vendor/assets/components/moment/lang/cv.js +59 -0
  377. data/vendor/assets/components/moment/lang/cy.js +77 -0
  378. data/vendor/assets/components/moment/lang/da.js +56 -0
  379. data/vendor/assets/components/moment/lang/de-at.js +72 -0
  380. data/vendor/assets/components/moment/lang/de.js +71 -0
  381. data/vendor/assets/components/moment/lang/el.js +90 -0
  382. data/vendor/assets/components/moment/lang/en-au.js +62 -0
  383. data/vendor/assets/components/moment/lang/en-ca.js +59 -0
  384. data/vendor/assets/components/moment/lang/en-gb.js +63 -0
  385. data/vendor/assets/components/moment/lang/eo.js +65 -0
  386. data/vendor/assets/components/moment/lang/es.js +75 -0
  387. data/vendor/assets/components/moment/lang/et.js +76 -0
  388. data/vendor/assets/components/moment/lang/eu.js +60 -0
  389. data/vendor/assets/components/moment/lang/fa.js +97 -0
  390. data/vendor/assets/components/moment/lang/fi.js +103 -0
  391. data/vendor/assets/components/moment/lang/fo.js +56 -0
  392. data/vendor/assets/components/moment/lang/fr-ca.js +54 -0
  393. data/vendor/assets/components/moment/lang/fr.js +58 -0
  394. data/vendor/assets/components/moment/lang/gl.js +71 -0
  395. data/vendor/assets/components/moment/lang/he.js +77 -0
  396. data/vendor/assets/components/moment/lang/hi.js +105 -0
  397. data/vendor/assets/components/moment/lang/hr.js +140 -0
  398. data/vendor/assets/components/moment/lang/hu.js +105 -0
  399. data/vendor/assets/components/moment/lang/hy-am.js +113 -0
  400. data/vendor/assets/components/moment/lang/id.js +67 -0
  401. data/vendor/assets/components/moment/lang/is.js +124 -0
  402. data/vendor/assets/components/moment/lang/it.js +59 -0
  403. data/vendor/assets/components/moment/lang/ja.js +58 -0
  404. data/vendor/assets/components/moment/lang/ka.js +108 -0
  405. data/vendor/assets/components/moment/lang/km.js +55 -0
  406. data/vendor/assets/components/moment/lang/ko.js +63 -0
  407. data/vendor/assets/components/moment/lang/lb.js +160 -0
  408. data/vendor/assets/components/moment/lang/lt.js +118 -0
  409. data/vendor/assets/components/moment/lang/lv.js +77 -0
  410. data/vendor/assets/components/moment/lang/mk.js +86 -0
  411. data/vendor/assets/components/moment/lang/ml.js +64 -0
  412. data/vendor/assets/components/moment/lang/mr.js +104 -0
  413. data/vendor/assets/components/moment/lang/ms-my.js +66 -0
  414. data/vendor/assets/components/moment/lang/nb.js +57 -0
  415. data/vendor/assets/components/moment/lang/ne.js +105 -0
  416. data/vendor/assets/components/moment/lang/nl.js +67 -0
  417. data/vendor/assets/components/moment/lang/nn.js +56 -0
  418. data/vendor/assets/components/moment/lang/pl.js +98 -0
  419. data/vendor/assets/components/moment/lang/pt-br.js +56 -0
  420. data/vendor/assets/components/moment/lang/pt.js +60 -0
  421. data/vendor/assets/components/moment/lang/ro.js +72 -0
  422. data/vendor/assets/components/moment/lang/ru.js +166 -0
  423. data/vendor/assets/components/moment/lang/sk.js +156 -0
  424. data/vendor/assets/components/moment/lang/sl.js +144 -0
  425. data/vendor/assets/components/moment/lang/sq.js +61 -0
  426. data/vendor/assets/components/moment/lang/sr-cyrl.js +106 -0
  427. data/vendor/assets/components/moment/lang/sr.js +106 -0
  428. data/vendor/assets/components/moment/lang/sv.js +63 -0
  429. data/vendor/assets/components/moment/lang/ta.js +112 -0
  430. data/vendor/assets/components/moment/lang/th.js +58 -0
  431. data/vendor/assets/components/moment/lang/tl-ph.js +58 -0
  432. data/vendor/assets/components/moment/lang/tr.js +93 -0
  433. data/vendor/assets/components/moment/lang/tzm-latn.js +55 -0
  434. data/vendor/assets/components/moment/lang/tzm.js +55 -0
  435. data/vendor/assets/components/moment/lang/uk.js +157 -0
  436. data/vendor/assets/components/moment/lang/uz.js +55 -0
  437. data/vendor/assets/components/moment/lang/vi.js +62 -0
  438. data/vendor/assets/components/moment/lang/zh-cn.js +108 -0
  439. data/vendor/assets/components/moment/lang/zh-tw.js +84 -0
  440. data/vendor/assets/components/moment/min/langs.js +6426 -0
  441. data/vendor/assets/components/moment/min/langs.min.js +4 -0
  442. data/vendor/assets/components/moment/min/moment-with-langs.js +8521 -0
  443. data/vendor/assets/components/moment/min/moment-with-langs.min.js +9 -0
  444. data/vendor/assets/components/moment/min/moment.min.js +6 -0
  445. data/vendor/assets/components/moment/moment.js +2610 -0
  446. data/vendor/assets/components/moment/readme.md +388 -0
  447. data/vendor/assets/components/numeral/.bower.json +28 -0
  448. data/vendor/assets/components/numeral/.gitignore +29 -0
  449. data/vendor/assets/components/numeral/.travis.yml +7 -0
  450. data/vendor/assets/components/numeral/Gruntfile.js +91 -0
  451. data/vendor/assets/components/numeral/LICENSE +22 -0
  452. data/vendor/assets/components/numeral/README.md +213 -0
  453. data/vendor/assets/components/numeral/bower.json +16 -0
  454. data/vendor/assets/components/numeral/component.json +16 -0
  455. data/vendor/assets/components/numeral/languages.js +989 -0
  456. data/vendor/assets/components/numeral/languages/be-nl.js +35 -0
  457. data/vendor/assets/components/numeral/languages/chs.js +34 -0
  458. data/vendor/assets/components/numeral/languages/cs.js +34 -0
  459. data/vendor/assets/components/numeral/languages/da-dk.js +34 -0
  460. data/vendor/assets/components/numeral/languages/de-ch.js +34 -0
  461. data/vendor/assets/components/numeral/languages/de.js +34 -0
  462. data/vendor/assets/components/numeral/languages/en-gb.js +38 -0
  463. data/vendor/assets/components/numeral/languages/es-ES.js +39 -0
  464. data/vendor/assets/components/numeral/languages/es.js +39 -0
  465. data/vendor/assets/components/numeral/languages/et.js +37 -0
  466. data/vendor/assets/components/numeral/languages/fi.js +34 -0
  467. data/vendor/assets/components/numeral/languages/fr-CA.js +34 -0
  468. data/vendor/assets/components/numeral/languages/fr-ch.js +34 -0
  469. data/vendor/assets/components/numeral/languages/fr.js +34 -0
  470. data/vendor/assets/components/numeral/languages/hu.js +34 -0
  471. data/vendor/assets/components/numeral/languages/it.js +34 -0
  472. data/vendor/assets/components/numeral/languages/ja.js +34 -0
  473. data/vendor/assets/components/numeral/languages/nl-nl.js +35 -0
  474. data/vendor/assets/components/numeral/languages/pl.js +34 -0
  475. data/vendor/assets/components/numeral/languages/pt-br.js +34 -0
  476. data/vendor/assets/components/numeral/languages/pt-pt.js +34 -0
  477. data/vendor/assets/components/numeral/languages/ru-UA.js +35 -0
  478. data/vendor/assets/components/numeral/languages/ru.js +37 -0
  479. data/vendor/assets/components/numeral/languages/sk.js +34 -0
  480. data/vendor/assets/components/numeral/languages/th.js +34 -0
  481. data/vendor/assets/components/numeral/languages/tr.js +67 -0
  482. data/vendor/assets/components/numeral/languages/uk-UA.js +35 -0
  483. data/vendor/assets/components/numeral/min/languages.min.js +129 -0
  484. data/vendor/assets/components/numeral/min/languages/be-nl.min.js +6 -0
  485. data/vendor/assets/components/numeral/min/languages/chs.min.js +6 -0
  486. data/vendor/assets/components/numeral/min/languages/cs.min.js +6 -0
  487. data/vendor/assets/components/numeral/min/languages/da-dk.min.js +6 -0
  488. data/vendor/assets/components/numeral/min/languages/de-ch.min.js +6 -0
  489. data/vendor/assets/components/numeral/min/languages/de.min.js +6 -0
  490. data/vendor/assets/components/numeral/min/languages/en-gb.min.js +6 -0
  491. data/vendor/assets/components/numeral/min/languages/es-ES.min.js +6 -0
  492. data/vendor/assets/components/numeral/min/languages/es.min.js +6 -0
  493. data/vendor/assets/components/numeral/min/languages/et.min.js +9 -0
  494. data/vendor/assets/components/numeral/min/languages/fi.min.js +6 -0
  495. data/vendor/assets/components/numeral/min/languages/fr-CA.min.js +6 -0
  496. data/vendor/assets/components/numeral/min/languages/fr-ch.min.js +6 -0
  497. data/vendor/assets/components/numeral/min/languages/fr.min.js +6 -0
  498. data/vendor/assets/components/numeral/min/languages/hu.min.js +6 -0
  499. data/vendor/assets/components/numeral/min/languages/it.min.js +6 -0
  500. data/vendor/assets/components/numeral/min/languages/ja.min.js +6 -0
  501. data/vendor/assets/components/numeral/min/languages/nl-nl.min.js +6 -0
  502. data/vendor/assets/components/numeral/min/languages/pl.min.js +6 -0
  503. data/vendor/assets/components/numeral/min/languages/pt-br.min.js +6 -0
  504. data/vendor/assets/components/numeral/min/languages/pt-pt.min.js +6 -0
  505. data/vendor/assets/components/numeral/min/languages/ru-UA.min.js +1 -0
  506. data/vendor/assets/components/numeral/min/languages/ru.min.js +6 -0
  507. data/vendor/assets/components/numeral/min/languages/sk.min.js +6 -0
  508. data/vendor/assets/components/numeral/min/languages/th.min.js +6 -0
  509. data/vendor/assets/components/numeral/min/languages/tr.min.js +6 -0
  510. data/vendor/assets/components/numeral/min/languages/uk-UA.min.js +1 -0
  511. data/vendor/assets/components/numeral/min/numeral.min.js +8 -0
  512. data/vendor/assets/components/numeral/numeral.js +679 -0
  513. data/vendor/assets/components/numeral/package.json +50 -0
  514. data/vendor/assets/components/numeral/tests/languages/be-nl.js +107 -0
  515. data/vendor/assets/components/numeral/tests/languages/chs.js +101 -0
  516. data/vendor/assets/components/numeral/tests/languages/cs.js +102 -0
  517. data/vendor/assets/components/numeral/tests/languages/da-dk.js +101 -0
  518. data/vendor/assets/components/numeral/tests/languages/de-ch.js +101 -0
  519. data/vendor/assets/components/numeral/tests/languages/de.js +101 -0
  520. data/vendor/assets/components/numeral/tests/languages/en-gb.js +101 -0
  521. data/vendor/assets/components/numeral/tests/languages/en.js +98 -0
  522. data/vendor/assets/components/numeral/tests/languages/es-ES.js +101 -0
  523. data/vendor/assets/components/numeral/tests/languages/es.js +101 -0
  524. data/vendor/assets/components/numeral/tests/languages/et.js +101 -0
  525. data/vendor/assets/components/numeral/tests/languages/fi.js +101 -0
  526. data/vendor/assets/components/numeral/tests/languages/fr-CA.js +101 -0
  527. data/vendor/assets/components/numeral/tests/languages/fr-ch.js +101 -0
  528. data/vendor/assets/components/numeral/tests/languages/fr.js +101 -0
  529. data/vendor/assets/components/numeral/tests/languages/hu.js +101 -0
  530. data/vendor/assets/components/numeral/tests/languages/it.js +101 -0
  531. data/vendor/assets/components/numeral/tests/languages/ja.js +101 -0
  532. data/vendor/assets/components/numeral/tests/languages/nl-nl.js +109 -0
  533. data/vendor/assets/components/numeral/tests/languages/pl.js +102 -0
  534. data/vendor/assets/components/numeral/tests/languages/pt-br.js +101 -0
  535. data/vendor/assets/components/numeral/tests/languages/pt-pt.js +101 -0
  536. data/vendor/assets/components/numeral/tests/languages/ru-UA.js +102 -0
  537. data/vendor/assets/components/numeral/tests/languages/ru.js +102 -0
  538. data/vendor/assets/components/numeral/tests/languages/sk.js +101 -0
  539. data/vendor/assets/components/numeral/tests/languages/th.js +101 -0
  540. data/vendor/assets/components/numeral/tests/languages/tr.js +101 -0
  541. data/vendor/assets/components/numeral/tests/languages/uk-UA.js +102 -0
  542. data/vendor/assets/components/numeral/tests/numeral/format.js +204 -0
  543. data/vendor/assets/components/numeral/tests/numeral/manipulate.js +104 -0
  544. data/vendor/assets/components/numeral/tests/numeral/misc.js +123 -0
  545. data/vendor/assets/components/numeral/tests/numeral/unformat.js +96 -0
  546. data/vendor/assets/components/qunit-bdd/.bower.json +31 -0
  547. data/vendor/assets/components/qunit-bdd/LICENSE +13 -0
  548. data/vendor/assets/components/qunit-bdd/README.md +282 -0
  549. data/vendor/assets/components/qunit-bdd/bower.json +22 -0
  550. data/vendor/assets/components/qunit-bdd/karma.conf.js +70 -0
  551. data/vendor/assets/components/qunit-bdd/lib/qunit-bdd.js +755 -0
  552. data/vendor/assets/components/qunit-bdd/package.json +33 -0
  553. data/vendor/assets/javascripts/bs-breadcrumbs.js +85 -0
  554. data/vendor/assets/javascripts/bs-core.js +476 -0
  555. data/vendor/assets/javascripts/bs-notifications.js +111 -0
  556. data/vendor/assets/javascripts/daterangepicker.js +1030 -0
  557. data/vendor/assets/javascripts/fix_bind_phantomjs.js +37 -0
  558. data/vendor/assets/javascripts/jquery-deparam.js +97 -0
  559. data/vendor/assets/javascripts/sidebar-tree.js +68 -0
  560. data/vendor/assets/stylesheets/daterangepicker.css +271 -0
  561. metadata +766 -0
@@ -0,0 +1,1548 @@
1
+ (function(global) {
2
+
3
+ Ember.libraries.register('Ember Simple Auth', '0.6.4');
4
+
5
+ var define, requireModule;
6
+
7
+ (function() {
8
+ var registry = {}, seen = {};
9
+
10
+ define = function(name, deps, callback) {
11
+ registry[name] = { deps: deps, callback: callback };
12
+ };
13
+
14
+ requireModule = function(name) {
15
+ if (seen.hasOwnProperty(name)) { return seen[name]; }
16
+ seen[name] = {};
17
+
18
+ if (!registry[name]) {
19
+ throw new Error("Could not find module " + name);
20
+ }
21
+
22
+ var mod = registry[name],
23
+ deps = mod.deps,
24
+ callback = mod.callback,
25
+ reified = [],
26
+ exports;
27
+
28
+ for (var i=0, l=deps.length; i<l; i++) {
29
+ if (deps[i] === 'exports') {
30
+ reified.push(exports = {});
31
+ } else {
32
+ reified.push(requireModule(resolve(deps[i])));
33
+ }
34
+ }
35
+
36
+ var value = callback.apply(this, reified);
37
+ return seen[name] = exports || value;
38
+
39
+ function resolve(child) {
40
+ if (child.charAt(0) !== '.') { return child; }
41
+ var parts = child.split("/");
42
+ var parentBase = name.split("/").slice(0, -1);
43
+
44
+ for (var i=0, l=parts.length; i<l; i++) {
45
+ var part = parts[i];
46
+
47
+ if (part === '..') { parentBase.pop(); }
48
+ else if (part === '.') { continue; }
49
+ else { parentBase.push(part); }
50
+ }
51
+
52
+ return parentBase.join("/");
53
+ }
54
+ };
55
+
56
+ requireModule.registry = registry;
57
+ })();
58
+
59
+ define("simple-auth/authenticators/base",
60
+ ["exports"],
61
+ function(__exports__) {
62
+ "use strict";
63
+ /**
64
+ The base for all authenticators. __This serves as a starting point for
65
+ implementing custom authenticators and must not be used directly.__
66
+
67
+ The authenticator authenticates the session. The actual mechanism used to do
68
+ this might e.g. be posting a set of credentials to a server and in exchange
69
+ retrieving an access token, initiating authentication against an external
70
+ provider like Facebook etc. and depends on the specific authenticator. Any
71
+ data that the authenticator receives upon successful authentication and
72
+ resolves with from the
73
+ [`Authenticators.Base#authenticate`](#SimpleAuth-Authenticators-Base-authenticate)
74
+ method is stored in the session and can then be used by the authorizer (see
75
+ [`Authorizers.Base`](#SimpleAuth-Authorizers-Base)).
76
+
77
+ The authenticator also decides whether a set of data that was restored from
78
+ the session store (see
79
+ [`Stores.Base`](#SimpleAuth-Stores-Base)) is sufficient for the session to be
80
+ authenticated or not.
81
+
82
+ __Custom authenticators have to be registered with Ember's dependency
83
+ injection container__ so that the session can retrieve an instance, e.g.:
84
+
85
+ ```javascript
86
+ import Base from 'simple-auth/authenticators/base';
87
+
88
+ var CustomAuthenticator = Base.extend({
89
+ ...
90
+ });
91
+
92
+ Ember.Application.initializer({
93
+ name: 'authentication',
94
+ initialize: function(container, application) {
95
+ container.register('authenticator:custom', CustomAuthenticator);
96
+ }
97
+ });
98
+ ```
99
+
100
+ ```javascript
101
+ // app/controllers/login.js
102
+ import AuthenticationControllerMixin from 'simple-auth/mixins/authentication-controller-mixin';
103
+
104
+ export default Ember.Controller.extend(AuthenticationControllerMixin, {
105
+ authenticator: 'authenticator:custom'
106
+ });
107
+ ```
108
+
109
+ @class Base
110
+ @namespace SimpleAuth.Authenticators
111
+ @module simple-auth/authenticators/base
112
+ @extends Ember.Object
113
+ @uses Ember.Evented
114
+ */
115
+ __exports__["default"] = Ember.Object.extend(Ember.Evented, {
116
+ /**
117
+ __Triggered when the data that constitutes the session is updated by the
118
+ authenticator__. This might happen e.g. because the authenticator refreshes
119
+ it or an event from is triggered from an external authentication provider.
120
+ The session automatically catches that event, passes the updated data back
121
+ to the authenticator's
122
+ [SimpleAuth.Authenticators.Base#restore](#SimpleAuth-Authenticators-Base-restore)
123
+ method and handles the result of that invocation accordingly.
124
+
125
+ @event sessionDataUpdated
126
+ @param {Object} data The updated session data
127
+ */
128
+ /**
129
+ __Triggered when the data that constitutes the session is invalidated by
130
+ the authenticator__. This might happen e.g. because the date expires or an
131
+ event is triggered from an external authentication provider. The session
132
+ automatically catches that event and invalidates itself.
133
+
134
+ @event sessionDataInvalidated
135
+ @param {Object} data The updated session data
136
+ */
137
+
138
+ /**
139
+ Restores the session from a set of properties. __This method is invoked by
140
+ the session either after the application starts up and session data was
141
+ restored from the store__ or when properties in the store have changed due
142
+ to external events (e.g. in another tab) and the new set of properties
143
+ needs to be re-checked for whether it still constitutes an authenticated
144
+ session.
145
+
146
+ __This method returns a promise. A resolving promise will result in the
147
+ session being authenticated.__ Any properties the promise resolves with
148
+ will be saved in and accessible via the session. In most cases the `data`
149
+ argument will simply be forwarded through the promise. A rejecting promise
150
+ indicates that authentication failed and the session will remain unchanged.
151
+
152
+ `SimpleAuth.Authenticators.Base`'s implementation always returns a
153
+ rejecting promise.
154
+
155
+ @method restore
156
+ @param {Object} data The data to restore the session from
157
+ @return {Ember.RSVP.Promise} A promise that when it resolves results in the session being authenticated
158
+ */
159
+ restore: function(data) {
160
+ return new Ember.RSVP.reject();
161
+ },
162
+
163
+ /**
164
+ Authenticates the session with the specified `options`. These options vary
165
+ depending on the actual authentication mechanism the authenticator
166
+ implements (e.g. a set of credentials or a Facebook account id etc.). __The
167
+ session will invoke this method when an action in the appliaction triggers
168
+ authentication__ (see
169
+ [SimpleAuth.AuthenticationControllerMixin.actions#authenticate](#SimpleAuth-AuthenticationControllerMixin-authenticate)).
170
+
171
+ __This method returns a promise. A resolving promise will result in the
172
+ session being authenticated.__ Any properties the promise resolves with
173
+ will be saved in and accessible via the session. A rejecting promise
174
+ indicates that authentication failed and the session will remain unchanged.
175
+
176
+ `SimpleAuth.Authenticators.Base`'s implementation always returns a
177
+ rejecting promise and thus never authenticates the session.
178
+
179
+ @method authenticate
180
+ @param {Object} options The options to authenticate the session with
181
+ @return {Ember.RSVP.Promise} A promise that when it resolves results in the session being authenticated
182
+ */
183
+ authenticate: function(options) {
184
+ return new Ember.RSVP.reject();
185
+ },
186
+
187
+ /**
188
+ This callback is invoked when the session is invalidated. While the session
189
+ will invalidate itself and clear all session properties, it might be
190
+ necessary for some authenticators to perform additional tasks (e.g.
191
+ invalidating an access token on the server), which should be done in this
192
+ method.
193
+
194
+ __This method returns a promise. A resolving promise will result in the
195
+ session being invalidated.__ A rejecting promise will result in the session
196
+ invalidation being intercepted and the session being left authenticated.
197
+
198
+ `SimpleAuth.Authenticators.Base`'s implementation always returns a
199
+ resolving promise and thus never intercepts session invalidation.
200
+
201
+ @method invalidate
202
+ @param {Object} data The data that the session currently holds
203
+ @return {Ember.RSVP.Promise} A promise that when it resolves results in the session being invalidated
204
+ */
205
+ invalidate: function(data) {
206
+ return new Ember.RSVP.resolve();
207
+ }
208
+ });
209
+ });
210
+ define("simple-auth/authorizers/base",
211
+ ["exports"],
212
+ function(__exports__) {
213
+ "use strict";
214
+ /**
215
+ The base for all authorizers. __This serves as a starting point for
216
+ implementing custom authorizers and must not be used directly.__
217
+
218
+ __The authorizer preprocesses all XHR requests__ (except ones to 3rd party
219
+ origins, see
220
+ [Configuration.crossOriginWhitelist](#SimpleAuth-Configuration-crossOriginWhitelist))
221
+ and makes sure they have the required data attached that allows the server to
222
+ identify the user making the request. This data might be an HTTP header,
223
+ query string parameters in the URL, cookies etc. __The authorizer has to fit
224
+ the authenticator__ (see
225
+ [SimpleAuth.Authenticators.Base](#SimpleAuth-Authenticators-Base))
226
+ as it relies on data that the authenticator acquires during authentication.
227
+
228
+ @class Base
229
+ @namespace SimpleAuth.Authorizers
230
+ @module simple-auth/authorizers/base
231
+ @extends Ember.Object
232
+ */
233
+ __exports__["default"] = Ember.Object.extend({
234
+ /**
235
+ The session the authorizer gets the data it needs to authorize requests
236
+ from.
237
+
238
+ @property session
239
+ @readOnly
240
+ @type SimpleAuth.Session
241
+ @default the session instance
242
+ */
243
+ session: null,
244
+
245
+ /**
246
+ Authorizes an XHR request by adding some sort of secret information that
247
+ allows the server to identify the user making the request (e.g. a token in
248
+ the `Authorization` header or some other secret in the query string etc.).
249
+
250
+ `SimpleAuth.Authorizers.Base`'s implementation does nothing.
251
+
252
+ @method authorize
253
+ @param {jqXHR} jqXHR The XHR request to authorize (see http://api.jquery.com/jQuery.ajax/#jqXHR)
254
+ @param {Object} requestOptions The options as provided to the `$.ajax` method (see http://api.jquery.com/jQuery.ajaxPrefilter/)
255
+ */
256
+ authorize: function(jqXHR, requestOptions) {
257
+ }
258
+ });
259
+ });
260
+ define("simple-auth/configuration",
261
+ ["./utils/get-global-config","exports"],
262
+ function(__dependency1__, __exports__) {
263
+ "use strict";
264
+ var getGlobalConfig = __dependency1__["default"];
265
+
266
+ /**
267
+ Ember Simple Auth's configuration object.
268
+
269
+ To change any of these values, define a global environment object for Ember
270
+ Simple Auth and define the values there:
271
+
272
+ ```javascript
273
+ window.ENV = window.ENV || {};
274
+ window.ENV['simple-auth'] = {
275
+ authenticationRoute: 'sign-in'
276
+ };
277
+ ```
278
+
279
+ @class Configuration
280
+ @namespace SimpleAuth
281
+ @module simple-auth/configuration
282
+ */
283
+ __exports__["default"] = {
284
+ /**
285
+ The route to transition to for authentication.
286
+
287
+ @property authenticationRoute
288
+ @readOnly
289
+ @static
290
+ @type String
291
+ @default 'login'
292
+ */
293
+ authenticationRoute: 'login',
294
+
295
+ /**
296
+ The route to transition to after successful authentication.
297
+
298
+ @property routeAfterAuthentication
299
+ @readOnly
300
+ @static
301
+ @type String
302
+ @default 'index'
303
+ */
304
+ routeAfterAuthentication: 'index',
305
+
306
+ /**
307
+ The name of the property that the session is injected with into routes and
308
+ controllers.
309
+
310
+ @property sessionPropertyName
311
+ @readOnly
312
+ @static
313
+ @type String
314
+ @default 'session'
315
+ */
316
+ sessionPropertyName: 'session',
317
+
318
+ /**
319
+ The authorizer factory to use as it is registered with Ember's container,
320
+ see
321
+ [Ember's API docs](http://emberjs.com/api/classes/Ember.Application.html#method_register);
322
+ when the application does not interact with a server that requires
323
+ authorized requests, no auzthorizer is needed.
324
+
325
+ @property authorizer
326
+ @readOnly
327
+ @static
328
+ @type String
329
+ @default null
330
+ */
331
+ authorizer: null,
332
+
333
+ /**
334
+ The session factory to use as it is registered with Ember's container,
335
+ see
336
+ [Ember's API docs](http://emberjs.com/api/classes/Ember.Application.html#method_register).
337
+
338
+ @property session
339
+ @readOnly
340
+ @static
341
+ @type String
342
+ @default 'simple-auth-session:main'
343
+ */
344
+ session: 'simple-auth-session:main',
345
+
346
+ /**
347
+ The store factory to use as it is registered with Ember's container, see
348
+ [Ember's API docs](http://emberjs.com/api/classes/Ember.Application.html#method_register).
349
+
350
+ @property store
351
+ @readOnly
352
+ @static
353
+ @type String
354
+ @default simple-auth-session-store:local-storage
355
+ */
356
+ store: 'simple-auth-session-store:local-storage',
357
+
358
+ /**
359
+ Ember Simple Auth will never authorize requests going to a different origin
360
+ than the one the Ember.js application was loaded from; to explicitely
361
+ enable authorization for additional origins, whitelist those origins with
362
+ this setting. _Beware that origins consist of protocol, host and port (port
363
+ can be left out when it is 80 for HTTP or 443 for HTTPS)_
364
+
365
+ @property crossOriginWhitelist
366
+ @readOnly
367
+ @static
368
+ @type Array
369
+ @default []
370
+ */
371
+ crossOriginWhitelist: [],
372
+
373
+ /**
374
+ @property applicationRootUrl
375
+ @private
376
+ */
377
+ applicationRootUrl: null,
378
+
379
+ /**
380
+ @method load
381
+ @private
382
+ */
383
+ load: function(container) {
384
+ var globalConfig = getGlobalConfig('simple-auth');
385
+ this.authenticationRoute = globalConfig.authenticationRoute || this.authenticationRoute;
386
+ this.routeAfterAuthentication = globalConfig.routeAfterAuthentication || this.routeAfterAuthentication;
387
+ this.sessionPropertyName = globalConfig.sessionPropertyName || this.sessionPropertyName;
388
+ this.authorizer = globalConfig.authorizer || this.authorizer;
389
+ this.session = globalConfig.session || this.session;
390
+ this.store = globalConfig.store || this.store;
391
+ this.crossOriginWhitelist = globalConfig.crossOriginWhitelist || this.crossOriginWhitelist;
392
+ this.applicationRootUrl = container.lookup('router:main').get('rootURL') || '/';
393
+ }
394
+ };
395
+ });
396
+ define("simple-auth/ember",
397
+ ["./initializer"],
398
+ function(__dependency1__) {
399
+ "use strict";
400
+ var initializer = __dependency1__["default"];
401
+
402
+ Ember.onLoad('Ember.Application', function(Application) {
403
+ Application.initializer(initializer);
404
+ });
405
+ });
406
+ define("simple-auth/initializer",
407
+ ["./setup","exports"],
408
+ function(__dependency1__, __exports__) {
409
+ "use strict";
410
+ var setup = __dependency1__["default"];
411
+
412
+ __exports__["default"] = {
413
+ name: 'simple-auth',
414
+ initialize: function(container, application) {
415
+ setup(container, application);
416
+ }
417
+ };
418
+ });
419
+ define("simple-auth/mixins/application-route-mixin",
420
+ ["./../configuration","exports"],
421
+ function(__dependency1__, __exports__) {
422
+ "use strict";
423
+ var Configuration = __dependency1__["default"];
424
+
425
+ /**
426
+ The mixin for the application route; defines actions to authenticate the
427
+ session as well as to invalidate it. These actions can be used in all
428
+ templates like this:
429
+
430
+ ```handlebars
431
+ {{#if session.isAuthenticated}}
432
+ <a {{ action 'invalidateSession' }}>Logout</a>
433
+ {{else}}
434
+ <a {{ action 'authenticateSession' }}>Login</a>
435
+ {{/if}}
436
+ ```
437
+
438
+ or in the case that the application uses a dedicated route for logging in:
439
+
440
+ ```handlebars
441
+ {{#if session.isAuthenticated}}
442
+ <a {{ action 'invalidateSession' }}>Logout</a>
443
+ {{else}}
444
+ {{#link-to 'login'}}Login{{/link-to}}
445
+ {{/if}}
446
+ ```
447
+
448
+ This mixin also defines actions that are triggered whenever the session is
449
+ successfully authenticated or invalidated and whenever authentication or
450
+ invalidation fails. These actions provide a good starting point for adding
451
+ custom behavior to these events.
452
+
453
+ __When this mixin is used and the application's `ApplicationRoute` defines
454
+ the `beforeModel` method, that method has to call `_super`.__
455
+
456
+ Using this mixin is optional. Without using it, the session's events will not
457
+ be automatically translated into route actions but would have to be handled
458
+ inidivially, e.g. in an initializer:
459
+
460
+ ```javascript
461
+ Ember.Application.initializer({
462
+ name: 'authentication',
463
+ after: 'simple-auth',
464
+ initialize: function(container, application) {
465
+ var applicationRoute = container.lookup('route:application');
466
+ var session = container.lookup('simple-auth-session:main');
467
+ // handle the session events
468
+ session.on('sessionAuthenticationSucceeded', function() {
469
+ applicationRoute.transitionTo('index');
470
+ });
471
+ }
472
+ });
473
+ ```
474
+
475
+ @class ApplicationRouteMixin
476
+ @namespace SimpleAuth
477
+ @module simple-auth/mixins/application-route-mixin
478
+ @extends Ember.Mixin
479
+ @static
480
+ */
481
+ __exports__["default"] = Ember.Mixin.create({
482
+ /**
483
+ @method beforeModel
484
+ @private
485
+ */
486
+ beforeModel: function(transition) {
487
+ this._super(transition);
488
+ if (!this.get('_authEventListenersAssigned')) {
489
+ this.set('_authEventListenersAssigned', true);
490
+ var _this = this;
491
+ Ember.A([
492
+ 'sessionAuthenticationSucceeded',
493
+ 'sessionAuthenticationFailed',
494
+ 'sessionInvalidationSucceeded',
495
+ 'sessionInvalidationFailed',
496
+ 'authorizationFailed'
497
+ ]).forEach(function(event) {
498
+ _this.get(Configuration.sessionPropertyName).on(event, function(error) {
499
+ Array.prototype.unshift.call(arguments, event);
500
+ transition.send.apply(transition, arguments);
501
+ });
502
+ });
503
+ }
504
+ },
505
+
506
+ actions: {
507
+ /**
508
+ This action triggers transition to the
509
+ [`Configuration.authenticationRoute`](#SimpleAuth-Configuration-authenticationRoute).
510
+ It can be used in templates as shown above. It is also triggered
511
+ automatically by the
512
+ [`AuthenticatedRouteMixin`](#SimpleAuth-AuthenticatedRouteMixin) whenever
513
+ a route that requries authentication is accessed but the session is not
514
+ currently authenticated.
515
+
516
+ __For an application that works without an authentication route (e.g.
517
+ because it opens a new window to handle authentication there), this is
518
+ the action to override, e.g.:__
519
+
520
+ ```javascript
521
+ App.ApplicationRoute = Ember.Route.extend(SimpleAuth.ApplicationRouteMixin, {
522
+ actions: {
523
+ authenticateSession: function() {
524
+ this.get('session').authenticate('authenticator:custom', {});
525
+ }
526
+ }
527
+ });
528
+ ```
529
+
530
+ @method actions.authenticateSession
531
+ */
532
+ authenticateSession: function() {
533
+ this.transitionTo(Configuration.authenticationRoute);
534
+ },
535
+
536
+ /**
537
+ This action is triggered whenever the session is successfully
538
+ authenticated. If there is a transition that was previously intercepted
539
+ by
540
+ [`AuthenticatedRouteMixin#beforeModel`](#SimpleAuth-AuthenticatedRouteMixin-beforeModel)
541
+ it will retry it. If there is no such transition, this action transitions
542
+ to the
543
+ [`Configuration.routeAfterAuthentication`](#SimpleAuth-Configuration-routeAfterAuthentication).
544
+
545
+ @method actions.sessionAuthenticationSucceeded
546
+ */
547
+ sessionAuthenticationSucceeded: function() {
548
+ var attemptedTransition = this.get(Configuration.sessionPropertyName).get('attemptedTransition');
549
+ if (attemptedTransition) {
550
+ attemptedTransition.retry();
551
+ this.get(Configuration.sessionPropertyName).set('attemptedTransition', null);
552
+ } else {
553
+ this.transitionTo(Configuration.routeAfterAuthentication);
554
+ }
555
+ },
556
+
557
+ /**
558
+ This action is triggered whenever session authentication fails. The
559
+ `error` argument is the error object that the promise the authenticator
560
+ returns rejects with. (see
561
+ [`Authenticators.Base#authenticate`](#SimpleAuth-Authenticators-Base-authenticate)).
562
+
563
+ It can be overridden to display error messages etc.:
564
+
565
+ ```javascript
566
+ App.ApplicationRoute = Ember.Route.extend(SimpleAuth.ApplicationRouteMixin, {
567
+ actions: {
568
+ sessionAuthenticationFailed: function(error) {
569
+ this.controllerFor('application').set('loginErrorMessage', error.message);
570
+ }
571
+ }
572
+ });
573
+ ```
574
+
575
+ @method actions.sessionAuthenticationFailed
576
+ @param {any} error The error the promise returned by the authenticator rejects with, see [`Authenticators.Base#authenticate`](#SimpleAuth-Authenticators-Base-authenticate)
577
+ */
578
+ sessionAuthenticationFailed: function(error) {
579
+ },
580
+
581
+ /**
582
+ This action invalidates the session (see
583
+ [`Session#invalidate`](#SimpleAuth-Session-invalidate)).
584
+ If invalidation succeeds, it reloads the application (see
585
+ [`ApplicationRouteMixin#sessionInvalidationSucceeded`](#SimpleAuth-ApplicationRouteMixin-sessionInvalidationSucceeded)).
586
+
587
+ @method actions.invalidateSession
588
+ */
589
+ invalidateSession: function() {
590
+ this.get(Configuration.sessionPropertyName).invalidate();
591
+ },
592
+
593
+ /**
594
+ This action is invoked whenever the session is successfully invalidated.
595
+ It reloads the Ember.js application by redirecting the browser to the
596
+ application's root URL so that all in-memory data (such as Ember Data
597
+ stores etc.) gets cleared. The root URL is automatically retrieved from
598
+ the Ember.js application's router (see
599
+ http://emberjs.com/guides/routing/#toc_specifying-a-root-url).
600
+
601
+ @method actions.sessionInvalidationSucceeded
602
+ */
603
+ sessionInvalidationSucceeded: function() {
604
+ window.location.replace(Configuration.applicationRootUrl);
605
+ },
606
+
607
+ /**
608
+ This action is invoked whenever session invalidation fails. This mainly
609
+ serves as an extension point to add custom behavior and does nothing by
610
+ default.
611
+
612
+ @method actions.sessionInvalidationFailed
613
+ @param {any} error The error the promise returned by the authenticator rejects with, see [`Authenticators.Base#invalidate`](#SimpleAuth-Authenticators-Base-invalidate)
614
+ */
615
+ sessionInvalidationFailed: function(error) {
616
+ },
617
+
618
+ /**
619
+ This action is invoked when an authorization error occurs (which is
620
+ the case __when the server responds with HTTP status 401__). It
621
+ invalidates the session and reloads the application (see
622
+ [`ApplicationRouteMixin#sessionInvalidationSucceeded`](#SimpleAuth-ApplicationRouteMixin-sessionInvalidationSucceeded)).
623
+
624
+ @method actions.authorizationFailed
625
+ */
626
+ authorizationFailed: function() {
627
+ if (this.get(Configuration.sessionPropertyName).get('isAuthenticated')) {
628
+ this.get(Configuration.sessionPropertyName).invalidate();
629
+ }
630
+ }
631
+ }
632
+ });
633
+ });
634
+ define("simple-auth/mixins/authenticated-route-mixin",
635
+ ["./../configuration","exports"],
636
+ function(__dependency1__, __exports__) {
637
+ "use strict";
638
+ var Configuration = __dependency1__["default"];
639
+
640
+ /**
641
+ This mixin is for routes that require the session to be authenticated to be
642
+ accessible. Including this mixin in a route automatically adds a hook that
643
+ enforces the session to be authenticated and redirects to the
644
+ [`Configuration.authenticationRoute`](#SimpleAuth-Configuration-authenticationRoute)
645
+ if it is not.
646
+
647
+ ```javascript
648
+ // app/routes/protected.js
649
+ import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixin';
650
+
651
+ export default Ember.Route.extend(AuthenticatedRouteMixin);
652
+ ```
653
+
654
+ `AuthenticatedRouteMixin` performs the redirect in the `beforeModel` method
655
+ so that in all methods executed after that the session is guaranteed to be
656
+ authenticated. __If `beforeModel` is overridden, ensure that the custom
657
+ implementation calls `this._super(transition)`__ so that the session
658
+ enforcement code is actually executed.
659
+
660
+ @class AuthenticatedRouteMixin
661
+ @namespace SimpleAuth
662
+ @module simple-auth/mixins/authenticated-route-mixin
663
+ @extends Ember.Mixin
664
+ @static
665
+ */
666
+ __exports__["default"] = Ember.Mixin.create({
667
+ /**
668
+ This method implements the enforcement of the session being authenticated.
669
+ If the session is not authenticated, the current transition will be aborted
670
+ and a redirect will be triggered to the
671
+ [`Configuration.authenticationRoute`](#SimpleAuth-Configuration-authenticationRoute).
672
+ The method also saves the intercepted transition so that it can be retried
673
+ after the session has been authenticated (see
674
+ [`ApplicationRouteMixin#sessionAuthenticationSucceeded`](#SimpleAuth-ApplicationRouteMixin-sessionAuthenticationSucceeded)).
675
+
676
+ @method beforeModel
677
+ @param {Transition} transition The transition that lead to this route
678
+ */
679
+ beforeModel: function(transition) {
680
+ this._super(transition);
681
+ if (!this.get(Configuration.sessionPropertyName).get('isAuthenticated')) {
682
+ transition.abort();
683
+ this.get(Configuration.sessionPropertyName).set('attemptedTransition', transition);
684
+ transition.send('authenticateSession');
685
+ }
686
+ }
687
+ });
688
+ });
689
+ define("simple-auth/mixins/authentication-controller-mixin",
690
+ ["./../configuration","exports"],
691
+ function(__dependency1__, __exports__) {
692
+ "use strict";
693
+ var Configuration = __dependency1__["default"];
694
+
695
+ /**
696
+ This mixin is for the controller that handles the
697
+ [`Configuration.authenticationRoute`](#SimpleAuth-Configuration-authenticationRoute).
698
+ It provides the `authenticate` action that will authenticate the session with
699
+ the configured authenticator (see
700
+ [`AuthenticationControllerMixin#authenticator`](#SimpleAuth-AuthenticationControllerMixin-authenticator)).
701
+
702
+ @class AuthenticationControllerMixin
703
+ @namespace SimpleAuth
704
+ @module simple-auth/mixins/authentication-controller-mixin
705
+ @extends Ember.Mixin
706
+ */
707
+ __exports__["default"] = Ember.Mixin.create({
708
+ /**
709
+ The authenticator factory to use as it is registered with Ember's
710
+ container, see
711
+ [Ember's API docs](http://emberjs.com/api/classes/Ember.Application.html#method_register).
712
+
713
+ @property authenticator
714
+ @type String
715
+ @default null
716
+ */
717
+ authenticator: null,
718
+
719
+ actions: {
720
+ /**
721
+ This action will authenticate the session with the configured
722
+ authenticator (see
723
+ [`AuthenticationControllerMixin#authenticator`](#SimpleAuth-AuthenticationControllerMixin-authenticator),
724
+ [`Session#authenticate`](#SimpleAuth-Session-authenticate)).
725
+
726
+ @method actions.authenticate
727
+ @param {Object} options Any options the authenticator needs to authenticate the session
728
+ */
729
+ authenticate: function(options) {
730
+ var authenticator = this.get('authenticator');
731
+ Ember.assert('AuthenticationControllerMixin/LoginControllerMixin require the authenticator property to be set on the controller', !Ember.isEmpty(authenticator));
732
+ return this.get(Configuration.sessionPropertyName).authenticate(this.get('authenticator'), options);
733
+ }
734
+ }
735
+ });
736
+ });
737
+ define("simple-auth/mixins/login-controller-mixin",
738
+ ["./../configuration","./authentication-controller-mixin","exports"],
739
+ function(__dependency1__, __dependency2__, __exports__) {
740
+ "use strict";
741
+ var Configuration = __dependency1__["default"];
742
+ var AuthenticationControllerMixin = __dependency2__["default"];
743
+
744
+ /**
745
+ This mixin is for the controller that handles the
746
+ [`Configuration.authenticationRoute`](#SimpleAuth-Configuration-authenticationRoute)
747
+ if the used authentication mechanism works with a login form that asks for
748
+ user credentials. It provides the `authenticate` action that will
749
+ authenticate the session with the configured authenticator when invoked.
750
+ __This is a specialization of
751
+ [`AuthenticationControllerMixin`](#SimpleAuth-AuthenticationControllerMixin).__
752
+
753
+ Accompanying the controller that this mixin is mixed in the application needs
754
+ to have a `login` template with the fields `identification` and `password` as
755
+ well as an actionable button or link that triggers the `authenticate` action,
756
+ e.g.:
757
+
758
+ ```handlebars
759
+ <form {{action 'authenticate' on='submit'}}>
760
+ <label for="identification">Login</label>
761
+ {{input id='identification' placeholder='Enter Login' value=identification}}
762
+ <label for="password">Password</label>
763
+ {{input id='password' placeholder='Enter Password' type='password' value=password}}
764
+ <button type="submit">Login</button>
765
+ </form>
766
+ ```
767
+
768
+ @class LoginControllerMixin
769
+ @namespace SimpleAuth
770
+ @module simple-auth/mixins/login-controller-mixin
771
+ @extends SimpleAuth.AuthenticationControllerMixin
772
+ */
773
+ __exports__["default"] = Ember.Mixin.create(AuthenticationControllerMixin, {
774
+ actions: {
775
+ /**
776
+ This action will authenticate the session with the configured
777
+ authenticator (see
778
+ [AuthenticationControllerMixin#authenticator](#SimpleAuth-Authentication-authenticator))
779
+ if both `identification` and `password` are non-empty. It passes both
780
+ values to the authenticator.
781
+
782
+ __The action also resets the `password` property so sensitive data does
783
+ not stay in memory for longer than necessary.__
784
+
785
+ @method actions.authenticate
786
+ */
787
+ authenticate: function() {
788
+ var data = this.getProperties('identification', 'password');
789
+ this.set('password', null);
790
+ return this._super(data);
791
+ }
792
+ }
793
+ });
794
+ });
795
+ define("simple-auth/session",
796
+ ["exports"],
797
+ function(__exports__) {
798
+ "use strict";
799
+ /**
800
+ __The session provides access to the current authentication state as well as
801
+ any data the authenticator resolved with__ (see
802
+ [`Authenticators.Base#authenticate`](#SimpleAuth-Authenticators-Base-authenticate)).
803
+ It is created when Ember Simple Auth is set up and __injected into all
804
+ controllers and routes so that these parts of the application can always
805
+ access the current authentication state and other data__, depending on the
806
+ authenticator in use and whether the session is actually authenticated (see
807
+ [`Authenticators.Base`](#SimpleAuth-Authenticators-Base)).
808
+
809
+ The session also provides methods to authenticate and to invalidate itself
810
+ (see
811
+ [`Session#authenticate`](#SimpleAuth-Session-authenticate),
812
+ [`Session#invaldiate`](#SimpleAuth-Session-invaldiate)).
813
+ These methods are usually invoked through actions from routes or controllers.
814
+ To authenticate the session manually, simple call the
815
+ [`Session#authenticate`](#SimpleAuth-Session-authenticate)
816
+ method with the authenticator factory to use as well as any options the
817
+ authenticator needs to authenticate the session:
818
+
819
+ ```javascript
820
+ this.get('session').authenticate('authenticator:custom', { some: 'option' }).then(function() {
821
+ // authentication was successful
822
+ }, function() {
823
+ // authentication failed
824
+ });
825
+ ```
826
+
827
+ The session also observes the store and - if it is authenticated - the
828
+ authenticator for changes (see
829
+ [`Authenticators.Base`](#SimpleAuth-Authenticators-Base)
830
+ end [`Stores.Base`](#SimpleAuth-Stores-Base)).
831
+
832
+ @class Session
833
+ @namespace SimpleAuth
834
+ @module simple-auth/session
835
+ @extends Ember.ObjectProxy
836
+ @uses Ember.Evented
837
+ */
838
+ __exports__["default"] = Ember.ObjectProxy.extend(Ember.Evented, {
839
+ /**
840
+ Triggered __whenever the session is successfully authenticated__. When the
841
+ application uses the
842
+ [`ApplicationRouteMixin` mixin](#SimpleAuth-ApplicationRouteMixin),
843
+ [`ApplicationRouteMixin.actions#sessionAuthenticationSucceeded`](#SimpleAuth-ApplicationRouteMixin-sessionAuthenticationSucceeded)
844
+ will be invoked whenever this event is triggered.
845
+
846
+ @event sessionAuthenticationSucceeded
847
+ */
848
+ /**
849
+ Triggered __whenever an attempt to authenticate the session fails__. When
850
+ the application uses the
851
+ [`ApplicationRouteMixin` mixin](#SimpleAuth-ApplicationRouteMixin),
852
+ [`ApplicationRouteMixin.actions#sessionAuthenticationFailed`](#SimpleAuth-ApplicationRouteMixin-sessionAuthenticationFailed)
853
+ will be invoked whenever this event is triggered.
854
+
855
+ @event sessionAuthenticationFailed
856
+ @param {Object} error The error object; this depends on the authenticator in use, see [SimpleAuth.Authenticators.Base#authenticate](#SimpleAuth-Authenticators-Base-authenticate)
857
+ */
858
+ /**
859
+ Triggered __whenever the session is successfully invalidated__. When the
860
+ application uses the
861
+ [`ApplicationRouteMixin` mixin](#SimpleAuth-ApplicationRouteMixin),
862
+ [`ApplicationRouteMixin.actions#sessionInvalidationSucceeded`](#SimpleAuth-ApplicationRouteMixin-sessionInvalidationSucceeded)
863
+ will be invoked whenever this event is triggered.
864
+
865
+ @event sessionInvalidationSucceeded
866
+ */
867
+ /**
868
+ Triggered __whenever an attempt to invalidate the session fails__. When the
869
+ application uses the
870
+ [`ApplicationRouteMixin` mixin](#SimpleAuth-ApplicationRouteMixin),
871
+ [`ApplicationRouteMixin.actions#sessionInvalidationFailed`](#SimpleAuth-ApplicationRouteMixin-sessionInvalidationFailed)
872
+ will be invoked whenever this event is triggered.
873
+
874
+ @event sessionInvalidationFailed
875
+ @param {Object} error The error object; this depends on the authenticator in use, see [SimpleAuth.Authenticators.Base#invalidate](#SimpleAuth-Authenticators-Base-invalidate)
876
+ */
877
+ /**
878
+ Triggered __whenever the server rejects the authorization information
879
+ passed with a request and responds with status 401__. When the application
880
+ uses the
881
+ [`ApplicationRouteMixin` mixin](#SimpleAuth-ApplicationRouteMixin),
882
+ [`ApplicationRouteMixin.actions#authorizationFailed`](#SimpleAuth-ApplicationRouteMixin-authorizationFailed)
883
+ will be invoked whenever this event is triggered.
884
+
885
+ @event authorizationFailed
886
+ */
887
+
888
+ /**
889
+ The authenticator factory to use as it is registered with Ember's
890
+ container, see
891
+ [Ember's API docs](http://emberjs.com/api/classes/Ember.Application.html#method_register).
892
+ This is only set when the session is currently authenticated.
893
+
894
+ @property authenticator
895
+ @type String
896
+ @readOnly
897
+ @default null
898
+ */
899
+ authenticator: null,
900
+ /**
901
+ The store used to persist session properties.
902
+
903
+ @property store
904
+ @type SimpleAuth.Stores.Base
905
+ @readOnly
906
+ @default null
907
+ */
908
+ store: null,
909
+ /**
910
+ The Ember.js container,
911
+
912
+ @property container
913
+ @type Container
914
+ @readOnly
915
+ @default null
916
+ */
917
+ container: null,
918
+ /**
919
+ Returns whether the session is currently authenticated.
920
+
921
+ @property isAuthenticated
922
+ @type Boolean
923
+ @readOnly
924
+ @default false
925
+ */
926
+ isAuthenticated: false,
927
+ /**
928
+ @property attemptedTransition
929
+ @private
930
+ */
931
+ attemptedTransition: null,
932
+ /**
933
+ @property content
934
+ @private
935
+ */
936
+ content: {},
937
+
938
+ /**
939
+ Authenticates the session with an `authenticator` and appropriate
940
+ `options`. __This delegates the actual authentication work to the
941
+ `authenticator`__ and handles the returned promise accordingly (see
942
+ [`Authenticators.Base#authenticate`](#SimpleAuth-Authenticators-Base-authenticate)).
943
+ All data the authenticator resolves with will be saved in the session.
944
+
945
+ __This method returns a promise itself. A resolving promise indicates that
946
+ the session was successfully authenticated__ while a rejecting promise
947
+ indicates that authentication failed and the session remains
948
+ unauthenticated.
949
+
950
+ @method authenticate
951
+ @param {String} authenticator The authenticator factory to use as it is registered with Ember's container, see [Ember's API docs](http://emberjs.com/api/classes/Ember.Application.html#method_register)
952
+ @param {Object} options The options to pass to the authenticator; depending on the type of authenticator these might be a set of credentials, a Facebook OAuth Token, etc.
953
+ @return {Ember.RSVP.Promise} A promise that resolves when the session was authenticated successfully
954
+ */
955
+ authenticate: function(authenticator, options) {
956
+ Ember.assert('Session#authenticate requires the authenticator factory to be specified, was ' + authenticator, !Ember.isEmpty(authenticator));
957
+ var _this = this;
958
+ return new Ember.RSVP.Promise(function(resolve, reject) {
959
+ _this.container.lookup(authenticator).authenticate(options).then(function(content) {
960
+ _this.setup(authenticator, content, true);
961
+ resolve();
962
+ }, function(error) {
963
+ _this.clear();
964
+ _this.trigger('sessionAuthenticationFailed', error);
965
+ reject(error);
966
+ });
967
+ });
968
+ },
969
+
970
+ /**
971
+ Invalidates the session with the authenticator it is currently
972
+ authenticated with (see
973
+ [`Session#authenticator`](#SimpleAuth-Session-authenticator)). __This
974
+ invokes the authenticator's `invalidate` method and handles the returned
975
+ promise accordingly__ (see
976
+ [`Authenticators.Base#invalidate`](#SimpleAuth-Authenticators-Base-invalidate)).
977
+
978
+ __This method returns a promise itself. A resolving promise indicates that
979
+ the session was successfully invalidated__ while a rejecting promise
980
+ indicates that the promise returned by the `authenticator` rejected and
981
+ thus invalidation was cancelled. In that case the session remains
982
+ authenticated. Once the session is successfully invalidated it clears all
983
+ of its data.
984
+
985
+ @method invalidate
986
+ @return {Ember.RSVP.Promise} A promise that resolves when the session was invalidated successfully
987
+ */
988
+ invalidate: function() {
989
+ Ember.assert('Session#invalidate requires the session to be authenticated', this.get('isAuthenticated'));
990
+ var _this = this;
991
+ return new Ember.RSVP.Promise(function(resolve, reject) {
992
+ var authenticator = _this.container.lookup(_this.authenticator);
993
+ authenticator.invalidate(_this.content).then(function() {
994
+ authenticator.off('sessionDataUpdated');
995
+ _this.clear(true);
996
+ resolve();
997
+ }, function(error) {
998
+ _this.trigger('sessionInvalidationFailed', error);
999
+ reject(error);
1000
+ });
1001
+ });
1002
+ },
1003
+
1004
+ /**
1005
+ @method restore
1006
+ @private
1007
+ */
1008
+ restore: function() {
1009
+ var _this = this;
1010
+ return new Ember.RSVP.Promise(function(resolve, reject) {
1011
+ var restoredContent = _this.store.restore();
1012
+ var authenticator = restoredContent.authenticator;
1013
+ if (!!authenticator) {
1014
+ delete restoredContent.authenticator;
1015
+ _this.container.lookup(authenticator).restore(restoredContent).then(function(content) {
1016
+ _this.setup(authenticator, content);
1017
+ resolve();
1018
+ }, function() {
1019
+ _this.store.clear();
1020
+ reject();
1021
+ });
1022
+ } else {
1023
+ _this.store.clear();
1024
+ reject();
1025
+ }
1026
+ });
1027
+ },
1028
+
1029
+ /**
1030
+ @method setup
1031
+ @private
1032
+ */
1033
+ setup: function(authenticator, content, trigger) {
1034
+ content = Ember.merge(Ember.merge({}, this.content), content);
1035
+ trigger = !!trigger && !this.get('isAuthenticated');
1036
+ this.beginPropertyChanges();
1037
+ this.setProperties({
1038
+ isAuthenticated: true,
1039
+ authenticator: authenticator,
1040
+ content: content
1041
+ });
1042
+ this.bindToAuthenticatorEvents();
1043
+ this.updateStore();
1044
+ this.endPropertyChanges();
1045
+ if (trigger) {
1046
+ this.trigger('sessionAuthenticationSucceeded');
1047
+ }
1048
+ },
1049
+
1050
+ /**
1051
+ @method clear
1052
+ @private
1053
+ */
1054
+ clear: function(trigger) {
1055
+ trigger = !!trigger && this.get('isAuthenticated');
1056
+ this.beginPropertyChanges();
1057
+ this.setProperties({
1058
+ isAuthenticated: false,
1059
+ authenticator: null,
1060
+ content: {}
1061
+ });
1062
+ this.store.clear();
1063
+ this.endPropertyChanges();
1064
+ if (trigger) {
1065
+ this.trigger('sessionInvalidationSucceeded');
1066
+ }
1067
+ },
1068
+
1069
+ /**
1070
+ @method setUnknownProperty
1071
+ @private
1072
+ */
1073
+ setUnknownProperty: function(key, value) {
1074
+ var result = this._super(key, value);
1075
+ this.updateStore();
1076
+ return result;
1077
+ },
1078
+
1079
+ /**
1080
+ @method updateStore
1081
+ @private
1082
+ */
1083
+ updateStore: function() {
1084
+ var data = this.content;
1085
+ if (!Ember.isEmpty(this.authenticator)) {
1086
+ data = Ember.merge({ authenticator: this.authenticator }, data);
1087
+ }
1088
+ if (!Ember.isEmpty(data)) {
1089
+ this.store.persist(data);
1090
+ }
1091
+ },
1092
+
1093
+ /**
1094
+ @method bindToAuthenticatorEvents
1095
+ @private
1096
+ */
1097
+ bindToAuthenticatorEvents: function() {
1098
+ var _this = this;
1099
+ var authenticator = this.container.lookup(this.authenticator);
1100
+ authenticator.off('sessionDataUpdated');
1101
+ authenticator.off('sessionDataInvalidated');
1102
+ authenticator.on('sessionDataUpdated', function(content) {
1103
+ _this.setup(_this.authenticator, content);
1104
+ });
1105
+ authenticator.on('sessionDataInvalidated', function(content) {
1106
+ _this.clear(true);
1107
+ });
1108
+ },
1109
+
1110
+ /**
1111
+ @method bindToStoreEvents
1112
+ @private
1113
+ */
1114
+ bindToStoreEvents: function() {
1115
+ var _this = this;
1116
+ this.store.on('sessionDataUpdated', function(content) {
1117
+ var authenticator = content.authenticator;
1118
+ if (!!authenticator) {
1119
+ delete content.authenticator;
1120
+ _this.container.lookup(authenticator).restore(content).then(function(content) {
1121
+ _this.setup(authenticator, content, true);
1122
+ }, function() {
1123
+ _this.clear(true);
1124
+ });
1125
+ } else {
1126
+ _this.clear(true);
1127
+ }
1128
+ });
1129
+ }.observes('store')
1130
+ });
1131
+ });
1132
+ define("simple-auth/setup",
1133
+ ["./configuration","./session","./stores/local-storage","./stores/ephemeral","exports"],
1134
+ function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __exports__) {
1135
+ "use strict";
1136
+ var Configuration = __dependency1__["default"];
1137
+ var Session = __dependency2__["default"];
1138
+ var LocalStorage = __dependency3__["default"];
1139
+ var Ephemeral = __dependency4__["default"];
1140
+
1141
+ function extractLocationOrigin(location) {
1142
+ if (Ember.typeOf(location) === 'string') {
1143
+ var link = document.createElement('a');
1144
+ link.href = location;
1145
+ //IE requires the following line when url is relative.
1146
+ //First assignment of relative url to link.href results in absolute url on link.href but link.hostname and other properties are not set
1147
+ //Second assignment of absolute url to link.href results in link.hostname and other properties being set as expected
1148
+ link.href = link.href;
1149
+ location = link;
1150
+ }
1151
+ var port = location.port;
1152
+ if (Ember.isEmpty(port)) {
1153
+ //need to include the port whether its actually present or not as some versions of IE will always set it
1154
+ port = location.protocol === 'http:' ? '80' : (location.protocol === 'https:' ? '443' : '');
1155
+ }
1156
+ return location.protocol + '//' + location.hostname + (port !== '' ? ':' + port : '');
1157
+ }
1158
+
1159
+ var urlOrigins = {};
1160
+ var crossOriginWhitelist;
1161
+ function shouldAuthorizeRequest(options) {
1162
+ if (options.crossDomain === false) {
1163
+ return true;
1164
+ }
1165
+ var urlOrigin = urlOrigins[options.url] = urlOrigins[options.url] || extractLocationOrigin(options.url);
1166
+ return crossOriginWhitelist.indexOf(urlOrigin) > -1;
1167
+ }
1168
+
1169
+ function registerFactories(container) {
1170
+ container.register('simple-auth-session-store:local-storage', LocalStorage);
1171
+ container.register('simple-auth-session-store:ephemeral', Ephemeral);
1172
+ container.register('simple-auth-session:main', Session);
1173
+ }
1174
+
1175
+ /**
1176
+ @method setup
1177
+ @private
1178
+ **/
1179
+ __exports__["default"] = function(container, application) {
1180
+ Configuration.load(container);
1181
+ application.deferReadiness();
1182
+ registerFactories(container);
1183
+
1184
+ var store = container.lookup(Configuration.store);
1185
+ var session = container.lookup(Configuration.session);
1186
+ session.setProperties({ store: store, container: container });
1187
+ Ember.A(['controller', 'route']).forEach(function(component) {
1188
+ container.injection(component, Configuration.sessionPropertyName, Configuration.session);
1189
+ });
1190
+
1191
+ crossOriginWhitelist = Ember.A(Configuration.crossOriginWhitelist).map(function(origin) {
1192
+ return extractLocationOrigin(origin);
1193
+ });
1194
+
1195
+ if (!Ember.isEmpty(Configuration.authorizer)) {
1196
+ var authorizer = container.lookup(Configuration.authorizer);
1197
+ if (!!authorizer) {
1198
+ authorizer.set('session', session);
1199
+ Ember.$.ajaxPrefilter(function(options, originalOptions, jqXHR) {
1200
+ if (!authorizer.isDestroyed && shouldAuthorizeRequest(options)) {
1201
+ authorizer.authorize(jqXHR, options);
1202
+ }
1203
+ });
1204
+ Ember.$(document).ajaxError(function(event, jqXHR, setting, exception) {
1205
+ if (jqXHR.status === 401) {
1206
+ session.trigger('authorizationFailed');
1207
+ }
1208
+ });
1209
+ }
1210
+ } else {
1211
+ Ember.Logger.debug('No authorizer factory was configured for Ember Simple Auth - specify one if backend requests need to be authorized.');
1212
+ }
1213
+
1214
+ var advanceReadiness = function() {
1215
+ application.advanceReadiness();
1216
+ };
1217
+ session.restore().then(advanceReadiness, advanceReadiness);
1218
+ }
1219
+ });
1220
+ define("simple-auth/stores/base",
1221
+ ["../utils/flat-objects-are-equal","exports"],
1222
+ function(__dependency1__, __exports__) {
1223
+ "use strict";
1224
+ var flatObjectsAreEqual = __dependency1__["default"];
1225
+
1226
+ /**
1227
+ The base for all store types. __This serves as a starting point for
1228
+ implementing custom stores and must not be used directly.__
1229
+
1230
+ Stores are used to persist the session's state so it survives a page reload
1231
+ and is synchronized across multiple tabs or windows of the same application.
1232
+ The store to be used with the application can be configured in the global
1233
+ configuration object:
1234
+
1235
+ ```js
1236
+ window.ENV = window.ENV || {};
1237
+ window.ENV['simple-auth'] = {
1238
+ store: 'simple-auth-session-store:local-storage'
1239
+ }
1240
+ ```
1241
+
1242
+ @class Base
1243
+ @namespace SimpleAuth.Stores
1244
+ @module simple-auth/stores/base
1245
+ @extends Ember.Object
1246
+ @uses Ember.Evented
1247
+ */
1248
+ __exports__["default"] = Ember.Object.extend(Ember.Evented, {
1249
+ /**
1250
+ __Triggered when the data that constitutes the session changes in the
1251
+ store. This usually happens because the session is authenticated or
1252
+ invalidated in another tab or window.__ The session automatically catches
1253
+ that event, passes the updated data to its authenticator's
1254
+ [`Authenticators.Base#restore`](#SimpleAuth-Authenticators-Base-restore)
1255
+ method and handles the result of that invocation accordingly.
1256
+
1257
+ @event sessionDataUpdated
1258
+ @param {Object} data The updated session data
1259
+ */
1260
+
1261
+ /**
1262
+ Persists the `data` in the store. This actually replaces all currently
1263
+ stored data.
1264
+
1265
+ `Stores.Base`'s implementation does nothing.
1266
+
1267
+ @method persist
1268
+ @param {Object} data The data to persist
1269
+ */
1270
+ persist: function(data) {
1271
+ },
1272
+
1273
+ /**
1274
+ Restores all data currently saved in the store as a plain object.
1275
+
1276
+ `Stores.Base`'s implementation always returns an empty plain Object.
1277
+
1278
+ @method restore
1279
+ @return {Object} The data currently persisted in the store.
1280
+ */
1281
+ restore: function() {
1282
+ return {};
1283
+ },
1284
+
1285
+ /**
1286
+ Clears the store.
1287
+
1288
+ `Stores.Base`'s implementation does nothing.
1289
+
1290
+ @method clear
1291
+ */
1292
+ clear: function() {
1293
+ }
1294
+ });
1295
+ });
1296
+ define("simple-auth/stores/ephemeral",
1297
+ ["./base","exports"],
1298
+ function(__dependency1__, __exports__) {
1299
+ "use strict";
1300
+ var Base = __dependency1__["default"];
1301
+
1302
+ /**
1303
+ Store that saves its data in memory and thus __is not actually persistent__.
1304
+ It does also not synchronize the session's state across multiple tabs or
1305
+ windows as those cannot share memory.
1306
+
1307
+ __This store is mainly useful for testing.__
1308
+
1309
+ _The factory for this store is registered as
1310
+ `'simple-auth-session-store:ephemeral'` in Ember's container._
1311
+
1312
+ @class Ephemeral
1313
+ @namespace SimpleAuth.Stores
1314
+ @module simple-auth/stores/ephemeral
1315
+ @extends Stores.Base
1316
+ */
1317
+ __exports__["default"] = Base.extend({
1318
+ /**
1319
+ @method init
1320
+ @private
1321
+ */
1322
+ init: function() {
1323
+ this.clear();
1324
+ },
1325
+
1326
+ /**
1327
+ Persists the `data`.
1328
+
1329
+ @method persist
1330
+ @param {Object} data The data to persist
1331
+ */
1332
+ persist: function(data) {
1333
+ this._data = JSON.stringify(data || {});
1334
+ },
1335
+
1336
+ /**
1337
+ Restores all data currently saved as a plain object.
1338
+
1339
+ @method restore
1340
+ @return {Object} All data currently persisted
1341
+ */
1342
+ restore: function() {
1343
+ return JSON.parse(this._data) || {};
1344
+ },
1345
+
1346
+ /**
1347
+ Clears the store.
1348
+
1349
+ @method clear
1350
+ */
1351
+ clear: function() {
1352
+ delete this._data;
1353
+ this._data = '{}';
1354
+ }
1355
+ });
1356
+ });
1357
+ define("simple-auth/stores/local-storage",
1358
+ ["./base","../utils/flat-objects-are-equal","exports"],
1359
+ function(__dependency1__, __dependency2__, __exports__) {
1360
+ "use strict";
1361
+ var Base = __dependency1__["default"];
1362
+ var flatObjectsAreEqual = __dependency2__["default"];
1363
+
1364
+ /**
1365
+ Store that saves its data in the browser's `localStorage`.
1366
+
1367
+ _The factory for this store is registered as
1368
+ `'simple-auth-session-store:local-storage'` in Ember's container._
1369
+
1370
+ __`Stores.LocalStorage` is Ember Simple Auth's default store.__
1371
+
1372
+ @class LocalStorage
1373
+ @namespace SimpleAuth.Stores
1374
+ @module simple-auth/stores/local-storage
1375
+ @extends Stores.Base
1376
+ */
1377
+ __exports__["default"] = Base.extend({
1378
+ /**
1379
+ The key the store stores the data in.
1380
+
1381
+ @property key
1382
+ @type String
1383
+ @default 'ember_simple_auth:session'
1384
+ */
1385
+ key: 'ember_simple_auth:session',
1386
+
1387
+ /**
1388
+ @method init
1389
+ @private
1390
+ */
1391
+ init: function() {
1392
+ this.bindToStorageEvents();
1393
+ },
1394
+
1395
+ /**
1396
+ Persists the `data` in the `localStorage`.
1397
+
1398
+ @method persist
1399
+ @param {Object} data The data to persist
1400
+ */
1401
+ persist: function(data) {
1402
+ data = JSON.stringify(data || {});
1403
+ localStorage.setItem(this.key, data);
1404
+ this._lastData = this.restore();
1405
+ },
1406
+
1407
+ /**
1408
+ Restores all data currently saved in the `localStorage` identified by the
1409
+ `keyPrefix` as one plain object.
1410
+
1411
+ @method restore
1412
+ @return {Object} All data currently persisted in the `localStorage`
1413
+ */
1414
+ restore: function() {
1415
+ var data = localStorage.getItem(this.key);
1416
+ return JSON.parse(data) || {};
1417
+ },
1418
+
1419
+ /**
1420
+ Clears the store by deleting all `localStorage` keys prefixed with the
1421
+ `keyPrefix`.
1422
+
1423
+ @method clear
1424
+ */
1425
+ clear: function() {
1426
+ localStorage.removeItem(this.key);
1427
+ this._lastData = null;
1428
+ },
1429
+
1430
+ /**
1431
+ @method bindToStorageEvents
1432
+ @private
1433
+ */
1434
+ bindToStorageEvents: function() {
1435
+ var _this = this;
1436
+ Ember.$(window).bind('storage', function(e) {
1437
+ var data = _this.restore();
1438
+ if (!flatObjectsAreEqual(data, _this._lastData)) {
1439
+ _this._lastData = data;
1440
+ _this.trigger('sessionDataUpdated', data);
1441
+ }
1442
+ });
1443
+ }
1444
+ });
1445
+ });
1446
+ define("simple-auth/utils/flat-objects-are-equal",
1447
+ ["exports"],
1448
+ function(__exports__) {
1449
+ "use strict";
1450
+ /**
1451
+ @method flatObjectsAreEqual
1452
+ @private
1453
+ */
1454
+ __exports__["default"] = function(a, b) {
1455
+ function sortObject(object) {
1456
+ var array = [];
1457
+ for (var property in object) {
1458
+ array.push([property, object[property]]);
1459
+ }
1460
+ return array.sort(function(a, b) {
1461
+ if (a[0] < b[0]) {
1462
+ return -1;
1463
+ } else if (a[0] > b[0]) {
1464
+ return 1;
1465
+ } else {
1466
+ return 0;
1467
+ }
1468
+ });
1469
+ }
1470
+ return JSON.stringify(sortObject(a)) === JSON.stringify(sortObject(b));
1471
+ }
1472
+ });
1473
+ define("simple-auth/utils/get-global-config",
1474
+ ["exports"],
1475
+ function(__exports__) {
1476
+ "use strict";
1477
+ var global = (typeof window !== 'undefined') ? window : {};
1478
+
1479
+ __exports__["default"] = function(scope) {
1480
+ return(global.ENV || {})[scope] || {};
1481
+ }
1482
+ });
1483
+ define("simple-auth/utils/is-secure-url",
1484
+ ["exports"],
1485
+ function(__exports__) {
1486
+ "use strict";
1487
+ /**
1488
+ @method isSecureUrl
1489
+ @private
1490
+ */
1491
+ __exports__["default"] = function(url) {
1492
+ var link = document.createElement('a');
1493
+ link.href = url;
1494
+ link.href = link.href;
1495
+ return link.protocol == 'https:';
1496
+ }
1497
+ });
1498
+ var initializer = requireModule('simple-auth/initializer').default;
1499
+ var Configuration = requireModule('simple-auth/configuration').default;
1500
+ var Session = requireModule('simple-auth/session').default;
1501
+ var BaseAuthenticator = requireModule('simple-auth/authenticators/base').default;
1502
+ var BaseAuthorizer = requireModule('simple-auth/authorizers/base').default;
1503
+ var BaseStore = requireModule('simple-auth/stores/base').default;
1504
+ var LocalStorageStore = requireModule('simple-auth/stores/local-storage').default;
1505
+ var EphemeralStore = requireModule('simple-auth/stores/ephemeral').default;
1506
+ var flatObjectsAreEqual = requireModule('simple-auth/utils/flat-objects-are-equal').default;
1507
+ var isSecureUrl = requireModule('simple-auth/utils/is-secure-url').default;
1508
+ var getGlobalConfig = requireModule('simple-auth/utils/get-global-config').default;
1509
+ var ApplicationRouteMixin = requireModule('simple-auth/mixins/application-route-mixin').default;
1510
+ var AuthenticatedRouteMixin = requireModule('simple-auth/mixins/authenticated-route-mixin').default;
1511
+ var AuthenticationControllerMixin = requireModule('simple-auth/mixins/authentication-controller-mixin').default;
1512
+ var LoginControllerMixin = requireModule('simple-auth/mixins/login-controller-mixin').default;
1513
+
1514
+ global.SimpleAuth = {
1515
+ Configuration: Configuration,
1516
+
1517
+ Session: Session,
1518
+
1519
+ Authenticators: {
1520
+ Base: BaseAuthenticator
1521
+ },
1522
+
1523
+ Authorizers: {
1524
+ Base: BaseAuthorizer
1525
+ },
1526
+
1527
+ Stores: {
1528
+ Base: BaseStore,
1529
+ LocalStorage: LocalStorageStore,
1530
+ Ephemeral: EphemeralStore
1531
+ },
1532
+
1533
+ Utils: {
1534
+ flatObjectsAreEqual: flatObjectsAreEqual,
1535
+ isSecureUrl: isSecureUrl,
1536
+ getGlobalConfig: getGlobalConfig
1537
+ },
1538
+
1539
+ ApplicationRouteMixin: ApplicationRouteMixin,
1540
+ AuthenticatedRouteMixin: AuthenticatedRouteMixin,
1541
+ AuthenticationControllerMixin: AuthenticationControllerMixin,
1542
+ LoginControllerMixin: LoginControllerMixin
1543
+ };
1544
+
1545
+ requireModule('simple-auth/ember');
1546
+
1547
+ Ember.libraries.register('Ember Simple Auth', '0.6.4');
1548
+ })((typeof global !== 'undefined') ? global : window);