nodebb-plugin-ezoic-infinite 0.4.2 → 0.4.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 CHANGED
@@ -60,7 +60,7 @@ plugin.addAdminNavigation = async (header) => {
60
60
  };
61
61
 
62
62
  plugin.init = async ({ router, middleware }) => {
63
- router.get('/admin/plugins/ezoic-infinite', middleware.admin.buildHeader, async (req, res) => {
63
+ async function render(req, res) {
64
64
  const settings = await getSettings();
65
65
  const allGroups = await getAllGroups();
66
66
 
@@ -71,7 +71,10 @@ plugin.init = async ({ router, middleware }) => {
71
71
  enableMessageAds_checked: settings.enableMessageAds ? 'checked' : '',
72
72
  allGroups,
73
73
  });
74
- });
74
+ }
75
+
76
+ router.get('/admin/plugins/ezoic-infinite', middleware.admin.buildHeader, render);
77
+ router.get('/api/admin/plugins/ezoic-infinite', render);
75
78
 
76
79
  router.get('/api/plugins/ezoic-infinite/config', middleware.buildHeader, async (req, res) => {
77
80
  const settings = await getSettings();
@@ -79,11 +82,9 @@ plugin.init = async ({ router, middleware }) => {
79
82
 
80
83
  res.json({
81
84
  excluded,
82
-
83
85
  enableBetweenAds: settings.enableBetweenAds,
84
86
  placeholderIds: settings.placeholderIds,
85
87
  intervalPosts: settings.intervalPosts,
86
-
87
88
  enableMessageAds: settings.enableMessageAds,
88
89
  messagePlaceholderIds: settings.messagePlaceholderIds,
89
90
  messageIntervalPosts: settings.messageIntervalPosts,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-ezoic-infinite",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
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/admin.js CHANGED
@@ -1,12 +1,7 @@
1
- /* globals app, ajaxify */
1
+ /* globals app */
2
2
  'use strict';
3
3
 
4
4
  (function () {
5
- function isOurPage(data) {
6
- const url = data?.url || ajaxify?.data?.url || window.location.pathname || '';
7
- return url.includes('admin/plugins/ezoic-infinite') || url.includes('/plugins/ezoic-infinite');
8
- }
9
-
10
5
  function init() {
11
6
  const $form = $('.ezoic-infinite-settings');
12
7
  if (!$form.length) return;
@@ -17,14 +12,12 @@
17
12
  $('#save').off('click.ezoicInfinite').on('click.ezoicInfinite', function (e) {
18
13
  e.preventDefault();
19
14
  Settings.save('ezoic-infinite', $form, function () {
20
- app.alertSuccess('Paramètres enregistrés');
15
+ app.alertSuccess('Enregistré');
21
16
  });
22
17
  });
23
18
  });
24
19
  }
25
20
 
26
21
  $(document).ready(init);
27
- $(window).on('action:ajaxify.end', function (ev, data) {
28
- if (isOurPage(data)) init();
29
- });
22
+ $(window).on('action:ajaxify.end', init);
30
23
  })();
package/README.md DELETED
@@ -1,21 +0,0 @@
1
- # nodebb-plugin-ezoic-infinite
2
-
3
- Plugin NodeBB 4.x pour intégrer Ezoic lors des chargements en infinite scroll.
4
-
5
- ## Fonctionnalités
6
- - Pubs **entre posts** : toutes les N réponses, avec pool d'IDs (fenêtre glissante)
7
- - Pubs **type message** entre les réponses : toutes les M réponses, avec pool d'IDs séparé (fenêtre glissante)
8
- - Exclusion par groupes (ACP)
9
-
10
- ## Installation (local)
11
- ```bash
12
- cd /path/to/nodebb/node_modules
13
- unzip nodebb-plugin-ezoic-infinite.zip -d nodebb-plugin-ezoic-infinite
14
- cd /path/to/nodebb
15
- npm i ./node_modules/nodebb-plugin-ezoic-infinite
16
- ./nodebb build
17
- ./nodebb restart
18
- ```
19
-
20
- ## Configuration
21
- ACP -> Plugins -> Ezoic Infinite Ads