javascript – Get text from live preview to php and convert

I have created this live-preview thingy that works perfectly, but new lines and so on doesn’t show, and also I have a bb-codes function I would my text to go through. So that text in the textarea (b)Hello world(/b) is Hello world

This is my code so far:

<html>
    <head>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

    </head>
    <body>
        <textarea name="WPcomment" id="WPComment" placeholder="Legg til tekst..."></textarea>
        <br>
        <input type="button" class="button" name="answer" value="Live-preview" onclick="showDiv()" />
        <div style="display:none;" id="prevCom"></div>
    </body>
        <script type="text/javascript">
            
        var wpcomment = document.getElementById('WPComment');

        wpcomment.onkeyup = wpcomment.onkeypress = function(){
            document.getElementById('prevCom').innerHTML = this.value;
        }
        
        function showDiv() {
           document.getElementById('prevCom').style.display = "block";
        }
        
        </script>
</html>

Jsfiddle: https://jsfiddle.net/mhp57cno/

The php that I use when I output text from my database is this:

$htmltext = htmlspecialchars($htmltext);
$htmltext = showBBcodes($htmltext);

echo $htmltext;

What I basicly want is the text from #prevCom to output as the $htmltext from above

File preview – transparent overlay or white bg

I wonder how the preview of the file will be better. I take into account the version where the preview is opened in the form of a “modal” with a semi-transparent background (e.g. as in gmail) or with a non-transparent background as e.g. in Jira, Slack or Messenger. In my opinion, the version with a non-transparent background is better, it allows you to focus more on the file and things from the overlay do not create a mess, but we lose some context of the page we are on. This is not a typical modal, which always has a transparent background so as not to lose the context and the file preview (images, videos, pdfs etc.

What do you think? What are the arguments for the first or second option?

unity – Animation works well on preview but not when hitting play

I’m using a simple animation where I want to move an sprite just a little bit bellow its current position, and this works well on preview mode in the Animation tab.

But as soon as I hit play, the value I’m trying to animate is not the same as the one in the keyframe, the value is lesser than the one I setted. I don’t know what I’m doing wrong… I’ll append a clip showing this problem.

I already tried turning on and off Apply Root Motion and some alike questions, but none of the solution worked for me so far…

enter image description here

usb video preview – Android Enthusiasts Stack Exchange

after digitizing all my family’s old video footage I am now looking for a way to distribute the rendered videos in the family. I would have preferred a classic DVD or Bluray with a menu, but the capacity is not enough for that. Hence a flash drive. Android TV seems to be unable to read HTML with Flash menus, DVD or Bluray folder structures, or disk images from USB to visualize menus. Now I assume that most devices have a nice menu for previewing video files. Since the first 4 seconds of each video contains the title heading, I would like to set the first frame as a thumbnail. So I rendered it into MP4 container and put the cover image into the container. On the PC it is also correctly displayed without any problems. But Android TV simply selects any frame from the video as thumbnail/preview image. Are there any other suggestions how I can reach my goal?

Thanks a lot, I’m desperate.

dart – Adjusting contrast on camera preview and image widgets flutter

I need to display a CameraPreview widget and an image (separately) with the contrast adjusted on both. I’ve been looking into the ColorFiltered and ShaderMask widgets but I’m not sure what blend mode to use or if it will be helpful to change the blend mode. Does anyone have any examples of changing the contrast?

plugins – serverSideRender does not render “preview” html inside Gutenberg block

I’ve pulling pulling my hair for the last 2 days with this and searching did not result in any solution to the issue I am having.

I wanted to use <serverSideRender /> to load dynamic content in the front-end as well as see the generated content in the Gutenberg editor. I tested it with the simple example given on the Gutenberg doc page.

Here is the JS code:

const { registerBlockType }                 = wp.blocks;
const { serverSideRender }                  = wp.serverSideRender

registerBlockType( 'gutenberg-examples/example-dynamic', {
    title: 'Example: last post',
    icon: 'megaphone',
    category: 'widgets',

    edit: function( props ) {

        return (

            <p>serverSideRender should appear here:</p>,
            <serverSideRender
                block="gutenberg-examples/example-dynamic"
                attributes={ props.attributes }
            />
        );
    },
} );

PHP Code:

function gutenberg_examples_dynamic_render_callback( $attributes, $content ) {
    $recent_posts = wp_get_recent_posts( array(
        'numberposts' => 1,
        'post_status' => 'publish',
    ) );
    if ( count( $recent_posts ) === 0 ) {
        return 'No posts';
    }
    $post = $recent_posts( 0 );
    $post_id = $post('ID');
    return sprintf(
        '<a class="wp-block-my-plugin-latest-post" href="%1$s">%2$s</a>',
        esc_url( get_permalink( $post_id ) ),
        esc_html( get_the_title( $post_id ) )
    );
}

function gutenberg_examples_dynamic() {

    register_block_type( 'gutenberg-examples/example-dynamic', array(
        'render_callback' => 'gutenberg_examples_dynamic_render_callback'
    ) );

}
add_action( 'init', 'gutenberg_examples_dynamic' );

The front-end displays the post as intended. Screenshot below:

enter image description here

But in Gutenberg the block does not show the dynamic content. In theory I should see the same thing as the front-end right? Or am I missing something?

This is what I see in Gutenberg:

enter image description here

As you can see, none of the dynamic content is rendered and there aren’t any errors in the console either.

What am I doing wrong? Any help would be much appreciated.

Thanks in advance

Preview does not open several files in one window on MacOS catalina

I have recently updated my mac to the catalina version. after the update the preview app stopped opening PDF files in one window. i have gone to view prefrences andunder images i have tried using both the options for opening several files in one window (open all files in one window and open groups of files in the same window). it still doesnt work instead it keeps opening each file in its own window. i have shut down and restarted my laptop severally and nothing has worked. what else can i try to be able to open several files in the same window

How to make ranger’s image/pdf preview persist in terminal?

Just got image/pdf preview working in ranger, but I’ve noticed that when moving my mouse away from the terminal window running ranger, the preview disappears. More annoying than this is that you can’t run commands with the preview still displayed.

For instance I would like to preview the file, and then :rename it. As soon as any key is pressed (Shift in this case) the preview vanishes and I have to navigate to another file and then back to the file I want to preview.

I’m using the st terminal emulator and the default set preview_image_method w3m. What’s going on here? Any way to fix this?