Skip to content
View in the app

A better way to browse. Learn more.

IPBMafia.ru - поддержка Invision Community, релизы, темы, плагины и приложения

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Кнопка "Разъединить" при написании скрипта через источник

Featured Replies

Доброго времени суток, господа.

Пытаюсь создать скрипт на своем форуме, который будет автоматически перенаправлять пользователя в новую вкладку и создавать ему там страницу с автозаполнением. Видел такое на просторах интернета, решил реализовать у себя.

Однако, при выполнении скрипта возникает уведомление об объединении постов. То есть, заведомо скрипт может и работает, но почему-то инициирует уведомление о соединении/разъединении темы и дальше не выполняется никаким образом.

Сам код:

<script>
const forumCreateURL = "ссылка на создание темы, где будет создаваться результат формы";

function createBiographyTopic() {
const fullName = document.getElementById('fullName').value.trim() || 'Имя Фамилия';

let bioText = `<p style="text-align: center;"><span style="font-size:36px;"><span class="h1">Биография ${fullName}</span></span></p>\n<hr>\n\n<div class="main-text">\n`;

bioText += `<p><strong><span style="color:#d9c29e;">Имя и фамилия:</span></strong> ${fullName}<br>`;
bioText += `<strong><span style="color:#d9c29e;">Пол:</span></strong> ${document.getElementById('gender').value.trim() || '—'}<br>`;
bioText += `<strong><span style="color:#d9c29e;">Возраст:</span></strong> ${document.getElementById('age').value.trim() || '—'}<br>`;
bioText += `<strong><span style="color:#d9c29e;">Дата рождения:</span></strong> ${document.getElementById('birthDate').value.trim() || '—'}<br>`;
bioText += `<strong><span style="color:#d9c29e;">Место рождения:</span></strong> ${document.getElementById('birthPlace').value.trim() || '—'}<br>`;
bioText += `<strong><span style="color:#d9c29e;">Место проживания:</span></strong> ${document.getElementById('residence').value.trim() || '—'}</p>\n\n`;

const appearance = document.getElementById('appearance').value.trim();
if (appearance) bioText += `<p><strong><span style="color:#d9c29e;">Внешность:</span></strong> ${appearance}</p>\n\n`;

const hobbies = document.getElementById('hobbies').value.trim();
if (hobbies) bioText += `<p><strong><span style="color:#d9c29e;">Хобби:</span></strong> ${hobbies}</p>\n\n`;

bioText += `<p><strong><span style="color:#d9c29e;">Детство</span></strong><br>${document.getElementById('childhood').value.trim() || '...'}</p>\n\n`;
bioText += `<p><strong><span style="color:#d9c29e;">Юность</span></strong><br>${document.getElementById('youth').value.trim() || '...'}</p>\n\n`;
bioText += `<p><strong><span style="color:#d9c29e;">Взрослая жизнь</span></strong><br>${document.getElementById('adulthood').value.trim() || '...'}</p>\n\n`;
bioText += `<p><strong><span style="color:#d9c29e;">Настоящее время</span></strong><br>${document.getElementById('present').value.trim() || '...'}</p>\n</div>`;

const title = `Биография ${fullName}`;

let newWin = window.open(forumCreateURL, '_blank', 'width=1300,height=900');
if (!newWin) {
alert(' Разрешите всплывающие окна!');
return;
}

newWin.onload = function() {
setTimeout(() => {
try {
let titleInput = newWin.document.getElementById("elInput_topic_title");
if (titleInput) titleInput.value = title;

if (newWin.CKEDITOR && newWin.CKEDITOR.instances && newWin.CKEDITOR.instances.topic_content) {
newWin.CKEDITOR.instances.topic_content.setData(bioText);
} else {
let contentArea = newWin.document.querySelector('textarea[name="topic_content"]');
if (contentArea) contentArea.value = bioText;
}

alert(' Тема открыта и заполнена!\nПроверь данные и опубликуй.');
} catch(e) {
alert(' Тема открыта, но заполнить автоматически не удалось.\nВставь текст вручную.');
}
}, 1200);
};
}
</script>

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Ответить в этой теме...

Последние посетители 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.