Adding Select All for [code] BBcode

Adding Select All for [code] BBcode 1.1

Нет прав на скачивание
Совместимость с XF
  1. 2.2.x
Краткое описание
A simple, effective way to automatically select all content within a code bbcode in your forum. Replace the existing bbcodetag_code file with our provided solution for seamless functionality without needing an extra "select all" button. Download attached file or manually modify your template. Add JavaScript at end for optimal performance.
A simple but effective way to select all the content within a code bbcode in your forum.

Please note: this doesn't add a "select all" button like you're probably used to see, but it adds a simple functionality to your mouse (or your thumbs) so that each time you click (or tap) inside a code box, it'll automatically select all the text into it.

How to:
Download the attached file, and replace it with your existing bb_code_tag_code file in your template(s).
Alternatively, follow these steps to manually modify it:
  • Find
HTML:
<code>{$content}</code>
  • Replace it with:
HTML:
<code onclick="getData(this)">{$content}</code>
  • And add the following javascript code at the very end of that file (so that you load it only when you effectively have a code bbcode in your page, to save bandwidth):
JavaScript:
<script>
function getData(element)
{
if (document.body.createTextRange) {
var range = document.body.createTextRange();
range.moveToElementText(element);
range.select();
} else if (window.getSelection) {
var selection = window.getSelection();
var range = document.createRange();
range.selectNodeContents(element);
selection.removeAllRanges();
selection.addRange(range);
}
}
</script>

gyS0higkSU6HTYEB43FHDA.webp
Автор
axtona
Просмотры
324
Тип расширения
txt
Размер файла
939 байт
Первый выпуск
Последнее обновление
Оценки 0.00 звезды 0 оценок
Ссылка не работает? Отправить сообщение команде NP, и мы поможем вам очень быстро!
Поддержите разработчика Если вы довольны тестом или ваш проект приносит доход, нажмите кнопку «Больше информации», чтобы поддержать разработчика покупкой.

Больше Ресурсов от axtona

4SEO  PRO - joomla seo plugin A
automate every bit of SEO work that can be automated, but let you customize everything with the easy
 Курсор A
Core AddOn, który z当下起,(prawie) wszystkie moje AddOny zaczynają teraz wymagać.
 Индекс Листа A
Этот Add-On добавляет буквенное значение TabIndex к выбранным форумам.

Похожие ресурсы

 BBCode parser A
Удаляет ненужные BBCode теги из сообщений.
Просмотры
636
Обновлено
[AndyB] Disallow bold bbcode A
Disallows bold bbcode tag in posts.
Просмотры
429
Обновлено
[AndyB] HTML to bbcode A
Updates post with HTML to BBCode.
Просмотры
303
Обновлено
Назад
Вверх