nodebb-plugin-ezoic-infinite 1.0.11 → 1.0.13
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 +1 -1
- package/public/client.js +13 -4
package/package.json
CHANGED
package/public/client.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
/* globals ajaxify */
|
|
4
4
|
(function () {
|
|
5
|
+
try {
|
|
5
6
|
if (window.ezoicInfiniteLoaded) return;
|
|
6
7
|
window.ezoicInfiniteLoaded = true;
|
|
7
8
|
|
|
@@ -23,16 +24,20 @@
|
|
|
23
24
|
|
|
24
25
|
function getPageKey() {
|
|
25
26
|
try {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (
|
|
27
|
+
const ax = window.ajaxify;
|
|
28
|
+
if (ax && ax.data) {
|
|
29
|
+
if (ax.data.tid) return 'topic:' + ax.data.tid;
|
|
30
|
+
if (ax.data.cid) return 'cid:' + ax.data.cid + ':' + window.location.pathname;
|
|
29
31
|
}
|
|
30
32
|
} catch (e) {}
|
|
31
33
|
return window.location.pathname;
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
function isTopicPage() {
|
|
35
|
-
try {
|
|
37
|
+
try {
|
|
38
|
+
const ax = window.ajaxify;
|
|
39
|
+
return !!(ax && ax.data && ax.data.tid);
|
|
40
|
+
} catch (e) {}
|
|
36
41
|
return /^\/topic\//.test(window.location.pathname);
|
|
37
42
|
}
|
|
38
43
|
|
|
@@ -348,4 +353,8 @@ function bindNodeBBEvents() {
|
|
|
348
353
|
setTimeout(run, 1200);
|
|
349
354
|
});
|
|
350
355
|
}
|
|
356
|
+
;
|
|
357
|
+
} catch (e) {
|
|
358
|
+
// fail silently to avoid breaking NodeBB
|
|
359
|
+
}
|
|
351
360
|
})();
|