nodebb-plugin-ezoic-infinite 1.0.16 → 1.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-ezoic-infinite",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
4
4
  "description": "Ezoic ads with infinite scroll using a pool of placeholder IDs",
5
5
  "main": "library.js",
6
6
  "license": "MIT",
package/public/client.js CHANGED
@@ -237,7 +237,8 @@
237
237
 
238
238
  items.forEach((li, idx) => {
239
239
  const pos = idx + 1;
240
- if (pos % interval !== 0) return;
240
+ const firstEnabled = normalizeBool(cfg.showFirstTopicAd);
241
+ if (!(firstEnabled && pos === 1) && (pos % interval !== 0)) return;
241
242
  if (idx === items.length - 1) return;
242
243
 
243
244
  const next = li.nextElementSibling;
@@ -268,7 +269,8 @@
268
269
 
269
270
  posts.forEach((post, idx) => {
270
271
  const no = idx + 1;
271
- if (no % interval !== 0) return;
272
+ const firstEnabled = normalizeBool(cfg.showFirstMessageAd);
273
+ if (!(firstEnabled && no === 1) && (no % interval !== 0)) return;
272
274
  if (idx === posts.length - 1) return;
273
275
 
274
276
  const next = post.nextElementSibling;
@@ -7,6 +7,10 @@
7
7
  <div class="form-check mb-3">
8
8
  <input class="form-check-input" type="checkbox" id="enableBetweenAds" name="enableBetweenAds" {enableBetweenAds_checked}>
9
9
  <label class="form-check-label" for="enableBetweenAds">Activer les pubs entre les posts</label>
10
+ <div class="form-check mt-2">
11
+ <input class="form-check-input" type="checkbox" name="showFirstTopicAd" />
12
+ <label class="form-check-label">Afficher une pub après le 1er sujet</label>
13
+ </div>
10
14
  </div>
11
15
 
12
16
  <div class="mb-3">
@@ -28,6 +32,10 @@
28
32
  <div class="form-check mb-3">
29
33
  <input class="form-check-input" type="checkbox" id="enableMessageAds" name="enableMessageAds" {enableMessageAds_checked}>
30
34
  <label class="form-check-label" for="enableMessageAds">Activer les pubs “message”</label>
35
+ <div class="form-check mt-2">
36
+ <input class="form-check-input" type="checkbox" name="showFirstMessageAd" />
37
+ <label class="form-check-label">Afficher une pub après le 1er message</label>
38
+ </div>
31
39
  </div>
32
40
 
33
41
  <div class="mb-3">