Commit Graph

10 Commits

Author SHA1 Message Date
David Taylor 7685ebf396
DEV: Update to native class syntax (#230) 2024-11-29 10:11:21 +00:00
Blake Erickson 9581367239
FIX: Add exclude groups for each ad platforms (#197)
With the new group system for displaying ads we no longer can check if a
user belongs to a trust level group lower than specified. The other
problem is that ALL users including staff and higher trust levels all
belong to trust level 0. So without this fix if we say that an ad should
be visible to trust level 0 users then it will be shown to all users.

This fix adds a new default setting for each ad platform for excluding
trust level 3, 4, and staff users from being shown ads.

- Make display_groups hidden (they will be removed in a later commit)
- Switch to using only exclude_groups instead of display groups and
  exclude groups
- rename showToDisplayGroups to showXAds for each provider
2024-02-08 19:42:40 -07:00
Blake Erickson 6f8ff34ffa
DEV: Convert TL settings to groups (#195)
* DEV: Convert TL settings to groups

This change converts the TL site settings in this plugin to use groups
instead.

See: https://meta.discourse.org/t/283408

Co-authored-by: Martin Brennan <martin@discourse.org>
2024-01-31 11:04:24 -07:00
David Taylor 36f4ebc64b
DEV: Abort placing adsense if Ember component is destroyed (#190)
This should avoid surprising error messages being printed to the console
2023-11-08 10:44:39 +11:00
David Taylor 789be84744
DEV: Log errors from adsense (#189) 2023-11-07 22:44:02 +00:00
David Taylor c88bb59d81
FIX: Fully re-render ads when navigating between pages (#188)
In the past, the ad plugin relied on two side-effects to achieve this behaviour:

1. Components being fully destroyed/rendered when navigating between pages. This stopped working when Discourse core moved to the more efficient 'loading slider' UI

2. The `listLoading` argument. This was an implementation detail of the old discovery routing infrastructure. Core recently overhauled this and removed the `listLoading` argument, because loading is now handled properly by the Ember router.

Instead of these two properties, we can use the `currentRoute` property of Ember's router service to trigger changes when navigating between pages. A common `{{#each` trick is used to fully destroy/re-render components even if the ad network is unchanged.
2023-11-07 21:12:30 +00:00
David Taylor 86ef7da2eb DEV: Apply eslint --fix 2023-11-07 18:14:12 +00:00
Isaac Janzen fb73dda584
DEV: Remove 'htmlSafe' string prototype extensions (#140)
Context: https://deprecations.emberjs.com/v3.x/#toc_ember-string-prototype_extensions
2022-06-01 11:37:01 -05:00
Jarek Radosz 7e2a490b67
DEV: Fix imports (#132) 2022-03-06 19:52:19 +01:00
Jarek Radosz c788b7bf1f
DEV: Lose the es6 suffix (#131) 2022-03-05 17:23:41 +01:00