@brightspot/ui 3.0.1-cms-ui-migration.2 → 3.0.1-cms-ui-migration.3
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/README.md +54 -35
- package/dist/custom-elements.json +1924 -1924
- package/dist/storybook/assets/{ActionBar.stories-hJ_5cm-P.js → ActionBar.stories-CSxtZl7v.js} +1 -1
- package/dist/storybook/assets/{ActionItem.stories-Bjx2803w.js → ActionItem.stories-BWcMRMP3.js} +1 -1
- package/dist/storybook/assets/{Avatar.stories-Cj0YgZ6f.js → Avatar.stories-CYTUGXzH.js} +1 -1
- package/dist/storybook/assets/{AvatarGroup.stories-Lh_sQFCU.js → AvatarGroup.stories-CSYBYo_5.js} +1 -1
- package/dist/storybook/assets/{Badge.stories-BL7RUibx.js → Badge.stories-LuF4BuVr.js} +1 -1
- package/dist/storybook/assets/{Button-BPHNcxqK.js → Button-CrXCMxHb.js} +1 -1
- package/dist/storybook/assets/{Button.stories-CAYO4gdU.js → Button.stories-JVwxdrdM.js} +1 -1
- package/dist/storybook/assets/{ButtonGroup.stories-Cd13Us5K.js → ButtonGroup.stories-qtq64a1H.js} +1 -1
- package/dist/storybook/assets/{Celebrate.stories-D_KE3Qze.js → Celebrate.stories-DjTtaSd6.js} +1 -1
- package/dist/storybook/assets/{Checkbox.stories-Aj1xgZVn.js → Checkbox.stories-v1Pr5mL6.js} +1 -1
- package/dist/storybook/assets/{CircularProgress.stories-BecV_v6d.js → CircularProgress.stories-DkV7PJ4D.js} +1 -1
- package/dist/storybook/assets/{ClipboardMixin.stories-DU-WiZ2f.js → ClipboardMixin.stories-Dh5c7uSM.js} +1 -1
- package/dist/storybook/assets/{Color-6BZIO3FS-BYl4KZZn.js → Color-6BZIO3FS-B1gcREt6.js} +1 -1
- package/dist/storybook/assets/{Colors.stories-BMUVUy2q.js → Colors.stories-DnubtRqn.js} +1 -1
- package/dist/storybook/assets/{CombinedEffects.stories-FHcPKFm6.js → CombinedEffects.stories-By6akSve.js} +1 -1
- package/dist/storybook/assets/{ComponentStatesMixin-EMUnfT5y.js → ComponentStatesMixin-CPLGv3h-.js} +1 -1
- package/dist/storybook/assets/{ComponentStatesMixin.stories-SXq0kzS9.js → ComponentStatesMixin.stories-CiQ_lyhm.js} +1 -1
- package/dist/storybook/assets/{CopyToClipboard.stories-u43lhvcI.js → CopyToClipboard.stories-cJ7rl3mj.js} +1 -1
- package/dist/storybook/assets/{Debounce.stories-BdCn5qgO.js → Debounce.stories-Bw-goobU.js} +1 -1
- package/dist/storybook/assets/{DocsRenderer-LL677BLK-DxiEJ_jx.js → DocsRenderer-LL677BLK-CNW57dGQ.js} +3 -3
- package/dist/storybook/assets/{Dropdown.stories-BWSRwjIF.js → Dropdown.stories-CwC3HXXd.js} +1 -1
- package/dist/storybook/assets/{EmptyState.stories-BpobeZL5.js → EmptyState.stories-BUEJwuhP.js} +1 -1
- package/dist/storybook/assets/{Events.stories-CP5kMzpr.js → Events.stories-D1mf9buv.js} +1 -1
- package/dist/storybook/assets/{Heading.stories-CbJD-oTB.js → Heading.stories-DO906G4P.js} +1 -1
- package/dist/storybook/assets/{HueRipple.stories-BOABJ7zw.js → HueRipple.stories-BOySRSZB.js} +1 -1
- package/dist/storybook/assets/{Icon.stories-CWlUHL4j.js → Icon.stories-BsqgTbdG.js} +1 -1
- package/dist/storybook/assets/{IconButton.stories-BWBs-OLT.js → IconButton.stories-aza1AAKk.js} +1 -1
- package/dist/storybook/assets/{LinearProgress.stories-LZ0GZoxF.js → LinearProgress.stories-CDYmiiex.js} +1 -1
- package/dist/storybook/assets/{Pagination.stories-CbLaR3P9.js → Pagination.stories-LXB-x7YB.js} +1 -1
- package/dist/storybook/assets/{Popover.stories-JHrWqYZw.js → Popover.stories-DY1HesPJ.js} +1 -1
- package/dist/storybook/assets/{ReadyMixin-B1H2a9x8.js → ReadyMixin-DmOC67IJ.js} +1 -1
- package/dist/storybook/assets/{RovingTabindexMixin.stories-UMHpYG73.js → RovingTabindexMixin.stories-BWy0Rq8d.js} +1 -1
- package/dist/storybook/assets/{Rtc.stories-VQtNSlls.js → Rtc.stories-DrmdqqbI.js} +1 -1
- package/dist/storybook/assets/{ScrollShadow.stories-CYdi8Tgp.js → ScrollShadow.stories-DiKFPazh.js} +1 -1
- package/dist/storybook/assets/{Switch.stories-D8F2hZCf.js → Switch.stories-BgFnw8_z.js} +1 -1
- package/dist/storybook/assets/{Tab.stories-wgBP0lTj.js → Tab.stories-c2wLMooF.js} +1 -1
- package/dist/storybook/assets/{Tabs.stories-C00rr5sf.js → Tabs.stories-CjH8seNP.js} +1 -1
- package/dist/storybook/assets/{Throttle.stories-BhQEfJbS.js → Throttle.stories-CXysc_QE.js} +1 -1
- package/dist/storybook/assets/{Tooltip.stories-CGoZ5qTn.js → Tooltip.stories-6qzyByPm.js} +1 -1
- package/dist/storybook/assets/{Upload.stories-B3K-HAXw.js → Upload.stories-BLxykydQ.js} +1 -1
- package/dist/storybook/assets/{UploadItem.stories-71ArSoUh.js → UploadItem.stories-CcfcqdJW.js} +1 -1
- package/dist/storybook/assets/{Welcome.stories-CihlfFXS.js → Welcome.stories-CzYS_3fH.js} +1 -1
- package/dist/storybook/assets/{Widget.stories-1u4KbiJM.js → Widget.stories-Du7T4LAI.js} +1 -1
- package/dist/storybook/assets/{WithTooltip-65CFNBJE-B3Jitxw9.js → WithTooltip-65CFNBJE-D4LfXdYt.js} +1 -1
- package/dist/storybook/assets/{blocks-C1HaXuQB.js → blocks-DR3fGePu.js} +5 -5
- package/dist/storybook/assets/{formatter-EIJCOSYU-Dy9Lt9fs.js → formatter-EIJCOSYU-Cf01216O.js} +1 -1
- package/dist/storybook/assets/if-defined-DaMmbcIU.js +1 -0
- package/dist/storybook/assets/{iframe-Dx6IxWXF.js → iframe-CQArUhO8.js} +4 -4
- package/dist/storybook/assets/{index-OrjedSVh.js → index-B1uI_67G.js} +1 -1
- package/dist/storybook/assets/{onFind-YTqjw6W0.js → onFind-BpFkN2Rh.js} +1 -1
- package/dist/storybook/assets/{onFind.stories-DEvwTrmx.js → onFind.stories-Cxdeg69X.js} +1 -1
- package/dist/storybook/assets/{onRemove.stories-D5mO-Lin.js → onRemove.stories-BHEWpNrE.js} +1 -1
- package/dist/storybook/assets/{onVisible.stories-C3Rcz0Eb.js → onVisible.stories-DFJ3S_ZS.js} +1 -1
- package/dist/storybook/assets/{style-map-CiMHry7H.js → style-map-DJ83UC3V.js} +1 -1
- package/dist/storybook/assets/{syntaxhighlighter-ED5Y7EFY-DIZnuhb2.js → syntaxhighlighter-ED5Y7EFY-zYN83mxK.js} +1 -1
- package/dist/storybook/iframe.html +1 -1
- package/dist/storybook/project.json +1 -1
- package/package.json +16 -2
- package/dist/storybook/assets/if-defined-CA2KmTqA.js +0 -1
- package/src/legacy/tool-ui/src/main/resources/settings.properties +0 -1
- package/src/legacy/tool-ui/src/main/webapp/WEB-INF/web.xml +0 -81
- package/src/legacy/tool-ui/src/main/webapp/script/bsp-uploader.js +0 -170
- package/src/legacy/tool-ui/src/main/webapp/script/bsp-utils.js +0 -393
- package/src/legacy/tool-ui/src/main/webapp/script/content/layout-element.js +0 -141
- package/src/legacy/tool-ui/src/main/webapp/script/input/query.js +0 -78
- package/src/legacy/tool-ui/src/main/webapp/script/input/workflow.js +0 -718
- package/src/legacy/tool-ui/src/main/webapp/script/jquery.extra.js +0 -633
- package/src/legacy/tool-ui/src/main/webapp/script/v3/Dropbox.js +0 -18
- package/src/legacy/tool-ui/src/main/webapp/script/v3/EditFieldUpdate.js +0 -406
- package/src/legacy/tool-ui/src/main/webapp/script/v3/EditFieldUpdateCache.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/script/v3/Notification.js +0 -151
- package/src/legacy/tool-ui/src/main/webapp/script/v3/content/edit.js +0 -194
- package/src/legacy/tool-ui/src/main/webapp/script/v3/content/state.js +0 -785
- package/src/legacy/tool-ui/src/main/webapp/script/v3/csrf.js +0 -35
- package/src/legacy/tool-ui/src/main/webapp/script/v3/dashboard.js +0 -65
- package/src/legacy/tool-ui/src/main/webapp/script/v3/input/dataTransfer.js +0 -129
- package/src/legacy/tool-ui/src/main/webapp/script/v3/input/file.js +0 -433
- package/src/legacy/tool-ui/src/main/webapp/script/v3/input/object.js +0 -743
- package/src/legacy/tool-ui/src/main/webapp/script/v3/input/read-only.js +0 -17
- package/src/legacy/tool-ui/src/main/webapp/script/v3/jquery.frame.js +0 -478
- package/src/legacy/tool-ui/src/main/webapp/script/v3/jquery.repeatable.js +0 -2406
- package/src/legacy/tool-ui/src/main/webapp/script/v3/plugin/popup.d.ts +0 -2
- package/src/legacy/tool-ui/src/main/webapp/script/v3/plugin/popup.js +0 -446
- package/src/legacy/tool-ui/src/main/webapp/script/v3/search-filters.js +0 -62
- package/src/legacy/tool-ui/src/main/webapp/script/v3/search.js +0 -53
- package/src/legacy/tool-ui/src/main/webapp/script/v3.js +0 -1049
- package/src/legacy/tool-ui/src/main/webapp/v4/Admin.js +0 -16
- package/src/legacy/tool-ui/src/main/webapp/v4/AutoExpand.js +0 -84
- package/src/legacy/tool-ui/src/main/webapp/v4/AutoSubmit.js +0 -68
- package/src/legacy/tool-ui/src/main/webapp/v4/Bridge.js +0 -536
- package/src/legacy/tool-ui/src/main/webapp/v4/CheckboxInput.js +0 -22
- package/src/legacy/tool-ui/src/main/webapp/v4/ColorInput.js +0 -5
- package/src/legacy/tool-ui/src/main/webapp/v4/ColorInputSpectrum.js +0 -107
- package/src/legacy/tool-ui/src/main/webapp/v4/ComboInput.js +0 -1491
- package/src/legacy/tool-ui/src/main/webapp/v4/CommunityWidget.js +0 -29
- package/src/legacy/tool-ui/src/main/webapp/v4/ContentEdit.js +0 -2427
- package/src/legacy/tool-ui/src/main/webapp/v4/ContentLock.js +0 -470
- package/src/legacy/tool-ui/src/main/webapp/v4/ContentReporting.js +0 -32
- package/src/legacy/tool-ui/src/main/webapp/v4/DataTable.js +0 -31
- package/src/legacy/tool-ui/src/main/webapp/v4/DateStringField.js +0 -485
- package/src/legacy/tool-ui/src/main/webapp/v4/Entry.js +0 -264
- package/src/legacy/tool-ui/src/main/webapp/v4/ExternalItemAuth.js +0 -16
- package/src/legacy/tool-ui/src/main/webapp/v4/Form.js +0 -31
- package/src/legacy/tool-ui/src/main/webapp/v4/Hierarchy.js +0 -100
- package/src/legacy/tool-ui/src/main/webapp/v4/Icon.ts +0 -49
- package/src/legacy/tool-ui/src/main/webapp/v4/ImageEditor.js +0 -2403
- package/src/legacy/tool-ui/src/main/webapp/v4/ImageEditorBundle.js +0 -5
- package/src/legacy/tool-ui/src/main/webapp/v4/LinkCarousel.js +0 -40
- package/src/legacy/tool-ui/src/main/webapp/v4/LinkList.js +0 -14
- package/src/legacy/tool-ui/src/main/webapp/v4/LinkTable.js +0 -123
- package/src/legacy/tool-ui/src/main/webapp/v4/Location.js +0 -19
- package/src/legacy/tool-ui/src/main/webapp/v4/LocationMap.js +0 -148
- package/src/legacy/tool-ui/src/main/webapp/v4/LookingGlass.js +0 -24
- package/src/legacy/tool-ui/src/main/webapp/v4/Message.js +0 -14
- package/src/legacy/tool-ui/src/main/webapp/v4/NumberBar.js +0 -32
- package/src/legacy/tool-ui/src/main/webapp/v4/Page.js +0 -890
- package/src/legacy/tool-ui/src/main/webapp/v4/Preview.js +0 -758
- package/src/legacy/tool-ui/src/main/webapp/v4/PreviewEditor.js +0 -86
- package/src/legacy/tool-ui/src/main/webapp/v4/PreviewOverlay.js +0 -1005
- package/src/legacy/tool-ui/src/main/webapp/v4/PubSub.js +0 -47
- package/src/legacy/tool-ui/src/main/webapp/v4/QueryField.js +0 -211
- package/src/legacy/tool-ui/src/main/webapp/v4/RegionMap.js +0 -215
- package/src/legacy/tool-ui/src/main/webapp/v4/RepeatableContentInputGroup.js +0 -160
- package/src/legacy/tool-ui/src/main/webapp/v4/RichTextEditor.js +0 -154
- package/src/legacy/tool-ui/src/main/webapp/v4/SearchFields.js +0 -281
- package/src/legacy/tool-ui/src/main/webapp/v4/SearchResult.js +0 -255
- package/src/legacy/tool-ui/src/main/webapp/v4/SharePreview.js +0 -56
- package/src/legacy/tool-ui/src/main/webapp/v4/Sortable.js +0 -874
- package/src/legacy/tool-ui/src/main/webapp/v4/StyleEmbeddedContent.js +0 -100
- package/src/legacy/tool-ui/src/main/webapp/v4/StyleguidePresets.js +0 -357
- package/src/legacy/tool-ui/src/main/webapp/v4/TabContainer.js +0 -360
- package/src/legacy/tool-ui/src/main/webapp/v4/Taxonomy.js +0 -27
- package/src/legacy/tool-ui/src/main/webapp/v4/ThemeBundleEditor.js +0 -224
- package/src/legacy/tool-ui/src/main/webapp/v4/TimedContent.js +0 -147
- package/src/legacy/tool-ui/src/main/webapp/v4/TimedContentBundle.js +0 -8
- package/src/legacy/tool-ui/src/main/webapp/v4/VideoEditor.js +0 -2417
- package/src/legacy/tool-ui/src/main/webapp/v4/VideoEditorBundle.js +0 -8
- package/src/legacy/tool-ui/src/main/webapp/v4/ViewMirror.js +0 -52
- package/src/legacy/tool-ui/src/main/webapp/v4/ViewPreview.d.ts +0 -13
- package/src/legacy/tool-ui/src/main/webapp/v4/ViewPreview.js +0 -177
- package/src/legacy/tool-ui/src/main/webapp/v4/Widget.js +0 -90
- package/src/legacy/tool-ui/src/main/webapp/v4/__mocks__/fileMock.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/__mocks__/styleMock.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/__mocks__/textArea.mock.js +0 -20
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/globals.js +0 -770
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/ProseMirror.test.js +0 -16
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/index.html +0 -54
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/comment_manager/CommentManager.test.js +0 -29
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/comment_manager/index.html +0 -35
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/custom_keyboard/CustomKeyboard.js +0 -42
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/custom_keyboard/index.html +0 -37
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/enhancement_manager/EnhancementManager.test.js +0 -288
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/enhancement_manager/block.html +0 -38
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/enhancement_manager/inline.html +0 -38
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/enhancement_manager/no-popups.html +0 -38
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/list_manager/ListManager.js +0 -257
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/list_manager/index.html +0 -38
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/menubar/hierarchal.html +0 -33
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/menubar/index.html +0 -33
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/menubar/menubar.test.js +0 -195
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/menubar/small.html +0 -34
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/menubar/tags.html +0 -34
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/placeholder_manager/PlaceholderManager.test.js +0 -134
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/placeholder_manager/has-editable-placeholder.html +0 -32
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/placeholder_manager/has-text.html +0 -34
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/placeholder_manager/index.html +0 -31
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/table_manager/TableManager.test.js +0 -63
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/table_manager/existing.html +0 -48
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/track_manager/TrackManager.test.js +0 -291
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/track_manager/existing.html +0 -39
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/integration/rte/plugins/track_manager/insert.html +0 -37
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/Sortable.test.js +0 -105
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/ProseMirror.test.js +0 -41
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/codemirror-shim.test.js +0 -72
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/plugins/collab_manager/CollabManager.test.js +0 -46
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/plugins/enhancement_manager/EnhancementManager.test.js +0 -84
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/plugins/list_manager/ListManager.test.js +0 -54
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/plugins/menubar/menubar.test.js +0 -183
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/plugins/spellcheck/SpellCheck.test.js +0 -45
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/settings/BSSerializer.test.js +0 -346
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/settings/menuItemsBuilder.test.js +0 -226
- package/src/legacy/tool-ui/src/main/webapp/v4/__tests__/unit/rte/utilities.test.js +0 -118
- package/src/legacy/tool-ui/src/main/webapp/v4/appetizeio/Appetizeio.js +0 -5
- package/src/legacy/tool-ui/src/main/webapp/v4/appetizeio/AppetizeioEmbedded.js +0 -113
- package/src/legacy/tool-ui/src/main/webapp/v4/compat/Fetch.js +0 -16
- package/src/legacy/tool-ui/src/main/webapp/v4/compat/jquery.js +0 -32
- package/src/legacy/tool-ui/src/main/webapp/v4/compat/requirejs.js +0 -13
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/Tether.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/TetherLayout.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/closest.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/create.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/find.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/findAll.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/ifClick.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/ifMatches.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/ifUnmodified.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/index.js +0 -5
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/insertBefore.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/insertFirst.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/insertLast.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/onFind.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/onFindOnce.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/onRTEReady.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/onRemove.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/onVisible.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/previousUntil.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/dom/resolveIconCompat.js +0 -40
- package/src/legacy/tool-ui/src/main/webapp/v4/rtc/Socket.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/rtc/index.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/ProseMirror.js +0 -909
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/README.md +0 -68
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/codemirror-shim.d.ts +0 -8
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/codemirror-shim.js +0 -274
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/collab-workflow.jpeg +0 -0
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/interchangeable.ts +0 -250
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/mention.js +0 -90
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/PluginProvider.js +0 -124
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/README.md +0 -46
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/ai_inline_manager/AIInlineManager.ts +0 -124
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/ai_inline_manager/views/AIInlineView.ts +0 -1019
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/ai_manager/AiManager.ts +0 -199
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/collab_manager/CollabManager.js +0 -339
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/collab_manager/views/AvatarView.js +0 -96
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/comment_manager/CommentManager.js +0 -348
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/custom_keyboard/CustomKeyboard.js +0 -110
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/custom_keyboard/README.md +0 -29
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/EnhancementManager.js +0 -428
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/README.md +0 -63
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/commands.js +0 -690
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/constants.js +0 -12
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/enhancement-creation.jpeg +0 -0
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/index.js +0 -15
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/rte-flow.jpeg +0 -0
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/views/ActionButtonView.js +0 -86
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/views/BlockSubmenuView.js +0 -60
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/views/EnhancementView.js +0 -208
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/views/PreviewView.js +0 -102
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/enhancement_manager/views/SubmenuView.js +0 -365
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/find_replace_manager/FindReplaceManager.js +0 -239
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/find_replace_manager/views/FindView.js +0 -604
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/fullscreen_manager/FullscreenManager.js +0 -57
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/fullscreen_manager/README.md +0 -26
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/fullscreen_manager/commands.js +0 -16
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/fullscreen_manager/index.js +0 -4
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/fullscreen_manager/views/FullscreenView.js +0 -474
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/html_editor_manager/htmlEditorManager.js +0 -66
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/html_editor_manager/views/HtmlEditorView.js +0 -97
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/list_manager/ListManager.js +0 -342
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/list_manager/README.md +0 -50
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/list_manager/commands.js +0 -207
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/list_manager/constants.js +0 -26
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/list_manager/index.js +0 -4
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/menubar/Menubar.js +0 -485
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/menubar/README.md +0 -40
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/menubar/views/MenuView.js +0 -842
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/paste_manager/PasteManager.js +0 -368
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/placeholder_manager/PlaceHolderManager.js +0 -128
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/raw_text_manager/README.md +0 -13
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/raw_text_manager/RawTextManager.js +0 -96
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/spellcheck/index.js +0 -3
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/spellcheck/spellcheck-plugin.js +0 -280
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/spellcheck/spellcheck-service.js +0 -94
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/table_manager/TableManager.js +0 -57
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/table_manager/commands.js +0 -97
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/table_manager/views/TableSizerView.js +0 -88
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/table_manager/views/TableView.js +0 -613
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/track_manager/README.md +0 -13
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/plugins/track_manager/TrackManager.js +0 -905
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/BSSerializer.js +0 -819
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/README.md +0 -80
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/commands.js +0 -98
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/constants.d.ts +0 -84
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/constants.js +0 -87
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/index.js +0 -13
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/keymapBuilder.js +0 -223
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/menuItemsBuilder.js +0 -559
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/settings/schemaBuilder.js +0 -1281
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/utilities.d.ts +0 -4
- package/src/legacy/tool-ui/src/main/webapp/v4/rte/utilities.js +0 -359
- package/src/legacy/tool-ui/src/main/webapp/v4/theme/ColorRotator.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/util/debounce.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/util/getComponentKey.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/util/noise.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/util/repaint.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/util/storage.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/util/throttle.js +0 -1
- package/src/legacy/tool-ui/src/main/webapp/v4/widget/AssignmentContent.js +0 -33
- package/src/legacy/tool-ui/src/main/webapp/v4/widget/AssignmentDeskDashboard.js +0 -217
- package/src/legacy/tool-ui/src/main/webapp/v4/widget/AssociatedContentWidget.js +0 -7
- package/src/legacy/tool-ui/src/main/webapp/v4/widget/BulkUpload.js +0 -19
- package/src/legacy/tool-ui/src/main/webapp/v4/widget/Calendar.js +0 -7
- package/src/legacy/tool-ui/src/main/webapp/v4/widget/ClosableWindow.js +0 -13
- package/src/legacy/tool-ui/src/main/webapp/v4/widget/PitchAssignments.js +0 -25
- package/src/legacy/tool-ui/src/main/webapp/v4/widget/PitchContent.js +0 -33
- package/src/legacy/tool-ui/src/main/webapp/v4/widget/Revisions.js +0 -61
|
@@ -1,1049 +0,0 @@
|
|
|
1
|
-
import './jquery.extra'
|
|
2
|
-
|
|
3
|
-
import './bsp-uploader'
|
|
4
|
-
import bspUtils from './bsp-utils'
|
|
5
|
-
import 'iframeResizer'
|
|
6
|
-
|
|
7
|
-
import { processFiles } from './v3/input/dataTransfer'
|
|
8
|
-
import './v3/input/file'
|
|
9
|
-
import './v3/input/object'
|
|
10
|
-
import './input/query'
|
|
11
|
-
import './v3/input/read-only'
|
|
12
|
-
import './input/workflow'
|
|
13
|
-
|
|
14
|
-
import './v3/plugin/popup'
|
|
15
|
-
import './v3/jquery.frame'
|
|
16
|
-
import './v3/jquery.repeatable'
|
|
17
|
-
|
|
18
|
-
import './v3/Dropbox'
|
|
19
|
-
import './v3/EditFieldUpdate'
|
|
20
|
-
import './v3/Notification'
|
|
21
|
-
|
|
22
|
-
import './v3/dashboard'
|
|
23
|
-
import './v3/content/edit'
|
|
24
|
-
import './content/layout-element'
|
|
25
|
-
import './v3/content/state'
|
|
26
|
-
import './v3/csrf'
|
|
27
|
-
import './v3/search'
|
|
28
|
-
import './v3/search-filters'
|
|
29
|
-
|
|
30
|
-
import { announceWithDelay, replaceWithEach } from '../../../dom/aria'
|
|
31
|
-
|
|
32
|
-
export const getWordCountMessage = function (
|
|
33
|
-
charCount,
|
|
34
|
-
wordCount,
|
|
35
|
-
min,
|
|
36
|
-
max,
|
|
37
|
-
suggestedMin,
|
|
38
|
-
suggestedMax,
|
|
39
|
-
) {
|
|
40
|
-
const minDiff = min - charCount
|
|
41
|
-
const maxDiff = charCount - max
|
|
42
|
-
const message =
|
|
43
|
-
charCount < min
|
|
44
|
-
? `${suggestedMin}. ${minDiff} ${
|
|
45
|
-
minDiff > 1
|
|
46
|
-
? window.BRIGHTSPOT.ui.tooltips.charCountCharacterPlural
|
|
47
|
-
: window.BRIGHTSPOT.ui.tooltips.charCountCharacterSingular
|
|
48
|
-
} ${window.BRIGHTSPOT.ui.tooltips.charCountUnderLimit}`
|
|
49
|
-
: charCount > max
|
|
50
|
-
? `${suggestedMax}. ${maxDiff} ${
|
|
51
|
-
maxDiff > 1
|
|
52
|
-
? window.BRIGHTSPOT.ui.tooltips.charCountCharacterPlural
|
|
53
|
-
: window.BRIGHTSPOT.ui.tooltips.charCountCharacterSingular
|
|
54
|
-
} ${window.BRIGHTSPOT.ui.tooltips.charCountOverLimit}`
|
|
55
|
-
: replaceWithEach(`${window.BRIGHTSPOT.ui.tooltips.charCountMessage}`, [
|
|
56
|
-
wordCount,
|
|
57
|
-
wordCount > 1 || wordCount === 0
|
|
58
|
-
? window.BRIGHTSPOT.ui.tooltips.charCountWordPlural
|
|
59
|
-
: window.BRIGHTSPOT.ui.tooltips.charCountWordSingular,
|
|
60
|
-
charCount,
|
|
61
|
-
charCount > 1 || charCount === 0
|
|
62
|
-
? window.BRIGHTSPOT.ui.tooltips.charCountCharacterPlural
|
|
63
|
-
: window.BRIGHTSPOT.ui.tooltips.charCountCharacterSingular,
|
|
64
|
-
])
|
|
65
|
-
return message
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export const getWordCountLabel = function (wordCount, charCount, warning) {
|
|
69
|
-
const tooltips = window.BRIGHTSPOT?.ui.tooltips
|
|
70
|
-
const wordLabel =
|
|
71
|
-
wordCount === 1
|
|
72
|
-
? tooltips?.charCountWordSingular
|
|
73
|
-
: tooltips?.charCountWordPlural
|
|
74
|
-
const charLabel =
|
|
75
|
-
charCount === 1
|
|
76
|
-
? tooltips?.charCountCharacterSingular
|
|
77
|
-
: tooltips?.charCountCharacterPlural
|
|
78
|
-
return (
|
|
79
|
-
tooltips?.charCountLabel +
|
|
80
|
-
': ' +
|
|
81
|
-
(warning ||
|
|
82
|
-
wordCount + ' ' + wordLabel + ', ' + charCount + ' ' + charLabel)
|
|
83
|
-
)
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
var win = window
|
|
87
|
-
// var undef
|
|
88
|
-
var $win = $(win)
|
|
89
|
-
var doc = win.document
|
|
90
|
-
var $doc = $(doc)
|
|
91
|
-
var tooltips = window.BRIGHTSPOT?.ui.tooltips
|
|
92
|
-
|
|
93
|
-
$.addToolCheck = function () {}
|
|
94
|
-
|
|
95
|
-
// Standard behaviors.
|
|
96
|
-
document.addEventListener('DOMContentLoaded', () => {
|
|
97
|
-
$doc.repeatable(
|
|
98
|
-
'live',
|
|
99
|
-
'.repeatableForm, .repeatableInputs, .repeatableLayout, .repeatableObjectId, .repeatableDropdown',
|
|
100
|
-
)
|
|
101
|
-
$doc.repeatable('live', '.repeatableText', {
|
|
102
|
-
addButtonText: '',
|
|
103
|
-
removeButtonText: '',
|
|
104
|
-
restoreButtonText: '',
|
|
105
|
-
})
|
|
106
|
-
})
|
|
107
|
-
|
|
108
|
-
bspUtils.onDomInsert(document, '.ExternalPreviewFrame', {
|
|
109
|
-
insert: function (frame) {
|
|
110
|
-
var $frame = $(frame)
|
|
111
|
-
|
|
112
|
-
$frame.iFrameResize({
|
|
113
|
-
resizedCallback: function () {
|
|
114
|
-
setTimeout(function () {
|
|
115
|
-
$frame.resize()
|
|
116
|
-
}, 0)
|
|
117
|
-
},
|
|
118
|
-
})
|
|
119
|
-
},
|
|
120
|
-
})
|
|
121
|
-
|
|
122
|
-
$doc.frame({
|
|
123
|
-
frameClassName: 'frame',
|
|
124
|
-
loadingClassName: 'loading',
|
|
125
|
-
loadedClassName: 'loaded',
|
|
126
|
-
})
|
|
127
|
-
|
|
128
|
-
bspUtils.onDomInsert(document, '.ProseMirrorContainer', {
|
|
129
|
-
insert: function (pm) {
|
|
130
|
-
bspUtils.addDomInsertBlacklist(pm)
|
|
131
|
-
},
|
|
132
|
-
})
|
|
133
|
-
|
|
134
|
-
$doc.objectId('live', ':input.objectId')
|
|
135
|
-
|
|
136
|
-
// Hide non-essential items in the permissions input.
|
|
137
|
-
$doc.on('change', '.inputContainer .permissions select', function () {
|
|
138
|
-
var $select = $(this)
|
|
139
|
-
|
|
140
|
-
$select
|
|
141
|
-
.parent()
|
|
142
|
-
.find('> h2, > ul')
|
|
143
|
-
.toggle($select.find(':selected').val() === 'some')
|
|
144
|
-
})
|
|
145
|
-
|
|
146
|
-
$doc.on('change', '.widget-urlsItemRemove input[type="checkbox"]', function () {
|
|
147
|
-
var $input = $(this)
|
|
148
|
-
var $label = $input.closest('.widget-urlsItemRemove')
|
|
149
|
-
var $item = $input.closest('.widget-urlsItem')
|
|
150
|
-
$input
|
|
151
|
-
.closest('.widget-urlsItem')
|
|
152
|
-
.toggleClass('is-removing toBeRemoved', $input.is(':checked'))
|
|
153
|
-
$label.attr(
|
|
154
|
-
'title',
|
|
155
|
-
$item.hasClass('toBeRemoved') ? tooltips.restore : tooltips.remove,
|
|
156
|
-
)
|
|
157
|
-
})
|
|
158
|
-
|
|
159
|
-
bspUtils.onDomInsert(document, '.inputContainer .permissions select', {
|
|
160
|
-
afterInsert: function (selects) {
|
|
161
|
-
var $hide = $()
|
|
162
|
-
|
|
163
|
-
$(selects).each(function () {
|
|
164
|
-
var $select = $(this)
|
|
165
|
-
|
|
166
|
-
if ($select.val() !== 'some') {
|
|
167
|
-
$hide = $hide.add($select.parent().find('> h2, > ul'))
|
|
168
|
-
}
|
|
169
|
-
})
|
|
170
|
-
|
|
171
|
-
$hide.hide()
|
|
172
|
-
},
|
|
173
|
-
})
|
|
174
|
-
|
|
175
|
-
$doc.onCreate('.searchSuggestionsForm', function () {
|
|
176
|
-
var $suggestionsForm = $(this)
|
|
177
|
-
var $source = $suggestionsForm
|
|
178
|
-
var $contentForm
|
|
179
|
-
var search
|
|
180
|
-
|
|
181
|
-
do {
|
|
182
|
-
$source = $source.popup('source')
|
|
183
|
-
|
|
184
|
-
if ($source) {
|
|
185
|
-
$contentForm = $source.closest('.contentForm')
|
|
186
|
-
}
|
|
187
|
-
} while ($contentForm.length === 0 && $source && $source.length > 0)
|
|
188
|
-
|
|
189
|
-
if (!$contentForm || $contentForm.length === 0) {
|
|
190
|
-
return
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
search = win.location.search
|
|
194
|
-
search += search.indexOf('?') > -1 ? '&' : '?'
|
|
195
|
-
search += 'id=' + $contentForm.attr('data-content-id')
|
|
196
|
-
|
|
197
|
-
$.ajax({
|
|
198
|
-
data: $contentForm.serialize(),
|
|
199
|
-
type: 'post',
|
|
200
|
-
url: CONTEXT_PATH + 'content/state.jsp' + search,
|
|
201
|
-
complete: function (request) {
|
|
202
|
-
if ($suggestionsForm.closest('body').length === 0) {
|
|
203
|
-
return
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
$suggestionsForm.append(
|
|
207
|
-
$('<input/>', {
|
|
208
|
-
type: 'hidden',
|
|
209
|
-
name: 'object',
|
|
210
|
-
value: request.responseText,
|
|
211
|
-
}),
|
|
212
|
-
)
|
|
213
|
-
|
|
214
|
-
$suggestionsForm.append(
|
|
215
|
-
$('<input/>', {
|
|
216
|
-
type: 'hidden',
|
|
217
|
-
name: 'field',
|
|
218
|
-
value: $source.closest('.inputContainer').attr('data-field'),
|
|
219
|
-
}),
|
|
220
|
-
)
|
|
221
|
-
|
|
222
|
-
$suggestionsForm[0].requestSubmit()
|
|
223
|
-
},
|
|
224
|
-
})
|
|
225
|
-
})
|
|
226
|
-
|
|
227
|
-
$doc.onCreate('.searchAdvancedResult', function () {
|
|
228
|
-
var $result = $(this)
|
|
229
|
-
var checked
|
|
230
|
-
|
|
231
|
-
$result.find('thead tr:first th:first').append(
|
|
232
|
-
$('<div/>', {
|
|
233
|
-
html: $('<span/>', {
|
|
234
|
-
class: 'icon icon-check icon-only',
|
|
235
|
-
}),
|
|
236
|
-
|
|
237
|
-
css: {
|
|
238
|
-
cursor: 'pointer',
|
|
239
|
-
'text-align': 'center',
|
|
240
|
-
'user-select': 'none',
|
|
241
|
-
'vertical-align': 'middle',
|
|
242
|
-
},
|
|
243
|
-
|
|
244
|
-
click: function () {
|
|
245
|
-
var $div = $(this)
|
|
246
|
-
|
|
247
|
-
checked = !checked
|
|
248
|
-
|
|
249
|
-
$div.closest('table').find(':checkbox').prop('checked', checked)
|
|
250
|
-
$div
|
|
251
|
-
.find('.icon')
|
|
252
|
-
.removeClass('icon-check icon-check-empty')
|
|
253
|
-
.addClass(checked ? 'icon-check-empty' : 'icon-check')
|
|
254
|
-
return false
|
|
255
|
-
},
|
|
256
|
-
}),
|
|
257
|
-
)
|
|
258
|
-
|
|
259
|
-
$result.on('change', ':checkbox', function () {
|
|
260
|
-
$result.find('.actions .action').each(function () {
|
|
261
|
-
var $action = $(this)
|
|
262
|
-
var text = $action.text()
|
|
263
|
-
|
|
264
|
-
if ($result.find(':checkbox:checked').length > 0) {
|
|
265
|
-
$action.text(text.replace('All', 'Selected'))
|
|
266
|
-
} else {
|
|
267
|
-
$action.text(text.replace('Selected', 'All'))
|
|
268
|
-
}
|
|
269
|
-
})
|
|
270
|
-
})
|
|
271
|
-
})
|
|
272
|
-
|
|
273
|
-
// Show stack trace when clicking on the exception message.
|
|
274
|
-
$doc.delegate('.exception > *', 'click', function () {
|
|
275
|
-
$(this).find('> .stackTrace').toggle()
|
|
276
|
-
})
|
|
277
|
-
|
|
278
|
-
/*
|
|
279
|
-
@wc: Number = word count
|
|
280
|
-
@cc: Number = char count
|
|
281
|
-
@requiredMin: Number = the required minimum character count.
|
|
282
|
-
@requiredMax: Number = the required maximum character count.
|
|
283
|
-
@requiredNote: String = the localized note used when required.
|
|
284
|
-
@suggestedMin: Number = the suggested minimum character count.
|
|
285
|
-
@suggestedMax: Number = the suggested maximum character count.
|
|
286
|
-
@suggestedNote: String = the localized note used when suggested.
|
|
287
|
-
*/
|
|
288
|
-
export const getAriaWordCountMessage = function (
|
|
289
|
-
wc,
|
|
290
|
-
cc,
|
|
291
|
-
requiredMin,
|
|
292
|
-
requiredMax,
|
|
293
|
-
requiredNote,
|
|
294
|
-
suggestedMin,
|
|
295
|
-
suggestedMax,
|
|
296
|
-
suggestedNote,
|
|
297
|
-
) {
|
|
298
|
-
let ariaMessage =
|
|
299
|
-
wc +
|
|
300
|
-
` ${
|
|
301
|
-
wc > 1 || wc === 0
|
|
302
|
-
? window.BRIGHTSPOT.ui.tooltips.charCountWordPlural
|
|
303
|
-
: window.BRIGHTSPOT.ui.tooltips.charCountWordSingular
|
|
304
|
-
} ` +
|
|
305
|
-
cc +
|
|
306
|
-
` ${
|
|
307
|
-
cc > 1 || cc === 0
|
|
308
|
-
? window.BRIGHTSPOT.ui.tooltips.charCountCharacterPlural
|
|
309
|
-
: window.BRIGHTSPOT.ui.tooltips.charCountCharacterSingular
|
|
310
|
-
}`
|
|
311
|
-
|
|
312
|
-
if (cc < requiredMin) {
|
|
313
|
-
ariaMessage += ` ${requiredNote} ${requiredMin} ${window.BRIGHTSPOT.ui.tooltips.charCountMinimum}.`
|
|
314
|
-
if (!isNaN(suggestedMin)) {
|
|
315
|
-
ariaMessage += ` ${suggestedNote} ${suggestedMin} ${
|
|
316
|
-
suggestedMin > 1
|
|
317
|
-
? window.BRIGHTSPOT.ui.tooltips.charCountCharacterPlural
|
|
318
|
-
: window.BRIGHTSPOT.ui.tooltips.charCountCharacterSingular
|
|
319
|
-
}.`
|
|
320
|
-
}
|
|
321
|
-
} else if (!isNaN(requiredMax)) {
|
|
322
|
-
ariaMessage += ` ${requiredNote} ${requiredMax} ${window.BRIGHTSPOT.ui.tooltips.charCountMaximum}.`
|
|
323
|
-
if (!isNaN(suggestedMax)) {
|
|
324
|
-
ariaMessage += ` ${suggestedNote} ${suggestedMax} ${
|
|
325
|
-
suggestedMax > 1
|
|
326
|
-
? window.BRIGHTSPOT.ui.tooltips.charCountCharacterPlural
|
|
327
|
-
: window.BRIGHTSPOT.ui.tooltips.charCountCharacterSingular
|
|
328
|
-
}.`
|
|
329
|
-
}
|
|
330
|
-
} else if (cc < suggestedMin) {
|
|
331
|
-
ariaMessage += `. ${suggestedNote} ${suggestedMin} ${window.BRIGHTSPOT.ui.tooltips.charCountMinimum}.`
|
|
332
|
-
} else if (!isNaN(suggestedMax)) {
|
|
333
|
-
ariaMessage += `. ${suggestedNote} ${suggestedMax} ${window.BRIGHTSPOT.ui.tooltips.charCountMaximum}.`
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
return ariaMessage
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
// Soft validation based on suggested sizes.
|
|
340
|
-
;(function () {
|
|
341
|
-
var TRIM_RE = /^\s+|\s+$/g
|
|
342
|
-
var WHITESPACE_RE = /\s+/
|
|
343
|
-
|
|
344
|
-
function updateWordCount($container, $input, value) {
|
|
345
|
-
var cc, wc
|
|
346
|
-
let suggestedMin = +$input.attr('data-suggested-minimum')
|
|
347
|
-
let suggestedMax = +$input.attr('data-suggested-maximum')
|
|
348
|
-
let requiredMin = +$input.attr('data-required-minimum')
|
|
349
|
-
let requiredMax = +$input.attr('data-required-maximum')
|
|
350
|
-
|
|
351
|
-
if (
|
|
352
|
-
value === $input.attr('placeholder') &&
|
|
353
|
-
!$input[0].hasAttribute('data-editable-placeholder')
|
|
354
|
-
) {
|
|
355
|
-
cc = 0
|
|
356
|
-
wc = 0
|
|
357
|
-
} else {
|
|
358
|
-
value = (value || '').replace(TRIM_RE, '')
|
|
359
|
-
cc = value.length
|
|
360
|
-
wc = value ? value.split(WHITESPACE_RE).length : 0
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
var $wordCount = $container.find('> .inputWordCount')
|
|
364
|
-
|
|
365
|
-
if ($wordCount.length === 0) {
|
|
366
|
-
$wordCount = $('<div/>', {
|
|
367
|
-
class: 'inputWordCount CIG-wordCount',
|
|
368
|
-
role: 'status',
|
|
369
|
-
'aria-live': 'off',
|
|
370
|
-
})
|
|
371
|
-
|
|
372
|
-
$container.append($wordCount)
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
const warningMessage =
|
|
376
|
-
cc < suggestedMin
|
|
377
|
-
? $input.attr('data-suggested-minimum-message')
|
|
378
|
-
: cc > suggestedMax
|
|
379
|
-
? $input.attr('data-suggested-maximum-message')
|
|
380
|
-
: ''
|
|
381
|
-
|
|
382
|
-
$wordCount.toggleClass('inputWordCount-warning', !!warningMessage)
|
|
383
|
-
$wordCount.text(warningMessage || wc + 'w ' + cc + 'c')
|
|
384
|
-
$wordCount.attr('aria-label', getWordCountLabel(wc, cc, warningMessage))
|
|
385
|
-
|
|
386
|
-
let fieldNote = wc + 'w ' + cc + 'c'
|
|
387
|
-
let suggestedNote = ' (' + $input.attr('data-suggested-message') + ' '
|
|
388
|
-
let requiredNote = ' ' + $input.attr('data-required-message') + ' '
|
|
389
|
-
let charMin = $input.attr('data-min-message')
|
|
390
|
-
let charMax = $input.attr('data-max-message')
|
|
391
|
-
|
|
392
|
-
if (cc < requiredMin) {
|
|
393
|
-
fieldNote += requiredNote + requiredMin + charMin
|
|
394
|
-
if (!isNaN(suggestedMin)) {
|
|
395
|
-
fieldNote += suggestedNote + suggestedMin + 'c)'
|
|
396
|
-
}
|
|
397
|
-
} else if (!isNaN(requiredMax)) {
|
|
398
|
-
fieldNote += requiredNote + requiredMax + charMax
|
|
399
|
-
if (!isNaN(suggestedMax)) {
|
|
400
|
-
fieldNote += suggestedNote + suggestedMax + 'c)'
|
|
401
|
-
}
|
|
402
|
-
} else if (cc < suggestedMin) {
|
|
403
|
-
fieldNote += suggestedNote + suggestedMin + charMin + ')'
|
|
404
|
-
} else if (!isNaN(suggestedMax)) {
|
|
405
|
-
fieldNote += suggestedNote + suggestedMax + charMax + ')'
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
$wordCount.text(fieldNote)
|
|
409
|
-
|
|
410
|
-
announceWithDelay(
|
|
411
|
-
getAriaWordCountMessage(
|
|
412
|
-
wc,
|
|
413
|
-
cc,
|
|
414
|
-
requiredMin,
|
|
415
|
-
requiredMax,
|
|
416
|
-
$input.attr('data-required-message'),
|
|
417
|
-
suggestedMin,
|
|
418
|
-
suggestedMax,
|
|
419
|
-
$input.attr('data-suggested-message'),
|
|
420
|
-
),
|
|
421
|
-
)
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
$doc.delegate(
|
|
425
|
-
'.inputSmall-text:not(:has(> select)) :text:not([data-hide-word-count="true"]), .inputSmall-text:not(:has(> select)) textarea:not(.richtext, [data-hide-word-count="true"])',
|
|
426
|
-
'change.wordCount focus.wordCount input.wordCount',
|
|
427
|
-
$.throttle(100, function () {
|
|
428
|
-
var $input = $(this)
|
|
429
|
-
|
|
430
|
-
updateWordCount(
|
|
431
|
-
$input.closest('.inputContainer'),
|
|
432
|
-
$input,
|
|
433
|
-
$input.val() || $input.attr('placeholder'),
|
|
434
|
-
)
|
|
435
|
-
}),
|
|
436
|
-
)
|
|
437
|
-
|
|
438
|
-
// For new rich text editor, special handling for the word count.
|
|
439
|
-
// Note this counts only the text content not the final output which includes extra HTML elements.
|
|
440
|
-
var rteWordCountInterval
|
|
441
|
-
|
|
442
|
-
function rteWordCount(rte) {
|
|
443
|
-
var $input, $container, html, $html, text
|
|
444
|
-
|
|
445
|
-
$input = rte.$el
|
|
446
|
-
$container = $input.closest('.rte2-wrapper').find('> .rte2-toolbar')
|
|
447
|
-
|
|
448
|
-
// Get the HTML from the RTE - and add a data attribute to "previewable" block elements so we can remove them
|
|
449
|
-
// and not include the text in the word count, because such text is typically used as a placeholder in the RTE
|
|
450
|
-
// and not rendered to the page.
|
|
451
|
-
html = rte.toHTML(undefined, { wordCount: true })
|
|
452
|
-
$html = $(new DOMParser().parseFromString(html, 'text/html').body)
|
|
453
|
-
$html.find('del,.rte-comment,[data-rte-previewable]').remove()
|
|
454
|
-
$html.find('br,p,div,ul,ol,li').after('\n')
|
|
455
|
-
text = $html.text()
|
|
456
|
-
|
|
457
|
-
updateWordCount($container, $input, text)
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
$doc.on('rteChange', function (event, rte) {
|
|
461
|
-
if (rteWordCountInterval) {
|
|
462
|
-
clearInterval(rteWordCountInterval)
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
rteWordCountInterval = setTimeout(function () {
|
|
466
|
-
rteWordCount(rte)
|
|
467
|
-
}, 1000)
|
|
468
|
-
})
|
|
469
|
-
})()
|
|
470
|
-
|
|
471
|
-
// Add function to calculate z-index
|
|
472
|
-
$.fn.zIndex = function (zIndex) {
|
|
473
|
-
if (zIndex !== undefined) {
|
|
474
|
-
return this.css('zIndex', zIndex)
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
if (this.length) {
|
|
478
|
-
var elem = $(this[0])
|
|
479
|
-
var position
|
|
480
|
-
var value
|
|
481
|
-
while (elem.length && elem[0] !== document) {
|
|
482
|
-
// Ignore z-index if position is set to a value where z-index is ignored by the browser
|
|
483
|
-
// This makes behavior of this function consistent across browsers
|
|
484
|
-
// WebKit always returns auto if the element is positioned
|
|
485
|
-
position = elem.css('position')
|
|
486
|
-
if (
|
|
487
|
-
position === 'absolute' ||
|
|
488
|
-
position === 'relative' ||
|
|
489
|
-
position === 'fixed'
|
|
490
|
-
) {
|
|
491
|
-
// IE returns 0 when zIndex is not specified
|
|
492
|
-
// other browsers return a string
|
|
493
|
-
// we ignore the case of nested elements with an explicit value of 0
|
|
494
|
-
// <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
|
|
495
|
-
value = parseInt(elem.css('zIndex'), 10)
|
|
496
|
-
if (!isNaN(value) && value !== 0) {
|
|
497
|
-
return value
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
elem = elem.parent()
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
return 0
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
// Handle file uploads from drag-and-drop.
|
|
507
|
-
;(function () {
|
|
508
|
-
var docEntered
|
|
509
|
-
|
|
510
|
-
// Show all drop zones when the user initiates drag-and-drop.
|
|
511
|
-
$doc.bind('dragenter', function (event) {
|
|
512
|
-
if (!event.originalEvent.dataTransfer.types?.includes('Files')) {
|
|
513
|
-
return
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
var $body, $cover
|
|
517
|
-
|
|
518
|
-
if (docEntered) {
|
|
519
|
-
return
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
docEntered = true
|
|
523
|
-
$body = $(doc.body)
|
|
524
|
-
|
|
525
|
-
// Cover is required to detect mouse leaving the window.
|
|
526
|
-
$cover = $('<div/>', {
|
|
527
|
-
class: 'uploadableCover',
|
|
528
|
-
css: {
|
|
529
|
-
left: 0,
|
|
530
|
-
height: '100%',
|
|
531
|
-
position: 'absolute',
|
|
532
|
-
top: 0,
|
|
533
|
-
width: '100%',
|
|
534
|
-
'z-index': 1999999,
|
|
535
|
-
},
|
|
536
|
-
})
|
|
537
|
-
|
|
538
|
-
let depth = 0
|
|
539
|
-
|
|
540
|
-
$cover.bind('dragenter dragover', function (event) {
|
|
541
|
-
if (event.type === 'dragenter') {
|
|
542
|
-
++depth
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
event.stopPropagation()
|
|
546
|
-
event.preventDefault()
|
|
547
|
-
return false
|
|
548
|
-
})
|
|
549
|
-
|
|
550
|
-
function destroy() {
|
|
551
|
-
docEntered = false
|
|
552
|
-
$cover.remove()
|
|
553
|
-
$('.uploadableFile').remove()
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
$cover.bind('dragleave', function (event) {
|
|
557
|
-
--depth
|
|
558
|
-
|
|
559
|
-
if (depth === 0) {
|
|
560
|
-
destroy()
|
|
561
|
-
}
|
|
562
|
-
})
|
|
563
|
-
|
|
564
|
-
$cover.bind('drop', function (event) {
|
|
565
|
-
event.preventDefault()
|
|
566
|
-
destroy()
|
|
567
|
-
return false
|
|
568
|
-
})
|
|
569
|
-
|
|
570
|
-
const v5Enabled = window.BRIGHTSPOT?.ui.cms.enableV5UI
|
|
571
|
-
|
|
572
|
-
const $dropZones = $(
|
|
573
|
-
'.inputContainer .action-upload, .uploadable .uploadableLink, .fileSelector, .RichTextEditor-upload',
|
|
574
|
-
).filter(function (index, elem) {
|
|
575
|
-
const { left, right, top, bottom } = this.getBoundingClientRect()
|
|
576
|
-
const topMostElement = document.elementFromPoint(
|
|
577
|
-
(left + right) / 2,
|
|
578
|
-
(top + bottom) / 2,
|
|
579
|
-
)
|
|
580
|
-
|
|
581
|
-
if (elem.classList.contains('RichTextEditor-upload')) {
|
|
582
|
-
return true
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
if (v5Enabled && topMostElement?.closest('.fileSelector')) {
|
|
586
|
-
return true
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
return topMostElement === this
|
|
590
|
-
})
|
|
591
|
-
|
|
592
|
-
// Get the top most open dialog or fullscreen RTE
|
|
593
|
-
const topLayer = Array.from(
|
|
594
|
-
document.querySelectorAll(
|
|
595
|
-
'dialog[open], .ProseMirror-fullscreen-container:not(.hide)',
|
|
596
|
-
),
|
|
597
|
-
).pop()
|
|
598
|
-
|
|
599
|
-
// Append the cover to either the dialog, fullscreen RTE, or body
|
|
600
|
-
if (v5Enabled && topLayer) {
|
|
601
|
-
$(topLayer).append($cover)
|
|
602
|
-
} else {
|
|
603
|
-
$body.append($cover)
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
// Gather the z-indexes of the drop zone parents to determine highest level.
|
|
607
|
-
let highestZIndex = 1
|
|
608
|
-
$dropZones.each(function () {
|
|
609
|
-
const currIndex = parseInt($(this).parents('div').last().css('z-index'))
|
|
610
|
-
|
|
611
|
-
if (currIndex >= highestZIndex) {
|
|
612
|
-
highestZIndex = currIndex
|
|
613
|
-
}
|
|
614
|
-
})
|
|
615
|
-
|
|
616
|
-
// Valid file drop zones.
|
|
617
|
-
$dropZones.each(function () {
|
|
618
|
-
var $upload = $(this)
|
|
619
|
-
var $container = $upload.closest(
|
|
620
|
-
'.inputContainer, .uploadable, .ProseMirror-fullscreen-container',
|
|
621
|
-
)
|
|
622
|
-
var overlayCss
|
|
623
|
-
var $dropLink
|
|
624
|
-
var $fileSelector
|
|
625
|
-
var $fileSelectorSelect
|
|
626
|
-
var $fileSelectorInput
|
|
627
|
-
var $fileSelectorLabel
|
|
628
|
-
|
|
629
|
-
const parents = $(this).parents('div')
|
|
630
|
-
const currIndex = parseInt(parents.last().css('z-index'))
|
|
631
|
-
|
|
632
|
-
// If z-index is less than highest z-index, than this dropzone should not take priority
|
|
633
|
-
if (highestZIndex > 1 && currIndex < highestZIndex) {
|
|
634
|
-
return
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
const isInInvisiblePopup = [...parents].some((element) => {
|
|
638
|
-
return (
|
|
639
|
-
element.classList.contains('Popup') &&
|
|
640
|
-
!element.classList.contains('is-visible')
|
|
641
|
-
)
|
|
642
|
-
})
|
|
643
|
-
// Only add drag and drop if the element is visible.
|
|
644
|
-
// For example, an element might be hidden in another tab,
|
|
645
|
-
// so we do not want drag and drop region for that element.
|
|
646
|
-
if (!$(this).is(':visible') || isInInvisiblePopup) {
|
|
647
|
-
return
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
// If a dialog is open, we can skip any drop zone not inside the dialog
|
|
651
|
-
if (
|
|
652
|
-
v5Enabled &&
|
|
653
|
-
topLayer?.nodeName === 'DIALOG' &&
|
|
654
|
-
topLayer != $(this)[0]?.closest('dialog')
|
|
655
|
-
)
|
|
656
|
-
return
|
|
657
|
-
|
|
658
|
-
// Check if this is a FileSelector widget, such as used to upload a single new file
|
|
659
|
-
if ($(this).is('.fileSelector')) {
|
|
660
|
-
$fileSelector = $(this)
|
|
661
|
-
$fileSelectorSelect = $(this).find(
|
|
662
|
-
'> btu-toggleable > select[name $= "file.action"]',
|
|
663
|
-
)
|
|
664
|
-
$fileSelectorLabel = $(this).find('> .dropDown-input > .dropDown-label')
|
|
665
|
-
$fileSelectorInput = $(this).find(
|
|
666
|
-
'> .file-selector-com-psddev-cms-ui-form-field-NewUploadFileFormInputAction input[type="file"]',
|
|
667
|
-
)
|
|
668
|
-
// The existing drag and drop code used a link to display the "Drop Files Here" text,
|
|
669
|
-
// so we'll create a link that can be used
|
|
670
|
-
$upload = $('<a>', { href: '#' }).on('click', function () {
|
|
671
|
-
return false
|
|
672
|
-
})
|
|
673
|
-
}
|
|
674
|
-
|
|
675
|
-
// container dimensions
|
|
676
|
-
const { height, left, top, width } = $container[0].getBoundingClientRect()
|
|
677
|
-
const containerStyle = window.getComputedStyle($container[0])
|
|
678
|
-
const offset = parseFloat(
|
|
679
|
-
containerStyle.getPropertyValue('--gap-m').replace('px', ''),
|
|
680
|
-
)
|
|
681
|
-
|
|
682
|
-
const isFullScreen = $container[0].classList.contains(
|
|
683
|
-
'ProseMirror-fullscreen-container',
|
|
684
|
-
)
|
|
685
|
-
|
|
686
|
-
// Dimensions & positioning of drag-and-drop overlay
|
|
687
|
-
overlayCss = $.extend($container.offset(), {
|
|
688
|
-
height: isFullScreen ? height - offset * 2 : height + offset * 2,
|
|
689
|
-
left: isFullScreen ? offset : left - offset,
|
|
690
|
-
position: 'absolute',
|
|
691
|
-
top: isFullScreen ? offset : top - offset,
|
|
692
|
-
width: isFullScreen ? width - offset * 2 : width + offset * 2,
|
|
693
|
-
// Calculate the z-index for the element and use the same value for the drag-and-drop overlay.
|
|
694
|
-
// This should ensure that things like popups will show the drag and drop overlay,
|
|
695
|
-
// and still be on top of other drag-and-drop overlays that are in a lower stacking context.
|
|
696
|
-
'z-index': $(this).zIndex() || 'auto',
|
|
697
|
-
})
|
|
698
|
-
|
|
699
|
-
$dropLink = $upload.clone()
|
|
700
|
-
$dropLink.text('Drop Files Here')
|
|
701
|
-
|
|
702
|
-
const $dropInput = $('<div/>', {
|
|
703
|
-
class: 'uploadableFile',
|
|
704
|
-
css: $.extend(overlayCss, {
|
|
705
|
-
'z-index': 2000000,
|
|
706
|
-
}),
|
|
707
|
-
})
|
|
708
|
-
|
|
709
|
-
$dropInput.on('dragenter dragover', function (event) {
|
|
710
|
-
$dropInput[0].classList.add('is-active')
|
|
711
|
-
event.preventDefault()
|
|
712
|
-
})
|
|
713
|
-
|
|
714
|
-
$dropInput.on('dragleave', (event) => {
|
|
715
|
-
$dropInput[0].classList.remove('is-active')
|
|
716
|
-
})
|
|
717
|
-
|
|
718
|
-
// On file drop, provide array of Files to the appropriate input.
|
|
719
|
-
$dropInput.one('drop', function (event) {
|
|
720
|
-
event.preventDefault()
|
|
721
|
-
|
|
722
|
-
var dropLinkOffset = $dropLink.offset()
|
|
723
|
-
var $frame
|
|
724
|
-
let filesHandler
|
|
725
|
-
|
|
726
|
-
$cover.hide()
|
|
727
|
-
|
|
728
|
-
// Are we dealing with a FileSelector control, or an upload link?
|
|
729
|
-
if ($fileSelector) {
|
|
730
|
-
// Allow dropping of one file only.
|
|
731
|
-
|
|
732
|
-
filesHandler = (files) => {
|
|
733
|
-
if (files.length === 1) {
|
|
734
|
-
$fileSelectorSelect.val('newUpload').trigger('change')
|
|
735
|
-
$fileSelectorLabel.trigger('dropDown-update')
|
|
736
|
-
// This is to avoid `files` property validation exception.
|
|
737
|
-
Object.defineProperty($fileSelectorInput.get(0), 'files', {
|
|
738
|
-
value: files,
|
|
739
|
-
configurable: true,
|
|
740
|
-
writable: true,
|
|
741
|
-
})
|
|
742
|
-
$fileSelectorInput.change()
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
|
|
746
|
-
// Clear the drag and drop regions
|
|
747
|
-
destroy()
|
|
748
|
-
} else {
|
|
749
|
-
// We are dealing with an upload link, so click it to make the popup appear
|
|
750
|
-
if (window.ENABLE_CODE_MIRROR_RICH_TEXT_EDITOR) {
|
|
751
|
-
$dropLink.click()
|
|
752
|
-
} else {
|
|
753
|
-
$upload[0].click()
|
|
754
|
-
}
|
|
755
|
-
|
|
756
|
-
$frame = $('.frame[name="' + $dropLink.attr('target') + '"]')
|
|
757
|
-
|
|
758
|
-
if ($frame.length === 0) {
|
|
759
|
-
}
|
|
760
|
-
|
|
761
|
-
// Position the popup over the drop link.
|
|
762
|
-
$frame.popup('source', $upload, {
|
|
763
|
-
pageX: dropLinkOffset.left + $dropLink.outerWidth() / 2,
|
|
764
|
-
pageY: dropLinkOffset.top + $dropLink.outerHeight(),
|
|
765
|
-
})
|
|
766
|
-
|
|
767
|
-
// Closing the popup resets the drag-and-drop.
|
|
768
|
-
$frame.popup('container').bind('close', function () {
|
|
769
|
-
destroy()
|
|
770
|
-
})
|
|
771
|
-
|
|
772
|
-
let count = 0
|
|
773
|
-
|
|
774
|
-
filesHandler = (files) => {
|
|
775
|
-
if (files.length < 1) {
|
|
776
|
-
$frame.popup('container').trigger('close')
|
|
777
|
-
return
|
|
778
|
-
}
|
|
779
|
-
var $frameFileInput = $frame
|
|
780
|
-
.find('input.fileUploader[type="file"]')
|
|
781
|
-
.eq(0)
|
|
782
|
-
|
|
783
|
-
if ($frameFileInput.length !== 1) {
|
|
784
|
-
setTimeout(filesHandler, 20, files)
|
|
785
|
-
} else {
|
|
786
|
-
// This is to avoid `files` property validation exception.
|
|
787
|
-
Object.defineProperty($frameFileInput.get(0), 'files', {
|
|
788
|
-
value: files,
|
|
789
|
-
})
|
|
790
|
-
|
|
791
|
-
const interval = setInterval(() => {
|
|
792
|
-
if (
|
|
793
|
-
$frame.hasClass('loaded') &&
|
|
794
|
-
$frameFileInput.hasClass('bsp-uploader-item')
|
|
795
|
-
) {
|
|
796
|
-
$frameFileInput.change()
|
|
797
|
-
clearInterval(interval)
|
|
798
|
-
}
|
|
799
|
-
}, 20)
|
|
800
|
-
}
|
|
801
|
-
}
|
|
802
|
-
}
|
|
803
|
-
processFiles(event.originalEvent.dataTransfer, filesHandler)
|
|
804
|
-
})
|
|
805
|
-
|
|
806
|
-
$dropInput.append($dropLink)
|
|
807
|
-
$cover.append($dropInput)
|
|
808
|
-
})
|
|
809
|
-
})
|
|
810
|
-
|
|
811
|
-
$doc.bind('dragend', function (event) {
|
|
812
|
-
if (docEntered) {
|
|
813
|
-
docEntered = false
|
|
814
|
-
$('.uploadableCover').remove()
|
|
815
|
-
$('.uploadableFile').remove()
|
|
816
|
-
}
|
|
817
|
-
})
|
|
818
|
-
})()
|
|
819
|
-
|
|
820
|
-
$doc.on(
|
|
821
|
-
'click',
|
|
822
|
-
'button[name="action-delete"], :submit[name="action-delete"]',
|
|
823
|
-
function () {
|
|
824
|
-
return confirm('Are you sure you want to permanently delete this item?')
|
|
825
|
-
},
|
|
826
|
-
)
|
|
827
|
-
|
|
828
|
-
$doc.on(
|
|
829
|
-
'click',
|
|
830
|
-
'button[name="action-trash"], :submit[name="action-trash"]',
|
|
831
|
-
function () {
|
|
832
|
-
var confirmMessage = 'Are you sure you want to archive this item?'
|
|
833
|
-
if (
|
|
834
|
-
$('[data-internal-name="com.psddev.cms.tool.content.ReferencesWidget"]')
|
|
835
|
-
.length > 0 ||
|
|
836
|
-
$('[data-tab-class="com.psddev.cms.type.page.ContentTypeReferencesTab"]')
|
|
837
|
-
.length > 0
|
|
838
|
-
) {
|
|
839
|
-
confirmMessage += '\nThis asset has associated References!'
|
|
840
|
-
}
|
|
841
|
-
return confirm(confirmMessage)
|
|
842
|
-
},
|
|
843
|
-
)
|
|
844
|
-
|
|
845
|
-
$doc.on('click', '[data-confirm-message]', function () {
|
|
846
|
-
return confirm($(this).attr('data-confirm-message'))
|
|
847
|
-
})
|
|
848
|
-
|
|
849
|
-
// Key bindings.
|
|
850
|
-
$doc.on('keydown', ':input', function (event) {
|
|
851
|
-
if (event.which === 27) {
|
|
852
|
-
$(this).blur()
|
|
853
|
-
}
|
|
854
|
-
})
|
|
855
|
-
|
|
856
|
-
$doc.on('keypress', function (event) {
|
|
857
|
-
var $searchInput
|
|
858
|
-
|
|
859
|
-
if (
|
|
860
|
-
window.BRIGHTSPOT?.ui?.cms?.enableSearchKeyboardShortcut !== false &&
|
|
861
|
-
event.which === 47 &&
|
|
862
|
-
$(event.target).closest(':input').length === 0 &&
|
|
863
|
-
$(event.target).closest('.ProseMirror').length === 0
|
|
864
|
-
) {
|
|
865
|
-
$searchInput = $('.toolSearch .searchInput :text')
|
|
866
|
-
|
|
867
|
-
$searchInput.val('')
|
|
868
|
-
$searchInput.trigger('click')
|
|
869
|
-
return false
|
|
870
|
-
}
|
|
871
|
-
})
|
|
872
|
-
|
|
873
|
-
// Synchronizes main search input with the hidden one in the type select form.
|
|
874
|
-
$doc.on(
|
|
875
|
-
'input',
|
|
876
|
-
'.searchFiltersRest > .searchInput > btu-input > :text',
|
|
877
|
-
function () {
|
|
878
|
-
var $input = $(this)
|
|
879
|
-
var $otherInput = $input
|
|
880
|
-
.closest('.searchFilters')
|
|
881
|
-
.find('.searchFiltersType > input[name="' + $input.attr('name') + '"]')
|
|
882
|
-
|
|
883
|
-
if ($otherInput.length > 0) {
|
|
884
|
-
$otherInput.val($input.val())
|
|
885
|
-
|
|
886
|
-
for (const i of $otherInput) {
|
|
887
|
-
i.dispatchEvent(new CustomEvent('input', { bubbles: true }))
|
|
888
|
-
}
|
|
889
|
-
}
|
|
890
|
-
},
|
|
891
|
-
)
|
|
892
|
-
|
|
893
|
-
$doc.on(
|
|
894
|
-
'open',
|
|
895
|
-
[
|
|
896
|
-
'.popup[data-popup-source-class~="objectId-select"]',
|
|
897
|
-
'.popup[data-popup-source-class~="rte2-enhancement-toolbar-change"]',
|
|
898
|
-
].join(','),
|
|
899
|
-
function (event) {
|
|
900
|
-
var $popup = $(event.target)
|
|
901
|
-
var isEnhancement = $popup.is(
|
|
902
|
-
'.popup[data-popup-source-class~="rte2-enhancement-toolbar-change"]',
|
|
903
|
-
)
|
|
904
|
-
var $input = $popup.popup('source')
|
|
905
|
-
var $withLeftNav = $input.closest('.withLeftNav')
|
|
906
|
-
|
|
907
|
-
$.data($popup[0], 'objectSelect-$withLeftNav', $withLeftNav)
|
|
908
|
-
$withLeftNav.addClass('objectSelectOpen')
|
|
909
|
-
|
|
910
|
-
var $container = $input
|
|
911
|
-
var fieldsLabel = ''
|
|
912
|
-
var isAdd
|
|
913
|
-
|
|
914
|
-
for (;;) {
|
|
915
|
-
$container = $container.parent().closest('.inputContainer')
|
|
916
|
-
|
|
917
|
-
if ($container.length > 0) {
|
|
918
|
-
fieldsLabel =
|
|
919
|
-
$container.find('> .inputLabel > label').text() +
|
|
920
|
-
(fieldsLabel ? ' \u2192 ' + fieldsLabel : '')
|
|
921
|
-
isAdd = $container.find('> .plugin-repeatable').length > 0
|
|
922
|
-
} else {
|
|
923
|
-
break
|
|
924
|
-
}
|
|
925
|
-
}
|
|
926
|
-
|
|
927
|
-
var label =
|
|
928
|
-
(isEnhancement
|
|
929
|
-
? 'Select Enhancement for '
|
|
930
|
-
: isAdd
|
|
931
|
-
? 'Add to '
|
|
932
|
-
: 'Select ') + fieldsLabel
|
|
933
|
-
var objectLabelHtml = $input
|
|
934
|
-
.closest('.contentForm')
|
|
935
|
-
.find('.ContentLabel')
|
|
936
|
-
.html()
|
|
937
|
-
|
|
938
|
-
bspUtils.onDomInsert($popup[0], '> .content > .frame > h1', {
|
|
939
|
-
insert: function (heading) {
|
|
940
|
-
var $heading = $(heading)
|
|
941
|
-
|
|
942
|
-
$heading.text(label)
|
|
943
|
-
|
|
944
|
-
if (objectLabelHtml) {
|
|
945
|
-
$heading.append(' - ')
|
|
946
|
-
$heading.append(objectLabelHtml)
|
|
947
|
-
}
|
|
948
|
-
},
|
|
949
|
-
})
|
|
950
|
-
},
|
|
951
|
-
)
|
|
952
|
-
|
|
953
|
-
$doc.on(
|
|
954
|
-
'close',
|
|
955
|
-
[
|
|
956
|
-
'.popup[data-popup-source-class~="objectId-select"]',
|
|
957
|
-
'.popup[data-popup-source-class~="rte2-enhancement-toolbar-change"]',
|
|
958
|
-
].join(','),
|
|
959
|
-
function (event) {
|
|
960
|
-
var $withLeftNav = $.data(event.target, 'objectSelect-$withLeftNav')
|
|
961
|
-
|
|
962
|
-
if ($withLeftNav) {
|
|
963
|
-
$withLeftNav.removeClass('objectSelectOpen')
|
|
964
|
-
}
|
|
965
|
-
},
|
|
966
|
-
)
|
|
967
|
-
|
|
968
|
-
var OBJECT_EDIT_POPUP_SELECTORS = [
|
|
969
|
-
'.popup[data-popup-source-class~="objectId-create"]',
|
|
970
|
-
'.popup[data-popup-source-class~="objectId-edit"]',
|
|
971
|
-
'.popup[data-popup-source-class~="action-copy"]',
|
|
972
|
-
'.popup[data-popup-source-class~="action-create"]',
|
|
973
|
-
'.popup[data-popup-source-class~="rte2-enhancement-toolbar-edit"]',
|
|
974
|
-
]
|
|
975
|
-
|
|
976
|
-
// Add back to button above the content edit form within a popup.
|
|
977
|
-
bspUtils.onDomInsert(
|
|
978
|
-
document,
|
|
979
|
-
OBJECT_EDIT_POPUP_SELECTORS.map(function (s) {
|
|
980
|
-
return s + ' > .content'
|
|
981
|
-
}).join(', '),
|
|
982
|
-
{
|
|
983
|
-
insert: function (frame) {
|
|
984
|
-
var $frame = $(frame)
|
|
985
|
-
var $source = $frame.popup('source')
|
|
986
|
-
var text = $source
|
|
987
|
-
.closest('.contentForm')
|
|
988
|
-
.find(
|
|
989
|
-
'> .contentForm-main > .widget > h1, > .withLeftNav > .main > .widget > h1',
|
|
990
|
-
)
|
|
991
|
-
.eq(0)
|
|
992
|
-
.clone()
|
|
993
|
-
|
|
994
|
-
if (text.find('.ComboInput-selected').length) {
|
|
995
|
-
let newLabel = ''
|
|
996
|
-
let firstChild =
|
|
997
|
-
$(text)[0].querySelector('.breadcrumbItem').childNodes[0]
|
|
998
|
-
if (firstChild.nodeName === '#text') {
|
|
999
|
-
newLabel = firstChild.textContent
|
|
1000
|
-
}
|
|
1001
|
-
text =
|
|
1002
|
-
newLabel +
|
|
1003
|
-
text.find('.ComboInput-selected').text() +
|
|
1004
|
-
': ' +
|
|
1005
|
-
text.find('.ContentLabel').text()
|
|
1006
|
-
} else if (text) {
|
|
1007
|
-
text = text.text()
|
|
1008
|
-
} else {
|
|
1009
|
-
text = $source.closest('.frame').find('> h1').text()
|
|
1010
|
-
}
|
|
1011
|
-
|
|
1012
|
-
text = text ? 'Back to ' + text : 'Back'
|
|
1013
|
-
|
|
1014
|
-
$frame.prepend(
|
|
1015
|
-
$('<button/>', {
|
|
1016
|
-
class: 'popup-objectId-edit-heading Link',
|
|
1017
|
-
text: text,
|
|
1018
|
-
click: function () {
|
|
1019
|
-
$(this).popup('close')
|
|
1020
|
-
|
|
1021
|
-
// Send focus back into search popup if content form was opened from it
|
|
1022
|
-
const otherPopup = document.querySelector('.Popup.is-visible')
|
|
1023
|
-
if (otherPopup) {
|
|
1024
|
-
const closePopup = otherPopup.querySelector('.Popup-close')
|
|
1025
|
-
closePopup?.focus()
|
|
1026
|
-
}
|
|
1027
|
-
|
|
1028
|
-
return false
|
|
1029
|
-
},
|
|
1030
|
-
}),
|
|
1031
|
-
)
|
|
1032
|
-
},
|
|
1033
|
-
},
|
|
1034
|
-
)
|
|
1035
|
-
|
|
1036
|
-
$doc.ready(function () {
|
|
1037
|
-
$(this).trigger('create')
|
|
1038
|
-
;(function () {
|
|
1039
|
-
bspUtils.onDomInsert(document, '.toolSearch :text', {
|
|
1040
|
-
insert: function (input) {
|
|
1041
|
-
var $input = $(input)
|
|
1042
|
-
|
|
1043
|
-
if ($input.is(':focus')) {
|
|
1044
|
-
$input.focus()
|
|
1045
|
-
}
|
|
1046
|
-
},
|
|
1047
|
-
})
|
|
1048
|
-
})()
|
|
1049
|
-
})
|