nodebb-plugin-katex2 1.0.3 → 1.0.5
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/plugin.json +1 -2
- package/static/js/render.js +8 -5
package/package.json
CHANGED
package/plugin.json
CHANGED
package/static/js/render.js
CHANGED
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
// const basePath = "/plugins/nodebb-plugin-katex/node_modules/katex/dist/";
|
|
121
121
|
// Находим правильный путь
|
|
122
122
|
// Путь к файлам через modules
|
|
123
|
-
const basePath = "/assets/plugins/nodebb-plugin-
|
|
123
|
+
const basePath = "/assets/plugins/nodebb-plugin-katex2/katex/";
|
|
124
124
|
|
|
125
125
|
// Параллельная загрузка всех файлов
|
|
126
126
|
await Promise.all([
|
|
@@ -223,6 +223,7 @@
|
|
|
223
223
|
* Рендеринг всех постов (async)
|
|
224
224
|
*/
|
|
225
225
|
async function renderAllPosts() {
|
|
226
|
+
console.log("[KaTeX] Try rendering");
|
|
226
227
|
// Проверяем наличие формул
|
|
227
228
|
if (!hasMathContent()) {
|
|
228
229
|
console.log("[KaTeX] No math content found, skipping");
|
|
@@ -262,7 +263,9 @@
|
|
|
262
263
|
*/
|
|
263
264
|
function init() {
|
|
264
265
|
// Первый рендеринг
|
|
265
|
-
|
|
266
|
+
setTimeout(function () {
|
|
267
|
+
renderAllPosts();
|
|
268
|
+
}, 500);
|
|
266
269
|
|
|
267
270
|
// События NodeBB для динамического контента
|
|
268
271
|
|
|
@@ -270,21 +273,21 @@
|
|
|
270
273
|
window.addEventListener("action:posts.loaded", function () {
|
|
271
274
|
setTimeout(function () {
|
|
272
275
|
renderAllPosts();
|
|
273
|
-
},
|
|
276
|
+
}, 500);
|
|
274
277
|
});
|
|
275
278
|
|
|
276
279
|
// Когда открывается тема
|
|
277
280
|
window.addEventListener("action:topic.loaded", function () {
|
|
278
281
|
setTimeout(function () {
|
|
279
282
|
renderAllPosts();
|
|
280
|
-
},
|
|
283
|
+
}, 500);
|
|
281
284
|
});
|
|
282
285
|
|
|
283
286
|
// Когда происходит навигация
|
|
284
287
|
window.addEventListener("action:ajaxify.end", function () {
|
|
285
288
|
setTimeout(function () {
|
|
286
289
|
renderAllPosts();
|
|
287
|
-
},
|
|
290
|
+
}, 800);
|
|
288
291
|
});
|
|
289
292
|
|
|
290
293
|
// Когда обновляется превью в редакторе
|