Add html figure tag

Add html figure tag

20th Oct. 2024

Updated
* added class to figure tag to set width
* created variable prompt text for use as alt for image and figcaption

v 7.2.5
Have made a copy of the quicktags plugin >> _myhtmltags.plugin.php


<figure>
Duplicated, inserted and modified two sections of code that were for inserting an <img> tag


Insert code for [button]

PHP

<?php echo $params['js_prefix']; ?>b2evoButtons[<?php echo $params['js_prefix']; ?>b2evoButtons.length] = new <?php echo $params['js_prefix']; ?>b2evoButton(
                '<?php echo $params['js_prefix']; ?>b2evo_figure'
                ,'<?php echo ($simple ? 'figure' : 'figure') ?>', ''
                ,'',' '
                ,'f'
                ,'<?php echo TS_('FiGuRe [Alt-F]') ?>'
            ); // special case

Insert code to impliment

PHP

function <?php echo $params['js_prefix']; ?>b2evoInsertFigure(myField)
        {
            
            var myValue = prompt( '<?php echo TS_('URL') ?>:', '/media/blogs/' );
            var myText = prompt( '<?php echo TS_('ALT & Figcaption Text') ?>:');
            if (myValue) {
                myValue = '<figure class="nineTpercent"><img src="'
                        + myValue
                        + '" alt="' + myText
                        + '" /><figcaption>'
                        + myText
                        + '</figcaption>'
                        + '</figure>';
                textarea_wrap_selection( myField, myValue, '', 1 );
            }
        }