This repository was archived by the owner on Jul 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +17
-5
lines changed
assets/javascripts/discourse/components Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -5,18 +5,23 @@ import AdComponent from "./ad-component";
55export default class CarbonadsAd extends AdComponent {
66 serve_id = null ;
77 placement = null ;
8+ format = null ;
89
910 init () {
1011 this .set (" serve_id" , this .siteSettings .carbonads_serve_id );
1112 this .set (" placement" , this .siteSettings .carbonads_placement );
13+ this .set (" format" , this .siteSettings .carbonads_format );
1214 super .init ();
1315 }
1416
15- @discourseComputed (" serve_id" , " placement" )
16- url (serveId , placement ) {
17- return htmlSafe (
18- ` //cdn.carbonads.com/carbon.js?serve=${ serveId} &placement=${ placement} `
19- );
17+ @discourseComputed (" serve_id" , " placement" , " format" )
18+ url (serveId , placement , format ) {
19+ let baseUrl = ` //cdn.carbonads.com/carbon.js?serve=${ serveId} &placement=${ placement} ` ;
20+ if (format) {
21+ baseUrl += ` &format=${ format} ` ;
22+ }
23+
24+ return htmlSafe (baseUrl);
2025 }
2126
2227 @discourseComputed
Original file line number Diff line number Diff line change 9797
9898 carbonads_serve_id : " Your Carbon Ads Serve ID"
9999 carbonads_placement : " Your Carbon Ads Placement"
100+ carbonads_format : " Your Carbon Ads Format"
100101 carbonads_through_trust_level : " Show your ads to users based on trust levels. Users with trust level higher than this value will not see ads."
101102 carbonads_exclude_groups : " Ads will not be shown to members of these groups"
102103 carbonads_topic_list_top_enabled : " Show an ad above the topic list"
Original file line number Diff line number Diff line change @@ -438,6 +438,12 @@ carbonads_plugin:
438438 carbonads_placement :
439439 client : true
440440 default : " "
441+ carbonads_format :
442+ client : true
443+ default : " responsive"
444+ choices :
445+ - responsive
446+ - cover
441447 carbonads_through_trust_level :
442448 client : true
443449 default : 2
You can’t perform that action at this time.
0 commit comments