[hideprofile]
Код:
<!--HTML-->
<div class="horseshoe-bay-town-record-post" lang="ru">
<!-- Загрузите PNG-шапку на форум и вставьте её прямую ссылку в src. -->
<img class="horseshoe-bay-town-record-post-header" src="https://upforme.ru/uploads/001c/c1/8b/13/477727.png" alt="City of Horseshoe Bay, North Carolina. Community Forum">
<div class="horseshoe-bay-town-record-post-domain">
<strong>horseshoebay.nc.gov/forum</strong>
<span>Official city domain</span>
</div>
<div class="horseshoe-bay-town-record-post-intro">
<span class="horseshoe-bay-town-record-post-pinned">Закреплённая тема</span>
<div class="horseshoe-bay-town-record-post-title">Добро пожаловать на форум Хорсшу-Бэй</div>
<div class="horseshoe-bay-town-record-post-lead" style="text-align:justify!important;text-align-last:left;-webkit-hyphens:none!important;hyphens:none!important;word-break:normal!important;overflow-wrap:normal!important;">Добро пожаловать на форум, посвящённый жизни Хорсшу-Бэй! Здесь вы можете прочитать последние новости от мэра Брауна, получить консультацию сотрудников архива касательно местной истории, поделиться списком любимых кофеен и просто обсудить все события, связанные с нашим любимым городом.</div>
<div class="horseshoe-bay-town-record-post-note">
<div class="horseshoe-bay-town-record-post-note-copy" style="text-align:justify!important;text-align-last:left;-webkit-hyphens:none!important;hyphens:none!important;word-break:normal!important;overflow-wrap:normal!important;">Тема создана непосредственно для игроков, желающих поделиться своими хэдканонами. Здесь вы можете опубликовать сплетню о вчерашней драке в баре, пожаловаться на нерадивых соседей, показать фотографию вашего дома, составить официальную жалобу в мэрию, посоветоваться с форумчанами, куда сходить и как провести в городе время, выкладывать апдейты по составлению родословной или же публиковать скриншоты старых газетных вырезок. Не забудьте проставлять в названии сообщения хэштег рубрики.</div>
</div>
<div class="horseshoe-bay-town-record-post-rubrics">
<div class="horseshoe-bay-town-record-post-rubric">
<span class="horseshoe-bay-town-record-post-flair horseshoe-bay-town-record-post-news">#hb_news</span>
<span>новости из мэрии, объявления о фестивалях, событиях, концертах, ремонтных работах, объявления о пропажах</span>
</div>
<div class="horseshoe-bay-town-record-post-rubric">
<span class="horseshoe-bay-town-record-post-flair horseshoe-bay-town-record-post-tea">#hb_tea</span>
<span>сплетни</span>
</div>
<div class="horseshoe-bay-town-record-post-rubric">
<span class="horseshoe-bay-town-record-post-flair horseshoe-bay-town-record-post-history">#hb_history</span>
<span>всё, что касается истории и прошлого Хорсшу-Бэй</span>
</div>
<div class="horseshoe-bay-town-record-post-rubric">
<span class="horseshoe-bay-town-record-post-flair horseshoe-bay-town-record-post-spntrl">#hb_spntrl</span>
<span>обсуждения городских легенд и местного фольклора</span>
</div>
</div>
</div>
<div class="horseshoe-bay-town-record-post-feed">
<div class="horseshoe-bay-town-record-post-feed-title">
<span class="horseshoe-bay-town-record-post-feed-heading">Городская лента</span>
</div>
<div class="horseshoe-bay-town-record-post-feed-scroll" role="region" aria-label="Последние обсуждения Хорсшу-Бэй" tabindex="0" style="box-sizing:border-box;max-height:380px;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-gutter:stable;-webkit-overflow-scrolling:touch;">
<!-- НОВАЯ ЗАПИСЬ: скопируйте целиком один блок horseshoe-bay-town-record-post-row. -->
<div class="horseshoe-bay-town-record-post-row">
<div class="horseshoe-bay-town-record-post-date"><strong>06</strong><span>июн</span></div>
<div class="horseshoe-bay-town-record-post-entry">
<span class="horseshoe-bay-town-record-post-flair horseshoe-bay-town-record-post-tea">#hb_tea</span>
<div class="horseshoe-bay-town-record-post-entry-title"><a class="horseshoe-bay-town-record-post-link" href="https://daymare.rusff.me/viewtopic.php?id=671#p70168">конец света близок</a></div>
<div class="horseshoe-bay-town-record-post-entry-meta" style="display:flex!important;flex-wrap:wrap!important;align-items:baseline!important;justify-content:flex-start!important;gap:3px 10px!important;"><span class="horseshoe-bay-town-record-post-entry-author">taburetka_v_cosmose</span><span>в интернетах пишут, что в хорсшу-бэй приедет канье уэст выступать. это правда???</span><span class="horseshoe-bay-town-record-post-comments" style="display:inline-block!important;width:auto!important;margin:0!important;padding:0!important;border:0!important;float:none!important;text-align:left!important;white-space:nowrap!important;">367 комментариев</span></div>
</div>
</div>
<div class="horseshoe-bay-town-record-post-row">
<div class="horseshoe-bay-town-record-post-date"><strong>06</strong><span>июн</span></div>
<div class="horseshoe-bay-town-record-post-entry">
<span class="horseshoe-bay-town-record-post-flair horseshoe-bay-town-record-post-history">#hb_history</span>
<div class="horseshoe-bay-town-record-post-entry-title"><a class="horseshoe-bay-town-record-post-link" href="https://daymare.rusff.me/viewtopic.php?id=671#p69324">Дизайнеры North Shore Fish Co. застряли в 50х</a></div>
<div class="horseshoe-bay-town-record-post-entry-meta" style="display:flex!important;flex-wrap:wrap!important;align-items:baseline!important;justify-content:flex-start!important;gap:3px 10px!important;"><span class="horseshoe-bay-town-record-post-entry-author">solarjake8</span><span>Вот их реклама 1949 года:</span><span class="horseshoe-bay-town-record-post-comments" style="display:inline-block!important;width:auto!important;margin:0!important;padding:0!important;border:0!important;float:none!important;text-align:left!important;white-space:nowrap!important;">68 комментариев</span></div>
</div>
</div>
<div class="horseshoe-bay-town-record-post-row">
<div class="horseshoe-bay-town-record-post-date"><strong>06</strong><span>июн</span></div>
<div class="horseshoe-bay-town-record-post-entry">
<span class="horseshoe-bay-town-record-post-flair horseshoe-bay-town-record-post-tea">#hb_tea</span>
<div class="horseshoe-bay-town-record-post-entry-title"><a class="horseshoe-bay-town-record-post-link" href="#replace-with-henderson-post-link">Кто-нибудь знает, почему полиция уже час стоит у Хендерсонов?</a></div>
<div class="horseshoe-bay-town-record-post-entry-meta" style="display:flex!important;flex-wrap:wrap!important;align-items:baseline!important;justify-content:flex-start!important;gap:3px 10px!important;"><span class="horseshoe-bay-town-record-post-entry-author">carolyn54</span><span>не моё дело конечно просто интересно</span><span class="horseshoe-bay-town-record-post-comments" style="display:inline-block!important;width:auto!important;margin:0!important;padding:0!important;border:0!important;float:none!important;text-align:left!important;white-space:nowrap!important;">83 комментария</span></div>
</div>
</div>
<div class="horseshoe-bay-town-record-post-row">
<div class="horseshoe-bay-town-record-post-date"><strong>05</strong><span>июн</span></div>
<div class="horseshoe-bay-town-record-post-entry">
<span class="horseshoe-bay-town-record-post-flair horseshoe-bay-town-record-post-news">#hb_news</span>
<div class="horseshoe-bay-town-record-post-entry-title"><a class="horseshoe-bay-town-record-post-link" href="#replace-with-terry-post-link">КТО ПОЛОЖИЛ ПАКЕТ С СОБАЧЬИМ ГОВНОМ В МОЙ МУСОРНЫЙ БАК</a></div>
<div class="horseshoe-bay-town-record-post-entry-meta" style="display:flex!important;flex-wrap:wrap!important;align-items:baseline!important;justify-content:flex-start!important;gap:3px 10px!important;"><span class="horseshoe-bay-town-record-post-entry-author">Terry_B</span><span>камера у меня есть. АЛЛО!!!</span><span class="horseshoe-bay-town-record-post-comments" style="display:inline-block!important;width:auto!important;margin:0!important;padding:0!important;border:0!important;float:none!important;text-align:left!important;white-space:nowrap!important;">126 комментариев</span></div>
</div>
</div>
<div class="horseshoe-bay-town-record-post-row">
<div class="horseshoe-bay-town-record-post-date"><strong>04</strong><span>июн</span></div>
<div class="horseshoe-bay-town-record-post-entry">
<span class="horseshoe-bay-town-record-post-flair horseshoe-bay-town-record-post-news">#hb_news</span>
<div class="horseshoe-bay-town-record-post-entry-title"><a class="horseshoe-bay-town-record-post-link" href="#replace-with-amazon-post-link">Кому привезли мою посылку Amazon?</a></div>
<div class="horseshoe-bay-town-record-post-entry-meta" style="display:flex!important;flex-wrap:wrap!important;align-items:baseline!important;justify-content:flex-start!important;gap:3px 10px!important;"><span class="horseshoe-bay-town-record-post-entry-author">denise84</span><span>там корм для кошки и крем для ног пожалуйста верните</span></div>
</div>
</div>
<div class="horseshoe-bay-town-record-post-row">
<div class="horseshoe-bay-town-record-post-date"><strong>03</strong><span>июн</span></div>
<div class="horseshoe-bay-town-record-post-entry">
<span class="horseshoe-bay-town-record-post-flair horseshoe-bay-town-record-post-tea">#hb_tea</span>
<div class="horseshoe-bay-town-record-post-entry-title"><a class="horseshoe-bay-town-record-post-link" href="#replace-with-lemon-pie-post-link">Кто знает женщину которая делает лимонные пироги</a></div>
<div class="horseshoe-bay-town-record-post-entry-meta" style="display:flex!important;flex-wrap:wrap!important;align-items:baseline!important;justify-content:flex-start!important;gap:3px 10px!important;"><span class="horseshoe-bay-town-record-post-entry-author">Debbie</span><span>НЕ ту что на ярмарке. другая. у неё ещё сын стоматолог</span></div>
</div>
</div>
<div class="horseshoe-bay-town-record-post-row">
<div class="horseshoe-bay-town-record-post-date"><strong>02</strong><span>июн</span></div>
<div class="horseshoe-bay-town-record-post-entry">
<span class="horseshoe-bay-town-record-post-flair horseshoe-bay-town-record-post-spntrl">#hb_spntrl</span>
<div class="horseshoe-bay-town-record-post-entry-title"><a class="horseshoe-bay-town-record-post-link" href="#replace-with-power-post-link">У кого сейчас моргнул свет</a></div>
<div class="horseshoe-bay-town-record-post-entry-meta" style="display:flex!important;flex-wrap:wrap!important;align-items:baseline!important;justify-content:flex-start!important;gap:3px 10px!important;"><span class="horseshoe-bay-town-record-post-entry-author">susan</span><span>21:43</span><span class="horseshoe-bay-town-record-post-comments" style="display:inline-block!important;width:auto!important;margin:0!important;padding:0!important;border:0!important;float:none!important;text-align:left!important;white-space:nowrap!important;">57 комментариев</span></div>
</div>
</div>
</div>
</div>
<div class="horseshoe-bay-town-record-post-composer" id="horseshoeBayTownRecordComposer">
<div class="horseshoe-bay-town-record-post-composer-heading">
<div class="horseshoe-bay-town-record-post-composer-heading-copy">
<div class="horseshoe-bay-town-record-post-composer-title">Начать новое обсуждение</div>
<div class="horseshoe-bay-town-record-post-composer-subtitle">horseshoebay.nc.gov/forum/new</div>
</div>
</div>
<div class="horseshoe-bay-town-record-post-composer-layout">
<div class="horseshoe-bay-town-record-post-composer-profile">
<div class="horseshoe-bay-town-record-post-composer-profile-title">Автор публикации</div>
<div class="horseshoe-bay-town-record-post-composer-avatar-frame">
<span>аватар</span>
<img class="horseshoe-bay-town-record-post-composer-avatar-preview" id="horseshoeBayTownRecordAvatarPreview" src="" alt="">
</div>
<button class="horseshoe-bay-town-record-post-composer-upload-button" id="horseshoeBayTownRecordOpenAvatarUploader" type="button">Загрузить</button>
<div class="horseshoe-bay-town-record-post-composer-uploader-mount horseshoe-bay-town-record-post-composer-avatar-uploader-mount" id="horseshoeBayTownRecordAvatarUploaderMount"></div>
<label class="horseshoe-bay-town-record-post-composer-field">
<span class="horseshoe-bay-town-record-post-composer-label">Ник на сайте</span>
<input class="horseshoe-bay-town-record-post-composer-input" id="horseshoeBayTownRecordNickname" type="text" maxlength="40" placeholder="например, carolyn54">
</label>
<input id="horseshoeBayTownRecordAvatarUrl" type="hidden" value="">
</div>
<div class="horseshoe-bay-town-record-post-composer-main">
<label class="horseshoe-bay-town-record-post-composer-field">
<span class="horseshoe-bay-town-record-post-composer-label">Заголовок обсуждения</span>
<input class="horseshoe-bay-town-record-post-composer-input horseshoe-bay-town-record-post-composer-input-title" id="horseshoeBayTownRecordPostTitle" type="text" maxlength="120">
</label>
<div class="horseshoe-bay-town-record-post-composer-field">
<span class="horseshoe-bay-town-record-post-composer-label">Рубрика</span>
<div class="horseshoe-bay-town-record-post-composer-tags" role="radiogroup" aria-label="Рубрика публикации">
<label class="horseshoe-bay-town-record-post-composer-tag">
<input class="horseshoe-bay-town-record-post-composer-tag-input" type="radio" name="horseshoe-bay-town-record-post-composer-tag" value="news" checked>
<span class="horseshoe-bay-town-record-post-composer-tag-label horseshoe-bay-town-record-post-news">#hb_news</span>
</label>
<label class="horseshoe-bay-town-record-post-composer-tag">
<input class="horseshoe-bay-town-record-post-composer-tag-input" type="radio" name="horseshoe-bay-town-record-post-composer-tag" value="tea">
<span class="horseshoe-bay-town-record-post-composer-tag-label horseshoe-bay-town-record-post-tea">#hb_tea</span>
</label>
<label class="horseshoe-bay-town-record-post-composer-tag">
<input class="horseshoe-bay-town-record-post-composer-tag-input" type="radio" name="horseshoe-bay-town-record-post-composer-tag" value="history">
<span class="horseshoe-bay-town-record-post-composer-tag-label horseshoe-bay-town-record-post-history">#hb_history</span>
</label>
<label class="horseshoe-bay-town-record-post-composer-tag">
<input class="horseshoe-bay-town-record-post-composer-tag-input" type="radio" name="horseshoe-bay-town-record-post-composer-tag" value="spntrl">
<span class="horseshoe-bay-town-record-post-composer-tag-label horseshoe-bay-town-record-post-spntrl">#hb_spntrl</span>
</label>
</div>
</div>
<div class="horseshoe-bay-town-record-post-composer-field">
<span class="horseshoe-bay-town-record-post-composer-label">Сообщение</span>
<div class="horseshoe-bay-town-record-post-composer-toolbar" id="horseshoeBayTownRecordToolbar" role="toolbar" aria-label="Форматирование текста">
<button class="horseshoe-bay-town-record-post-composer-tool" type="button" data-command="bold" title="Жирный"><strong>B</strong></button>
<button class="horseshoe-bay-town-record-post-composer-tool" type="button" data-command="italic" title="Курсив"><em>I</em></button>
<button class="horseshoe-bay-town-record-post-composer-tool" type="button" data-command="underline" title="Подчёркивание"><u>U</u></button>
<button class="horseshoe-bay-town-record-post-composer-tool" type="button" data-command="formatBlock" data-value="blockquote" title="Цитата">цитата</button>
<button class="horseshoe-bay-town-record-post-composer-tool" type="button" data-command="insertUnorderedList" title="Список">список</button>
<button class="horseshoe-bay-town-record-post-composer-tool" type="button" data-command="createLink" title="Ссылка">ссылка</button>
<button class="horseshoe-bay-town-record-post-composer-tool" type="button" data-action="insert-image-url" title="Картинка по ссылке">картинка</button>
<button class="horseshoe-bay-town-record-post-composer-tool" type="button" data-command="removeFormat" title="Очистить форматирование">очистить</button>
</div>
<div class="horseshoe-bay-town-record-post-composer-editor" id="horseshoeBayTownRecordEditor" contenteditable="true" role="textbox" aria-multiline="true" data-placeholder="Напишите сплетню, объявление, жалобу или городскую легенду..."></div>
</div>
<div class="horseshoe-bay-town-record-post-composer-attachments">
<div class="horseshoe-bay-town-record-post-composer-attachments-heading">
<span>Добавить изображение в текст</span>
<span>в позицию курсора</span>
</div>
<div class="horseshoe-bay-town-record-post-composer-upload-row">
<button class="horseshoe-bay-town-record-post-composer-upload-button" id="horseshoeBayTownRecordOpenImageUploader" type="button">Загрузить</button>
<span>Картинка появится прямо в сообщении. Можно добавить несколько и разделить их текстом.</span>
</div>
<div class="horseshoe-bay-town-record-post-composer-uploader-mount" id="horseshoeBayTownRecordUploaderMount"></div>
</div>
</div>
</div>
<div class="horseshoe-bay-town-record-post-composer-actions">
<span class="horseshoe-bay-town-record-post-composer-status" id="horseshoeBayTownRecordStatus" role="status" aria-live="polite"></span>
<button class="horseshoe-bay-town-record-post-composer-button" id="horseshoeBayTownRecordGenerate" type="button">Скопировать код</button>
</div>
<div class="horseshoe-bay-town-record-post-composer-generated" id="horseshoeBayTownRecordGenerated">
<div class="horseshoe-bay-town-record-post-composer-generated-section">
<span class="horseshoe-bay-town-record-post-composer-label">Предпросмотр публикации</span>
<div id="horseshoeBayTownRecordPublicationPreview"></div>
</div>
<div class="horseshoe-bay-town-record-post-composer-generated-section">
<span class="horseshoe-bay-town-record-post-composer-label">Код для ответа RUSFF</span>
<div class="horseshoe-bay-town-record-post-composer-output" id="horseshoeBayTownRecordOutput" contenteditable="true" spellcheck="false"></div>
</div>
</div>
</div>
<div class="horseshoe-bay-town-record-post-footer" style="display:block!important;text-align:center!important;">
<span class="horseshoe-bay-town-record-post-footer-location" style="display:block!important;width:100%!important;text-align:center!important;">Horseshoe Bay, North Carolina · 2026</span>
</div>
</div>
<script>
(function () {
"use strict";
var root = document.getElementById("horseshoeBayTownRecordComposer");
var nickname = document.getElementById("horseshoeBayTownRecordNickname");
var avatarUrl = document.getElementById("horseshoeBayTownRecordAvatarUrl");
var avatarPreview = document.getElementById("horseshoeBayTownRecordAvatarPreview");
var openAvatarUploader = document.getElementById("horseshoeBayTownRecordOpenAvatarUploader");
var avatarUploaderMount = document.getElementById("horseshoeBayTownRecordAvatarUploaderMount");
var postTitle = document.getElementById("horseshoeBayTownRecordPostTitle");
var toolbar = document.getElementById("horseshoeBayTownRecordToolbar");
var editor = document.getElementById("horseshoeBayTownRecordEditor");
var openImageUploader = document.getElementById("horseshoeBayTownRecordOpenImageUploader");
var imageUploaderMount = document.getElementById("horseshoeBayTownRecordUploaderMount");
var generate = document.getElementById("horseshoeBayTownRecordGenerate");
var generated = document.getElementById("horseshoeBayTownRecordGenerated");
var publicationPreview = document.getElementById("horseshoeBayTownRecordPublicationPreview");
var output = document.getElementById("horseshoeBayTownRecordOutput");
var status = document.getElementById("horseshoeBayTownRecordStatus");
var uploaderTimer = 0;
var savedEditorRange = null;
var activeUploaderCleanup = null;
if (!root || !nickname || !avatarUrl || !avatarPreview || !openAvatarUploader || !avatarUploaderMount || !postTitle || !toolbar || !editor || !openImageUploader || !imageUploaderMount || !generate || !generated || !publicationPreview || !output || !status) return;
function escapeHtml(value) {
return String(value)
.replace(/&/g, "&")
.replace(/</g, "<")
.replace(/>/g, ">")
.replace(/"/g, """)
.replace(/'/g, "'");
}
function safeUrl(value) {
var trimmed = String(value || "").trim();
if (!/^https?:\/\//i.test(trimmed)) return "";
return trimmed;
}
function setStatus(message, kind) {
status.textContent = message;
status.className = "horseshoe-bay-town-record-post-composer-status";
if (kind) status.className += " horseshoe-bay-town-record-post-composer-status-" + kind;
}
function setPreviewImage(element, value) {
if (!value) {
element.removeAttribute("src");
element.classList.remove("horseshoe-bay-town-record-post-composer-preview-visible");
return;
}
element.src = value;
element.classList.add("horseshoe-bay-town-record-post-composer-preview-visible");
}
function extractRUSFFImageUrl(value) {
var source = String(value || "");
var linkedPattern = /\[url=(https?:\/\/[^\]\s]+)\]\s*\[img(?:=[^\]]*)?\][\s\S]*?\[\/img\]\s*\[\/url\]/gi;
var imagePattern = /\[img(?:=[^\]]*)?\](https?:\/\/[^\[\]\s]+)\[\/img\]/gi;
var match;
var linkedUrl = "";
var imageUrlValue = "";
while ((match = linkedPattern.exec(source))) linkedUrl = safeUrl(match[1]);
if (linkedUrl) return linkedUrl;
while ((match = imagePattern.exec(source))) imageUrlValue = safeUrl(match[1]);
return imageUrlValue;
}
function openRUSFFUploader(targetMount, onCaptured, successMessage) {
var nativeButton = document.querySelector("#button-image img");
var nativeArea = document.getElementById("image-area");
var reply = document.querySelector('#main-reply textarea[name="req_message"], #main-reply textarea, textarea[name="req_message"]');
var nativeParent;
var nativeNextSibling;
var nativeStyle;
var returnScrollX = window.pageXOffset || document.documentElement.scrollLeft || 0;
var returnScrollY = window.pageYOffset || document.documentElement.scrollTop || 0;
var before;
var selectionStart;
var selectionEnd;
var prefix;
var suffix;
var beforeImageUrl;
var checks = 0;
if (!nativeButton || !reply) {
setStatus("Штатный загрузчик RUSFF не найден на этой странице.", "error");
return;
}
if (activeUploaderCleanup) activeUploaderCleanup();
if (uploaderTimer) window.clearInterval(uploaderTimer);
before = reply.value;
selectionStart = typeof reply.selectionStart === "number" ? reply.selectionStart : before.length;
selectionEnd = typeof reply.selectionEnd === "number" ? reply.selectionEnd : selectionStart;
prefix = before.slice(0, selectionStart);
suffix = before.slice(selectionEnd);
beforeImageUrl = extractRUSFFImageUrl(before);
if (nativeArea) {
nativeParent = nativeArea.parentNode;
nativeNextSibling = nativeArea.nextSibling;
nativeStyle = nativeArea.getAttribute("style");
}
if (!nativeArea || window.getComputedStyle(nativeArea).display === "none") nativeButton.click();
nativeArea = document.getElementById("image-area");
if (!nativeArea) {
setStatus("Штатный загрузчик RUSFF не открылся.", "error");
return;
}
if (!nativeParent) {
nativeParent = nativeArea.parentNode;
nativeNextSibling = nativeArea.nextSibling;
nativeStyle = nativeArea.getAttribute("style");
}
targetMount.appendChild(nativeArea);
nativeArea.classList.add("horseshoe-bay-town-record-post-composer-native-uploader");
nativeArea.style.display = "block";
activeUploaderCleanup = function () {
if (!nativeArea) return;
nativeArea.classList.remove("horseshoe-bay-town-record-post-composer-native-uploader");
if (nativeStyle === null) nativeArea.removeAttribute("style");
else nativeArea.setAttribute("style", nativeStyle);
if (nativeParent) nativeParent.insertBefore(nativeArea, nativeNextSibling);
activeUploaderCleanup = null;
};
setStatus("Загрузчик открыт здесь. После штатной вставки картинка появится в публикации.", "success");
function restoreComposerPosition() {
function restore() {
window.scrollTo(returnScrollX, returnScrollY);
}
restore();
window.requestAnimationFrame(restore);
window.setTimeout(restore, 90);
}
uploaderTimer = window.setInterval(function () {
var current = reply.value;
var inserted = "";
var capturedUrl = "";
checks += 1;
if (current !== before && current.indexOf(prefix) === 0 && current.slice(current.length - suffix.length) === suffix) {
inserted = current.slice(prefix.length, current.length - suffix.length);
capturedUrl = extractRUSFFImageUrl(inserted);
if (capturedUrl) {
reply.value = before;
if (typeof reply.setSelectionRange === "function") reply.setSelectionRange(selectionStart, selectionEnd);
reply.dispatchEvent(new Event("input", { bubbles: true }));
}
}
if (!capturedUrl && current !== before) {
var currentImageUrl = extractRUSFFImageUrl(current);
if (currentImageUrl && currentImageUrl !== beforeImageUrl) capturedUrl = currentImageUrl;
}
if (capturedUrl) {
window.clearInterval(uploaderTimer);
uploaderTimer = 0;
if (activeUploaderCleanup) activeUploaderCleanup();
onCaptured(capturedUrl);
restoreComposerPosition();
setStatus(successMessage, "success");
return;
}
if (checks >= 600) {
window.clearInterval(uploaderTimer);
uploaderTimer = 0;
if (activeUploaderCleanup) activeUploaderCleanup();
restoreComposerPosition();
setStatus("Загрузчик закрыт без вставленного изображения. Можно попробовать ещё раз.", "error");
}
}, 300);
}
function selectionIsInsideEditor(range) {
var container = range && range.commonAncestorContainer;
if (!container) return false;
if (container.nodeType === 3) container = container.parentNode;
return container === editor || editor.contains(container);
}
function rememberEditorRange() {
var selection = window.getSelection();
var range;
if (!selection || !selection.rangeCount) return;
range = selection.getRangeAt(0);
if (selectionIsInsideEditor(range)) savedEditorRange = range.cloneRange();
}
function rangeAtEditorEnd() {
var range = document.createRange();
range.selectNodeContents(editor);
range.collapse(false);
return range;
}
function insertImageAtCaret(value) {
var url = safeUrl(value);
var selection = window.getSelection();
var range = savedEditorRange && selectionIsInsideEditor(savedEditorRange)
? savedEditorRange.cloneRange()
: rangeAtEditorEnd();
var image;
var lineBreak;
if (!url) {
setStatus("Ссылка на картинку должна начинаться с http:// или https://", "error");
return false;
}
image = document.createElement("img");
image.className = "horseshoe-bay-town-record-post-composer-inline-image";
image.src = url;
image.alt = "";
lineBreak = document.createElement("br");
range.deleteContents();
range.insertNode(lineBreak);
range.insertNode(image);
range.setStartAfter(lineBreak);
range.collapse(true);
selection.removeAllRanges();
selection.addRange(range);
savedEditorRange = range.cloneRange();
editor.focus();
editor.dispatchEvent(new Event("input", { bubbles: true }));
return true;
}
function sanitizeEditorHtml(value) {
var holder = document.createElement("div");
var allowed = {
A: true,
B: true,
BLOCKQUOTE: true,
BR: true,
DIV: true,
EM: true,
I: true,
LI: true,
IMG: true,
OL: true,
P: true,
STRONG: true,
U: true,
UL: true
};
var nodes;
var index;
holder.innerHTML = value;
nodes = holder.querySelectorAll("*");
for (index = nodes.length - 1; index >= 0; index -= 1) {
var node = nodes[index];
var tag = node.tagName;
var originalHref = tag === "A" ? node.getAttribute("data-horseshoe-bay-href") || "" : "";
var originalSrc = tag === "IMG" ? node.getAttribute("data-horseshoe-bay-src") || "" : "";
if (!allowed[tag]) {
node.replaceWith(document.createTextNode(node.textContent || ""));
continue;
}
while (node.attributes.length) node.removeAttribute(node.attributes[0].name);
if (tag === "A" && originalHref) node.setAttribute("href", originalHref);
if (tag === "IMG" && originalSrc) {
node.setAttribute("class", "horseshoe-bay-town-record-post-publication-image");
node.setAttribute("src", originalSrc);
node.setAttribute("alt", "");
}
}
return holder.innerHTML.trim();
}
function cleanEditorHtml(value) {
var holder = document.createElement("div");
var links;
var index;
holder.innerHTML = value;
links = holder.querySelectorAll("a");
for (index = 0; index < links.length; index += 1) {
var href = safeUrl(links[index].getAttribute("href"));
if (href) links[index].setAttribute("data-horseshoe-bay-href", href);
}
var images = holder.querySelectorAll("img");
for (index = images.length - 1; index >= 0; index -= 1) {
var src = safeUrl(images[index].getAttribute("src"));
if (src) images[index].setAttribute("data-horseshoe-bay-src", src);
else images[index].remove();
}
return sanitizeEditorHtml(holder.innerHTML);
}
function selectedTag() {
var checked = root.querySelector('input[name="horseshoe-bay-town-record-post-composer-tag"]:checked');
return checked ? checked.value : "news";
}
function publicationHtml() {
var author = nickname.value.trim();
var title = postTitle.value.trim();
var avatar = safeUrl(avatarUrl.value);
var body = cleanEditorHtml(editor.innerHTML);
var bodyText = editor.textContent.replace(/\s+/g, " ").trim();
var bodyHasImage = Boolean(editor.querySelector("img"));
var tag = selectedTag();
var tagText = "#hb_" + tag;
var avatarMarkup = avatar
? '<img class="horseshoe-bay-town-record-post-publication-avatar" src="' + escapeHtml(avatar) + '" alt="">'
: '<span class="horseshoe-bay-town-record-post-publication-avatar-fallback">аватар</span>';
if (!author) return { error: "Укажите ник жителя на городском сайте." };
if (!title) return { error: "Добавьте заголовок публикации." };
if (!bodyText && !bodyHasImage) return { error: "Напишите текст публикации или добавьте изображение." };
return {
html: '<div class="horseshoe-bay-town-record-post-publication" lang="ru">\n' +
' <div class="horseshoe-bay-town-record-post-publication-author">\n' +
' ' + avatarMarkup + '\n' +
' <div class="horseshoe-bay-town-record-post-publication-identity">\n' +
' <div class="horseshoe-bay-town-record-post-publication-name">' + escapeHtml(author) + '</div>\n' +
' <div class="horseshoe-bay-town-record-post-publication-site">horseshoebay.nc.gov/forum</div>\n' +
' </div>\n' +
' <span class="horseshoe-bay-town-record-post-flair horseshoe-bay-town-record-post-' + tag + '">' + tagText + '</span>\n' +
' </div>\n' +
' <div class="horseshoe-bay-town-record-post-publication-main">\n' +
' <div class="horseshoe-bay-town-record-post-publication-title">' + escapeHtml(title) + '</div>\n' +
' <div class="horseshoe-bay-town-record-post-publication-copy">' + body + '</div>\n' +
' </div>\n' +
'</div>'
};
}
toolbar.addEventListener("mousedown", function (event) {
if (event.target.closest("button")) event.preventDefault();
});
toolbar.addEventListener("click", function (event) {
var button = event.target.closest("button");
var command;
var value;
if (!button || !toolbar.contains(button)) return;
if (button.getAttribute("data-action") === "insert-image-url") {
value = window.prompt("Вставьте прямую ссылку на изображение, начиная с https://");
if (value !== null && insertImageAtCaret(value)) setStatus("Картинка добавлена в текст публикации.", "success");
return;
}
command = button.getAttribute("data-command");
if (!command) return;
value = button.getAttribute("data-value") || null;
editor.focus();
if (command === "createLink") {
value = window.prompt("Вставьте полную ссылку, начиная с https://");
if (!safeUrl(value)) {
setStatus("Ссылка должна начинаться с http:// или https://", "error");
return;
}
}
document.execCommand(command, false, value);
rememberEditorRange();
});
avatarUrl.addEventListener("input", function () {
setPreviewImage(avatarPreview, safeUrl(avatarUrl.value));
});
avatarPreview.addEventListener("error", function () {
setPreviewImage(avatarPreview, "");
});
openAvatarUploader.addEventListener("click", function () {
openRUSFFUploader(avatarUploaderMount, function (capturedUrl) {
avatarUrl.value = capturedUrl;
avatarUrl.dispatchEvent(new Event("input", { bubbles: true }));
setPreviewImage(avatarPreview, capturedUrl);
}, "Аватар загружен через RUSFF и добавлен в публикацию.");
});
openImageUploader.addEventListener("mousedown", function (event) {
event.preventDefault();
rememberEditorRange();
});
openImageUploader.addEventListener("click", function () {
openRUSFFUploader(imageUploaderMount, function (capturedUrl) {
insertImageAtCaret(capturedUrl);
}, "Изображение загружено через RUSFF и вставлено в текст публикации.");
});
editor.addEventListener("keyup", rememberEditorRange);
editor.addEventListener("mouseup", rememberEditorRange);
editor.addEventListener("input", rememberEditorRange);
function copyGeneratedCode() {
var value = output.textContent;
function copied() {
setStatus("Код публикации скопирован.", "success");
}
function fallbackCopy() {
var range = document.createRange();
var selection = window.getSelection();
range.selectNodeContents(output);
selection.removeAllRanges();
selection.addRange(range);
if (document.execCommand("copy")) copied();
else setStatus("Не получилось скопировать автоматически. Выделите код вручную.", "error");
selection.removeAllRanges();
}
if (!value) {
setStatus("Сначала соберите публикацию.", "error");
return;
}
if (navigator.clipboard && navigator.clipboard.writeText) {
navigator.clipboard.writeText(value).then(copied).catch(fallbackCopy);
} else {
fallbackCopy();
}
}
generate.addEventListener("click", function () {
var result = publicationHtml();
var bracket = String.fromCharCode(91);
if (result.error) {
generated.classList.remove("horseshoe-bay-town-record-post-composer-generated-visible");
setStatus(result.error, "error");
return;
}
publicationPreview.innerHTML = result.html;
output.textContent = bracket + "hideprofile]" + bracket + "code]<!--HTML-->\n" + result.html + "\n" + bracket + "/code]";
generated.classList.add("horseshoe-bay-town-record-post-composer-generated-visible");
copyGeneratedCode();
});
})();
</script>
шаблоны для публикации
Как добавить запись
Выберите подходящую рубрику и скопируйте её код целиком.Замените три поля:
ЗАГОЛОВОК — название вашей записи;
ОПИСАНИЕ ИЛИ ИЗОБРАЖЕНИЯ — текст, фотографии и другие материалы;
@НИК_НА_ФОРУМЕ — ваш форумный ник.#hb_news
новости, объявления, события и пропажи
Код:[hideprofile] [block=horseshoe-bay-town-record-post-flair horseshoe-bay-town-record-post-news]#hb_news[/block] [size=16][b]ЗАГОЛОВОК[/b][/size] ОПИСАНИЕ ИЛИ ИЗОБРАЖЕНИЯ [size=10][i]Автор: @НИК_НА_ФОРУМЕ[/i][/size]#hb_tea
сплетни, слухи и всё, что «не моё дело, но…»
Код:[hideprofile] [block=horseshoe-bay-town-record-post-flair horseshoe-bay-town-record-post-tea]#hb_tea[/block] [size=16][b]ЗАГОЛОВОК[/b][/size] ОПИСАНИЕ ИЛИ ИЗОБРАЖЕНИЯ [size=10][i]Автор: @НИК_НА_ФОРУМЕ[/i][/size]#hb_history
архивы, газетные вырезки, родословные и прошлое города
Код:[hideprofile] [block=horseshoe-bay-town-record-post-flair horseshoe-bay-town-record-post-history]#hb_history[/block] [size=16][b]ЗАГОЛОВОК[/b][/size] ОПИСАНИЕ ИЛИ ИЗОБРАЖЕНИЯ [size=10][i]Автор: @НИК_НА_ФОРУМЕ[/i][/size]#hb_spntrl
легенды, странности, фольклор и необъяснимое
Код:[hideprofile] [block=horseshoe-bay-town-record-post-flair horseshoe-bay-town-record-post-spntrl]#hb_spntrl[/block] [size=16][b]ЗАГОЛОВОК[/b][/size] ОПИСАНИЕ ИЛИ ИЗОБРАЖЕНИЯ [size=10][i]Автор: @НИК_НА_ФОРУМЕ[/i][/size]






















