jquery.terminal
jquery.terminal copied to clipboard
Pause terminal when loading images
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)