тест
Автопланер
Сообщений 1 страница 6 из 6
Поделиться22026-03-12 18:23:53
[html]<div id="forum-last-post-days-strict">до запроса</div>
<script>
(function () {
let container = null;
function escapeHtml(str) {
return String(str || '')
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"')
.replace(/'/g, ''');
}
function sendMessage(msg) {
console.log('[LPD post] send to parent', msg);
window.parent.postMessage(msg, '*');
}
function requestData() {
sendMessage({ type: 'getLPDTestData' });
}
function render(rows) {
if (!container) return;
if (!rows || !rows.length) {
container.textContent = 'Нет данных.';
return;
}
container.innerHTML = rows.map(function (row) {
return (
escapeHtml(row.userName) +
' — ' +
escapeHtml(row.lastPostText) +
' — ' +
escapeHtml(String(row.daysSince)) + ' дн.'
);
}).join('<br>');
}
function handleMessage(event) {
const msg = event.data;
console.log('[LPD post] got message', msg, event.origin);
if (!msg || msg.type !== 'LPDTestData') return;
render(msg.data || []);
}
function init() {
container = document.getElementById('forum-last-post-days-strict');
if (!container) return;
container.textContent = 'запрос отправлен';
requestData();
}
window.addEventListener('message', handleMessage);
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', init);
} else {
init();
}
})();
</script>[/html]
Поделиться32026-03-29 08:48:27
тест
Поделиться42026-03-29 08:51:09
СООБЩЕНИЕ ОТЛЭМ
тест
Поделиться52026-03-31 10:47:50
[html]<div id="forum-last-post-days-strict">Загрузка...</div>
<script>
(function () {
let container = null;
function escapeHtml(str) {
return String(str || '')
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"')
.replace(/'/g, ''');
}
function sendMessage(msg) {
window.parent.postMessage(msg, '*');
}
function requestData() {
sendMessage({
type: 'getLastPostDaysData'
});
}
function render(rows) {
if (!container) return;
if (!rows || !rows.length) {
container.textContent = 'Нет данных.';
return;
}
container.innerHTML = rows.map(function (row) {
return (
escapeHtml(row.userName) +
' — ' +
escapeHtml(row.lastPostText) +
' — ' +
escapeHtml(String(row.daysSince)) + ' дн.'
);
}).join('<br>');
}
function handleMessage(event) {
const msg = event.data;
if (!msg || msg.type !== 'lastPostDaysData') return;
if (msg.data && msg.data.error) {
container.textContent = 'Ошибка: ' + msg.data.error;
return;
}
render(msg.data || []);
}
function init() {
container = document.getElementById('forum-last-post-days-strict');
if (!container) return;
requestData();
}
window.addEventListener('message', handleMessage);
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', init);
} else {
init();
}
})();
</script>[/html]
Поделиться62026-03-31 10:48:21
[html]
<div id="forum-last-post-days-strict">Загрузка...</div>
<script>
window.LastPostDaysTableConfig = {
containerId: "forum-last-post-days-strict",
requestType: "getLastPostDaysData",
responseType: "lastPostDaysData",
maxTries: 120,
retryMs: 2000,
initialHideStarUsers: false
};
</script>
<script src="https://forumstatic.ru/files/0014/98/d3/25049.js"></script>
[/html]


























