adapt-authoring-ui 0.0.1
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/.eslintignore +2 -0
- package/.eslintrc +14 -0
- package/.github/ISSUE_TEMPLATE/bug_report.yml +55 -0
- package/.github/ISSUE_TEMPLATE/config.yml +1 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yml +22 -0
- package/.github/dependabot.yml +11 -0
- package/.github/pull_request_template.md +25 -0
- package/.github/workflows/labelled_prs.yml +16 -0
- package/.github/workflows/new.yml +19 -0
- package/adapt-authoring.json +11 -0
- package/app/core/app.js +43 -0
- package/app/core/assets/adapt-learning-logo-outline.png +0 -0
- package/app/core/assets/adapt-learning-logo-white.png +0 -0
- package/app/core/assets/ajax-loader.gif +0 -0
- package/app/core/assets/favicon.png +0 -0
- package/app/core/assets/transparency-light.png +0 -0
- package/app/core/browserStorage.js +45 -0
- package/app/core/collections/apiCollection.js +74 -0
- package/app/core/collections/contentCollection.js +33 -0
- package/app/core/collections/contentPluginCollection.js +24 -0
- package/app/core/collections/tagsCollection.js +4 -0
- package/app/core/constants.js +10 -0
- package/app/core/helpers.js +375 -0
- package/app/core/index.hbs +192 -0
- package/app/core/l10n.js +33 -0
- package/app/core/less/_reset.less +43 -0
- package/app/core/less/app.less +100 -0
- package/app/core/less/buttons.less +268 -0
- package/app/core/less/colourLabels.less +14 -0
- package/app/core/less/colours.less +132 -0
- package/app/core/less/columns.less +190 -0
- package/app/core/less/fonts.less +30 -0
- package/app/core/less/forms.less +77 -0
- package/app/core/less/sharedStyles.less +73 -0
- package/app/core/less/tables.less +29 -0
- package/app/core/less/tags.less +194 -0
- package/app/core/loading.hbs +27 -0
- package/app/core/models/articleModel.js +19 -0
- package/app/core/models/blockModel.js +25 -0
- package/app/core/models/clipboardModel.js +10 -0
- package/app/core/models/componentModel.js +18 -0
- package/app/core/models/configModel.js +22 -0
- package/app/core/models/contentModel.js +26 -0
- package/app/core/models/contentObjectModel.js +19 -0
- package/app/core/models/contentPluginModel.js +10 -0
- package/app/core/models/courseModel.js +24 -0
- package/app/core/models/sessionModel.js +86 -0
- package/app/core/origin.js +189 -0
- package/app/core/router.js +135 -0
- package/app/core/views/originView.js +92 -0
- package/app/libraries/babel-polyfill.min.js +1 -0
- package/app/libraries/backbone-forms-lists.js +669 -0
- package/app/libraries/backbone-forms.js +2604 -0
- package/app/libraries/backbone.js +1581 -0
- package/app/libraries/ckeditor.js +6 -0
- package/app/libraries/handlebars.js +4902 -0
- package/app/libraries/imageReady.js +2 -0
- package/app/libraries/inview.js +140 -0
- package/app/libraries/jquery-ui.min.js +6 -0
- package/app/libraries/jquery.form.js +1277 -0
- package/app/libraries/jquery.js +10346 -0
- package/app/libraries/jquery.tagsinput.min.js +1 -0
- package/app/libraries/moment.min.js +7 -0
- package/app/libraries/polyglot.min.js +2922 -0
- package/app/libraries/require.js +36 -0
- package/app/libraries/scrollTo.js +11 -0
- package/app/libraries/selectize/css/selectize.less +403 -0
- package/app/libraries/selectize/js/selectize.js +4500 -0
- package/app/libraries/spectrum/spectrum.js +2323 -0
- package/app/libraries/spectrum/spectrum.less +507 -0
- package/app/libraries/underscore.js +1692 -0
- package/app/libraries/velocity.js +4773 -0
- package/app/modules/appHeader/assets/top-bar-1080.jpg +0 -0
- package/app/modules/appHeader/assets/top-bar-2560.jpg +0 -0
- package/app/modules/appHeader/index.js +5 -0
- package/app/modules/appHeader/less/appHeader.less +72 -0
- package/app/modules/appHeader/templates/appHeader.hbs +17 -0
- package/app/modules/appHeader/views/appHeaderView.js +63 -0
- package/app/modules/assetManagement/collections/assetCollection.js +16 -0
- package/app/modules/assetManagement/index.js +65 -0
- package/app/modules/assetManagement/less/asset.less +229 -0
- package/app/modules/assetManagement/less/assetManagementModalTags.less +34 -0
- package/app/modules/assetManagement/less/assetManagementNew.less +60 -0
- package/app/modules/assetManagement/models/assetModel.js +11 -0
- package/app/modules/assetManagement/templates/assetManagement.hbs +12 -0
- package/app/modules/assetManagement/templates/assetManagementCollection.hbs +2 -0
- package/app/modules/assetManagement/templates/assetManagementEditAsset.hbs +9 -0
- package/app/modules/assetManagement/templates/assetManagementEditAssetSidebar.hbs +10 -0
- package/app/modules/assetManagement/templates/assetManagementListItem.hbs +35 -0
- package/app/modules/assetManagement/templates/assetManagementModalAutofill.hbs +1 -0
- package/app/modules/assetManagement/templates/assetManagementModalEditAsset.hbs +11 -0
- package/app/modules/assetManagement/templates/assetManagementModalFilters.hbs +16 -0
- package/app/modules/assetManagement/templates/assetManagementModalTags.hbs +26 -0
- package/app/modules/assetManagement/templates/assetManagementPreview.hbs +53 -0
- package/app/modules/assetManagement/templates/assetManagementSidebar.hbs +93 -0
- package/app/modules/assetManagement/templates/assetPicker.hbs +45 -0
- package/app/modules/assetManagement/views/assetManagementCollectionView.js +216 -0
- package/app/modules/assetManagement/views/assetManagementEditAssetSidebarView.js +25 -0
- package/app/modules/assetManagement/views/assetManagementEditAssetView.js +123 -0
- package/app/modules/assetManagement/views/assetManagementItemView.js +68 -0
- package/app/modules/assetManagement/views/assetManagementModalAutofillView.js +51 -0
- package/app/modules/assetManagement/views/assetManagementModalEditAssetView.js +38 -0
- package/app/modules/assetManagement/views/assetManagementModalFiltersView.js +132 -0
- package/app/modules/assetManagement/views/assetManagementModalTagsView.js +169 -0
- package/app/modules/assetManagement/views/assetManagementModalView.js +62 -0
- package/app/modules/assetManagement/views/assetManagementPreviewView.js +69 -0
- package/app/modules/assetManagement/views/assetManagementSidebarView.js +126 -0
- package/app/modules/assetManagement/views/assetManagementView.js +43 -0
- package/app/modules/colorLabel/index.js +48 -0
- package/app/modules/colorLabel/less/colorLabels.less +102 -0
- package/app/modules/colorLabel/models/colors.js +31 -0
- package/app/modules/colorLabel/templates/colorLabelPopUpView.hbs +21 -0
- package/app/modules/colorLabel/views/colorLabelPopupView.js +75 -0
- package/app/modules/contentHeader/index.js +6 -0
- package/app/modules/contentHeader/less/contentHeader.less +152 -0
- package/app/modules/contentHeader/less/options.less +51 -0
- package/app/modules/contentHeader/templates/actionsButton.hbs +3 -0
- package/app/modules/contentHeader/templates/contentHeader.hbs +38 -0
- package/app/modules/contentHeader/templates/contentHeaderToggleButton.hbs +11 -0
- package/app/modules/contentHeader/templates/filterItem.hbs +23 -0
- package/app/modules/contentHeader/templates/options.hbs +14 -0
- package/app/modules/contentHeader/templates/partials/part_headerButtonContent.hbs +2 -0
- package/app/modules/contentHeader/templates/sortItem.hbs +9 -0
- package/app/modules/contentHeader/views/actionsButtonView.js +14 -0
- package/app/modules/contentHeader/views/contentHeaderButtonView.js +42 -0
- package/app/modules/contentHeader/views/contentHeaderToggleButtonView.js +52 -0
- package/app/modules/contentHeader/views/contentHeaderView.js +96 -0
- package/app/modules/contentHeader/views/filtersButtonView.js +31 -0
- package/app/modules/contentHeader/views/optionsView.js +88 -0
- package/app/modules/contentHeader/views/sortsButtonView.js +45 -0
- package/app/modules/contentPane/index.js +20 -0
- package/app/modules/contentPane/less/contentPane.less +8 -0
- package/app/modules/contentPane/templates/contentPane.hbs +2 -0
- package/app/modules/contentPane/views/contentPaneView.js +77 -0
- package/app/modules/contextMenu/index.js +85 -0
- package/app/modules/contextMenu/less/contextMenu.less +54 -0
- package/app/modules/contextMenu/templates/contextMenu.hbs +6 -0
- package/app/modules/contextMenu/templates/contextMenuItem.hbs +8 -0
- package/app/modules/contextMenu/views/contextMenuItemView.js +37 -0
- package/app/modules/contextMenu/views/contextMenuView.js +76 -0
- package/app/modules/editor/article/index.js +18 -0
- package/app/modules/editor/article/templates/editorArticleEdit.hbs +2 -0
- package/app/modules/editor/article/templates/editorArticleEditSidebar.hbs +19 -0
- package/app/modules/editor/article/views/editorArticleEditSidebarView.js +32 -0
- package/app/modules/editor/article/views/editorArticleEditView.js +19 -0
- package/app/modules/editor/block/index.js +18 -0
- package/app/modules/editor/block/templates/editorBlockEdit.hbs +2 -0
- package/app/modules/editor/block/templates/editorBlockEditSidebar.hbs +19 -0
- package/app/modules/editor/block/views/editorBlockEditSidebarView.js +28 -0
- package/app/modules/editor/block/views/editorBlockEditView.js +19 -0
- package/app/modules/editor/component/index.js +22 -0
- package/app/modules/editor/component/templates/editorComponentEdit.hbs +2 -0
- package/app/modules/editor/component/templates/editorComponentEditSidebar.hbs +19 -0
- package/app/modules/editor/component/views/editorComponentEditSidebarView.js +32 -0
- package/app/modules/editor/component/views/editorComponentEditView.js +23 -0
- package/app/modules/editor/config/index.js +15 -0
- package/app/modules/editor/config/templates/editorConfigEdit.hbs +1 -0
- package/app/modules/editor/config/templates/editorConfigEditSidebar.hbs +10 -0
- package/app/modules/editor/config/views/editorConfigEditSidebarView.js +28 -0
- package/app/modules/editor/config/views/editorConfigEditView.js +28 -0
- package/app/modules/editor/contentObject/assets/component-icons/icon-accordion.png +0 -0
- package/app/modules/editor/contentObject/assets/component-icons/icon-assessment.png +0 -0
- package/app/modules/editor/contentObject/assets/component-icons/icon-blank.png +0 -0
- package/app/modules/editor/contentObject/assets/component-icons/icon-default.png +0 -0
- package/app/modules/editor/contentObject/assets/component-icons/icon-gmcq.png +0 -0
- package/app/modules/editor/contentObject/assets/component-icons/icon-graphic.png +0 -0
- package/app/modules/editor/contentObject/assets/component-icons/icon-hot-graphic.png +0 -0
- package/app/modules/editor/contentObject/assets/component-icons/icon-matching.png +0 -0
- package/app/modules/editor/contentObject/assets/component-icons/icon-mcq.png +0 -0
- package/app/modules/editor/contentObject/assets/component-icons/icon-media.png +0 -0
- package/app/modules/editor/contentObject/assets/component-icons/icon-narrative.png +0 -0
- package/app/modules/editor/contentObject/assets/component-icons/icon-slider.png +0 -0
- package/app/modules/editor/contentObject/assets/component-icons/icon-text.png +0 -0
- package/app/modules/editor/contentObject/index.js +68 -0
- package/app/modules/editor/contentObject/less/editing-overlay-component-list.less +60 -0
- package/app/modules/editor/contentObject/less/editing-overlay-panel.less +25 -0
- package/app/modules/editor/contentObject/less/editorMenu.less +84 -0
- package/app/modules/editor/contentObject/less/editorMenuItem.less +114 -0
- package/app/modules/editor/contentObject/less/editorMenuLayer.less +70 -0
- package/app/modules/editor/contentObject/less/editorPage.less +162 -0
- package/app/modules/editor/contentObject/less/editorPageArticle.less +40 -0
- package/app/modules/editor/contentObject/less/editorPageBlock.less +33 -0
- package/app/modules/editor/contentObject/less/editorPageComponent.less +47 -0
- package/app/modules/editor/contentObject/less/editorPageComponentList.less +234 -0
- package/app/modules/editor/contentObject/templates/editorMenu.hbs +1 -0
- package/app/modules/editor/contentObject/templates/editorMenuItem.hbs +23 -0
- package/app/modules/editor/contentObject/templates/editorMenuLayer.hbs +12 -0
- package/app/modules/editor/contentObject/templates/editorMenuSidebar.hbs +1 -0
- package/app/modules/editor/contentObject/templates/editorPage.hbs +15 -0
- package/app/modules/editor/contentObject/templates/editorPageArticle.hbs +15 -0
- package/app/modules/editor/contentObject/templates/editorPageBlock.hbs +14 -0
- package/app/modules/editor/contentObject/templates/editorPageComponent.hbs +9 -0
- package/app/modules/editor/contentObject/templates/editorPageComponentList.hbs +33 -0
- package/app/modules/editor/contentObject/templates/editorPageComponentListItem.hbs +24 -0
- package/app/modules/editor/contentObject/templates/editorPageComponentPasteZone.hbs +4 -0
- package/app/modules/editor/contentObject/templates/editorPageEdit.hbs +1 -0
- package/app/modules/editor/contentObject/templates/editorPageEditSidebar.hbs +10 -0
- package/app/modules/editor/contentObject/templates/editorPageSidebar.hbs +1 -0
- package/app/modules/editor/contentObject/views/editorMenuItemView.js +174 -0
- package/app/modules/editor/contentObject/views/editorMenuLayerView.js +212 -0
- package/app/modules/editor/contentObject/views/editorMenuSidebarView.js +13 -0
- package/app/modules/editor/contentObject/views/editorMenuView.js +211 -0
- package/app/modules/editor/contentObject/views/editorPageArticleView.js +278 -0
- package/app/modules/editor/contentObject/views/editorPageBlockView.js +280 -0
- package/app/modules/editor/contentObject/views/editorPageComponentListItemView.js +80 -0
- package/app/modules/editor/contentObject/views/editorPageComponentListView.js +131 -0
- package/app/modules/editor/contentObject/views/editorPageComponentPasteZoneView.js +47 -0
- package/app/modules/editor/contentObject/views/editorPageComponentView.js +202 -0
- package/app/modules/editor/contentObject/views/editorPageEditSidebarView.js +28 -0
- package/app/modules/editor/contentObject/views/editorPageEditView.js +19 -0
- package/app/modules/editor/contentObject/views/editorPageSidebarView.js +13 -0
- package/app/modules/editor/contentObject/views/editorPageView.js +183 -0
- package/app/modules/editor/course/index.js +26 -0
- package/app/modules/editor/course/templates/editorCourseEdit.hbs +2 -0
- package/app/modules/editor/course/templates/editorCourseEditSidebar.hbs +19 -0
- package/app/modules/editor/course/views/editorCourseEditSidebarView.js +28 -0
- package/app/modules/editor/course/views/editorCourseEditView.js +56 -0
- package/app/modules/editor/extensions/index.js +26 -0
- package/app/modules/editor/extensions/less/extensions.less +22 -0
- package/app/modules/editor/extensions/templates/editorExtensionsEdit.hbs +85 -0
- package/app/modules/editor/extensions/templates/editorExtensionsEditSidebar.hbs +1 -0
- package/app/modules/editor/extensions/views/editorExtensionsEditSidebarView.js +10 -0
- package/app/modules/editor/extensions/views/editorExtensionsEditView.js +85 -0
- package/app/modules/editor/global/collections/editorCollection.js +24 -0
- package/app/modules/editor/global/editorDataLoader.js +91 -0
- package/app/modules/editor/global/helpers.js +99 -0
- package/app/modules/editor/global/less/colorLabels.less +55 -0
- package/app/modules/editor/global/less/editor.less +204 -0
- package/app/modules/editor/global/templates/editor.hbs +1 -0
- package/app/modules/editor/global/templates/editorPasteZone.hbs +4 -0
- package/app/modules/editor/global/templates/partials/part_editorCommon.hbs +70 -0
- package/app/modules/editor/global/templates/partials/part_editorItemSidebar.hbs +40 -0
- package/app/modules/editor/global/templates/partials/part_editorMenu.hbs +4 -0
- package/app/modules/editor/global/templates/partials/part_settingsGeneral.hbs +27 -0
- package/app/modules/editor/global/views/editorOriginView.js +255 -0
- package/app/modules/editor/global/views/editorPasteZoneView.js +69 -0
- package/app/modules/editor/global/views/editorView.js +288 -0
- package/app/modules/editor/index.js +52 -0
- package/app/modules/editor/menuSettings/index.js +27 -0
- package/app/modules/editor/menuSettings/less/menusettings.less +55 -0
- package/app/modules/editor/menuSettings/templates/editorMenuSettingsEdit.hbs +1 -0
- package/app/modules/editor/menuSettings/templates/editorMenuSettingsEditSidebar.hbs +5 -0
- package/app/modules/editor/menuSettings/templates/editorMenuSettingsItem.hbs +4 -0
- package/app/modules/editor/menuSettings/views/editorMenuSettingsEditSidebarView.js +21 -0
- package/app/modules/editor/menuSettings/views/editorMenuSettingsEditView.js +71 -0
- package/app/modules/editor/menuSettings/views/editorMenuSettingsView.js +44 -0
- package/app/modules/editor/themeEditor/collections/editorPresetCollection.js +13 -0
- package/app/modules/editor/themeEditor/index.js +15 -0
- package/app/modules/editor/themeEditor/less/editorPresetEdit.less +78 -0
- package/app/modules/editor/themeEditor/less/editorTheming.less +73 -0
- package/app/modules/editor/themeEditor/models/editorModel.js +62 -0
- package/app/modules/editor/themeEditor/models/editorPresetModel.js +6 -0
- package/app/modules/editor/themeEditor/templates/editorPresetEdit.hbs +31 -0
- package/app/modules/editor/themeEditor/templates/editorTheming.hbs +35 -0
- package/app/modules/editor/themeEditor/templates/editorThemingSidebar.hbs +23 -0
- package/app/modules/editor/themeEditor/views/editorPresetEditView.js +98 -0
- package/app/modules/editor/themeEditor/views/editorThemingSidebarView.js +62 -0
- package/app/modules/editor/themeEditor/views/editorThemingView.js +304 -0
- package/app/modules/frameworkImport/index.js +32 -0
- package/app/modules/frameworkImport/less/frameworkImport.less +101 -0
- package/app/modules/frameworkImport/templates/frameworkImport.hbs +58 -0
- package/app/modules/frameworkImport/templates/frameworkImportSidebar.hbs +12 -0
- package/app/modules/frameworkImport/templates/frameworkImportSummary.hbs +40 -0
- package/app/modules/frameworkImport/templates/partials/part_frameworkImportButton.hbs +3 -0
- package/app/modules/frameworkImport/templates/partials/part_frameworkImportStatusMessages.hbs +22 -0
- package/app/modules/frameworkImport/views/frameworkImportSidebarView.js +31 -0
- package/app/modules/frameworkImport/views/frameworkImportView.js +109 -0
- package/app/modules/globalMenu/index.js +86 -0
- package/app/modules/globalMenu/less/globalMenu.less +117 -0
- package/app/modules/globalMenu/templates/globalMenu.hbs +6 -0
- package/app/modules/globalMenu/templates/globalMenuItem.hbs +10 -0
- package/app/modules/globalMenu/templates/partials/part_globalMenuButton.hbs +7 -0
- package/app/modules/globalMenu/views/globalMenuItemView.js +108 -0
- package/app/modules/globalMenu/views/globalMenuView.js +45 -0
- package/app/modules/limiteduser/index.js +17 -0
- package/app/modules/limiteduser/less/limitedUser.less +29 -0
- package/app/modules/limiteduser/templates/limitedUser.hbs +8 -0
- package/app/modules/limiteduser/views/limitedUserView.js +12 -0
- package/app/modules/modal/index.js +13 -0
- package/app/modules/modal/less/modal.less +61 -0
- package/app/modules/modal/models/modalModel.js +14 -0
- package/app/modules/modal/templates/modal.hbs +34 -0
- package/app/modules/modal/views/modalView.js +102 -0
- package/app/modules/notify/index.js +32 -0
- package/app/modules/notify/plugins/alert/assets/sweetalert.css +932 -0
- package/app/modules/notify/plugins/alert/index.js +117 -0
- package/app/modules/notify/plugins/alert/less/alert.less +74 -0
- package/app/modules/notify/plugins/alert/sweetalert2-11.1.7.all.min.js +2 -0
- package/app/modules/notify/plugins/console/index.js +18 -0
- package/app/modules/notify/plugins/snackbar/index.js +69 -0
- package/app/modules/notify/plugins/snackbar/less/snackbar.less +40 -0
- package/app/modules/notify/plugins/toast/index.js +70 -0
- package/app/modules/notify/plugins/toast/less/toast.less +62 -0
- package/app/modules/pluginManagement/index.js +36 -0
- package/app/modules/pluginManagement/less/pluginManagement.less +23 -0
- package/app/modules/pluginManagement/less/pluginType.less +25 -0
- package/app/modules/pluginManagement/templates/pluginManagement.hbs +43 -0
- package/app/modules/pluginManagement/templates/pluginManagementSidebar.hbs +40 -0
- package/app/modules/pluginManagement/templates/pluginManagementUpload.hbs +12 -0
- package/app/modules/pluginManagement/templates/pluginManagementUploadSidebar.hbs +13 -0
- package/app/modules/pluginManagement/templates/pluginType.hbs +43 -0
- package/app/modules/pluginManagement/views/pluginManagementSidebarView.js +48 -0
- package/app/modules/pluginManagement/views/pluginManagementUploadSidebarView.js +25 -0
- package/app/modules/pluginManagement/views/pluginManagementUploadView.js +52 -0
- package/app/modules/pluginManagement/views/pluginManagementView.js +104 -0
- package/app/modules/pluginManagement/views/pluginTypeView.js +105 -0
- package/app/modules/projects/assets/origami-project.jpg +0 -0
- package/app/modules/projects/index.js +82 -0
- package/app/modules/projects/less/projects.less +152 -0
- package/app/modules/projects/less/qproject.less +143 -0
- package/app/modules/projects/templates/project.hbs +63 -0
- package/app/modules/projects/templates/projects.hbs +6 -0
- package/app/modules/projects/templates/projectsSidebar.hbs +42 -0
- package/app/modules/projects/views/projectView.js +167 -0
- package/app/modules/projects/views/projectsSidebarView.js +172 -0
- package/app/modules/projects/views/projectsView.js +271 -0
- package/app/modules/scaffold/backboneFormsOverrides.js +284 -0
- package/app/modules/scaffold/index.js +342 -0
- package/app/modules/scaffold/lang/en.json +9 -0
- package/app/modules/scaffold/less/codeEditor.less +6 -0
- package/app/modules/scaffold/less/colourPicker.less +141 -0
- package/app/modules/scaffold/less/displayTitle.less +17 -0
- package/app/modules/scaffold/less/forms.less +174 -0
- package/app/modules/scaffold/less/list.less +35 -0
- package/app/modules/scaffold/less/modal.less +45 -0
- package/app/modules/scaffold/less/scaffoldAsset.less +23 -0
- package/app/modules/scaffold/less/scaffoldAssetItem.less +50 -0
- package/app/modules/scaffold/less/selectize.less +29 -0
- package/app/modules/scaffold/less/textArea.less +9 -0
- package/app/modules/scaffold/less/users.less +6 -0
- package/app/modules/scaffold/templates/field.hbs +25 -0
- package/app/modules/scaffold/templates/fieldset.hbs +10 -0
- package/app/modules/scaffold/templates/form.hbs +6 -0
- package/app/modules/scaffold/templates/list.hbs +4 -0
- package/app/modules/scaffold/templates/listItem.hbs +5 -0
- package/app/modules/scaffold/templates/scaffoldAsset.hbs +65 -0
- package/app/modules/scaffold/templates/scaffoldAssetItem.hbs +35 -0
- package/app/modules/scaffold/templates/scaffoldDisplayTitle.hbs +8 -0
- package/app/modules/scaffold/templates/scaffoldEditHtml.hbs +1 -0
- package/app/modules/scaffold/templates/scaffoldFile.hbs +1 -0
- package/app/modules/scaffold/templates/scaffoldItemsModal.hbs +14 -0
- package/app/modules/scaffold/templates/scaffoldModalOverlay.hbs +1 -0
- package/app/modules/scaffold/templates/scaffoldUsersOption.hbs +8 -0
- package/app/modules/scaffold/views/scaffoldAssetItemView.js +203 -0
- package/app/modules/scaffold/views/scaffoldAssetView.js +157 -0
- package/app/modules/scaffold/views/scaffoldCodeEditorView.js +64 -0
- package/app/modules/scaffold/views/scaffoldColourPickerView.js +70 -0
- package/app/modules/scaffold/views/scaffoldDisplayTitleView.js +112 -0
- package/app/modules/scaffold/views/scaffoldFileView.js +18 -0
- package/app/modules/scaffold/views/scaffoldItemsModalView.js +100 -0
- package/app/modules/scaffold/views/scaffoldListView.js +158 -0
- package/app/modules/scaffold/views/scaffoldTagsView.js +71 -0
- package/app/modules/scaffold/views/scaffoldUsersView.js +89 -0
- package/app/modules/sidebar/index.js +22 -0
- package/app/modules/sidebar/less/sidebar.less +298 -0
- package/app/modules/sidebar/less/sidebarFilter.less +91 -0
- package/app/modules/sidebar/templates/sidebar.hbs +7 -0
- package/app/modules/sidebar/templates/sidebarBreadcrumb.hbs +3 -0
- package/app/modules/sidebar/templates/sidebarDivide.hbs +5 -0
- package/app/modules/sidebar/templates/sidebarFieldsetFilter.hbs +6 -0
- package/app/modules/sidebar/templates/sidebarFilter.hbs +30 -0
- package/app/modules/sidebar/templates/sidebarRowFilter.hbs +4 -0
- package/app/modules/sidebar/templates/sidebarUpdateButton.hbs +3 -0
- package/app/modules/sidebar/views/sidebarFieldsetFilterView.js +43 -0
- package/app/modules/sidebar/views/sidebarFilterView.js +132 -0
- package/app/modules/sidebar/views/sidebarItemView.js +172 -0
- package/app/modules/sidebar/views/sidebarView.js +71 -0
- package/app/modules/user/assets/adapt-learning-logo.png +0 -0
- package/app/modules/user/assets/adapt-logo.png +0 -0
- package/app/modules/user/assets/login_bg.jpg +0 -0
- package/app/modules/user/index.js +75 -0
- package/app/modules/user/less/forgotPassword.less +14 -0
- package/app/modules/user/less/login.less +138 -0
- package/app/modules/user/less/logout.less +3 -0
- package/app/modules/user/less/resetPassword.less +7 -0
- package/app/modules/user/less/userProfile.less +49 -0
- package/app/modules/user/models/userProfileModel.js +32 -0
- package/app/modules/user/templates/forgotPassword.hbs +36 -0
- package/app/modules/user/templates/login.hbs +29 -0
- package/app/modules/user/templates/resetPassword.hbs +29 -0
- package/app/modules/user/templates/userProfile.hbs +71 -0
- package/app/modules/user/templates/userProfileSidebar.hbs +16 -0
- package/app/modules/user/views/forgotPasswordView.js +63 -0
- package/app/modules/user/views/loginView.js +93 -0
- package/app/modules/user/views/resetPasswordView.js +78 -0
- package/app/modules/user/views/userProfileSidebarView.js +32 -0
- package/app/modules/user/views/userProfileView.js +107 -0
- package/app/modules/userManagement/collections/userCollection.js +65 -0
- package/app/modules/userManagement/helpers.js +46 -0
- package/app/modules/userManagement/index.js +67 -0
- package/app/modules/userManagement/less/userManagement.less +268 -0
- package/app/modules/userManagement/models/userModel.js +34 -0
- package/app/modules/userManagement/templates/addUser.hbs +35 -0
- package/app/modules/userManagement/templates/addUserSidebar.hbs +9 -0
- package/app/modules/userManagement/templates/user.hbs +126 -0
- package/app/modules/userManagement/templates/userManagement.hbs +49 -0
- package/app/modules/userManagement/templates/userManagementFilter.hbs +19 -0
- package/app/modules/userManagement/templates/userManagementSidebar.hbs +13 -0
- package/app/modules/userManagement/views/addUserSidebarView.js +25 -0
- package/app/modules/userManagement/views/addUserView.js +85 -0
- package/app/modules/userManagement/views/filterView.js +49 -0
- package/app/modules/userManagement/views/userManagementSidebarView.js +33 -0
- package/app/modules/userManagement/views/userManagementView.js +104 -0
- package/app/modules/userManagement/views/userView.js +324 -0
- package/conf/config.schema.json +18 -0
- package/docs/migrating-from-legacy.md +19 -0
- package/docs/plugins/index-ui.md +17 -0
- package/docs/plugins/uidocs.js +54 -0
- package/docs/ui-extensions.md +15 -0
- package/index.js +1 -0
- package/lib/UiBuild.js +391 -0
- package/lib/UiModule.js +158 -0
- package/npm_hooks/postinstall.js +4 -0
- package/package.json +27 -0
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
// LICENCE https://github.com/adaptlearning/adapt_authoring/blob/master/LICENSE
|
|
2
|
+
define(['handlebars', 'moment', 'core/origin'], function(Handlebars, Moment, Origin) {
|
|
3
|
+
var helpers = {
|
|
4
|
+
console: function(context) {
|
|
5
|
+
return console.log(context);
|
|
6
|
+
},
|
|
7
|
+
|
|
8
|
+
lowerCase: function(text) {
|
|
9
|
+
return text.toLowerCase();
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
numbers: function(index) {
|
|
13
|
+
return index+1;
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
capitalise: function(text) {
|
|
17
|
+
return text.charAt(0).toUpperCase() + text.slice(1);
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
odd: function (index) {
|
|
21
|
+
return (index +1) % 2 === 0 ? 'even' : 'odd';
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
stringToClassName: function(text) {
|
|
25
|
+
if (!text) return;
|
|
26
|
+
// Check if first character is an underscore and remove
|
|
27
|
+
// Normally used for attribute with '_'s
|
|
28
|
+
if (text.slice(1) === '_') {
|
|
29
|
+
text = text.slice(1);
|
|
30
|
+
}
|
|
31
|
+
// Remove _ and spaces with dashes
|
|
32
|
+
return text.replace(/_| /g, "-").toLowerCase();
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
keyToTitleString: function(key) {
|
|
36
|
+
if (!key) return;
|
|
37
|
+
// check translatable strings first
|
|
38
|
+
var l10nKey = 'app.scaffold.' + key;
|
|
39
|
+
if(Origin.l10n.has(l10nKey)) {
|
|
40
|
+
return Origin.l10n.t(l10nKey);
|
|
41
|
+
}
|
|
42
|
+
// fall-back: remove all _ and capitalise
|
|
43
|
+
var string = key.replace(/_/g, '').replace(/[A-Z]/g, ' $&').toLowerCase();
|
|
44
|
+
return this.capitalise(string);
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
momentFormat: function(date, format) {
|
|
48
|
+
if (typeof date == 'undefined') {
|
|
49
|
+
return '-';
|
|
50
|
+
}
|
|
51
|
+
return Moment(date).format(format);
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
timestring: function(date) {
|
|
55
|
+
return new Date(date).getTime();
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
formatDuration: function(duration) {
|
|
59
|
+
var zero = '0', hh, mm, ss;
|
|
60
|
+
var time = new Date(0, 0, 0, 0, 0, Math.floor(duration), 0);
|
|
61
|
+
|
|
62
|
+
hh = time.getHours();
|
|
63
|
+
mm = time.getMinutes();
|
|
64
|
+
ss = time.getSeconds();
|
|
65
|
+
|
|
66
|
+
// Pad zero values to 00
|
|
67
|
+
hh = (zero+hh).slice(-2);
|
|
68
|
+
mm = (zero+mm).slice(-2);
|
|
69
|
+
ss = (zero+ss).slice(-2);
|
|
70
|
+
|
|
71
|
+
return `${hh}:${mm}:${ss}`;
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
// checks for http/https and www. prefix
|
|
75
|
+
isAssetExternal: function(url) {
|
|
76
|
+
if (!url || !url.length) {
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
var urlRegEx = new RegExp(/^(https?:\/\/)|^(www\.)/);
|
|
80
|
+
return url.match(urlRegEx) !== null;
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
ifValueEquals: function(value, text, block) {
|
|
84
|
+
return (value === text) ? block.fn(this) : block.inverse(this);
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
ifArrayIncludes: function(value, text, block) {
|
|
88
|
+
return value.includes(text) ? block.fn(this) : block.inverse(this);
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
ifUserIsMe: function(userId, block) {
|
|
92
|
+
var isMe = userId === Origin.sessionModel.get('id');
|
|
93
|
+
return isMe ? block.fn(this) : block.inverse(this);
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
selected: function(option, value){
|
|
97
|
+
return (option === value) ? ' selected' : '';
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
counterFromZero: function(n, block) {
|
|
101
|
+
var sum = '';
|
|
102
|
+
for (var i = 0; i <= n; ++i) sum += block.fn(i);
|
|
103
|
+
return sum;
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
counterFromOne: function(n, block) {
|
|
107
|
+
var sum = '';
|
|
108
|
+
for (var i = 1; i <= n; ++i) sum += block.fn(i);
|
|
109
|
+
return sum;
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
t: function(str, options) {
|
|
113
|
+
for (var placeholder in options.hash) {
|
|
114
|
+
options[placeholder] = options.hash[placeholder];
|
|
115
|
+
}
|
|
116
|
+
return Origin.l10n.t(str, options);
|
|
117
|
+
},
|
|
118
|
+
|
|
119
|
+
stripHtml: function(html) {
|
|
120
|
+
return new Handlebars.SafeString(html);
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
escapeText: function(text) {
|
|
124
|
+
var div = document.createElement('div');
|
|
125
|
+
div.appendChild(document.createTextNode(text));
|
|
126
|
+
return div.innerHTML;
|
|
127
|
+
},
|
|
128
|
+
|
|
129
|
+
bytesToSize: function(bytes) {
|
|
130
|
+
if (bytes === 0) return '0 B';
|
|
131
|
+
|
|
132
|
+
var k = 1000;
|
|
133
|
+
var sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
|
134
|
+
var i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
135
|
+
|
|
136
|
+
return (bytes / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
|
|
137
|
+
},
|
|
138
|
+
|
|
139
|
+
renderBooleanOptions: function(selectedValue) {
|
|
140
|
+
const html = val => `<option value="${val}"${selectedValue === val ? ' selected' : ''}>${val}</option>`;
|
|
141
|
+
return `${html(true)}${html(false)}`;
|
|
142
|
+
},
|
|
143
|
+
|
|
144
|
+
pickCSV: function(list, key, separator) {
|
|
145
|
+
if (!list || !list.length) {
|
|
146
|
+
return '';
|
|
147
|
+
}
|
|
148
|
+
if (!separator || !separator.length) {
|
|
149
|
+
separator = ',';
|
|
150
|
+
}
|
|
151
|
+
var vals = list.map(l => (key && val[key] )|| val);
|
|
152
|
+
return vals.join(separator);
|
|
153
|
+
},
|
|
154
|
+
|
|
155
|
+
renderTags: function(list, key) {
|
|
156
|
+
if (!list || !list.length) {
|
|
157
|
+
return '';
|
|
158
|
+
}
|
|
159
|
+
var html = '<ul class="tag-container">';
|
|
160
|
+
for (var i = 0; i < list.length; ++i) {
|
|
161
|
+
var item = list[i];
|
|
162
|
+
var tag = Handlebars.Utils.escapeExpression(key && item[key] || item);
|
|
163
|
+
html += `<li class="tag-item" title="${tag}"><span class="tag-value">${tag}</span></li>`;
|
|
164
|
+
}
|
|
165
|
+
return new Handlebars.SafeString(`${html}</ul>`);
|
|
166
|
+
},
|
|
167
|
+
|
|
168
|
+
ifHasScopes: function(scopes, block) {
|
|
169
|
+
return Origin.sessionModel.hasScopes(scopes.split(',')) ? block.fn(this) : block.inverse(this);
|
|
170
|
+
},
|
|
171
|
+
|
|
172
|
+
ifMailEnabled: function(block) {
|
|
173
|
+
return Origin.constants['adapt-authoring-mailer.isEnabled'] === true ? block.fn(this) : block.inverse(this);
|
|
174
|
+
},
|
|
175
|
+
|
|
176
|
+
ifAssetIsExternal: function(url, block) {
|
|
177
|
+
var isExternal = Handlebars.helpers.isAssetExternal(url);
|
|
178
|
+
return isExternal ? block.fn(this) : block.inverse(this);
|
|
179
|
+
},
|
|
180
|
+
|
|
181
|
+
ifAssetIsHeroImage: function(url, block) {
|
|
182
|
+
var isMultiPart = url.split('/').length === 1;
|
|
183
|
+
return isMultiPart ? block.fn(this) : block.inverse(this);
|
|
184
|
+
},
|
|
185
|
+
|
|
186
|
+
copyStringToClipboard: function(data) {
|
|
187
|
+
var textArea = document.createElement("textarea");
|
|
188
|
+
|
|
189
|
+
textArea.value = data;
|
|
190
|
+
// Place in top-left corner of screen regardless of scroll position.
|
|
191
|
+
textArea.style.position = 'fixed';
|
|
192
|
+
textArea.style.top = 0;
|
|
193
|
+
textArea.style.left = 0;
|
|
194
|
+
// Ensure it has a small width and height. Setting to 1px / 1em
|
|
195
|
+
// doesn't work as this gives a negative w/h on some browsers.
|
|
196
|
+
textArea.style.width = '2em';
|
|
197
|
+
textArea.style.height = '2em';
|
|
198
|
+
// We don't need padding, reducing the size if it does flash render.
|
|
199
|
+
textArea.style.padding = 0;
|
|
200
|
+
// Clean up any borders.
|
|
201
|
+
textArea.style.border = 'none';
|
|
202
|
+
textArea.style.outline = 'none';
|
|
203
|
+
textArea.style.boxShadow = 'none';
|
|
204
|
+
// Avoid flash of white box if rendered for any reason.
|
|
205
|
+
textArea.style.background = 'transparent';
|
|
206
|
+
|
|
207
|
+
document.body.appendChild(textArea);
|
|
208
|
+
|
|
209
|
+
textArea.select();
|
|
210
|
+
|
|
211
|
+
var success = document.execCommand('copy');
|
|
212
|
+
|
|
213
|
+
document.body.removeChild(textArea);
|
|
214
|
+
|
|
215
|
+
return success;
|
|
216
|
+
},
|
|
217
|
+
|
|
218
|
+
isValidEmail: function(value) {
|
|
219
|
+
var regEx = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
220
|
+
return value.length > 0 && regEx.test(value);
|
|
221
|
+
},
|
|
222
|
+
|
|
223
|
+
contentModelMap: function(type) {
|
|
224
|
+
var contentModels = {
|
|
225
|
+
course: 'core/models/courseModel',
|
|
226
|
+
contentobject: 'core/models/contentObjectModel',
|
|
227
|
+
article: 'core/models/articleModel',
|
|
228
|
+
block: 'core/models/blockModel',
|
|
229
|
+
component: 'core/models/componentModel'
|
|
230
|
+
};
|
|
231
|
+
if(contentModels.hasOwnProperty(type)) {
|
|
232
|
+
return require(contentModels[type]);
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
|
|
236
|
+
// Ensures list is iterated (doesn't guarantee order), even if using async iterator
|
|
237
|
+
// @param list Array or Backbone.Collection
|
|
238
|
+
// @param func Function to use as iterator. Will be passed item, index and callback function
|
|
239
|
+
// @param callback Function to be called on completion
|
|
240
|
+
forParallelAsync: function(list, func, callback) {
|
|
241
|
+
if(!list.hasOwnProperty('length') || list.length === 0) {
|
|
242
|
+
if(typeof callback === 'function') callback();
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
// make a copy in case func modifies the original
|
|
246
|
+
var listCopy = list.models ? list.models.slice() : list.slice();
|
|
247
|
+
var doneCount = 0;
|
|
248
|
+
var _checkCompletion = function() {
|
|
249
|
+
if((++doneCount === listCopy.length) && typeof callback === 'function') {
|
|
250
|
+
callback();
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
for(var i = 0, count = listCopy.length; i < count; i++) {
|
|
254
|
+
func(listCopy[i], i, _checkCompletion);
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
|
|
258
|
+
// Does a fetch for model in models, and returns the latest data in the
|
|
259
|
+
// passed callback
|
|
260
|
+
// @param models {Array of Backbone.Models}
|
|
261
|
+
// @param callback {Function to call when complete}
|
|
262
|
+
multiModelFetch: function(models, callback) {
|
|
263
|
+
var collatedData = {};
|
|
264
|
+
helpers.forParallelAsync(models, function(model, index, done) {
|
|
265
|
+
model.fetch({
|
|
266
|
+
success: function(data) {
|
|
267
|
+
collatedData[index] = data;
|
|
268
|
+
done();
|
|
269
|
+
},
|
|
270
|
+
error: function(data) {
|
|
271
|
+
console.error('Failed to fetch data for', model.get('_id'), + data.responseText);
|
|
272
|
+
done();
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
}, function doneAll() {
|
|
276
|
+
var orderedKeys = Object.keys(collatedData).sort();
|
|
277
|
+
var returnArr = [];
|
|
278
|
+
for(var i = 0, count = orderedKeys.length; i < count; i++) {
|
|
279
|
+
returnArr.push(collatedData[orderedKeys[i]]);
|
|
280
|
+
}
|
|
281
|
+
callback(returnArr);
|
|
282
|
+
});
|
|
283
|
+
},
|
|
284
|
+
|
|
285
|
+
maxUploadSize: function(options) {
|
|
286
|
+
const sizeInB = Origin.constants['adapt-authoring-middleware.fileUploadMaxFileSize'];
|
|
287
|
+
const multiplier = 0.00000095367432;
|
|
288
|
+
return new Handlebars.SafeString([
|
|
289
|
+
'<span class="max-fileupload-size">',
|
|
290
|
+
Origin.l10n.t('app.maxfileuploadsize', { size: `${Math.round(sizeInB*multiplier)}MB` }),
|
|
291
|
+
'</span>'].join(''))
|
|
292
|
+
},
|
|
293
|
+
|
|
294
|
+
flattenNestedProperties: function(properties) {
|
|
295
|
+
if (!properties) return {};
|
|
296
|
+
var flatProperties = {};
|
|
297
|
+
for (var key in properties) {
|
|
298
|
+
// Check for nested properties
|
|
299
|
+
if (typeof properties[key] === 'object') {
|
|
300
|
+
for (var innerKey in properties[key]) {
|
|
301
|
+
// Check if key already exists
|
|
302
|
+
if (flatProperties[innerKey]) {
|
|
303
|
+
flatProperties[key+'.'+innerKey] = properties[key][innerKey];
|
|
304
|
+
} else {
|
|
305
|
+
flatProperties[innerKey] = properties[key][innerKey];
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
} else {
|
|
309
|
+
flatProperties[key] = properties[key];
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
return flatProperties;
|
|
313
|
+
},
|
|
314
|
+
|
|
315
|
+
importConstants: function() {
|
|
316
|
+
this.constants = Origin.constants;
|
|
317
|
+
return '';
|
|
318
|
+
},
|
|
319
|
+
// Comparison operator (ifValueEquals left for compatibility)
|
|
320
|
+
when: (a, operator, b, block) => {
|
|
321
|
+
console.log(a, operator, b);
|
|
322
|
+
const ops = {
|
|
323
|
+
eq: (l,r) => l === r,
|
|
324
|
+
noteq: (l,r) => l !== r,
|
|
325
|
+
gt: (l,r) => Number(l) > Number(r),
|
|
326
|
+
or: (l,r) => l || r,
|
|
327
|
+
and: (l,r) => l && r
|
|
328
|
+
};
|
|
329
|
+
return ops[operator](a, b) ? block.fn(this) : block.inverse(this);
|
|
330
|
+
},
|
|
331
|
+
|
|
332
|
+
sortContentObjects: (a, b) => {
|
|
333
|
+
const soA = a._sortOrder || a.get('_sortOrder');
|
|
334
|
+
const soB = b._sortOrder || b.get('_sortOrder');
|
|
335
|
+
return soA > soB ? 1 : -1;
|
|
336
|
+
},
|
|
337
|
+
|
|
338
|
+
submitForm($form, options = {}) {
|
|
339
|
+
return new Promise(async (resolve, reject) => {
|
|
340
|
+
const body = new FormData($form[0]);
|
|
341
|
+
if(options.extendedData) Object.entries(options.extendedData).forEach(([attr, val]) => body.append(attr, val));
|
|
342
|
+
const res = await fetch($form.attr('action'), { method: $form.attr('method'), body });
|
|
343
|
+
if(res.status === 204) {
|
|
344
|
+
return resolve();
|
|
345
|
+
}
|
|
346
|
+
const data = await res.json();
|
|
347
|
+
if(res.status > 299) {
|
|
348
|
+
return reject(data);
|
|
349
|
+
}
|
|
350
|
+
resolve(data);
|
|
351
|
+
});
|
|
352
|
+
},
|
|
353
|
+
|
|
354
|
+
parseLinksHeader(res) {
|
|
355
|
+
const header = res.xhr.getResponseHeader('Link');
|
|
356
|
+
const links = {};
|
|
357
|
+
if(header) {
|
|
358
|
+
header.split(',').forEach(l => {
|
|
359
|
+
const [url, name] = l.split(';');
|
|
360
|
+
if (!url || !name) return console.error(`Could not parse links: ${l}`);
|
|
361
|
+
links[name.replace(/rel="(.*)"/, '$1').trim()] = url.replace(/<(.*)>/, '$1').trim();
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
return links;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
for(var name in helpers) {
|
|
369
|
+
if(helpers.hasOwnProperty(name)) {
|
|
370
|
+
Handlebars.registerHelper(name, helpers[name]);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
return helpers;
|
|
375
|
+
});
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en" data-adapt-framework-version="{{versions.adapt_framework}}" data-adapt-authoring-version="{{versions.adapt-authoring}}" data-adapt-authoring-branch="{{git.adapt-authoring.branch}}" data-adapt-authoring-commit="{{git.adapt-authoring.commit}}">
|
|
3
|
+
<head>
|
|
4
|
+
<title>{{productName}}</title>
|
|
5
|
+
<link rel="icon" type="image/png" href="/css/assets/favicon.png" />
|
|
6
|
+
<link rel="stylesheet" href="/css/adapt.css" />
|
|
7
|
+
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
|
8
|
+
<link rel="stylesheet" href="https://cdn.ckeditor.com/ckeditor5/42.0.0/ckeditor5.css">
|
|
9
|
+
{{#if isProduction}}
|
|
10
|
+
<script type="text/javascript" src="/require.js" data-main="/js/adapt.js"></script>
|
|
11
|
+
{{else}}
|
|
12
|
+
<script src="/require.js"></script>
|
|
13
|
+
<script src="/js/requireJsConfig.js"></script>
|
|
14
|
+
<script src="/core/app.js"></script>
|
|
15
|
+
{{/if}}
|
|
16
|
+
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.9.5/ace.js"></script>
|
|
17
|
+
<meta http-equiv="cache-control" content="no-store, no-cache, must-revalidate" />
|
|
18
|
+
<meta http-equiv="Pragma" content="no-store, no-cache" />
|
|
19
|
+
<meta http-equiv="Expires" content="0" />
|
|
20
|
+
</head>
|
|
21
|
+
<body>
|
|
22
|
+
<div id="app" class="app container">
|
|
23
|
+
<div class="app-inner">
|
|
24
|
+
</div>
|
|
25
|
+
<div class="loading">
|
|
26
|
+
<div class="loading-inner">
|
|
27
|
+
<div class="loading-logo">
|
|
28
|
+
<img src="/css/assets/adapt-learning-logo-outline.png">
|
|
29
|
+
</div>
|
|
30
|
+
<div class="loading-anim">
|
|
31
|
+
<div class="circle1"></div>
|
|
32
|
+
<div class="circle2"></div>
|
|
33
|
+
<div class="circle3"></div>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
<script type="importmap">
|
|
39
|
+
{
|
|
40
|
+
"imports": {
|
|
41
|
+
"ckeditor5": "https://cdn.ckeditor.com/ckeditor5/42.0.0/ckeditor5.js",
|
|
42
|
+
"ckeditor5/": "https://cdn.ckeditor.com/ckeditor5/42.0.0/"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
</script>
|
|
46
|
+
<script type="module">
|
|
47
|
+
import {
|
|
48
|
+
AccessibilityHelp,
|
|
49
|
+
Alignment,
|
|
50
|
+
Autoformat,
|
|
51
|
+
AutoImage,
|
|
52
|
+
AutoLink,
|
|
53
|
+
Autosave,
|
|
54
|
+
BalloonToolbar,
|
|
55
|
+
BlockQuote,
|
|
56
|
+
BlockToolbar,
|
|
57
|
+
Bold,
|
|
58
|
+
CKBox,
|
|
59
|
+
CKBoxImageEdit,
|
|
60
|
+
ClassicEditor,
|
|
61
|
+
Clipboard,
|
|
62
|
+
CloudServices,
|
|
63
|
+
Code,
|
|
64
|
+
CodeBlock,
|
|
65
|
+
Essentials,
|
|
66
|
+
FindAndReplace,
|
|
67
|
+
Font,
|
|
68
|
+
GeneralHtmlSupport,
|
|
69
|
+
Heading,
|
|
70
|
+
Highlight,
|
|
71
|
+
HorizontalLine,
|
|
72
|
+
HtmlEmbed,
|
|
73
|
+
ImageBlock,
|
|
74
|
+
ImageCaption,
|
|
75
|
+
ImageInline,
|
|
76
|
+
ImageInsert,
|
|
77
|
+
ImageInsertViaUrl,
|
|
78
|
+
ImageResize,
|
|
79
|
+
ImageStyle,
|
|
80
|
+
ImageTextAlternative,
|
|
81
|
+
ImageToolbar,
|
|
82
|
+
ImageUpload,
|
|
83
|
+
Indent,
|
|
84
|
+
IndentBlock,
|
|
85
|
+
Italic,
|
|
86
|
+
Link,
|
|
87
|
+
LinkImage,
|
|
88
|
+
List,
|
|
89
|
+
ListProperties,
|
|
90
|
+
MediaEmbed,
|
|
91
|
+
Mention,
|
|
92
|
+
Paragraph,
|
|
93
|
+
PasteFromOffice,
|
|
94
|
+
PictureEditing,
|
|
95
|
+
RemoveFormat,
|
|
96
|
+
SelectAll,
|
|
97
|
+
ShowBlocks,
|
|
98
|
+
SourceEditing,
|
|
99
|
+
SpecialCharacters,
|
|
100
|
+
SpecialCharactersArrows,
|
|
101
|
+
SpecialCharactersCurrency,
|
|
102
|
+
SpecialCharactersEssentials,
|
|
103
|
+
SpecialCharactersLatin,
|
|
104
|
+
SpecialCharactersMathematical,
|
|
105
|
+
SpecialCharactersText,
|
|
106
|
+
Strikethrough,
|
|
107
|
+
Subscript,
|
|
108
|
+
Superscript,
|
|
109
|
+
Table,
|
|
110
|
+
TableCellProperties,
|
|
111
|
+
TableProperties,
|
|
112
|
+
TableToolbar,
|
|
113
|
+
TextTransformation,
|
|
114
|
+
TodoList,
|
|
115
|
+
Underline,
|
|
116
|
+
Undo
|
|
117
|
+
} from 'ckeditor5';
|
|
118
|
+
|
|
119
|
+
window.CKEDITOR = ClassicEditor
|
|
120
|
+
window.CKEDITOR.pluginsConfig = [
|
|
121
|
+
AccessibilityHelp,
|
|
122
|
+
Alignment,
|
|
123
|
+
Autoformat,
|
|
124
|
+
AutoImage,
|
|
125
|
+
AutoLink,
|
|
126
|
+
Autosave,
|
|
127
|
+
BalloonToolbar,
|
|
128
|
+
BlockQuote,
|
|
129
|
+
BlockToolbar,
|
|
130
|
+
Bold,
|
|
131
|
+
CKBox,
|
|
132
|
+
CKBoxImageEdit,
|
|
133
|
+
Clipboard,
|
|
134
|
+
CloudServices,
|
|
135
|
+
Code,
|
|
136
|
+
CodeBlock,
|
|
137
|
+
Essentials,
|
|
138
|
+
FindAndReplace,
|
|
139
|
+
Font,
|
|
140
|
+
GeneralHtmlSupport,
|
|
141
|
+
Heading,
|
|
142
|
+
Highlight,
|
|
143
|
+
HorizontalLine,
|
|
144
|
+
HtmlEmbed,
|
|
145
|
+
ImageBlock,
|
|
146
|
+
ImageCaption,
|
|
147
|
+
ImageInline,
|
|
148
|
+
ImageInsert,
|
|
149
|
+
ImageInsertViaUrl,
|
|
150
|
+
ImageResize,
|
|
151
|
+
ImageStyle,
|
|
152
|
+
ImageTextAlternative,
|
|
153
|
+
ImageToolbar,
|
|
154
|
+
ImageUpload,
|
|
155
|
+
Indent,
|
|
156
|
+
IndentBlock,
|
|
157
|
+
Italic,
|
|
158
|
+
Link,
|
|
159
|
+
LinkImage,
|
|
160
|
+
List,
|
|
161
|
+
ListProperties,
|
|
162
|
+
MediaEmbed,
|
|
163
|
+
Mention,
|
|
164
|
+
Paragraph,
|
|
165
|
+
PasteFromOffice,
|
|
166
|
+
PictureEditing,
|
|
167
|
+
RemoveFormat,
|
|
168
|
+
SelectAll,
|
|
169
|
+
ShowBlocks,
|
|
170
|
+
SourceEditing,
|
|
171
|
+
SpecialCharacters,
|
|
172
|
+
SpecialCharactersArrows,
|
|
173
|
+
SpecialCharactersCurrency,
|
|
174
|
+
SpecialCharactersEssentials,
|
|
175
|
+
SpecialCharactersLatin,
|
|
176
|
+
SpecialCharactersMathematical,
|
|
177
|
+
SpecialCharactersText,
|
|
178
|
+
Strikethrough,
|
|
179
|
+
Subscript,
|
|
180
|
+
Superscript,
|
|
181
|
+
Table,
|
|
182
|
+
TableCellProperties,
|
|
183
|
+
TableProperties,
|
|
184
|
+
TableToolbar,
|
|
185
|
+
TextTransformation,
|
|
186
|
+
TodoList,
|
|
187
|
+
Underline,
|
|
188
|
+
Undo
|
|
189
|
+
];
|
|
190
|
+
</script>
|
|
191
|
+
</body>
|
|
192
|
+
</html>
|
package/app/core/l10n.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// LICENCE https://github.com/adaptlearning/adapt_authoring/blob/master/LICENSE
|
|
2
|
+
define(['polyglot'], function(Polyglot) {
|
|
3
|
+
return function l10n(Origin) {
|
|
4
|
+
let polyglot;
|
|
5
|
+
return {
|
|
6
|
+
load: async function() {
|
|
7
|
+
try {
|
|
8
|
+
const locale = localStorage.getItem('lang') || 'en';
|
|
9
|
+
polyglot = new Polyglot({
|
|
10
|
+
locale: locale,
|
|
11
|
+
phrases: await $.get(`/api/lang/${locale}`),
|
|
12
|
+
interpolation: { prefix: '${', suffix: '}' },
|
|
13
|
+
warn: message => Origin.debug && console.warn('l10n:', message)
|
|
14
|
+
});
|
|
15
|
+
} catch(e) {
|
|
16
|
+
console.error(e.message);
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
t: function(string, data) {
|
|
20
|
+
if(!polyglot || !polyglot.t) {
|
|
21
|
+
return string;
|
|
22
|
+
}
|
|
23
|
+
return polyglot.t.apply(polyglot, arguments);
|
|
24
|
+
},
|
|
25
|
+
has: function() {
|
|
26
|
+
if(!polyglot || !polyglot.has) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
return polyglot.has.apply(polyglot, arguments);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
html, body, body div, span, object, iframe, h1, h2, h3, h4, h5, h6, p,
|
|
2
|
+
blockquote, pre, abbr, address, cite, code, del, dfn, em, img, ins,
|
|
3
|
+
kbd, q, samp, small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul,
|
|
4
|
+
li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead,
|
|
5
|
+
tr, th, td, article, aside, figure, footer, header, hgroup, menu,
|
|
6
|
+
nav, section, time, mark, audio, video {margin: 0; padding: 0; border: 0;
|
|
7
|
+
outline: 0; font-size: 100%; vertical-align: baseline; background: transparent;}
|
|
8
|
+
article, aside, figure, footer, header, hgroup, nav, section {display: block;}
|
|
9
|
+
img, object, embed {max-width: 100%;}
|
|
10
|
+
html {overflow-y: auto;}
|
|
11
|
+
ul li {margin-left:20px;}
|
|
12
|
+
blockquote, q {quotes: none;}
|
|
13
|
+
blockquote:before, blockquote:after, q:before,
|
|
14
|
+
q:after {content: ''; content: none;}
|
|
15
|
+
a {margin: 0; padding: 0; font-size: 100%; vertical-align: baseline; background: transparent;}
|
|
16
|
+
del {text-decoration: line-through;}
|
|
17
|
+
abbr[title], dfn[title] {border-bottom: 1px dotted #000; cursor: help;}
|
|
18
|
+
table {border-collapse: collapse; border-spacing: 0;}
|
|
19
|
+
th {font-weight: bold; vertical-align: bottom;}
|
|
20
|
+
td {font-weight: normal; vertical-align: top;}
|
|
21
|
+
hr {display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0;}
|
|
22
|
+
input, select {vertical-align: middle;}
|
|
23
|
+
pre {white-space: pre; white-space: pre-wrap; white-space: pre-line; word-wrap: break-word;}
|
|
24
|
+
input[type="radio"] {vertical-align: text-bottom;}
|
|
25
|
+
input[type="checkbox"] {vertical-align: bottom; *vertical-align: baseline;}
|
|
26
|
+
select, input, textarea {font: 99% sans-serif;}
|
|
27
|
+
table {font-size: inherit; font: 100%;}
|
|
28
|
+
a:hover, a:active {outline: none;}
|
|
29
|
+
small {font-size: 85%;}
|
|
30
|
+
strong, th {font-weight: bold;}
|
|
31
|
+
td, td img {vertical-align: top;}
|
|
32
|
+
sub, sup {font-size: 75%; line-height: 0; position: relative;}
|
|
33
|
+
sup {top: -0.5em;}
|
|
34
|
+
sub {bottom: -0.25em;}
|
|
35
|
+
pre, code, kbd, samp {font-family: monospace, sans-serif;}
|
|
36
|
+
.clickable, label, input[type=button], input[type=submit], button {cursor: pointer;}
|
|
37
|
+
.disabled .clickable, .disabled label, .disabled input[type=button], .disabled input[type=submit], .disabled button {cursor: default;}
|
|
38
|
+
button, input, select, textarea {margin: 0;}
|
|
39
|
+
button {width: auto; overflow: visible;}
|
|
40
|
+
.ie7 img {-ms-interpolation-mode: bicubic;}
|
|
41
|
+
.clearfix:before, .clearfix:after { content: "\0020"; display: block; height: 0; overflow: hidden; }
|
|
42
|
+
.clearfix:after { clear: both; }
|
|
43
|
+
.clearfix { zoom: 1; }
|