Background for text in posts
Adds a possibility to wrap text in tags with background and other settings
https://i.imgur.com/LCFXuWH.png

examples

https://i.imgur.com/kV22D6Z.png
https://i.imgur.com/9IZuf5J.png

Author: kolobdur74
Platform: MyBB
Analogues: Text background fill with colour (MyBB) [Alex_63]

Code:
    <!--Background for text with any settings-->
    <script type="text/javascript">
    $('td#button-font').after('<td id="backgr" style=\'background-image:url("http://s4.uploads.ru/zkAou.png")\' title="Background for text" onclick="tag_background()"></td>');
    $(function(){
    $('.post-content:contains("[background=")').each(function(){
    var htmlbackground = $(this).html().replace(/\[background=(.*?)\]([^`]*?)\[\/background\]/gi, "<span style='width=80%; background:$1;'>$2</span>");
    $(this).html(htmlbackground)
    });
    });
    function tag_background(){
    var FoundErrorsBACKGROUND = '';
    var backgroundTIT = prompt('Enter parameters of background', 'url("http://s4.uploads.ru/zkAou.png") no-repeat #fc0');
    if (FoundErrorsBACKGROUND)
    {alert("Error!" + FoundErrorsBACKGROUND);
    return;}
    bbcode('[background='+backgroundTIT+']','[/background]');
    }
    </script>

Examples:

Code:
    [background=url("http://images.gofreedownload.net/heart-handprint-seamless-pattern-239222.jpg") no-repeat #fc0]буууууууууууууууууууууууууууууууу[/background]
     
     
    [background=url("http://s4.uploads.ru/zkAou.png") no-repeat #fc0]Очень много текста!!! Примеры!!![/background]
     
     
    [background=#F8F8FF][b][size=20]И еще огромное количество текста!!![/size][/b][/background]


Image links must be put in quotes: "link", like this:

background=url("http://s4.uploads.ru/zkAou.png") no-repeat #fc0


If a picture is not needed, it's possible to set only color in this way:

background=#F8F8FF


Background for text with width and height setting:

Code:
    <!--Background for text with width and height setting-->
    <script type="text/javascript">
    $('td#button-font').after('<td id="backgr" style=\'background-image:url("http://s4.uploads.ru/zkAou.png")\' title="Background for text" onclick="tag_background()"></td>');
    $(function(){
    $('.post-content:contains("[background=")').each(function(){
    var htmlbackground = $(this).html().replace(/\[background=(.*?)\,(.*?)\,(.*?)\]([^`]*?)\[\/background\]/gi, "<div style='background:$1;width:$2;height:$3;'>$4</div>");
    $(this).html(htmlbackground)
    });
    });
    function tag_background(){
    var FoundErrorsBACKGROUND = '';
    var backgroundTIT = prompt('Enter parameters of background', 'url("http://s4.uploads.ru/zkAou.png") no-repeat #fc0');
    var backgroundTIT2 = prompt('Enter width', '80%');
    var backgroundTIT3 = prompt('Enter height', '200px');
    if (FoundErrorsBACKGROUND)
    {alert("Error!" + FoundErrorsBACKGROUND);
    return;}
    bbcode('[background='+backgroundTIT+','+backgroundTIT2+','+backgroundTIT3+']','[/background]');
    }
    </script>

Insert separated by comma:
1. Background parameters (image, repeat or not, position, color)
2. Width you need
3. Height you need

Width and height both can be set in pixels or percentage, but height should be set in pixels, otherwise it'll shrink to text.

Background for text with text position (top and left indents) setting:

Code:
    <!--Background for text with text position (top and left indents) setting-->
    <script type="text/javascript">
    $('td#button-font').after('<td id="backgr" style=\'background-image:url("http://s4.uploads.ru/zkAou.png")\' title="Background for text" onclick="tag_background()"></td>');
    $(function(){
    $('.post-content:contains("[background=")').each(function(){
    var htmlbackground = $(this).html().replace(/\[background=(.*?)\,(.*?)\,(.*?)\,(.*?)\,(.*?)\]([^`]*?)\[\/background\]/gi, "<div style='position:relative;background:$1;width:$2;height:$3;'><span style='position:absolute;top:$4;left:$5;'>$6</span></div>");
    $(this).html(htmlbackground)
    });
    });
    function tag_background(){
    var FoundErrorsBACKGROUND = '';
    var backgroundTIT = prompt('Enter parameters of background', 'url("http://s4.uploads.ru/zkAou.png") no-repeat #fc0');
    var backgroundTIT2 = prompt('Enter width', '80%');
    var backgroundTIT3 = prompt('Enter height', '200px');
    var backgroundTIT4 = prompt('Enter top indent', '50%');
    var backgroundTIT5 = prompt('Enter left indent', '10%');
    if (FoundErrorsBACKGROUND)
    {alert("Error!" + FoundErrorsBACKGROUND);
    return;}
    bbcode('[background='+backgroundTIT+','+backgroundTIT2+','+backgroundTIT3+','+backgroundTIT4+','+backgroundTIT5+']','[/background]');
    }
    </script>

Insert separated by comma these 5 values:
1. Background parameters (image, repeat or not, position, color)
2. Width you need
3. Height you need
4: Top indent
5: Left indent

Indents can be set both in percentage or pixels.