docbrown/app/assets/javascripts/initializers
Nizar 7058d628af
Added Copy Permalink Functionality to Comment Dropdown (#8311)
* Added Copy Permalink Functionality to Comment Dropdown

Copy functionality is similar to the way 'copy article link' is implemented. It checks for the android bridge first, then the navigator, then fallsback to the default document copy command

Since the codes were really similar, I moved the copy functionality to a function of its own with callbacks and fallbacks as lambdas, and triggered it with the copyArticleLink and the copyPermalink

* Replaced Copy Permalink Callbacks with Promises

* Keep anchor tags instead of buttons (#1)

* copy permalink using anchor tag

* Missing closing button tag

* Adds 'Copied to Clipboard' Snackbar Message

* Patches bug introduced in #10323

Patch suggested in following comment: https://github.com/forem/forem/pull/8311\#pullrequestreview-492011202

* Removes import statement for addSnackbarItem and Suppresses ESLint Error

Initializer runs in global scope

* Unhandles exception when copying permalink so Honeybadger can handle it

* Replaces ButtonListener suffix for copyPermalink method with Listener

Co-authored-by: Fernando Valverde <fernando@visualcosita.com>
2020-11-11 08:32:10 -05:00
..
initializeAllChatButtons.js New Profile Header (#10185) 2020-09-03 16:47:01 +02:00
initializeAllFollowButts.js Tags index design update (#9072) 2020-07-06 11:43:58 +02:00
initializeAllTagEditButtons.js Add admin shortcut to tag page (#11092) 2020-10-28 12:19:21 -04:00
initializeArchivedPostFilter.js Fixes archived button in dashboard for PWA (#8930) 2020-06-26 11:26:12 -04:00
initializeArticleDate.js [deploy] Home Page Feed redesign + top comments (#7579) 2020-05-12 07:57:57 -05:00
initializeArticleReactions.js Improve styling for series (#9893) 2020-08-24 09:53:51 +02:00
initializeBaseTracking.js.erb Fetch GA Tracking ID from SiteConfig (#10262) 2020-09-09 18:17:44 -04:00
initializeBaseUserData.js [deploy] Fix tag display bug and crayonsify area (#10868) 2020-10-20 16:07:17 -04:00
initializeBodyData.js Replace querySelector and getElementsByTagName when selecting for head and body (#8315) 2020-06-08 20:08:40 -04:00
initializeBroadcast.js Hide active broadcasts from /connect routes (#10312) 2020-09-14 11:28:18 +02:00
initializeCommentDate.js Fix lint in initializeCommentDate.js (#4319) [ci skip] 2019-10-09 14:33:52 -04:00
initializeCommentDropdown.js Added Copy Permalink Functionality to Comment Dropdown (#8311) 2020-11-11 08:32:10 -05:00
initializeCommentPreview.js [deploy] Redesigned Comment Form (#10355) 2020-10-05 12:01:48 +02:00
initializeCommentsPage.js.erb Rate Limit Modal - Comments (#11102) 2020-11-03 15:49:20 -06:00
initializeCreditsPage.js Refactor: initializeCreditsPage.js (#4312) [ci skip] 2019-10-08 12:33:28 -04:00
initializeDashboardSort.js [deploy] Dashboard updates (#8879) 2020-06-25 13:10:17 -04:00
initializeDateTimeHelpers.js [deploy] Add local_date helper to handle dates with respect of user timezone (#9285) 2020-07-16 08:45:44 -06:00
initializeDrawerSliders.js [deploy] Frontend cleanups (#10416) 2020-09-24 08:15:12 -05:00
initializeEllipsisMenu.js Table component & Dashboard update (#8778) 2020-06-22 18:47:17 +02:00
initializeHeroBannerClose.js [deploy] Remove hardcoded banner exit code (#7018) 2020-04-02 12:08:13 -04:00
initializeLocalStorageRender.js Replace querySelector and getElementsByTagName when selecting for head and body (#8315) 2020-06-08 20:08:40 -04:00
initializeOnboardingTaskCard.js Fix TypeError: userData is null in initializeOnboardingTaskCard.js (#9298) [deploy] 2020-07-14 07:32:57 -07:00
initializePaymentPointers.js Check for meta payment pointer first before attempting to load (#9722) 2020-08-10 18:12:48 -04:00
initializePodcastPlayback.js Podcast + Video player native bridge small refactor (#11345) 2020-11-10 07:36:05 -06:00
initializePWAFunctionality.js Open /connect sidecar links in iframe (#5203) [deploy] 2019-12-21 15:46:36 -05:00
initializeReadingListIcons.js Don't show badge when reading list is left empty (#9437) 2020-07-22 08:55:33 -04:00
initializeSettings.js Layout updates (#8107) 2020-06-04 16:12:17 +02:00
initializeSpecialNavigationFunctionality.js CSS Cleanups, part 2 (#10527) 2020-10-03 06:57:57 +02:00
initializeSponsorshipVisibility.js New sidebar navigation (#7212) 2020-04-15 18:16:33 +02:00
initializeSwipeGestures.js add no console rule front-end (#10362) 2020-09-29 09:56:37 +02:00
initializeTimeFixer.js Refactor initializeTimeFixer.js (#4416) 2019-10-17 08:05:45 -04:00
initializeTouchDevice.js CSS Cleanups, part 2 (#10527) 2020-10-03 06:57:57 +02:00
initializeUserProfilePage.js New Profile Header (#10185) 2020-09-03 16:47:01 +02:00
initializeVideoPlayback.js Podcast + Video player native bridge small refactor (#11345) 2020-11-10 07:36:05 -06:00
initNotifications.js Notifications redesign (#11084) 2020-10-29 20:38:17 +01:00
initScrolling.js Tags index design update (#9072) 2020-07-06 11:43:58 +02:00
runtime.js Makes Runtime.js detect the generalized ForemWebView User Agent (#11288) 2020-11-05 14:18:17 -06:00