@sparkle-learning/core 0.0.16 → 0.0.20
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.
- package/dist/cjs/{PrivateRoute-946ab42c.js → PrivateRoute-cee9b061.js} +44 -45
- package/dist/cjs/{active-router-dca7573e.js → active-router-3bd7b540.js} +1 -1
- package/dist/cjs/{app-globals-bea78913.js → app-globals-98121d6d.js} +1 -1
- package/dist/cjs/{assets.service-5098e79c.js → assets.service-0c759d51.js} +2 -27
- package/dist/cjs/{httpService-6377985c.js → auth.store-aba3d22f.js} +31 -5
- package/dist/cjs/{button-active-1edcd24e.js → button-active-9456fb4d.js} +1 -1
- package/dist/cjs/compass-svg.cjs.entry.js +132 -0
- package/dist/cjs/context-consumer.cjs.entry.js +1 -1
- package/dist/cjs/course-select.cjs.entry.js +1 -1
- package/dist/cjs/environment-config.service-0e02b049.js +29 -0
- package/dist/cjs/facilitator.service-e1e2f719.js +94 -0
- package/dist/cjs/feed.service-518d18fd.js +5802 -0
- package/dist/cjs/header-mobile-collapse_60.cjs.entry.js +86 -0
- package/dist/cjs/{icons-fc80a947.js → icons-a0fef92b.js} +2 -8
- package/dist/cjs/{index-123ceda0.js → index-58b3ee93.js} +3 -3
- package/dist/cjs/{index-786a6369.js → index-7bcd36a0.js} +1 -1
- package/dist/cjs/{index-56cc404a.js → index-fbf4d3bf.js} +2 -0
- package/dist/cjs/index.cjs.js +9 -8
- package/dist/cjs/index.es-6a9d5ef8.js +13834 -0
- package/dist/cjs/ion-action-sheet.cjs.entry.js +4 -4
- package/dist/cjs/ion-alert.cjs.entry.js +4 -4
- package/dist/cjs/ion-app.cjs.entry.js +3 -3
- package/dist/cjs/ion-back-button.cjs.entry.js +89 -0
- package/dist/cjs/ion-backdrop.cjs.entry.js +2 -2
- package/dist/cjs/ion-badge.cjs.entry.js +2 -2
- package/dist/cjs/{ion-back-button_4.cjs.entry.js → ion-buttons_3.cjs.entry.js} +2 -83
- package/dist/cjs/ion-card-header.cjs.entry.js +2 -2
- package/dist/cjs/ion-card-subtitle.cjs.entry.js +2 -2
- package/dist/cjs/ion-card-title.cjs.entry.js +2 -2
- package/dist/cjs/ion-chip.cjs.entry.js +2 -2
- package/dist/cjs/{ion-content.cjs.entry.js → ion-content_2.cjs.entry.js} +259 -2
- package/dist/cjs/ion-datetime.cjs.entry.js +3 -3
- package/dist/cjs/ion-fab-button.cjs.entry.js +2 -2
- package/dist/cjs/ion-fab-list.cjs.entry.js +2 -2
- package/dist/cjs/ion-fab.cjs.entry.js +2 -2
- package/dist/cjs/ion-footer.cjs.entry.js +2 -2
- package/dist/cjs/ion-img.cjs.entry.js +2 -2
- package/dist/cjs/ion-infinite-scroll-content.cjs.entry.js +2 -2
- package/dist/cjs/ion-infinite-scroll.cjs.entry.js +2 -2
- package/dist/cjs/ion-item-divider.cjs.entry.js +2 -2
- package/dist/cjs/ion-item-group.cjs.entry.js +2 -2
- package/dist/cjs/ion-item-option.cjs.entry.js +2 -2
- package/dist/cjs/ion-item-options.cjs.entry.js +2 -2
- package/dist/cjs/ion-item-sliding.cjs.entry.js +2 -2
- package/dist/cjs/ion-loading.cjs.entry.js +3 -3
- package/dist/cjs/ion-menu-button.cjs.entry.js +4 -4
- package/dist/cjs/ion-menu-toggle.cjs.entry.js +4 -4
- package/dist/cjs/ion-menu.cjs.entry.js +3 -3
- package/dist/cjs/ion-modal.cjs.entry.js +4 -4
- package/dist/cjs/ion-nav-link.cjs.entry.js +1 -1
- package/dist/cjs/ion-nav.cjs.entry.js +3 -3
- package/dist/cjs/ion-note.cjs.entry.js +2 -2
- package/dist/cjs/ion-picker-column.cjs.entry.js +2 -2
- package/dist/cjs/ion-picker.cjs.entry.js +3 -3
- package/dist/cjs/ion-popover.cjs.entry.js +4 -4
- package/dist/cjs/ion-progress-bar.cjs.entry.js +2 -2
- package/dist/cjs/ion-refresher-content.cjs.entry.js +2 -2
- package/dist/cjs/ion-refresher.cjs.entry.js +2 -2
- package/dist/cjs/ion-reorder-group.cjs.entry.js +2 -2
- package/dist/cjs/ion-reorder.cjs.entry.js +2 -2
- package/dist/cjs/ion-route-redirect.cjs.entry.js +1 -1
- package/dist/cjs/ion-route.cjs.entry.js +1 -1
- package/dist/cjs/ion-router-link.cjs.entry.js +2 -2
- package/dist/cjs/ion-router-outlet.cjs.entry.js +3 -3
- package/dist/cjs/ion-router.cjs.entry.js +1 -1
- package/dist/cjs/ion-searchbar.cjs.entry.js +2 -2
- package/dist/cjs/ion-segment-button.cjs.entry.js +2 -2
- package/dist/cjs/ion-segment.cjs.entry.js +2 -2
- package/dist/cjs/ion-select-popover.cjs.entry.js +3 -3
- package/dist/cjs/ion-select_2.cjs.entry.js +3 -3
- package/dist/cjs/ion-skeleton-text.cjs.entry.js +2 -2
- package/dist/cjs/ion-slide.cjs.entry.js +2 -2
- package/dist/cjs/ion-slides.cjs.entry.js +2 -2
- package/dist/cjs/ion-split-pane.cjs.entry.js +2 -2
- package/dist/cjs/ion-tab-bar.cjs.entry.js +2 -2
- package/dist/cjs/ion-tab-button.cjs.entry.js +2 -2
- package/dist/cjs/ion-tab.cjs.entry.js +1 -1
- package/dist/cjs/ion-tabs.cjs.entry.js +1 -1
- package/dist/cjs/ion-textarea.cjs.entry.js +2 -2
- package/dist/cjs/ion-thumbnail.cjs.entry.js +2 -2
- package/dist/cjs/ion-toast.cjs.entry.js +3 -3
- package/dist/cjs/ion-toggle.cjs.entry.js +2 -2
- package/dist/cjs/ion-virtual-scroll.cjs.entry.js +1 -1
- package/dist/cjs/{ionic-global-57e21b7b.js → ionic-global-4930d319.js} +1 -1
- package/dist/cjs/{ios.transition-b6898b4e.js → ios.transition-6e1fd3d6.js} +2 -2
- package/dist/cjs/loader.cjs.js +4 -4
- package/dist/cjs/{md.transition-dcccb17e.js → md.transition-3652ad78.js} +2 -2
- package/dist/cjs/{menu-toggle-util-36785376.js → menu-toggle-util-a8fb4c56.js} +1 -1
- package/dist/cjs/{overlays-09ece60d.js → overlays-08a817ea.js} +1 -1
- package/dist/cjs/purify-9804ff8d.js +1355 -0
- package/dist/cjs/sparkle-animation-player.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-code.cjs.entry.js +2 -2
- package/dist/cjs/sparkle-compass-post.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-compass.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-core.cjs.js +4 -4
- package/dist/cjs/sparkle-emoji.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-facilitator-notes-form.cjs.entry.js +118 -0
- package/dist/cjs/sparkle-feed-post.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-feedback.cjs.entry.js +19 -6
- package/dist/cjs/sparkle-goal-form.cjs.entry.js +75 -34
- package/dist/cjs/sparkle-gww-comment-list.cjs.entry.js +2 -2
- package/dist/cjs/sparkle-gww-graph.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-lower-content-nav.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-menu-collapsible.cjs.entry.js +2 -2
- package/dist/cjs/sparkle-modal-image.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-notfound-page.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-overlay.cjs.entry.js +92 -0
- package/dist/cjs/sparkle-poll.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-quiz-container.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-quiz-feedback_5.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-quiz.cjs.entry.js +4 -3
- package/dist/cjs/sparkle-select.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-sidebar.cjs.entry.js +43 -0
- package/dist/cjs/sparkle-tab.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-table-of-contents.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-tabs.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-youtube.cjs.entry.js +1 -1
- package/dist/cjs/{status-tap-18630b4c.js → status-tap-466a7c6a.js} +1 -1
- package/dist/cjs/stencil-async-content.cjs.entry.js +1 -1
- package/dist/cjs/stencil-route-title.cjs.entry.js +2 -2
- package/dist/cjs/stencil-router-prompt.cjs.entry.js +2 -2
- package/dist/cjs/{student.service-93a3c3e1.js → student.service-41c7c78d.js} +17 -14
- package/dist/collection/PrivateRoute.js +1 -1
- package/dist/collection/{lib → assets/lib}/SignalRAspNetCoreHelper.js +2 -2
- package/dist/collection/{lib → assets/lib}/sparkleUtility.js +1 -1
- package/dist/collection/assets/svg/profile.svg +2 -0
- package/dist/collection/collection-manifest.json +8 -0
- package/dist/collection/components/compass-svg/compass-svg.css +15 -0
- package/dist/collection/components/compass-svg/compass-svg.js +156 -0
- package/dist/collection/components/layout/facilitator/export-lessons/export-lessons.css +7 -0
- package/dist/collection/components/layout/facilitator/export-lessons/export-lessons.js +110 -0
- package/dist/collection/components/layout/facilitator/facilitator-dashboard/facilitator-dashboard.css +3 -0
- package/dist/collection/components/layout/facilitator/facilitator-dashboard/facilitator-dashboard.js +214 -0
- package/dist/collection/components/layout/facilitator/facilitator-header/facilitator-header.js +22 -11
- package/dist/collection/components/layout/facilitator/facilitator-notes/facilitator-notes-form/facilitator-notes-form.css +3 -0
- package/dist/collection/components/layout/facilitator/facilitator-notes/facilitator-notes-form/facilitator-notes-form.js +144 -0
- package/dist/collection/components/layout/facilitator/facilitator-notes/facilitator-notes.css +14 -0
- package/dist/collection/components/layout/facilitator/facilitator-notes/facilitator-notes.js +64 -0
- package/dist/collection/components/layout/facilitator/facilitator-page.css +13 -3
- package/dist/collection/components/layout/facilitator/facilitator-page.js +147 -24
- package/dist/collection/components/layout/facilitator/online-students/online-students.js +59 -2
- package/dist/collection/components/layout/page/page.js +93 -4
- package/dist/collection/components/layout/page/templates/index.js +2 -0
- package/dist/collection/components/layout/page/templates/pdf.js +8 -0
- package/dist/collection/components/mini-apps/sparkle-goals/sparkle-goal-form/sparkle-goal-form.css +3 -3
- package/dist/collection/components/mini-apps/sparkle-goals/sparkle-goal-form/sparkle-goal-form.js +98 -64
- package/dist/collection/components/mini-apps/sparkle-goals/sparkle-goal-item/sparkle-goal-item.css +12 -29
- package/dist/collection/components/mini-apps/sparkle-goals/sparkle-goal-item/sparkle-goal-item.js +23 -6
- package/dist/collection/components/mini-apps/sparkle-goals/sparkle-goal-progress/sparkle-goal-progress.css +33 -0
- package/dist/collection/components/mini-apps/sparkle-goals/sparkle-goal-progress/sparkle-goal-progress.js +37 -0
- package/dist/collection/components/mini-apps/sparkle-goals/sparkle-goals.css +8 -8
- package/dist/collection/components/mini-apps/sparkle-goals/sparkle-goals.js +15 -60
- package/dist/collection/components/mini-apps/sparkle-gww/sparkle-gww-comment-list/sparkle-gww-comment-list.css +7 -7
- package/dist/collection/components/mini-apps/sparkle-gww/sparkle-gww-comment-list/sparkle-gww-comment-list.js +5 -3
- package/dist/collection/components/mini-apps/sparkle-gww/sparkle-gww-graph/sparkle-gww-graph.css +3 -3
- package/dist/collection/components/mini-apps/sparkle-gww/sparkle-gww-item/sparkle-gww-item.css +30 -29
- package/dist/collection/components/mini-apps/sparkle-gww/sparkle-gww-item/sparkle-gww-item.js +113 -13
- package/dist/collection/components/mini-apps/sparkle-gww/sparkle-gww.css +3 -3
- package/dist/collection/components/mini-apps/sparkle-gww/sparkle-gww.js +30 -64
- package/dist/collection/components/mini-apps/sparkle-health/sparkle-health.css +10 -3
- package/dist/collection/components/mini-apps/sparkle-health/sparkle-health.js +51 -11
- package/dist/collection/components/mini-apps/sparkle-mood/sparkle-mood.css +11 -11
- package/dist/collection/components/mini-apps/sparkle-mood/sparkle-mood.js +38 -8
- package/dist/collection/components/sparkle-course-root/sparkle-course-root.css +3 -3
- package/dist/collection/components/sparkle-course-root/sparkle-course-root.js +30 -27
- package/dist/collection/components/sparkle-emoji/sparkle-emoji.css +16 -16
- package/dist/collection/components/sparkle-feed-post/sparkle-feed-post.css +3 -3
- package/dist/collection/components/sparkle-feedback/sparkle-feedback.css +3 -3
- package/dist/collection/components/sparkle-feedback/sparkle-feedback.js +14 -1
- package/dist/collection/components/sparkle-forgot-password/sparkle-forgot-password.js +40 -6
- package/dist/collection/components/sparkle-login/sparkle-login.js +5 -3
- package/dist/collection/components/sparkle-poll/sparkle-poll.css +3 -3
- package/dist/collection/components/sparkle-quiz/sparkle-quiz-feedback/sparkle-quiz-feedback.css +3 -3
- package/dist/collection/components/sparkle-quiz/sparkle-quiz-input/sparkle-quiz-input.css +3 -3
- package/dist/collection/components/sparkle-quiz/sparkle-quiz-poll/sparkle-quiz-poll.css +3 -3
- package/dist/collection/components/sparkle-quiz/sparkle-quiz-select/sparkle-quiz-select.css +3 -3
- package/dist/collection/components/sparkle-quiz-container/sparkle-quiz-container.css +3 -3
- package/dist/collection/components/sparkle-reset-password/sparkle-reset-password.css +3 -0
- package/dist/collection/components/sparkle-reset-password/sparkle-reset-password.js +126 -0
- package/dist/collection/components/sparkle-root/sparkle-root.css +16 -0
- package/dist/collection/components/sparkle-root/sparkle-root.js +24 -1
- package/dist/collection/components/sparkle-signup/sparkle-signup.js +18 -14
- package/dist/collection/components/sparkle-unauthorized/sparkle-unauthorized.css +13 -13
- package/dist/collection/components/sparkle-user-enrollment/sparkle-user-enrollment.css +3 -3
- package/dist/collection/components/sparkle-user-profile/sparkle-user-profile.css +54 -3
- package/dist/collection/components/sparkle-user-profile/sparkle-user-profile.js +35 -8
- package/dist/collection/components/sparkle-validation-error/sparkle-validation-error.css +11 -0
- package/dist/collection/components/sparkle-validation-error/sparkle-validation-error.js +44 -0
- package/dist/collection/icons.js +1 -0
- package/dist/collection/models/class.model.js +5 -1
- package/dist/collection/models/facilitator-dashboard.model.js +5 -0
- package/dist/collection/services/account.service.js +42 -4
- package/dist/collection/services/appdata.service.js +60 -0
- package/dist/collection/services/auth/auth.service.js +34 -25
- package/dist/collection/services/environment/environment-config.js +6 -2
- package/dist/collection/services/facilitator.service.js +76 -0
- package/dist/collection/services/feed.service.js +43 -0
- package/dist/collection/services/httpService.js +16 -3
- package/dist/collection/services/media.service.js +29 -0
- package/dist/collection/services/signalR.service.js +85 -0
- package/dist/collection/services/student.service.js +8 -7
- package/dist/collection/stores/auth.store.js +2 -1
- package/dist/collection/stores/facilitator.store.js +11 -2
- package/dist/collection/stores/feed.store.js +3 -1
- package/dist/collection/stores/goal.store.js +2 -0
- package/dist/collection/stores/media.store.js +5 -0
- package/dist/collection/stores/signalR.store.js +6 -0
- package/dist/collection/stores/user.store.js +3 -1
- package/dist/collection/util.js +23 -1
- package/dist/collection/utils.js +0 -1
- package/dist/esm/{PrivateRoute-b34b53e0.js → PrivateRoute-9f0973bb.js} +42 -42
- package/dist/esm/{active-router-866d742c.js → active-router-b3ae32c7.js} +1 -1
- package/dist/esm/{app-globals-a5620b62.js → app-globals-6451faf3.js} +1 -1
- package/dist/esm/{assets.service-da511a45.js → assets.service-66e848b8.js} +2 -26
- package/dist/esm/{httpService-ed44926c.js → auth.store-dd944bc2.js} +31 -6
- package/dist/esm/{button-active-fe7ddd19.js → button-active-97535443.js} +1 -1
- package/dist/esm/compass-svg.entry.js +128 -0
- package/dist/esm/context-consumer.entry.js +1 -1
- package/dist/esm/course-select.entry.js +1 -1
- package/dist/esm/environment-config.service-2b5d692b.js +27 -0
- package/dist/esm/facilitator.service-cddb2feb.js +91 -0
- package/dist/esm/feed.service-0fda1e36.js +5787 -0
- package/dist/esm/header-mobile-collapse_60.entry.js +19 -0
- package/dist/esm/{icons-375b5504.js → icons-33e5804c.js} +3 -7
- package/dist/esm/{index-181d9e06.js → index-55fc9f5e.js} +2 -1
- package/dist/esm/{index-db21c1c7.js → index-a94619f9.js} +3 -3
- package/dist/esm/{index-c6bfe5ca.js → index-dc09784f.js} +1 -1
- package/dist/esm/index.es-8ad3b6a1.js +13748 -0
- package/dist/esm/index.js +7 -6
- package/dist/esm/ion-action-sheet.entry.js +4 -4
- package/dist/esm/ion-alert.entry.js +4 -4
- package/dist/esm/ion-app.entry.js +3 -3
- package/dist/esm/ion-back-button.entry.js +85 -0
- package/dist/esm/ion-backdrop.entry.js +2 -2
- package/dist/esm/ion-badge.entry.js +2 -2
- package/dist/esm/{ion-back-button_4.entry.js → ion-buttons_3.entry.js} +4 -84
- package/dist/esm/ion-card-header.entry.js +2 -2
- package/dist/esm/ion-card-subtitle.entry.js +2 -2
- package/dist/esm/ion-card-title.entry.js +2 -2
- package/dist/esm/ion-chip.entry.js +2 -2
- package/dist/esm/{ion-content.entry.js → ion-content_2.entry.js} +259 -3
- package/dist/esm/ion-datetime.entry.js +3 -3
- package/dist/esm/ion-fab-button.entry.js +2 -2
- package/dist/esm/ion-fab-list.entry.js +2 -2
- package/dist/esm/ion-fab.entry.js +2 -2
- package/dist/esm/ion-footer.entry.js +2 -2
- package/dist/esm/ion-img.entry.js +2 -2
- package/dist/esm/ion-infinite-scroll-content.entry.js +2 -2
- package/dist/esm/ion-infinite-scroll.entry.js +2 -2
- package/dist/esm/ion-item-divider.entry.js +2 -2
- package/dist/esm/ion-item-group.entry.js +2 -2
- package/dist/esm/ion-item-option.entry.js +2 -2
- package/dist/esm/ion-item-options.entry.js +2 -2
- package/dist/esm/ion-item-sliding.entry.js +2 -2
- package/dist/esm/ion-loading.entry.js +3 -3
- package/dist/esm/ion-menu-button.entry.js +4 -4
- package/dist/esm/ion-menu-toggle.entry.js +4 -4
- package/dist/esm/ion-menu.entry.js +3 -3
- package/dist/esm/ion-modal.entry.js +4 -4
- package/dist/esm/ion-nav-link.entry.js +1 -1
- package/dist/esm/ion-nav.entry.js +3 -3
- package/dist/esm/ion-note.entry.js +2 -2
- package/dist/esm/ion-picker-column.entry.js +2 -2
- package/dist/esm/ion-picker.entry.js +3 -3
- package/dist/esm/ion-popover.entry.js +4 -4
- package/dist/esm/ion-progress-bar.entry.js +2 -2
- package/dist/esm/ion-refresher-content.entry.js +2 -2
- package/dist/esm/ion-refresher.entry.js +2 -2
- package/dist/esm/ion-reorder-group.entry.js +2 -2
- package/dist/esm/ion-reorder.entry.js +2 -2
- package/dist/esm/ion-route-redirect.entry.js +1 -1
- package/dist/esm/ion-route.entry.js +1 -1
- package/dist/esm/ion-router-link.entry.js +2 -2
- package/dist/esm/ion-router-outlet.entry.js +3 -3
- package/dist/esm/ion-router.entry.js +1 -1
- package/dist/esm/ion-searchbar.entry.js +2 -2
- package/dist/esm/ion-segment-button.entry.js +2 -2
- package/dist/esm/ion-segment.entry.js +2 -2
- package/dist/esm/ion-select-popover.entry.js +3 -3
- package/dist/esm/ion-select_2.entry.js +3 -3
- package/dist/esm/ion-skeleton-text.entry.js +2 -2
- package/dist/esm/ion-slide.entry.js +2 -2
- package/dist/esm/ion-slides.entry.js +2 -2
- package/dist/esm/ion-split-pane.entry.js +2 -2
- package/dist/esm/ion-tab-bar.entry.js +2 -2
- package/dist/esm/ion-tab-button.entry.js +2 -2
- package/dist/esm/ion-tab.entry.js +1 -1
- package/dist/esm/ion-tabs.entry.js +1 -1
- package/dist/esm/ion-textarea.entry.js +2 -2
- package/dist/esm/ion-thumbnail.entry.js +2 -2
- package/dist/esm/ion-toast.entry.js +3 -3
- package/dist/esm/ion-toggle.entry.js +2 -2
- package/dist/esm/ion-virtual-scroll.entry.js +1 -1
- package/dist/esm/{ionic-global-2d79c2f2.js → ionic-global-1f9287cc.js} +1 -1
- package/dist/esm/{ios.transition-e24a66ff.js → ios.transition-d01abefd.js} +2 -2
- package/dist/esm/loader.js +4 -4
- package/dist/esm/{md.transition-a4f96d01.js → md.transition-245ffa55.js} +2 -2
- package/dist/esm/{menu-toggle-util-f9838cfb.js → menu-toggle-util-fe83fcf5.js} +1 -1
- package/dist/esm/{overlays-0222dd55.js → overlays-8363621c.js} +2 -2
- package/dist/esm/purify-76634fc8.js +1353 -0
- package/dist/esm/sparkle-animation-player.entry.js +1 -1
- package/dist/esm/sparkle-code.entry.js +2 -2
- package/dist/esm/sparkle-compass-post.entry.js +1 -1
- package/dist/esm/sparkle-compass.entry.js +1 -1
- package/dist/esm/sparkle-core.js +4 -4
- package/dist/esm/sparkle-emoji.entry.js +1 -1
- package/dist/esm/sparkle-facilitator-notes-form.entry.js +114 -0
- package/dist/esm/sparkle-feed-post.entry.js +1 -1
- package/dist/esm/sparkle-feedback.entry.js +19 -6
- package/dist/esm/sparkle-goal-form.entry.js +73 -32
- package/dist/esm/sparkle-gww-comment-list.entry.js +2 -2
- package/dist/esm/sparkle-gww-graph.entry.js +1 -1
- package/dist/esm/sparkle-lower-content-nav.entry.js +1 -1
- package/dist/esm/sparkle-menu-collapsible.entry.js +2 -2
- package/dist/esm/sparkle-modal-image.entry.js +1 -1
- package/dist/esm/sparkle-notfound-page.entry.js +1 -1
- package/dist/esm/sparkle-overlay.entry.js +88 -0
- package/dist/esm/sparkle-poll.entry.js +1 -1
- package/dist/esm/sparkle-quiz-container.entry.js +1 -1
- package/dist/esm/sparkle-quiz-feedback_5.entry.js +1 -1
- package/dist/esm/sparkle-quiz.entry.js +3 -2
- package/dist/esm/sparkle-select.entry.js +1 -1
- package/dist/esm/sparkle-sidebar.entry.js +39 -0
- package/dist/esm/sparkle-tab.entry.js +1 -1
- package/dist/esm/sparkle-table-of-contents.entry.js +1 -1
- package/dist/esm/sparkle-tabs.entry.js +1 -1
- package/dist/esm/sparkle-youtube.entry.js +1 -1
- package/dist/esm/{status-tap-dac23492.js → status-tap-9221cd79.js} +1 -1
- package/dist/esm/stencil-async-content.entry.js +1 -1
- package/dist/esm/stencil-route-title.entry.js +2 -2
- package/dist/esm/stencil-router-prompt.entry.js +2 -2
- package/dist/esm/{student.service-7c806a49.js → student.service-c36c5a75.js} +12 -9
- package/dist/sparkle-core/index.esm.js +1 -1
- package/dist/sparkle-core/{p-f4e2b82a.entry.js → p-016bf847.entry.js} +1 -1
- package/dist/sparkle-core/p-019d9d02.entry.js +1 -0
- package/dist/sparkle-core/p-03eb2164.js +1 -0
- package/dist/sparkle-core/{p-5cee001e.entry.js → p-03fd27d0.entry.js} +1 -1
- package/dist/sparkle-core/p-07018d29.js +1 -0
- package/dist/sparkle-core/p-083d57a6.entry.js +1 -0
- package/dist/sparkle-core/p-090f2624.js +1 -0
- package/dist/sparkle-core/{p-bc4e8c2a.entry.js → p-09d43bee.entry.js} +1 -1
- package/dist/sparkle-core/{p-b785a9ac.entry.js → p-0bd3e81f.entry.js} +1 -1
- package/dist/sparkle-core/{p-91889ff0.js → p-0e1c7c8c.js} +1 -1
- package/dist/sparkle-core/{p-1224fabd.entry.js → p-0efbc0b3.entry.js} +1 -1
- package/dist/sparkle-core/{p-7a898bda.entry.js → p-13b0cdfc.entry.js} +1 -1
- package/dist/sparkle-core/{p-586cb4d7.entry.js → p-13c9bf3a.entry.js} +1 -1
- package/dist/sparkle-core/{p-863b83d6.entry.js → p-151afa9e.entry.js} +1 -1
- package/dist/sparkle-core/{p-00adbab7.entry.js → p-15d68269.entry.js} +1 -1
- package/dist/sparkle-core/p-17507402.entry.js +1 -0
- package/dist/sparkle-core/{p-8bb44df7.entry.js → p-1bf8bed6.entry.js} +1 -1
- package/dist/sparkle-core/p-1ca4bf1d.entry.js +1 -0
- package/dist/sparkle-core/{p-5ca31915.entry.js → p-1e866c41.entry.js} +1 -1
- package/dist/sparkle-core/p-22926eed.entry.js +1 -0
- package/dist/sparkle-core/{p-517bb889.entry.js → p-2474bf60.entry.js} +1 -1
- package/dist/sparkle-core/{p-ffe93176.entry.js → p-25bbf9b4.entry.js} +1 -1
- package/dist/sparkle-core/p-2a45b732.js +1 -0
- package/dist/sparkle-core/{p-4572c448.entry.js → p-2abf4d37.entry.js} +1 -1
- package/dist/sparkle-core/{p-0c162ac4.entry.js → p-2c5edb9f.entry.js} +1 -1
- package/dist/sparkle-core/p-30b641a4.entry.js +1 -0
- package/dist/sparkle-core/{p-c05eb884.entry.js → p-359422b6.entry.js} +1 -1
- package/dist/sparkle-core/{p-62141bd4.entry.js → p-37bfb548.entry.js} +1 -1
- package/dist/sparkle-core/{p-80e128b9.entry.js → p-3a29a75b.entry.js} +1 -1
- package/dist/sparkle-core/{p-e5e40803.entry.js → p-3bb55510.entry.js} +1 -1
- package/dist/sparkle-core/p-3be0a218.js +1 -0
- package/dist/sparkle-core/{p-e5845154.entry.js → p-3cd28c60.entry.js} +1 -1
- package/dist/sparkle-core/{p-6f571ea1.entry.js → p-3f5d7a08.entry.js} +1 -1
- package/dist/sparkle-core/p-40db85ac.entry.js +1 -0
- package/dist/sparkle-core/{p-114fcfc1.entry.js → p-447163be.entry.js} +1 -1
- package/dist/sparkle-core/{p-bbb3b417.entry.js → p-49265a8e.entry.js} +1 -1
- package/dist/sparkle-core/{p-76c4e33b.entry.js → p-4950f841.entry.js} +1 -1
- package/dist/sparkle-core/{p-1cd371a7.entry.js → p-4d8cb365.entry.js} +1 -1
- package/dist/sparkle-core/p-4e28ca37.entry.js +1 -0
- package/dist/sparkle-core/{p-f985d69e.entry.js → p-5073899e.entry.js} +1 -1
- package/dist/sparkle-core/p-52355989.entry.js +1 -0
- package/dist/sparkle-core/{p-1898fe4c.entry.js → p-581ca370.entry.js} +1 -1
- package/dist/sparkle-core/{p-48d24341.entry.js → p-5b366c20.entry.js} +1 -1
- package/dist/sparkle-core/{p-ff092368.entry.js → p-5dce20b9.entry.js} +1 -1
- package/dist/sparkle-core/{p-c1a4ba92.entry.js → p-6006beec.entry.js} +1 -1
- package/dist/sparkle-core/{p-d4339e9c.entry.js → p-600d04fc.entry.js} +1 -1
- package/dist/sparkle-core/{p-257fd781.entry.js → p-60828739.entry.js} +1 -1
- package/dist/sparkle-core/{p-e48343fe.entry.js → p-6112b180.entry.js} +1 -1
- package/dist/sparkle-core/p-660fccf6.js +1 -0
- package/dist/sparkle-core/{p-0b04e1c4.entry.js → p-66e3bd1c.entry.js} +1 -1
- package/dist/sparkle-core/{p-9523cc6c.entry.js → p-66eb6b7a.entry.js} +1 -1
- package/dist/sparkle-core/p-67ddec3f.entry.js +1 -0
- package/dist/sparkle-core/p-68cb7d41.entry.js +1 -0
- package/dist/sparkle-core/{p-e7d32b53.entry.js → p-68f3c93d.entry.js} +1 -1
- package/dist/sparkle-core/p-69cd49de.js +1 -0
- package/dist/sparkle-core/{p-fb3ea85e.js → p-6d506f4e.js} +1 -1
- package/dist/sparkle-core/{p-7c39c5c0.entry.js → p-6edbdde5.entry.js} +1 -1
- package/dist/sparkle-core/p-6f0ecbe3.js +1 -0
- package/dist/sparkle-core/{p-7b7ebe04.entry.js → p-73a646fb.entry.js} +1 -1
- package/dist/sparkle-core/{p-0e1cdb86.js → p-765b8593.js} +1 -1
- package/dist/sparkle-core/{p-22836c22.js → p-770128c8.js} +1 -1
- package/dist/sparkle-core/{p-05bcee18.entry.js → p-7b37d523.entry.js} +1 -1
- package/dist/sparkle-core/{p-1d62b3ff.entry.js → p-7d83d006.entry.js} +1 -1
- package/dist/sparkle-core/p-7f3d5344.js +1 -0
- package/dist/sparkle-core/{p-99d08952.entry.js → p-81651f26.entry.js} +1 -1
- package/dist/sparkle-core/{p-d046110e.entry.js → p-85d31769.entry.js} +1 -1
- package/dist/sparkle-core/{p-42443d61.entry.js → p-86148067.entry.js} +1 -1
- package/dist/sparkle-core/{p-88ea26d4.entry.js → p-8b5bc1d6.entry.js} +1 -1
- package/dist/sparkle-core/{p-e0603c01.entry.js → p-8c3ee44c.entry.js} +1 -1
- package/dist/sparkle-core/{p-fce285b3.entry.js → p-9007a06b.entry.js} +1 -1
- package/dist/sparkle-core/{p-89aca87d.entry.js → p-90482861.entry.js} +1 -1
- package/dist/sparkle-core/{p-8dddaae1.entry.js → p-92d42c10.entry.js} +1 -1
- package/dist/sparkle-core/p-9a443f51.js +1 -0
- package/dist/sparkle-core/{p-aae8e3b8.entry.js → p-9ca56f5d.entry.js} +1 -1
- package/dist/sparkle-core/{p-c5cc6d79.entry.js → p-a061537e.entry.js} +1 -1
- package/dist/sparkle-core/{p-b0bb946d.entry.js → p-a250e2ae.entry.js} +1 -1
- package/dist/sparkle-core/{p-dc903858.entry.js → p-abe2676a.entry.js} +1 -1
- package/dist/sparkle-core/{p-64592d28.entry.js → p-ac5e5308.entry.js} +1 -1
- package/dist/sparkle-core/{p-6df23697.entry.js → p-afbaad64.entry.js} +1 -1
- package/dist/sparkle-core/p-b080c1e3.entry.js +1 -0
- package/dist/sparkle-core/p-b226f54d.js +1 -0
- package/dist/sparkle-core/p-b2d4840f.js +3 -0
- package/dist/sparkle-core/{p-9835f777.entry.js → p-bac45a26.entry.js} +1 -1
- package/dist/sparkle-core/p-bbe5977b.entry.js +1 -0
- package/dist/sparkle-core/p-bc568dcb.js +1 -0
- package/dist/sparkle-core/{p-60d25a7f.entry.js → p-bccd9036.entry.js} +1 -1
- package/dist/sparkle-core/{p-58a6d8ab.entry.js → p-c163c16d.entry.js} +1 -1
- package/dist/sparkle-core/{p-8626ebe6.entry.js → p-c3166584.entry.js} +1 -1
- package/dist/sparkle-core/{p-589d4664.entry.js → p-c34269ae.entry.js} +1 -1
- package/dist/sparkle-core/{p-3c3194fd.js → p-c466ee32.js} +1 -1
- package/dist/sparkle-core/p-c6710592.entry.js +1 -0
- package/dist/sparkle-core/{p-71f184d9.entry.js → p-c7022391.entry.js} +1 -1
- package/dist/sparkle-core/{p-1cd3c5d0.entry.js → p-c70b9765.entry.js} +1 -1
- package/dist/sparkle-core/{p-2e286dc5.entry.js → p-c82b05e0.entry.js} +1 -1
- package/dist/sparkle-core/{p-ebe7e674.entry.js → p-cf2332bb.entry.js} +1 -1
- package/dist/sparkle-core/{p-07d16606.entry.js → p-d069b834.entry.js} +1 -1
- package/dist/sparkle-core/{p-92fa1d62.js → p-d4ad796c.js} +1 -1
- package/dist/sparkle-core/{p-d9669c41.entry.js → p-d4d9aa4a.entry.js} +1 -1
- package/dist/sparkle-core/{p-f87fecb0.entry.js → p-d5023db0.entry.js} +1 -1
- package/dist/sparkle-core/p-d6152660.entry.js +1 -0
- package/dist/sparkle-core/{p-7e8645c2.js → p-d63406d8.js} +1 -1
- package/dist/sparkle-core/{p-3a75bd70.entry.js → p-dba672d5.entry.js} +1 -1
- package/dist/sparkle-core/{p-2fa5a8dd.entry.js → p-dd73d01a.entry.js} +1 -1
- package/dist/sparkle-core/p-de33872d.entry.js +1 -0
- package/dist/sparkle-core/p-dee2128a.entry.js +1 -0
- package/dist/sparkle-core/{p-7f4ae7be.entry.js → p-df07e132.entry.js} +1 -1
- package/dist/sparkle-core/p-e5d5aaa5.js +1 -0
- package/dist/sparkle-core/{p-0f83c1c3.entry.js → p-e72c6d87.entry.js} +1 -1
- package/dist/sparkle-core/{p-1a6ca540.entry.js → p-e818b11d.entry.js} +1 -1
- package/dist/sparkle-core/{p-e7d9176a.entry.js → p-e8df6ea6.entry.js} +1 -1
- package/dist/sparkle-core/{p-b9f544da.entry.js → p-e975924a.entry.js} +1 -1
- package/dist/sparkle-core/p-eb56aa20.entry.js +1 -0
- package/dist/sparkle-core/p-ec2e029e.js +483 -0
- package/dist/sparkle-core/{p-9a192334.js → p-ef2a2172.js} +1 -1
- package/dist/sparkle-core/p-f1a4ab33.entry.js +1 -0
- package/dist/sparkle-core/{p-cac9f43c.entry.js → p-f43ac631.entry.js} +1 -1
- package/dist/sparkle-core/{p-826aea5e.entry.js → p-f72a6e6d.entry.js} +1 -1
- package/dist/sparkle-core/{p-c557858e.entry.js → p-f9143c5d.entry.js} +1 -1
- package/dist/sparkle-core/{p-540238c1.entry.js → p-fd62283e.entry.js} +1 -1
- package/dist/sparkle-core/{p-6620c98e.entry.js → p-fef71e0e.entry.js} +1 -1
- package/dist/sparkle-core/sparkle-core.css +1 -1
- package/dist/sparkle-core/sparkle-core.esm.js +1 -1
- package/dist/types/{lib → assets/lib}/SignalRAspNetCoreHelper.d.ts +0 -0
- package/dist/types/{lib → assets/lib}/sparkleUtility.d.ts +0 -0
- package/dist/types/components/compass-svg/compass-svg.d.ts +34 -0
- package/dist/types/components/layout/facilitator/export-lessons/export-lessons.d.ts +16 -0
- package/dist/types/components/layout/facilitator/facilitator-dashboard/facilitator-dashboard.d.ts +22 -0
- package/dist/types/components/layout/facilitator/facilitator-header/facilitator-header.d.ts +1 -0
- package/dist/types/components/layout/facilitator/facilitator-notes/facilitator-notes-form/facilitator-notes-form.d.ts +24 -0
- package/dist/types/components/layout/facilitator/facilitator-notes/facilitator-notes.d.ts +9 -0
- package/dist/types/components/layout/facilitator/facilitator-page.d.ts +19 -2
- package/dist/types/components/layout/facilitator/online-students/online-students.d.ts +6 -0
- package/dist/types/components/layout/page/page.d.ts +8 -0
- package/dist/types/components/layout/page/templates/index.d.ts +1 -0
- package/dist/types/components/layout/page/templates/pdf.d.ts +2 -0
- package/dist/types/components/mini-apps/sparkle-goals/sparkle-goal-form/sparkle-goal-form.d.ts +6 -5
- package/dist/types/components/mini-apps/sparkle-goals/sparkle-goal-item/sparkle-goal-item.d.ts +1 -0
- package/dist/types/components/mini-apps/sparkle-goals/sparkle-goal-progress/sparkle-goal-progress.d.ts +4 -0
- package/dist/types/components/mini-apps/sparkle-goals/sparkle-goals.d.ts +3 -3
- package/dist/types/components/mini-apps/sparkle-gww/sparkle-gww-item/sparkle-gww-item.d.ts +9 -2
- package/dist/types/components/mini-apps/sparkle-gww/sparkle-gww.d.ts +4 -2
- package/dist/types/components/mini-apps/sparkle-health/sparkle-health.d.ts +4 -1
- package/dist/types/components/mini-apps/sparkle-mood/sparkle-mood.d.ts +3 -0
- package/dist/types/components/sparkle-course-root/sparkle-course-root.d.ts +6 -4
- package/dist/types/components/sparkle-forgot-password/sparkle-forgot-password.d.ts +3 -0
- package/dist/types/components/sparkle-reset-password/sparkle-reset-password.d.ts +22 -0
- package/dist/types/components/sparkle-root/sparkle-root.d.ts +4 -0
- package/dist/types/components/sparkle-signup/sparkle-signup.d.ts +1 -1
- package/dist/types/components/sparkle-user-profile/sparkle-user-profile.d.ts +4 -0
- package/dist/types/components/sparkle-validation-error/sparkle-validation-error.d.ts +7 -0
- package/dist/types/components.d.ts +143 -6
- package/dist/types/models/api.model.d.ts +8 -0
- package/dist/types/models/class.model.d.ts +59 -6
- package/dist/types/models/facilitator-dashboard.model.d.ts +61 -0
- package/dist/types/models/goal.model.d.ts +3 -2
- package/dist/types/services/account.service.d.ts +11 -2
- package/dist/types/services/appdata.service.d.ts +13 -0
- package/dist/types/services/facilitator.service.d.ts +22 -0
- package/dist/types/services/feed.service.d.ts +10 -0
- package/dist/types/services/httpService.d.ts +1 -0
- package/dist/types/services/media.service.d.ts +8 -0
- package/dist/types/services/signalR.service.d.ts +10 -0
- package/dist/types/services/student.service.d.ts +1 -1
- package/dist/types/stores/auth.store.d.ts +1 -0
- package/dist/types/stores/facilitator.store.d.ts +11 -2
- package/dist/types/stores/feed.store.d.ts +3 -1
- package/dist/types/stores/goal.store.d.ts +4 -1
- package/dist/types/stores/media.store.d.ts +8 -0
- package/dist/types/stores/signalR.store.d.ts +10 -0
- package/dist/types/stores/user.store.d.ts +3 -1
- package/dist/types/util.d.ts +11 -0
- package/package.json +7 -3
- package/dist/cjs/header-mobile-collapse_51.cjs.entry.js +0 -5285
- package/dist/cjs/ion-card-content.cjs.entry.js +0 -30
- package/dist/cjs/ion-card.cjs.entry.js +0 -70
- package/dist/cjs/ion-header.cjs.entry.js +0 -264
- package/dist/cjs/ion-spinner.cjs.entry.js +0 -64
- package/dist/cjs/sparkle-page-footer.cjs.entry.js +0 -27
- package/dist/cjs/sparkle-pagination.cjs.entry.js +0 -31
- package/dist/cjs/util-dd1e6ff1.js +0 -23
- package/dist/collection/lib/sparkle.js +0 -524
- package/dist/collection/lib/sparkle.signalr-client.js +0 -135
- package/dist/collection/pages/course/welcome-to-mind-body/introduction/animation/m4l1p1.js +0 -2884
- package/dist/esm/header-mobile-collapse_51.entry.js +0 -5231
- package/dist/esm/ion-card-content.entry.js +0 -26
- package/dist/esm/ion-card.entry.js +0 -66
- package/dist/esm/ion-header.entry.js +0 -260
- package/dist/esm/ion-spinner.entry.js +0 -60
- package/dist/esm/sparkle-page-footer.entry.js +0 -23
- package/dist/esm/sparkle-pagination.entry.js +0 -27
- package/dist/esm/util-0e88110d.js +0 -17
- package/dist/sparkle-core/p-0f511fed.entry.js +0 -1
- package/dist/sparkle-core/p-1227bbd6.entry.js +0 -1
- package/dist/sparkle-core/p-2d6fbde3.js +0 -1
- package/dist/sparkle-core/p-33b46e43.entry.js +0 -1
- package/dist/sparkle-core/p-3f769f4e.entry.js +0 -1
- package/dist/sparkle-core/p-51ffa746.entry.js +0 -1
- package/dist/sparkle-core/p-5336d922.js +0 -1
- package/dist/sparkle-core/p-58ede27f.js +0 -1
- package/dist/sparkle-core/p-5c51baac.js +0 -1
- package/dist/sparkle-core/p-5e8dc338.entry.js +0 -1
- package/dist/sparkle-core/p-6bf9263e.js +0 -1
- package/dist/sparkle-core/p-7d1b4002.entry.js +0 -1
- package/dist/sparkle-core/p-7d7a0a87.entry.js +0 -1
- package/dist/sparkle-core/p-7e8a6354.js +0 -1
- package/dist/sparkle-core/p-87e97bdd.entry.js +0 -1
- package/dist/sparkle-core/p-880c438c.entry.js +0 -1
- package/dist/sparkle-core/p-8fdccc4a.entry.js +0 -1
- package/dist/sparkle-core/p-9563bf6c.js +0 -1
- package/dist/sparkle-core/p-971b29c9.entry.js +0 -1
- package/dist/sparkle-core/p-972d5bd1.entry.js +0 -1
- package/dist/sparkle-core/p-a7754cd1.entry.js +0 -1
- package/dist/sparkle-core/p-b3dfac3e.js +0 -1
- package/dist/sparkle-core/p-c20861ac.entry.js +0 -1
- package/dist/sparkle-core/p-c396afb2.entry.js +0 -1
- package/dist/sparkle-core/p-c5de0b12.js +0 -1
- package/dist/sparkle-core/p-d3ea02b3.js +0 -1
- package/dist/sparkle-core/p-df5c60a1.entry.js +0 -1
- package/dist/sparkle-core/p-eeb7a650.entry.js +0 -1
- package/dist/sparkle-core/p-f0604500.entry.js +0 -1
- package/dist/sparkle-core/p-f2de03c5.entry.js +0 -1
@@ -1,524 +0,0 @@
|
|
1
|
-
var sparkle = sparkle || {};
|
2
|
-
(function () {
|
3
|
-
/* Application paths *****************************************/
|
4
|
-
|
5
|
-
//Current application root path (including virtual directory if exists).
|
6
|
-
sparkle.appPath = sparkle.appPath || '/';
|
7
|
-
sparkle.config = sparkle.config || {};
|
8
|
-
sparkle.pageLoadTime = new Date();
|
9
|
-
|
10
|
-
//Converts given path to absolute path using sparkle.appPath variable.
|
11
|
-
sparkle.toAbsAppPath = function (path) {
|
12
|
-
if (path.indexOf('/') == 0) {
|
13
|
-
path = path.substring(1);
|
14
|
-
}
|
15
|
-
|
16
|
-
return sparkle.appPath + path;
|
17
|
-
};
|
18
|
-
|
19
|
-
/* AUTHORIZATION **********************************************/
|
20
|
-
//Implements Authorization API that simplifies usage of authorization scripts generated by Abp.
|
21
|
-
|
22
|
-
sparkle.auth = sparkle.auth || {};
|
23
|
-
|
24
|
-
sparkle.auth.allPermissions = sparkle.auth.allPermissions || {};
|
25
|
-
|
26
|
-
sparkle.auth.grantedPermissions = sparkle.auth.grantedPermissions || {};
|
27
|
-
|
28
|
-
sparkle.auth.isGranted = function (permissionName) {
|
29
|
-
return sparkle.auth.allPermissions[permissionName] != undefined && sparkle.auth.grantedPermissions[permissionName] != undefined;
|
30
|
-
};
|
31
|
-
|
32
|
-
sparkle.auth.isAnyGranted = function () {
|
33
|
-
if (!arguments || arguments.length <= 0) {
|
34
|
-
return true;
|
35
|
-
}
|
36
|
-
|
37
|
-
for (var i = 0; i < arguments.length; i++) {
|
38
|
-
if (sparkle.auth.isGranted(arguments[i])) {
|
39
|
-
return true;
|
40
|
-
}
|
41
|
-
}
|
42
|
-
|
43
|
-
return false;
|
44
|
-
};
|
45
|
-
|
46
|
-
sparkle.auth.areAllGranted = function () {
|
47
|
-
if (!arguments || arguments.length <= 0) {
|
48
|
-
return true;
|
49
|
-
}
|
50
|
-
|
51
|
-
for (var i = 0; i < arguments.length; i++) {
|
52
|
-
if (!sparkle.auth.isGranted(arguments[i])) {
|
53
|
-
return false;
|
54
|
-
}
|
55
|
-
}
|
56
|
-
|
57
|
-
return true;
|
58
|
-
};
|
59
|
-
|
60
|
-
sparkle.auth.tokenCookieName = 'Sparkle.AuthToken';
|
61
|
-
|
62
|
-
sparkle.auth.setToken = function (authToken, expireDate) {
|
63
|
-
sparkle.utils.setCookieValue(sparkle.auth.tokenCookieName, authToken, expireDate, sparkle.appPath, sparkle.domain);
|
64
|
-
};
|
65
|
-
|
66
|
-
sparkle.auth.getToken = function () {
|
67
|
-
return sparkle.utils.getCookieValue(sparkle.auth.tokenCookieName);
|
68
|
-
};
|
69
|
-
|
70
|
-
sparkle.auth.clearToken = function () {
|
71
|
-
sparkle.auth.setToken();
|
72
|
-
};
|
73
|
-
|
74
|
-
sparkle.auth.refreshTokenCookieName = 'Sparkle.AuthRefreshToken';
|
75
|
-
|
76
|
-
sparkle.auth.setRefreshToken = function (refreshToken, expireDate) {
|
77
|
-
sparkle.utils.setCookieValue(sparkle.auth.refreshTokenCookieName, refreshToken, expireDate, sparkle.appPath, sparkle.domain);
|
78
|
-
};
|
79
|
-
|
80
|
-
sparkle.auth.getRefreshToken = function () {
|
81
|
-
return sparkle.utils.getCookieValue(sparkle.auth.refreshTokenCookieName);
|
82
|
-
};
|
83
|
-
|
84
|
-
sparkle.auth.clearRefreshToken = function () {
|
85
|
-
sparkle.auth.setRefreshToken();
|
86
|
-
};
|
87
|
-
|
88
|
-
/* SETTINGS **************************************************/
|
89
|
-
//Implements Settings API that simplifies usage of setting scripts generated by Abp.
|
90
|
-
|
91
|
-
sparkle.setting = sparkle.setting || {};
|
92
|
-
|
93
|
-
sparkle.setting.values = sparkle.setting.values || {};
|
94
|
-
|
95
|
-
sparkle.setting.get = function (name) {
|
96
|
-
return sparkle.setting.values[name];
|
97
|
-
};
|
98
|
-
|
99
|
-
sparkle.setting.getBoolean = function (name) {
|
100
|
-
var value = sparkle.setting.get(name);
|
101
|
-
return value == 'true' || value == 'True';
|
102
|
-
};
|
103
|
-
|
104
|
-
sparkle.setting.getInt = function (name) {
|
105
|
-
return parseInt(sparkle.setting.values[name]);
|
106
|
-
};
|
107
|
-
|
108
|
-
/* REALTIME NOTIFICATIONS ************************************/
|
109
|
-
|
110
|
-
sparkle.notifications = sparkle.notifications || {};
|
111
|
-
|
112
|
-
sparkle.notifications.severity = {
|
113
|
-
INFO: 0,
|
114
|
-
SUCCESS: 1,
|
115
|
-
WARN: 2,
|
116
|
-
ERROR: 3,
|
117
|
-
FATAL: 4,
|
118
|
-
};
|
119
|
-
|
120
|
-
sparkle.notifications.userNotificationState = {
|
121
|
-
UNREAD: 0,
|
122
|
-
READ: 1,
|
123
|
-
};
|
124
|
-
|
125
|
-
sparkle.notifications.getUserNotificationStateAsString = function (userNotificationState) {
|
126
|
-
switch (userNotificationState) {
|
127
|
-
case sparkle.notifications.userNotificationState.READ:
|
128
|
-
return 'READ';
|
129
|
-
case sparkle.notifications.userNotificationState.UNREAD:
|
130
|
-
return 'UNREAD';
|
131
|
-
default:
|
132
|
-
sparkle.log.warn('Unknown user notification state value: ' + userNotificationState);
|
133
|
-
return '?';
|
134
|
-
}
|
135
|
-
};
|
136
|
-
|
137
|
-
sparkle.notifications.getUiNotifyFuncBySeverity = function (severity) {
|
138
|
-
switch (severity) {
|
139
|
-
case sparkle.notifications.severity.SUCCESS:
|
140
|
-
return sparkle.notify.success;
|
141
|
-
case sparkle.notifications.severity.WARN:
|
142
|
-
return sparkle.notify.warn;
|
143
|
-
case sparkle.notifications.severity.ERROR:
|
144
|
-
return sparkle.notify.error;
|
145
|
-
case sparkle.notifications.severity.FATAL:
|
146
|
-
return sparkle.notify.error;
|
147
|
-
case sparkle.notifications.severity.INFO:
|
148
|
-
default:
|
149
|
-
return sparkle.notify.info;
|
150
|
-
}
|
151
|
-
};
|
152
|
-
|
153
|
-
sparkle.notifications.messageFormatters = {};
|
154
|
-
|
155
|
-
sparkle.notifications.messageFormatters['Sparkle.Notifications.MessageNotificationData'] = function (userNotification) {
|
156
|
-
return userNotification.notification.data.message || userNotification.notification.data.properties.Message;
|
157
|
-
};
|
158
|
-
|
159
|
-
sparkle.notifications.messageFormatters['Sparkle.Notifications.LocalizableMessageNotificationData'] = function (userNotification) {
|
160
|
-
var message = userNotification.notification.data.message || userNotification.notification.data.properties.Message;
|
161
|
-
var localizedMessage = sparkle.localization.localize(message.name, message.sourceName);
|
162
|
-
|
163
|
-
if (userNotification.notification.data.properties) {
|
164
|
-
var properties = Object.keys(userNotification.notification.data.properties);
|
165
|
-
for (var i = 0; i < properties.length; i++) {
|
166
|
-
localizedMessage = localizedMessage.replace('{' + properties[i] + '}', userNotification.notification.data.properties[properties[i]]);
|
167
|
-
}
|
168
|
-
}
|
169
|
-
|
170
|
-
return localizedMessage;
|
171
|
-
};
|
172
|
-
|
173
|
-
sparkle.notifications.getFormattedMessageFromUserNotification = function (userNotification) {
|
174
|
-
var formatter = sparkle.notifications.messageFormatters[userNotification.notification.data.type];
|
175
|
-
if (!formatter) {
|
176
|
-
sparkle.log.warn('No message formatter defined for given data type: ' + userNotification.notification.data.type);
|
177
|
-
return '?';
|
178
|
-
}
|
179
|
-
|
180
|
-
if (!sparkle.utils.isFunction(formatter)) {
|
181
|
-
sparkle.log.warn('Message formatter should be a function! It is invalid for data type: ' + userNotification.notification.data.type);
|
182
|
-
return '?';
|
183
|
-
}
|
184
|
-
|
185
|
-
return formatter(userNotification);
|
186
|
-
};
|
187
|
-
|
188
|
-
sparkle.notifications.showUiNotifyForUserNotification = function (userNotification, options) {
|
189
|
-
var message = sparkle.notifications.getFormattedMessageFromUserNotification(userNotification);
|
190
|
-
var uiNotifyFunc = sparkle.notifications.getUiNotifyFuncBySeverity(userNotification.notification.severity);
|
191
|
-
uiNotifyFunc(message, undefined, options);
|
192
|
-
};
|
193
|
-
|
194
|
-
/* UI *******************************************************/
|
195
|
-
|
196
|
-
sparkle.ui = sparkle.ui || {};
|
197
|
-
|
198
|
-
/* UI BLOCK */
|
199
|
-
//Defines UI Block API, not implements it
|
200
|
-
|
201
|
-
sparkle.ui.block = function (elm) {
|
202
|
-
sparkle.log.warn('sparkle.ui.block is not implemented!');
|
203
|
-
};
|
204
|
-
|
205
|
-
sparkle.ui.unblock = function (elm) {
|
206
|
-
sparkle.log.warn('sparkle.ui.unblock is not implemented!');
|
207
|
-
};
|
208
|
-
|
209
|
-
/* UI BUSY */
|
210
|
-
//Defines UI Busy API, not implements it
|
211
|
-
|
212
|
-
sparkle.ui.setBusy = function (elm, optionsOrPromise) {
|
213
|
-
sparkle.log.warn('sparkle.ui.setBusy is not implemented!');
|
214
|
-
};
|
215
|
-
|
216
|
-
sparkle.ui.clearBusy = function (elm) {
|
217
|
-
sparkle.log.warn('sparkle.ui.clearBusy is not implemented!');
|
218
|
-
};
|
219
|
-
|
220
|
-
/* SIMPLE EVENT BUS *****************************************/
|
221
|
-
|
222
|
-
sparkle.event = (function () {
|
223
|
-
var _callbacks = {};
|
224
|
-
|
225
|
-
var on = function (eventName, callback) {
|
226
|
-
if (!_callbacks[eventName]) {
|
227
|
-
_callbacks[eventName] = [];
|
228
|
-
}
|
229
|
-
|
230
|
-
_callbacks[eventName].push(callback);
|
231
|
-
};
|
232
|
-
|
233
|
-
var off = function (eventName, callback) {
|
234
|
-
var callbacks = _callbacks[eventName];
|
235
|
-
if (!callbacks) {
|
236
|
-
return;
|
237
|
-
}
|
238
|
-
|
239
|
-
var index = -1;
|
240
|
-
for (var i = 0; i < callbacks.length; i++) {
|
241
|
-
if (callbacks[i] === callback) {
|
242
|
-
index = i;
|
243
|
-
break;
|
244
|
-
}
|
245
|
-
}
|
246
|
-
|
247
|
-
if (index < 0) {
|
248
|
-
return;
|
249
|
-
}
|
250
|
-
|
251
|
-
_callbacks[eventName].splice(index, 1);
|
252
|
-
};
|
253
|
-
|
254
|
-
var trigger = function (eventName) {
|
255
|
-
var callbacks = _callbacks[eventName];
|
256
|
-
if (!callbacks || !callbacks.length) {
|
257
|
-
return;
|
258
|
-
}
|
259
|
-
|
260
|
-
var args = Array.prototype.slice.call(arguments, 1);
|
261
|
-
for (var i = 0; i < callbacks.length; i++) {
|
262
|
-
callbacks[i].apply(this, args);
|
263
|
-
}
|
264
|
-
};
|
265
|
-
|
266
|
-
// Public interface ///////////////////////////////////////////////////
|
267
|
-
|
268
|
-
return {
|
269
|
-
on: on,
|
270
|
-
off: off,
|
271
|
-
trigger: trigger,
|
272
|
-
};
|
273
|
-
})();
|
274
|
-
|
275
|
-
/* UTILS ***************************************************/
|
276
|
-
|
277
|
-
sparkle.utils = sparkle.utils || {};
|
278
|
-
|
279
|
-
/* Creates a name namespace.
|
280
|
-
* Example:
|
281
|
-
* var taskService = sparkle.utils.createNamespace(sparkle, 'services.task');
|
282
|
-
* taskService will be equal to sparkle.services.task
|
283
|
-
* first argument (root) must be defined first
|
284
|
-
************************************************************/
|
285
|
-
sparkle.utils.createNamespace = function (root, ns) {
|
286
|
-
var parts = ns.split('.');
|
287
|
-
for (var i = 0; i < parts.length; i++) {
|
288
|
-
if (typeof root[parts[i]] == 'undefined') {
|
289
|
-
root[parts[i]] = {};
|
290
|
-
}
|
291
|
-
|
292
|
-
root = root[parts[i]];
|
293
|
-
}
|
294
|
-
|
295
|
-
return root;
|
296
|
-
};
|
297
|
-
|
298
|
-
/* Find and replaces a string (search) to another string (replacement) in
|
299
|
-
* given string (str).
|
300
|
-
* Example:
|
301
|
-
* sparkle.utils.replaceAll('This is a test string', 'is', 'X') = 'ThX X a test string'
|
302
|
-
************************************************************/
|
303
|
-
sparkle.utils.replaceAll = function (str, search, replacement) {
|
304
|
-
var fix = search.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
305
|
-
return str.replace(new RegExp(fix, 'g'), replacement);
|
306
|
-
};
|
307
|
-
|
308
|
-
/* Formats a string just like string.format in C#.
|
309
|
-
* Example:
|
310
|
-
* sparkle.utils.formatString('Hello {0}','Tuana') = 'Hello Tuana'
|
311
|
-
************************************************************/
|
312
|
-
sparkle.utils.formatString = function () {
|
313
|
-
if (arguments.length < 1) {
|
314
|
-
return null;
|
315
|
-
}
|
316
|
-
|
317
|
-
var str = arguments[0];
|
318
|
-
|
319
|
-
for (var i = 1; i < arguments.length; i++) {
|
320
|
-
var placeHolder = '{' + (i - 1) + '}';
|
321
|
-
str = sparkle.utils.replaceAll(str, placeHolder, arguments[i]);
|
322
|
-
}
|
323
|
-
|
324
|
-
return str;
|
325
|
-
};
|
326
|
-
|
327
|
-
sparkle.utils.toPascalCase = function (str) {
|
328
|
-
if (!str || !str.length) {
|
329
|
-
return str;
|
330
|
-
}
|
331
|
-
|
332
|
-
if (str.length === 1) {
|
333
|
-
return str.charAt(0).toUpperCase();
|
334
|
-
}
|
335
|
-
|
336
|
-
return str.charAt(0).toUpperCase() + str.substr(1);
|
337
|
-
};
|
338
|
-
|
339
|
-
sparkle.utils.toCamelCase = function (str) {
|
340
|
-
if (!str || !str.length) {
|
341
|
-
return str;
|
342
|
-
}
|
343
|
-
|
344
|
-
if (str.length === 1) {
|
345
|
-
return str.charAt(0).toLowerCase();
|
346
|
-
}
|
347
|
-
|
348
|
-
return str.charAt(0).toLowerCase() + str.substr(1);
|
349
|
-
};
|
350
|
-
|
351
|
-
sparkle.utils.truncateString = function (str, maxLength) {
|
352
|
-
if (!str || !str.length || str.length <= maxLength) {
|
353
|
-
return str;
|
354
|
-
}
|
355
|
-
|
356
|
-
return str.substr(0, maxLength);
|
357
|
-
};
|
358
|
-
|
359
|
-
sparkle.utils.truncateStringWithPostfix = function (str, maxLength, postfix) {
|
360
|
-
postfix = postfix || '...';
|
361
|
-
|
362
|
-
if (!str || !str.length || str.length <= maxLength) {
|
363
|
-
return str;
|
364
|
-
}
|
365
|
-
|
366
|
-
if (maxLength <= postfix.length) {
|
367
|
-
return postfix.substr(0, maxLength);
|
368
|
-
}
|
369
|
-
|
370
|
-
return str.substr(0, maxLength - postfix.length) + postfix;
|
371
|
-
};
|
372
|
-
|
373
|
-
sparkle.utils.isFunction = function (obj) {
|
374
|
-
return !!(obj && obj.constructor && obj.call && obj.apply);
|
375
|
-
};
|
376
|
-
|
377
|
-
/**
|
378
|
-
* parameterInfos should be an array of { name, value } objects
|
379
|
-
* where name is query string parameter name and value is it's value.
|
380
|
-
* includeQuestionMark is true by default.
|
381
|
-
*/
|
382
|
-
sparkle.utils.buildQueryString = function (parameterInfos, includeQuestionMark) {
|
383
|
-
if (includeQuestionMark === undefined) {
|
384
|
-
includeQuestionMark = true;
|
385
|
-
}
|
386
|
-
|
387
|
-
var qs = '';
|
388
|
-
|
389
|
-
function addSeperator() {
|
390
|
-
if (!qs.length) {
|
391
|
-
if (includeQuestionMark) {
|
392
|
-
qs = qs + '?';
|
393
|
-
}
|
394
|
-
} else {
|
395
|
-
qs = qs + '&';
|
396
|
-
}
|
397
|
-
}
|
398
|
-
|
399
|
-
for (var i = 0; i < parameterInfos.length; ++i) {
|
400
|
-
var parameterInfo = parameterInfos[i];
|
401
|
-
if (parameterInfo.value === undefined) {
|
402
|
-
continue;
|
403
|
-
}
|
404
|
-
|
405
|
-
if (parameterInfo.value === null) {
|
406
|
-
parameterInfo.value = '';
|
407
|
-
}
|
408
|
-
|
409
|
-
addSeperator();
|
410
|
-
|
411
|
-
if (parameterInfo.value.toJSON && typeof parameterInfo.value.toJSON === 'function') {
|
412
|
-
qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value.toJSON());
|
413
|
-
} else if (Array.isArray(parameterInfo.value) && parameterInfo.value.length) {
|
414
|
-
for (var j = 0; j < parameterInfo.value.length; j++) {
|
415
|
-
if (j > 0) {
|
416
|
-
addSeperator();
|
417
|
-
}
|
418
|
-
|
419
|
-
qs = qs + parameterInfo.name + '[' + j + ']=' + encodeURIComponent(parameterInfo.value[j]);
|
420
|
-
}
|
421
|
-
} else {
|
422
|
-
qs = qs + parameterInfo.name + '=' + encodeURIComponent(parameterInfo.value);
|
423
|
-
}
|
424
|
-
}
|
425
|
-
|
426
|
-
return qs;
|
427
|
-
};
|
428
|
-
|
429
|
-
/**
|
430
|
-
* Sets a cookie value for given key.
|
431
|
-
* This is a simple implementation created to be used by ABP.
|
432
|
-
* Please use a complete cookie library if you need.
|
433
|
-
* @param {string} key
|
434
|
-
* @param {string} value
|
435
|
-
* @param {Date} expireDate (optional). If not specified the cookie will expire at the end of session.
|
436
|
-
* @param {string} path (optional)
|
437
|
-
*/
|
438
|
-
sparkle.utils.setCookieValue = function (key, value, expireDate, path, domain) {
|
439
|
-
var cookieValue = encodeURIComponent(key) + '=';
|
440
|
-
|
441
|
-
if (value) {
|
442
|
-
cookieValue = cookieValue + encodeURIComponent(value);
|
443
|
-
}
|
444
|
-
|
445
|
-
if (expireDate) {
|
446
|
-
cookieValue = cookieValue + '; expires=' + expireDate.toUTCString();
|
447
|
-
}
|
448
|
-
|
449
|
-
if (path) {
|
450
|
-
cookieValue = cookieValue + '; path=' + path;
|
451
|
-
}
|
452
|
-
|
453
|
-
if (domain) {
|
454
|
-
cookieValue = cookieValue + '; domain=' + domain;
|
455
|
-
}
|
456
|
-
|
457
|
-
document.cookie = cookieValue;
|
458
|
-
};
|
459
|
-
|
460
|
-
/**
|
461
|
-
* Gets a cookie with given key.
|
462
|
-
* This is a simple implementation created to be used by ABP.
|
463
|
-
* Please use a complete cookie library if you need.
|
464
|
-
* @param {string} key
|
465
|
-
* @returns {string} Cookie value or null
|
466
|
-
*/
|
467
|
-
sparkle.utils.getCookieValue = function (key) {
|
468
|
-
var equalities = document.cookie.split('; ');
|
469
|
-
for (var i = 0; i < equalities.length; i++) {
|
470
|
-
if (!equalities[i]) {
|
471
|
-
continue;
|
472
|
-
}
|
473
|
-
|
474
|
-
var splitted = equalities[i].split('=');
|
475
|
-
if (splitted.length != 2) {
|
476
|
-
continue;
|
477
|
-
}
|
478
|
-
|
479
|
-
if (decodeURIComponent(splitted[0]) === key) {
|
480
|
-
return decodeURIComponent(splitted[1] || '');
|
481
|
-
}
|
482
|
-
}
|
483
|
-
|
484
|
-
return null;
|
485
|
-
};
|
486
|
-
|
487
|
-
/**
|
488
|
-
* Deletes cookie for given key.
|
489
|
-
* This is a simple implementation created to be used by ABP.
|
490
|
-
* Please use a complete cookie library if you need.
|
491
|
-
* @param {string} key
|
492
|
-
* @param {string} path (optional)
|
493
|
-
*/
|
494
|
-
sparkle.utils.deleteCookie = function (key, path) {
|
495
|
-
var cookieValue = encodeURIComponent(key) + '=';
|
496
|
-
|
497
|
-
cookieValue = cookieValue + '; expires=' + new Date(new Date().getTime() - 86400000).toUTCString();
|
498
|
-
|
499
|
-
if (path) {
|
500
|
-
cookieValue = cookieValue + '; path=' + path;
|
501
|
-
}
|
502
|
-
|
503
|
-
document.cookie = cookieValue;
|
504
|
-
};
|
505
|
-
|
506
|
-
/* SECURITY ***************************************/
|
507
|
-
sparkle.security = sparkle.security || {};
|
508
|
-
sparkle.security.antiForgery = sparkle.security.antiForgery || {};
|
509
|
-
|
510
|
-
sparkle.security.antiForgery.tokenCookieName = 'XSRF-TOKEN';
|
511
|
-
sparkle.security.antiForgery.tokenHeaderName = 'X-XSRF-TOKEN';
|
512
|
-
|
513
|
-
sparkle.security.antiForgery.getToken = function () {
|
514
|
-
return sparkle.utils.getCookieValue(sparkle.security.antiForgery.tokenCookieName);
|
515
|
-
};
|
516
|
-
|
517
|
-
sparkle.security.antiForgery.shouldSendToken = function (settings) {
|
518
|
-
if (settings.crossDomain === undefined || settings.crossDomain === null) {
|
519
|
-
return sparkle.utils.getDomain(location.href) === sparkle.utils.getDomain(settings.url);
|
520
|
-
}
|
521
|
-
|
522
|
-
return !settings.crossDomain;
|
523
|
-
};
|
524
|
-
})();
|
@@ -1,135 +0,0 @@
|
|
1
|
-
var sparkle = sparkle || {};
|
2
|
-
(function () {
|
3
|
-
|
4
|
-
// Check if SignalR is defined
|
5
|
-
if (!signalR) {
|
6
|
-
return;
|
7
|
-
}
|
8
|
-
|
9
|
-
// Create namespaces
|
10
|
-
sparkle.signalr = sparkle.signalr || {};
|
11
|
-
sparkle.signalr.hubs = sparkle.signalr.hubs || {};
|
12
|
-
sparkle.signalr.reconnectTime = sparkle.signalr.reconnectTime || 5000;
|
13
|
-
sparkle.signalr.maxTries = sparkle.signalr.maxTries || 8;
|
14
|
-
sparkle.signalr.increaseReconnectTime = sparkle.signalr.increaseReconnectTime || function (time) {
|
15
|
-
return time * 2;
|
16
|
-
};
|
17
|
-
|
18
|
-
// Configure the connection for sparkle.signalr.hubs.common
|
19
|
-
function configureConnection(connection) {
|
20
|
-
// Set the common hub
|
21
|
-
sparkle.signalr.hubs.common = connection;
|
22
|
-
|
23
|
-
let tries = 1;
|
24
|
-
let reconnectTime = sparkle.signalr.reconnectTime;
|
25
|
-
|
26
|
-
// Reconnect loop
|
27
|
-
function tryReconnect() {
|
28
|
-
if (tries <= sparkle.signalr.maxTries) {
|
29
|
-
connection.start()
|
30
|
-
.then(function () {
|
31
|
-
reconnectTime = sparkle.signalr.reconnectTime;
|
32
|
-
tries = 1;
|
33
|
-
console.log('Reconnected to SignalR server!');
|
34
|
-
sparkle.event.trigger('sparkle.signalr.reconnected');
|
35
|
-
}).catch(function () {
|
36
|
-
tries += 1;
|
37
|
-
reconnectTime = sparkle.signalr.increaseReconnectTime(reconnectTime);
|
38
|
-
setTimeout(function () {
|
39
|
-
tryReconnect()
|
40
|
-
},
|
41
|
-
reconnectTime
|
42
|
-
);
|
43
|
-
});
|
44
|
-
}
|
45
|
-
}
|
46
|
-
|
47
|
-
// Reconnect if hub disconnects
|
48
|
-
connection.onclose(function (e) {
|
49
|
-
if (e) {
|
50
|
-
sparkle.log.debug('Connection closed with error: ' + e);
|
51
|
-
} else {
|
52
|
-
sparkle.log.debug('Disconnected');
|
53
|
-
}
|
54
|
-
|
55
|
-
if (!sparkle.signalr.autoReconnect) {
|
56
|
-
return;
|
57
|
-
}
|
58
|
-
|
59
|
-
sparkle.event.trigger('sparkle.signalr.disconnected');
|
60
|
-
tryReconnect();
|
61
|
-
});
|
62
|
-
|
63
|
-
// Register to get notifications
|
64
|
-
connection.on('getNotification', function (notification) {
|
65
|
-
sparkle.event.trigger('sparkle.notifications.received', notification);
|
66
|
-
});
|
67
|
-
}
|
68
|
-
|
69
|
-
// Connect to the server for sparkle.signalr.hubs.common
|
70
|
-
function connect() {
|
71
|
-
var url = sparkle.signalr.url || (sparkle.appPath + 'signalr');
|
72
|
-
|
73
|
-
// Start the connection
|
74
|
-
startConnection(url, configureConnection)
|
75
|
-
.then(function (connection) {
|
76
|
-
sparkle.log.debug('Connected to SignalR server!'); //TODO: Remove log
|
77
|
-
sparkle.event.trigger('sparkle.signalr.connected');
|
78
|
-
// Call the Register method on the hub
|
79
|
-
connection.invoke('register').then(function () {
|
80
|
-
sparkle.log.debug('Registered to the SignalR server!'); //TODO: Remove log
|
81
|
-
});
|
82
|
-
})
|
83
|
-
.catch(function (error) {
|
84
|
-
sparkle.log.debug(error.message);
|
85
|
-
});
|
86
|
-
}
|
87
|
-
|
88
|
-
// Starts a connection with transport fallback - if the connection cannot be started using
|
89
|
-
// the webSockets transport the function will fallback to the serverSentEvents transport and
|
90
|
-
// if this does not work it will try longPolling. If the connection cannot be started using
|
91
|
-
// any of the available transports the function will return a rejected Promise.
|
92
|
-
function startConnection(url, configureConnection) {
|
93
|
-
if (sparkle.signalr.remoteServiceBaseUrl) {
|
94
|
-
url = sparkle.signalr.remoteServiceBaseUrl + url;
|
95
|
-
}
|
96
|
-
|
97
|
-
// Add query string: https://github.com/aspnet/SignalR/issues/680
|
98
|
-
if (sparkle.signalr.qs) {
|
99
|
-
url += (url.indexOf('?') == -1 ? '?' : '&') + sparkle.signalr.qs;
|
100
|
-
}
|
101
|
-
|
102
|
-
return function start(transport) {
|
103
|
-
sparkle.log.debug('Starting connection using ' + signalR.HttpTransportType[transport] + ' transport');
|
104
|
-
var connection = new signalR.HubConnectionBuilder()
|
105
|
-
.withUrl(url, transport)
|
106
|
-
.build();
|
107
|
-
|
108
|
-
if (configureConnection && typeof configureConnection === 'function') {
|
109
|
-
configureConnection(connection);
|
110
|
-
}
|
111
|
-
|
112
|
-
return connection.start()
|
113
|
-
.then(function () {
|
114
|
-
return connection;
|
115
|
-
})
|
116
|
-
.catch(function (error) {
|
117
|
-
sparkle.log.debug('Cannot start the connection using ' + signalR.HttpTransportType[transport] + ' transport. ' + error.message);
|
118
|
-
if (transport !== signalR.HttpTransportType.LongPolling) {
|
119
|
-
return start(transport + 1);
|
120
|
-
}
|
121
|
-
|
122
|
-
return Promise.reject(error);
|
123
|
-
});
|
124
|
-
}(signalR.HttpTransportType.WebSockets);
|
125
|
-
}
|
126
|
-
|
127
|
-
sparkle.signalr.autoConnect = sparkle.signalr.autoConnect === undefined ? true : sparkle.signalr.autoConnect;
|
128
|
-
sparkle.signalr.autoReconnect = sparkle.signalr.autoReconnect === undefined ? true : sparkle.signalr.autoReconnect;
|
129
|
-
sparkle.signalr.connect = sparkle.signalr.connect || connect;
|
130
|
-
sparkle.signalr.startConnection = sparkle.signalr.startConnection || startConnection;
|
131
|
-
|
132
|
-
if (sparkle.signalr.autoConnect && !sparkle.signalr.hubs.common) {
|
133
|
-
sparkle.signalr.connect();
|
134
|
-
}
|
135
|
-
})();
|