Update CodeFund Ads to use new CodeFund API (#1)

Update CodeFund plugin to work with CodeFund's new API
This commit is contained in:
Nathan Hopkins 2019-01-29 15:22:24 -07:00 committed by Neil Lalonde
parent 9172a8f405
commit de0a47c1a7
6 changed files with 26 additions and 12 deletions

View File

@ -17,7 +17,7 @@ function loadCodeFund() {
return _promise;
}
const url = "https://codefund.io/t/s/" + propertyId + "/details.json";
const url = "https://codefund.app/properties/" + propertyId + "/funder.json";
_promise = new Promise(function(resolve, reject) {
let xhr = new XMLHttpRequest();

View File

@ -1,8 +1,9 @@
<span class="codefund-wrapper codefund-post-bottom">
<a href="{{adDetails.link}}" class="codefund-text" target="_blank" rel="noopener">
<a href="{{adDetails.campaignUrl}}" class="codefund-text" target="_blank" rel="noopener">
{{#if siteSettings.codefund_display_advertiser_labels}}
<span class="codefund-label">{{siteSettings.codefund_advertiser_short_label}}</span>
{{/if}}
<strong>{{adDetails.headline}}</strong> {{adDetails.description}}
<strong>{{adDetails.headline}}</strong> {{adDetails.body}}
</a>
<img src="{{adDetails.impressionUrl}}" class="codefund-pixel">
</span>

View File

@ -1,11 +1,12 @@
<span class="codefund-wrapper codefund-topic-above-post-stream">
<a href="{{adDetails.link}}" class="codefund-text" target="_blank" rel="noopener">
<a href="{{adDetails.campaignUrl}}" class="codefund-text" target="_blank" rel="noopener">
{{#if siteSettings.codefund_display_advertiser_labels}}
<span class="codefund-label">{{siteSettings.codefund_advertiser_label}}</span>
{{/if}}
<strong>{{adDetails.headline}}</strong> {{adDetails.description}}
<strong>{{adDetails.headline}}</strong> {{adDetails.body}}
</a>
<a href={{adDetails.poweredByLink}} class="codefund-powered-by" target="_blank" rel="noopener">
<a href={{adDetails.codefundUrl}} class="codefund-powered-by" target="_blank" rel="noopener">
ads via codefund.io
</a>
<img src="{{adDetails.impressionUrl}}" class="codefund-pixel">
</span>

View File

@ -1,11 +1,12 @@
<span class="codefund-wrapper codefund-topic-above-suggested">
<a href="{{adDetails.link}}" class="codefund-text" target="_blank" rel="noopener">
<a href="{{adDetails.campaignUrl}}" class="codefund-text" target="_blank" rel="noopener">
{{#if siteSettings.codefund_display_advertiser_labels}}
<span class="codefund-label">{{siteSettings.codefund_advertiser_label}}</span>
{{/if}}
<strong>{{adDetails.headline}}</strong> {{adDetails.description}}
<strong>{{adDetails.headline}}</strong> {{adDetails.body}}
</a>
<a href={{adDetails.poweredByLink}} class="codefund-powered-by" target="_blank" rel="noopener">
<a href={{adDetails.codefundUrl}} class="codefund-powered-by" target="_blank" rel="noopener">
ads via codefund.io
</a>
<img src="{{adDetails.impressionUrl}}" class="codefund-pixel">
</span>

View File

@ -1,11 +1,12 @@
<span class="codefund-wrapper codefund-topic-list-top">
<a href="{{adDetails.link}}" class="codefund-text" target="_blank" rel="noopener">
<a href="{{adDetails.campaignUrl}}" class="codefund-text" target="_blank" rel="noopener">
{{#if siteSettings.codefund_display_advertiser_labels}}
<span class="codefund-label">{{siteSettings.codefund_advertiser_label}}</span>
{{/if}}
<strong>{{adDetails.headline}}</strong> {{adDetails.description}}
<strong>{{adDetails.headline}}</strong> {{adDetails.body}}
</a>
<a href={{adDetails.poweredByLink}} class="codefund-powered-by" target="_blank" rel="noopener">
<a href={{adDetails.codefundUrl}} class="codefund-powered-by" target="_blank" rel="noopener">
ads via codefund.io
</a>
<img src="{{adDetails.impressionUrl}}" class="codefund-pixel">
</span>

View File

@ -175,4 +175,14 @@ and (max-width : 775px) {
text-align: center;
}
.codefund-wrapper.codefund-topic-above-suggested {
clear: both;
}
.codefund-wrapper .codefund-pixel {
visibility: hidden;
height: 1px;
width: 1px;
}
CSS