Adding Select All for [code] BBcode

Adding Select All for [code] BBcode 1.1

Vous n'avez pas l'autorisation de télécharger
Compatibilité XF
  1. 2.2.x
Description courte
A simple but effective way to select all the content within a code bbcode in your forum.
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
Auteur
axtona
Vues
282
Type d’extension
txt
Taille du fichier
939 octets
Première publication
Dernière mise à jour
Évaluations 0.00 étoile(s) 0 évaluations
Link was Broken? Please Envoyer un message à l’équipe NP et nous vous aiderons rapidement !
Soutenez le développeur Si vous êtes satisfait du test ou que votre projet vous a rapporté de l’argent, cliquez sur le bouton « Plus d’informations » pour soutenir le développeur en achetant.

Plus de ressources de axtona

Brazilian Language [PT-BR] A
Like the other available Brazilian Portuguese translation
SEO Audit A
SEO Audit 1.1.0
A comprehensive SEO auditing dashboard for XenForo administrators.
Galerie Média XenForo / XFMG A
La galerie Media XenForo est une extension officielle de XenForo qui permet d'ajouter une galerie à votre XF2

Ressources similaires

[AndyB] BBCode parser A
Removes undesired BBCode tags from messages.
Haut