Commit Graph

94 Commits

Author SHA1 Message Date
Martin Brennan 55045bba3c
DEV: Update code for eslint object-shorthand-rule. See 4f7aba06c0 (#119) 2021-11-10 11:58:31 +11:00
Joffrey JAFFEUX 6438000ed4
DEV: prettier 2.2.1 (#101) 2021-01-27 10:36:36 +01:00
jjaffeux 9adaef17cc Revert "DEV: enforces no-var (#94)"
This reverts commit 9ad0133624.
2020-10-13 15:42:21 +02:00
Joffrey JAFFEUX 9ad0133624
DEV: enforces no-var (#94) 2020-10-13 11:40:33 +02:00
Joffrey JAFFEUX 15b2c1a05e
REFACTOR: loadGoogle doesn't take any argument (#92) 2020-09-23 15:05:23 +02:00
Joffrey JAFFEUX 30dad0281d
DEV: apply coding standards (#91) 2020-09-04 13:24:14 +02:00
Joffrey JAFFEUX 270799166b
REFACTOR: applies discourse core coding practices (#82) 2020-03-23 09:40:29 +01:00
Neil Lalonde cd82a905ae
Load Google Ad Manager code from doubleclick.net
https://support.google.com/admanager/answer/1638622?hl=en
2020-03-13 14:24:54 -04:00
Gerhard Schlager 275921ac70
Make prettier happy 2020-01-16 00:12:27 +01:00
Neil Lalonde 116f9dd238 FEATURE: add support for fluid ad size in Google Ad Manager
No width or height will be set on containers when ad size is fluid.
2020-01-15 16:52:02 -05:00
David Taylor cf27a7be64 DEV: Stop loading external scripts while running tests (#81)
* DEV: Stop loading external scripts while running tests

* Revert "Turn of CSP for tests"

This reverts commit db1bf99277. It had no effect, since CSP is set by the server, and this was only affecting the client
2020-01-06 10:01:40 -07:00
Penar Musaraj b59f841944 DEV: Respect radix rule in eslint-config-discourse 1.0.6 2019-11-18 10:07:55 -05:00
Neil Lalonde 62888e734f FIX: handle no ad size given for AdSense and DFP ad units
For AdSense, assume responsive size.
For DFP, don't attempt to render the ad unit.
2019-09-10 17:07:47 -04:00
Neil Lalonde 3aa9cb8a0c FIX: wrong size DFP ads when using multiple sizes
getWidthAndHeight was being called twice for each ad placement:
once when setting the size of the div, and once when calling the 
defineSlot API. getWidthAndHeight always advances to the next size
in the list, so the wrong size ad would be inserted into the div.
2019-07-15 15:34:46 -04:00
Neil Lalonde 1929ac405c lint errors 2019-07-08 15:18:34 -04:00
Neil Lalonde 333f6cef81 FEATURE: support multiple ad sizes in AdSense and Ad Manager
Each ad placement in the AdSense and Ad Manager settings takes a list
of ad sizes instead of only one size. If given multiple sizes, the sizes
will alternate in order for each ad that's rendered.
2019-07-08 15:10:25 -04:00
Neil Lalonde 2ba276b0fb FIX: DFP ad units being refreshed multiple times on the same render
Ember is firing events multiple times when the ad component is shown.

Only solution I can find is to add a delay between calls to refresh
the ad unit. I chose 3 seconds.
2019-06-26 11:15:04 -04:00
Neil Lalonde 3054f2539a FEATURE: use a different Ad Manager publisher ID for mobile
If you want to use one Ad Manager publisher on desktop and a different
one on mobile, use the new dfp_publisher_id_mobile setting.
By default, dfp_publisher_id will be used for both desktop and mobile.
2019-06-19 11:52:23 -04:00
Penar Musaraj 574500ba08 Run Prettier 2019-06-14 13:24:55 -04:00
Penar Musaraj 203e14b639 Fix eslint warnings 2019-06-14 12:10:11 -04:00
Neil Lalonde 3a04f95916 REFACTOR: some changes to be closer to example implementation
https://support.google.com/admanager/answer/4578089?hl=en

* unique div ID for every ad slot
* setTargeting before calling addService
* don't destroySlots async (no examples of correct way to use this...)
2019-06-10 15:43:48 -04:00
Neil Lalonde 04525d0cf1 FIX: dfp category targeting params
DFP category targeting param wasn't always being updated on topic
list pages.

Also remove dependency on a category param being passed in to the
component from a template so that we can now place dfp ads
in places that don't have access to the current category and
targeting will still work.
2019-06-05 17:00:47 -04:00
Neil Lalonde 7af8f1d46b FEATURE: new setting to disable ads based on category of current page
Use the "no ads for categories" setting to define which category pages
(topic list and topics) should not render any ads.
2019-06-05 16:00:24 -04:00
Neil Lalonde 1bd80e1afe FEATURE: House Ads
Allows creating ads within Discourse admin at Plugins > House Ads.
Write the ads in html and style them with CSS in themes.
2019-05-03 11:39:34 -04:00
Neil Lalonde 5272995e74 FEATURE: use groups to control who sees ads 2019-05-03 11:39:34 -04:00
Neil Lalonde 369d5dfc9e oops revert again "FEATURE: use groups to control who sees ads" and all later" 2019-04-17 16:02:19 -04:00
Neil Lalonde e6bcd96d8e FEATURE: use groups to control who sees ads" and all later 2019-04-17 15:40:50 -04:00
Neil Lalonde 50d258dc37 Revert "FEATURE: use groups to control who sees ads" and all later
Revert "Updates to codefund-ad"
Revert "Updates to carbonads-ad"
Revert "Updates to amazon-product-links"
2019-04-17 15:37:09 -04:00
Neil Lalonde 4fd7caffd6 FEATURE: use groups to control who sees ads
A new setting has been added in Admin > Settings > Ad Plugin called
"no ads for groups". Add group names to this list. If a user belongs
to any of the groups, they will not see any ads. This is an alternative
to using trust level settings like "adsense through trust level".
2019-04-17 11:36:50 -04:00
Neil Lalonde ec10ef4483 FIX: wrong size setting being used for post-bottom desktop 2019-03-20 11:22:47 -04:00
Neil Lalonde 9b7a8830b8 FIX: resizing of ad units when they're rendered 2019-02-25 09:53:28 -05:00
Neil Lalonde 9a695cc67d refactor google-dfp-ad component to reduce repetition 2019-02-22 11:15:40 -05:00
Joffrey JAFFEUX 00789666d7 Reverts Ember.String.prototype.w monkey patching causing exception
The git blame of the commit is unclear on the reasons leading to this, and how to reproduce a failure.
2019-01-09 20:58:14 +01:00
David Taylor 2e36e2c656 DEV: Apply prettier 2018-10-22 19:49:32 +01:00
Jeff Wong 136cceb1e3 FIX: resolve collision on ember's builtin w string function 2018-05-16 13:37:50 -07:00
Neil Lalonde da1d4e0063 FIX: when dfp/adsense publisher id is missing, don't render blank ad units 2016-11-21 15:55:03 -05:00
Neil Lalonde 8ce3acfb3b add ad sizes settings for mobile DFP 2016-06-21 13:13:37 -04:00
Neil Lalonde f930aa14ec FIX: too much memory used by long topics 2016-05-16 14:26:14 -04:00
Neil Lalonde e4405dd486 Add support for showing ad after every nth post, not only after the nth post 2016-04-21 18:53:39 -04:00
Neil Lalonde cee3f66009 Render nth post dfp ads in position where post would be 2016-04-21 18:53:39 -04:00
Neil Lalonde 13b5d21565 Fix dfp ad dimensioned undefined. Refactor dfp ad component to remove unnecessary variables and rewrite copy-pasted code. 2016-04-21 18:53:39 -04:00
Robin Ward 4ab0f0fab8 Upgrade to new Plugin API 2016-02-22 12:16:09 -05:00
Ken Cooper ffbd69688e Fixed: mobile viewport was too large when presenting ads, making for a sloppy mobile experience. Restricted length of "Advertisement" label to fix it. 2015-10-28 16:51:53 -07:00
Neil Lalonde 85d357b007 DFP: send a 0 value for discourse-category targeting on /latest, /categories, etc so that ads can show there while targeting categories 2015-10-28 12:20:16 -04:00
Neil Lalonde c5b9392ae5 FIX: ads not refreshing when going from one topic list to another 2015-10-27 17:44:03 -04:00
Neil Lalonde e13a6ecdce DFP: send key discourse-category and value as category slug when loading ads 2015-10-27 16:42:36 -04:00
Neil Lalonde cf850b273d FIX: refresh DFP ads after navigating between topics and lists 2015-10-15 13:58:49 -04:00
Sarah Ni fe9c53ce58 removed all disable boxes and changed trust levels for amazon 2015-09-21 10:44:37 +10:00
Sarah Ni 647eecd95b master - more consistent naming for dfp settings and removed test folder 2015-09-10 12:07:36 +10:00
Sarah Ni fa3d25e4fd Working mobile ads that follow desktop custom targeting 2015-09-03 21:08:21 +10:00