Code select all

There should be a mod for that I think. Could you screen shot it and show it for us?
 
sarhad12 said:
is it not possible without mod?
Only if you know how to cod the forum I think. Have you tried it with different themes ?
I think the only way its through mods.
 
Do you have jQuery loaded on your forum? Do your areas have ID's or CLASS's associated with them?

If so, you can use the following at the end of your forum's template, before the closing </body> tag:

Code:
<script type="text/javascript">
$('IDENTIFY YOUR SECTION').focus(function() {
    var $this = $(this);
    $this.select();
    window.setTimeout(function() {
        $this.select();
    }, 1);
    function mouseUpHandler() {
        $this.off("mouseup", mouseUpHandler);
        return false;
    }
    $this.mouseup(mouseUpHandler);
});
</script>

So, if you have a division with a class of "code", you would change:

IDENTIFY YOUR SECTION => div.code

So, the first line of the above code would look like this:

Code:
$('div.code').focus(function() {

This can be used with any tag; i.e. textarea, input, etc.

If you do not have jQuery loaded, and don't want to add it, you can use basic javascript as well:

Code:
<script type="text/javascript">
    var textBox = document.getElementById("ID OF YOUR SECTION");
    textBox.onfocus = function() {
        textBox.select();
        textBox.onmouseup = function() {
            textBox.onmouseup = null;
            return false;
        };
    };
</script>

The above will require that your section has an ID. So if you have a textarea with an ID of "blah", the first line of the above code would be:

Code:
    var textBox = document.getElementById("blah");

Hope this helps.
 
I believe it requires a modification. I'm not the best at MyBb but Phpbb 3 implemented the feature due to high mod of that type demand.
 
Back
Top Bottom