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插件 A
自动化所有可以自动化的SEO工作,但让你能够轻松地自定义一切。
 核心 A
核心 1.4.2
核心插件,从现在开始,几乎所有的插件都将需要。
 信件索引 A
这个AddOn为选中的论坛添加了带字母的TabIndex。

相似的资源

[安迪B] BBCode解析器 A
去除消息中的 undesired 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
已更新
返回
顶部