jquery.terminal icon indicating copy to clipboard operation
jquery.terminal copied to clipboard

Pause terminal when loading images

Open jcubic opened this issue 2 years ago • 0 comments

I have an idea for a new feature for jQuery Terminal

I was reading Tutorial and realized that the code can be simplified if image loading is handled by the library.

This code:

function get_image(url) {
    return new Promise(function(resolve, reject) {
        const img = $('<img src="' + url + '"'/>');
        img.on('load', () => resolve(img));
        img.on('error', reject);
    });
}

in tutorial can be replace with just:

return $('<img src="' + url + '"'/>');

or

this.echo($('<img src="' + url + '"'/>'));

And jQuery Terminal should pause when the image is loading. This will be a breaking change so options need to be provided

  • [x] Pause the terminal when images are loading
  • [x] Add an option to turn that off
  • [ ] Update tutorial (also show return, don't remove the promise from tutorial only a note with version)

jcubic avatar Jul 02 '22 22:07 jcubic