nodebb-plugin-ezoic-infinite 1.9.3 → 1.9.4
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/library.js +19 -17
- package/package.json +1 -1
- package/public/templates/admin/plugins/ezoic-infinite.tpl +11 -11
package/library.js
CHANGED
|
@@ -83,27 +83,29 @@ async function getSettings() {
|
|
|
83
83
|
if (_settingsInflight) return _settingsInflight;
|
|
84
84
|
const gen = _settingsGen;
|
|
85
85
|
_settingsInflight = (async () => {
|
|
86
|
+
let data = null;
|
|
86
87
|
try {
|
|
87
88
|
const s = await meta.settings.get(SETTINGS_KEY);
|
|
89
|
+
data = {
|
|
90
|
+
enableBetweenAds: parseBool(s.enableBetweenAds, true),
|
|
91
|
+
showFirstTopicAd: parseBool(s.showFirstTopicAd, false),
|
|
92
|
+
placeholderIds: (s.placeholderIds || '').trim(),
|
|
93
|
+
intervalPosts: Math.max(1, parseInt(s.intervalPosts, 10) || 6),
|
|
94
|
+
enableCategoryAds: parseBool(s.enableCategoryAds, false),
|
|
95
|
+
showFirstCategoryAd: parseBool(s.showFirstCategoryAd, false),
|
|
96
|
+
categoryPlaceholderIds: (s.categoryPlaceholderIds || '').trim(),
|
|
97
|
+
intervalCategories: Math.max(1, parseInt(s.intervalCategories, 10) || 4),
|
|
98
|
+
enableMessageAds: parseBool(s.enableMessageAds, false),
|
|
99
|
+
showFirstMessageAd: parseBool(s.showFirstMessageAd, false),
|
|
100
|
+
messagePlaceholderIds: (s.messagePlaceholderIds || '').trim(),
|
|
101
|
+
messageIntervalPosts: Math.max(1, parseInt(s.messageIntervalPosts, 10) || 3),
|
|
102
|
+
excludedGroups: normalizeExcludedGroups(s.excludedGroups),
|
|
103
|
+
};
|
|
88
104
|
if (_settingsGen === gen) {
|
|
89
105
|
_settingsCacheAt = Date.now();
|
|
90
|
-
_settingsCache =
|
|
91
|
-
enableBetweenAds: parseBool(s.enableBetweenAds, true),
|
|
92
|
-
showFirstTopicAd: parseBool(s.showFirstTopicAd, false),
|
|
93
|
-
placeholderIds: (s.placeholderIds || '').trim(),
|
|
94
|
-
intervalPosts: Math.max(1, parseInt(s.intervalPosts, 10) || 6),
|
|
95
|
-
enableCategoryAds: parseBool(s.enableCategoryAds, false),
|
|
96
|
-
showFirstCategoryAd: parseBool(s.showFirstCategoryAd, false),
|
|
97
|
-
categoryPlaceholderIds: (s.categoryPlaceholderIds || '').trim(),
|
|
98
|
-
intervalCategories: Math.max(1, parseInt(s.intervalCategories, 10) || 4),
|
|
99
|
-
enableMessageAds: parseBool(s.enableMessageAds, false),
|
|
100
|
-
showFirstMessageAd: parseBool(s.showFirstMessageAd, false),
|
|
101
|
-
messagePlaceholderIds: (s.messagePlaceholderIds || '').trim(),
|
|
102
|
-
messageIntervalPosts: Math.max(1, parseInt(s.messageIntervalPosts, 10) || 3),
|
|
103
|
-
excludedGroups: normalizeExcludedGroups(s.excludedGroups),
|
|
104
|
-
};
|
|
106
|
+
_settingsCache = data;
|
|
105
107
|
}
|
|
106
|
-
return _settingsCache;
|
|
108
|
+
return _settingsCache || data;
|
|
107
109
|
} finally {
|
|
108
110
|
if (_settingsGen === gen) _settingsInflight = null;
|
|
109
111
|
}
|
|
@@ -189,7 +191,7 @@ const EZOIC_SCRIPTS = [
|
|
|
189
191
|
'<script data-cfasync="false" src="https://cmp.gatekeeperconsent.com/min.js"></script>',
|
|
190
192
|
'<script data-cfasync="false" src="https://the.gatekeeperconsent.com/cmp.min.js"></script>',
|
|
191
193
|
'<script data-cfasync="false" src="//www.ezojs.com/ezoic/sa.min.js"></script>',
|
|
192
|
-
'<script src="//ezoicanalytics.com/analytics.js"></script>',
|
|
194
|
+
'<script async src="//ezoicanalytics.com/analytics.js"></script>',
|
|
193
195
|
].join('\n');
|
|
194
196
|
|
|
195
197
|
// ── Hooks ────────────────────────────────────────────────────────────────────
|
package/package.json
CHANGED
|
@@ -7,10 +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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
<div class="form-check mt-2">
|
|
11
|
+
<input class="form-check-input" type="checkbox" name="showFirstTopicAd" {showFirstTopicAd_checked} />
|
|
12
|
+
<label class="form-check-label">Afficher une pub après le 1er sujet</label>
|
|
13
|
+
</div>
|
|
14
14
|
</div>
|
|
15
15
|
|
|
16
16
|
<div class="mb-3">
|
|
@@ -52,13 +52,13 @@
|
|
|
52
52
|
<h4 class="mt-3">Pubs “message” entre les réponses</h4>
|
|
53
53
|
<p class="form-text">Insère un bloc qui ressemble à un post, toutes les N réponses (dans une page topic).</p>
|
|
54
54
|
|
|
55
|
-
<div class
|
|
56
|
-
<input class
|
|
57
|
-
<label class
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
55
|
+
<div class=”form-check mb-3”>
|
|
56
|
+
<input class=”form-check-input” type=”checkbox” id=”enableMessageAds” name=”enableMessageAds” {enableMessageAds_checked}>
|
|
57
|
+
<label class=”form-check-label” for=”enableMessageAds”>Activer les pubs “message”</label>
|
|
58
|
+
<div class=”form-check mt-2”>
|
|
59
|
+
<input class=”form-check-input” type=”checkbox” name=”showFirstMessageAd” {showFirstMessageAd_checked} />
|
|
60
|
+
<label class=”form-check-label”>Afficher une pub après le 1er message</label>
|
|
61
|
+
</div>
|
|
62
62
|
</div>
|
|
63
63
|
|
|
64
64
|
<div class="mb-3">
|