").addClass("terminal-output").attr("role","log").appendTo(Te);B.addClass("terminal");if(ce.login&&is_function(ce.onBeforeLogin)){try{if(ce.onBeforeLogin.call(B,B)===false){ve=false}}catch(e){ce.onBeforeLogin=$.noop;v(e,"onBeforeLogin")}}var Re;if(typeof e==="string"){Re=e}else if(e instanceof Array){for(var Ae=0,je=e.length;Ae
',{raw:true})}else if(n(t[r],"text/plain")){t[r].getAsString(B.insert)}}}else if(e.clipboardData.getData){var s=e.clipboardData.getData("text/plain");B.insert(s)}return false}}}$(document).on("paste.terminal_"+B.id(),Ie);var Pe=$.extend({},F,$.omap(ce.keymap||{},function(t,r){if(!F[t]){return r.bind(B)}return function(e,n){return r.call(B,e,function(){return F[t](e,n)})}}));l(e,ce.login,function(e){if(ce.completion&&typeof ce.completion!=="boolean"||!ce.completion){e.completion="settings"}_e=new Stack($.extend({},ce.extra,{name:ce.name,prompt:ce.prompt,keypress:ce.keypress,keydown:ce.keydown,resize:ce.onResize,greetings:ce.greetings,mousewheel:ce.mousewheel,history:ce.history,keymap:Pe},e));ye=$("
").appendTo(Te).cmd({prompt:ce.prompt,history:ce.memory?"memory":ce.history,historyFilter:ce.historyFilter,historySize:ce.historySize,caseSensitiveSearch:ce.caseSensitiveSearch,width:"100%",enabled:false,char_width:re.width,keydown:D,keymap:Pe,clickTimeout:ce.clickTimeout,keypress:H,onCommandChange:function(e){if(is_function(ce.onCommandChange)){try{ce.onCommandChange.call(B,e,B)}catch(e){ce.onCommandChange=$.noop;v(e,"onCommandChange")}}B.scroll_to_bottom()},commands:R});function n(e){e=e.originalEvent;if(e){var n=document.elementFromPoint(e.clientX,e.clientY);if(!$(n).closest(".terminal").length&&B.enabled()){B.disable()}}}B.oneTime(100,function(){$(document).bind("click.terminal_"+B.id(),n).bind("contextmenu.terminal_"+B.id(),n)});var t=$(window);document.addEventListener("resume",function(){B.disable()});if(is_mobile){B.click(function(){if(!he){if(!B.enabled()){B.focus();ye.enable()}else{B.disable()}}})}else{t.on("focus.terminal_"+B.id(),Le).on("blur.terminal_"+B.id(),ze);(function(){var n=0;var t;var r="click_"+B.id();var i=B.find(".cmd textarea");function o(){if(t.is(".terminal")||t.is(".terminal-wrapper")){var e=B.get_command().length;B.set_position(e)}else if(t.closest(".prompt").length){B.set_position(0)}if(!i.is(":focus")){i.focus()}a()}function a(){n=0;t=null}var e;B.find(".cmd textarea").on("focus",function(){if(typeof e!=="undefined"){W.scrollTop(e)}}).on("blur",function(){e=W.scrollTop()});B.mousedown(function(e){if(!scrollbar_event(e,Se)){t=$(e.target)}}).mouseup(function(){if(get_selected_text()===""&&t){if(++n===1){if(!he){if(!de){B.focus()}else{var e=ce.clickTimeout;B.oneTime(e,r,o);return}}}else{B.stopTime(r)}}a()}).dblclick(function(){a();B.stopTime(r)})})();(function(){var t=B.find(".cmd textarea");B.on("contextmenu.terminal",function(e){if(get_selected_text()===""){if(!$(e.target).is("img,value,audio,object,canvas,a")){if(!B.enabled()){B.enable()}var n=ye.offset();t.css({left:e.pageX-n.left-20,top:e.pageY-n.top-20,width:"5em",height:"4em"});if(!t.is(":focus")){t.focus()}B.stopTime("textarea");B.oneTime(100,"textarea",function(){t.css({left:"",top:"",width:"",height:""})});B.stopTime("selection");B.everyTime(20,"selection",function(){if(t[0].selection!==t[0].value){if(get_textarea_selection(t[0])){clear_textarea_selection(t[0]);select(B.find(".terminal-output")[0],B.find(".cmd div:last-of-type")[0]);B.stopTime("selection")}}})}}})})()}B.on("click","a",function(e){var n=$(this);if(n.closest(".exception").length){var t=n.attr("href");if(t.match(/:[0-9]+$/)){e.preventDefault();u(t)}}if(de){B.find(".cmd textarea").focus()}});function r(){var e=re.width;re=get_char_size(B);if(e!==re.width){ye.option("char_width",re.width).refresh()}}i();function i(){if(B.is(":visible")){var e=Se.width();var n=Se.height();if(le!==n||se!==e){B.resize()}le=n;se=e}}function o(){B.resizer("unbind").resizer(i);Ee.resizer("unbind").resizer(function(){r();B.resize()})}if(B.is(":visible")){o()}function a(){if(we){we.unobserve(B[0])}var e=B.enabled();var n=B.is(":visible");if(n){o()}we=new window.IntersectionObserver(function(){if(B.is(":visible")&&!n){n=true;o();r();i();if(e){B.enable()}}else if(n&&!B.is(":visible")){n=false;e=$.terminal.active()===B&&B.enabled();B.disable()}},{root:document.body});we.observe(B[0])}var s=!!B.closest("body").length;var l=window.MutationObserver||window.WebKitMutationObserver;if(l){xe=new l(function(){if(B.closest("body").length){if(!s){B.scroll_to_bottom();if(window.IntersectionObserver){a()}i()}s=true}else if(s){s=false}});xe.observe(document.body,{childList:true})}if(window.IntersectionObserver&&s){a()}ee.resolve();if(de&&B.is(":visible")&&!is_mobile){B.focus(undefined,true)}else{B.disable()}if(is_function(Oe)){B.login(Oe,true,I)}else{I()}function f(e){var n=terminals.get()[e[0]];if(n&&Y===n.id()){if(!e[2]){t.resolve();return t.promise()}else if(ge){var t=$.Deferred();S.push(function(){return n.exec(e[2]).done(function(){n.save_state(e[2],true,e[1]);t.resolve()})});return t.promise()}else{return n.exec(e[2]).done(function(){n.save_state(e[2],true,e[1])})}}}if(ce.execHash){if(location.hash){setTimeout(function(){try{var e=location.hash.replace(/^#/,"");hash_commands=JSON.parse(decodeURIComponent(e));var t=0;(function e(){var n=hash_commands[t++];if(n){f(n).done(e)}else{change_hash=true}})()}catch(e){}})}else{change_hash=true}}else{change_hash=true}(function(){var i=false;$(document).bind("keydown.terminal_"+B.id(),function(e){if(e.shiftKey){i=true}}).bind("keyup.terminal_"+B.id(),function(e){if(e.shiftKey||e.which===16){i=false}});function t(e,n){if(!i){var t=_e.top();var r;if(is_function(t.mousewheel)){r=t.mousewheel(e,n,B)}else if(is_function(ce.mousewheel)){r=ce.mousewheel(e,n,B)}if(k()||r===false){e.stopPropagation();e.preventDefault()}if(r===false){return false}else if(r===true){return}if(n>0){B.scroll(-40)}else{B.scroll(40)}}}if($.event.special.mousewheel){B.on("mousewheel",t)}else{var r;var e=document.createElement("div");if("onwheel"in e){r="wheel"}else if(document.onmousewheel!==undefined){r="mousewheel"}else{r="DOMMouseScroll"}e=null;B.on(r,function(e){var n;if(r==="mousewheel"){n=-1/40*e.originalEvent.wheelDelta}else{n=e.originalEvent.deltaY||e.originalEvent.detail}t(e,-n)})}})()});B.data("terminal",B);return B}});
\ No newline at end of file
diff --git a/package.json b/package.json
index cb4f834e0..c58cccf51 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "jquery.terminal",
- "version": "1.20.2",
+ "version": "1.20.3",
"description": "jQuery Terminal Emulator is a plugin for creating command line interpreters in your applications.",
"main": "js/jquery.terminal.js",
"typings": "js/jquery.terminal.d.ts",
diff --git a/terminal.jquery.json b/terminal.jquery.json
index 5e94e8815..2002546d8 100644
--- a/terminal.jquery.json
+++ b/terminal.jquery.json
@@ -2,7 +2,7 @@
"name": "terminal",
"title": "jQuery Terminal Emulator",
"description": "jQuery Terminal Emulator is a plugin for creating command line interpreters in your applications.",
- "version": "1.20.2",
+ "version": "1.20.3",
"keywords": [
"terminal", "emulator", "prompt", "console", "keyboard", "type", "rpc", "input", "ui"
],