From 6324c2793468ba0609b9c62accb1815141af2add Mon Sep 17 00:00:00 2001 From: Jakub Jankiewicz Date: Wed, 18 Dec 2019 13:09:07 +0100 Subject: [PATCH] fix copy empty line #548 --- README.md | 2 +- js/jquery.terminal-2.9.0.js | 9 +++++---- js/jquery.terminal-2.9.0.min.js | 4 ++-- js/jquery.terminal-src.js | 5 +++-- js/jquery.terminal.js | 9 +++++---- js/jquery.terminal.min.js | 4 ++-- js/jquery.terminal.min.js.map | 2 +- 7 files changed, 19 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 66e7cecb1..6614a1a19 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ http://terminal.jcubic.pl [![npm](https://img.shields.io/badge/npm-DEV-blue.svg)](https://www.npmjs.com/package/jquery.terminal) ![bower](https://img.shields.io/badge/bower-DEV-yellow.svg) -[![travis](https://travis-ci.org/jcubic/jquery.terminal.svg?branch=devel&2927582373f2249bc9be6e71a1ff3c600513d68d)](https://travis-ci.org/jcubic/jquery.terminal) +[![travis](https://travis-ci.org/jcubic/jquery.terminal.svg?branch=devel&640206ad65434176d75f8a56ec304f0e42372ff7)](https://travis-ci.org/jcubic/jquery.terminal) [![Coverage Status](https://coveralls.io/repos/github/jcubic/jquery.terminal/badge.svg?branch=devel&61cd458e5a8c6d4c02575731ac378fd2)](https://coveralls.io/github/jcubic/jquery.terminal?branch=devel) ![downloads](https://img.shields.io/npm/dm/jquery.terminal.svg?style=flat) [![package quality](http://npm.packagequality.com/shield/jquery.terminal.svg)](http://packagequality.com/#?package=jquery.terminal) diff --git a/js/jquery.terminal-2.9.0.js b/js/jquery.terminal-2.9.0.js index 8a2bfbd5e..61d3c12ee 100644 --- a/js/jquery.terminal-2.9.0.js +++ b/js/jquery.terminal-2.9.0.js @@ -41,7 +41,7 @@ * * broken image by Sophia Bai from the Noun Project (CC-BY) * - * Date: Wed, 18 Dec 2019 11:56:23 +0000 + * Date: Wed, 18 Dec 2019 12:22:00 +0000 */ /* global location, setTimeout, window, global, sprintf, setImmediate, IntersectionObserver, ResizeObserver, module, require, define, @@ -3869,7 +3869,8 @@ } // ----------------------------------------------------------------- function process_div(element) { - return $(element).find('> div') + // span is empty line, div is default case with text + return $(element).find('> div, > span') .map(process_selected_line).get().join('\n').replace(/\n$/, ''); } // ----------------------------------------------------------------- @@ -3882,7 +3883,7 @@ stdout = $html.find('div[data-index]').map(function() { return process_div(this); }).get().join('\n'); - // match insdie single echo output + // match inside single echo output if (!stdout && html.match(/style="width: 100%;?"/)) { stdout = process_div($html); } @@ -4062,7 +4063,7 @@ // ------------------------------------------------------------------------- $.terminal = { version: 'DEV', - date: 'Wed, 18 Dec 2019 11:56:23 +0000', + date: 'Wed, 18 Dec 2019 12:22:00 +0000', // colors from https://www.w3.org/wiki/CSS/Properties/color/keywords color_names: [ 'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white', diff --git a/js/jquery.terminal-2.9.0.min.js b/js/jquery.terminal-2.9.0.min.js index f25c802d4..d0f8d4965 100644 --- a/js/jquery.terminal-2.9.0.min.js +++ b/js/jquery.terminal-2.9.0.min.js @@ -41,7 +41,7 @@ * * broken image by Sophia Bai from the Noun Project (CC-BY) * - * Date: Wed, 18 Dec 2019 11:56:23 +0000 + * Date: Wed, 18 Dec 2019 12:22:00 +0000 */ -(function(e){var m=function(){if(!m.cache.hasOwnProperty(arguments[0])){m.cache[arguments[0]]=m.parse(arguments[0])}return m.format.call(null,m.cache[arguments[0]],arguments)};m.format=function(e,t){var n=1,r=e.length,i="",a,o=[],u,s,l,f,c,p;for(u=0;u>>0;break;case"x":a=a.toString(16);break;case"X":a=a.toString(16).toUpperCase();break}a=/[def]/.test(l[8])&&l[3]&&a>=0?" +"+a:a;c=l[4]?l[4]==="0"?"0":l[4].charAt(1):" ";p=l[6]-String(a).length;f=l[6]?h(c,p):"";o.push(l[5]?a+f:f+a)}}return o.join("")};m.cache={};m.parse=function(e){var t=e,n=[],r=[],i=0;while(t){if((n=/^[^\x25]+/.exec(t))!==null){r.push(n[0])}else if((n=/^\x25{2}/.exec(t))!==null){r.push("%")}else if((n=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(t))!==null){if(n[2]){i|=1;var a=[],o=n[2],u=[];if((u=/^([a-z_][a-z_\d]*)/i.exec(o))!==null){a.push(u[1]);while((o=o.slice(u[0].length))!==""){if((u=/^\.([a-z_][a-z_\d]*)/i.exec(o))!==null){a.push(u[1])}else if((u=/^\[(\d+)\]/.exec(o))!==null){a.push(u[1])}else{throw"[sprintf] huh?"}}}else{throw"[sprintf] huh?"}n[2]=a}else{i|=2}if(i===3){throw"[sprintf] mixing positional and named placeholders is not (yet) supported"}r.push(n)}else{throw"[sprintf] huh?"}t=t.slice(n[0].length)}return r};var t=function(e,t,n){n=t.slice(0);n.splice(0,0,e);return m.apply(null,n)};function d(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function h(e,t){for(var n=[];t>0;n[--t]=e){}return n.join("")}e.sprintf=m;e.vsprintf=t})(typeof global!=="undefined"?global:window);(function(r,i){var e=typeof window!=="undefined"?window:global;if(typeof define==="function"&&define.amd){define(["jquery","wcwidth"],r)}else if(typeof module==="object"&&module.exports){module.exports=function(e,t,n){if(t===i){if(window!==i){t=require("jquery")}else{t=require("jquery")(e)}}if(n===i){n=require("wcwidth")}r(t,n);return t}}else{r(e.jQuery,e.wcwidth)}})(function($,wcwidth,undefined){"use strict";function debug(e){if(false){console.log(e)}}function DelayQueue(){var t=$.Callbacks();var n=false;this.resolve=function(){t.fire();n=true};this.add=function(e){if(n){e()}else{t.add(e)}}}$.omap=function(n,r){var i={};$.each(n,function(e,t){i[e]=r.call(n,e,t)});return i};$.fn.text_length=function(){return this.map(function(){return $(this).text().length}).get().reduce(function(e,t){return e+t},0)};var Clone={clone_object:function(e){var t={};if(typeof e==="object"){if($.isArray(e)){return this.clone_array(e)}else if(e===null){return e}else{for(var n in e){if($.isArray(e[n])){t[n]=this.clone_array(e[n])}else if(typeof e[n]==="object"){t[n]=this.clone_object(e[n])}else{t[n]=e[n]}}}}return t},clone_array:function(e){if(!is_function(Array.prototype.map)){throw new Error("Your browser don't support ES5 array map "+"use es5-shim")}return e.slice(0).map(function(e){if(typeof e==="object"){return this.clone_object(e)}else{return e}}.bind(this))}};var clone=function(e){return Clone.clone_object(e)};var localStorage;(function(){var e=function(){try{var e="test",t=window.localStorage;t.setItem(e,"1");t.removeItem(e);return true}catch(e){return false}};var t=function(){try{document.cookie.split(";");return true}catch(e){return false}};var n=e();function r(e,t){var n;if(typeof e==="string"&&typeof t==="string"){localStorage[e]=t;return true}else if(typeof e==="object"&&typeof t==="undefined"){for(n in e){if(e.hasOwnProperty(n)){localStorage[n]=e[n]}}return true}return false}function i(e,t){var n,r,i;n=new Date;n.setTime(n.getTime()+31536e6);r="; expires="+n.toGMTString();if(typeof e==="string"&&typeof t==="string"){document.cookie=e+"="+t+r+"; path=/";return true}else if(typeof e==="object"&&typeof t==="undefined"){for(i in e){if(e.hasOwnProperty(i)){document.cookie=i+"="+e[i]+r+"; path=/"}}return true}return false}function a(e){return localStorage[e]}function o(e){var t,n,r,i;t=e+"=";n=document.cookie.split(";");for(r=0;r=i||t<0||d&&n>=s}function y(){var e=$();if(_(e)){return b(e)}f=setTimeout(y,g(e))}function b(e){f=undefined;if(h&&o){return D(e)}o=u=undefined;return l}function w(){if(f!==undefined){clearTimeout(f)}p=0;o=c=u=f=undefined}function C(){return f===undefined?l:b($())}function E(){var e=$(),t=_(e);o=arguments;u=this;c=e;if(t){if(f===undefined){return v(c)}if(d){f=setTimeout(y,i);return D(c)}}if(f===undefined){f=setTimeout(y,i)}return l}E.cancel=w;E.flush=C;return E}}();var jQuery=$;(function(e){jQuery.fn.extend({everyTime:function(e,t,n,r,i){return this.each(function(){jQuery.timer.add(this,e,t,n,r,i)})},oneTime:function(e,t,n){return this.each(function(){jQuery.timer.add(this,e,t,n,1)})},stopTime:function(e,t){return this.each(function(){jQuery.timer.remove(this,e,t)})}});jQuery.extend({timer:{guid:1,global:{},regex:/^([0-9]+)\s*(.*s)?$/,powers:{ms:1,cs:10,ds:100,s:1e3,das:1e4,hs:1e5,ks:1e6},timeParse:function(e){if(e===undefined||e===null){return null}var t=this.regex.exec(jQuery.trim(e.toString()));if(t[2]){var n=parseInt(t[1],10);var r=this.powers[t[2]]||1;return n*r}else{return e}},add:function(e,t,n,r,i,a){var o=0;if(jQuery.isFunction(n)){if(!i){i=r}r=n;n=t}t=jQuery.timer.timeParse(t);if(typeof t!=="number"||isNaN(t)||t<=0){return}if(i&&i.constructor!==Number){a=!!i;i=0}i=i||0;a=a||false;if(!e.$timers){e.$timers={}}if(!e.$timers[n]){e.$timers[n]={}}r.$timerID=r.$timerID||this.guid++;var u=function(){if(a&&u.inProgress){return}u.inProgress=true;if(++o>i&&i!==0||r.call(e,o)===false){jQuery.timer.remove(e,n,r)}u.inProgress=false};u.$timerID=r.$timerID;if(!e.$timers[n][r.$timerID]){e.$timers[n][r.$timerID]=window.setInterval(u,t)}if(!this.global[n]){this.global[n]=[]}this.global[n].push(e)},remove:function(e,t,n){var r=e.$timers,i;if(r){if(!t){for(var a in r){if(r.hasOwnProperty(a)){this.remove(e,a,n)}}}else if(r[t]){if(n){if(n.$timerID){window.clearInterval(r[t][n.$timerID]);delete r[t][n.$timerID]}}else{for(var o in r[t]){if(r[t].hasOwnProperty(o)){window.clearInterval(r[t][o]);delete r[t][o]}}}for(i in r[t]){if(r[t].hasOwnProperty(i)){break}}if(!i){i=null;delete r[t]}}for(i in r){if(r.hasOwnProperty(i)){break}}if(!i){e.$timers=null}}}}});if(/(msie) ([\w.]+)/.exec(navigator.userAgent.toLowerCase())){e(window).one("unload",function(){var e=jQuery.timer.global;for(var t in e){if(e.hasOwnProperty(t)){var n=e[t],r=n.length;while(--r){jQuery.timer.remove(n[r],t)}}}})}})(jQuery);(function(f){if(!String.prototype.split.toString().match(/\[native/)){return}var c=String.prototype.split,p=/()??/.exec("")[1]===f,n;n=function(e,t,n){if(Object.prototype.toString.call(t)!=="[object RegExp]"){return c.call(e,t,n)}var r=[],i=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.extended?"x":"")+(t.sticky?"y":""),a=0,o,u,s,l;t=new RegExp(t.source,i+"g");e+="";if(!p){o=new RegExp("^"+t.source+"$(?!\\s)",i)}n=n===f?-1>>>0:n>>>0;while(u=t.exec(e)){s=u.index+u[0].length;if(s>a){r.push(e.slice(a,u.index));if(!p&&u.length>1){u[0].replace(o,function(){for(var e=1;e1&&u.index=n){break}}if(t.lastIndex===u.index){t.lastIndex++}}if(a===e.length){if(l||!t.test("")){r.push("")}}else{r.push(e.slice(a))}return r.length>n?r.slice(0,n):r};String.prototype.split=function(e,t){return n(this,e,t)};return n})();$.fn.caret=function(e){var t=this[0];var n=t.contentEditable==="true";if(arguments.length===0){if(window.getSelection){if(n){t.focus();var r=window.getSelection().getRangeAt(0),i=r.cloneRange();i.selectNodeContents(t);i.setEnd(r.endContainer,r.endOffset);return i.toString().length}return t.selectionStart}if(document.selection){t.focus();if(n){var r=document.selection.createRange(),i=document.body.createTextRange();i.moveToElementText(t);i.setEndPoint("EndToEnd",r);return i.text.length}var e=0,a=t.createTextRange(),i=document.selection.createRange().duplicate(),o=i.getBookmark();a.moveToBookmark(o);while(a.moveStart("character",-1)!==0)e++;return e}return 0}if(e===-1)e=this[n?"text":"val"]().length;if(window.getSelection){if(n){t.focus();window.getSelection().collapse(t.firstChild,e)}else t.setSelectionRange(e,e)}else if(document.body.createTextRange){var a=document.body.createTextRange();a.moveToElementText(t);a.moveStart("character",e);a.collapse(true);a.select()}if(!n&&!this.is(":focus")){t.focus()}return e};$.fn.resizer=function(u,e){var s=$.extend({},{prefix:""},e);var l=arguments.length===0;var f=arguments[0]==="unbind";if(!l&&!f&&!is_function(u)){throw new Error("Invalid argument, it need to a function or string "+'"unbind" or no arguments.')}if(f){u=is_function(arguments[1])?arguments[1]:null}return this.each(function(){var e=$(this);var t;var n;function r(){n.fire()}if(l||f){n=e.data("callbacks");if(l){n&&n.fire()}else{if(u&&n){n.remove(u);if(!n.has()){n=null}}else{n=null}if(!n){e.removeData("callbacks");if(window.ResizeObserver){var i=e.data("observer");if(i){i.unobserve(this);e.removeData("observer")}}else{t=e.find("> iframe");if(t.length){$(t[0].contentWindow).off("resize").remove();t.remove()}else if(e.is("body")){$(window).off("resize.resizer")}}}}}else if(e.data("callbacks")){$(this).data("callbacks").add(u)}else{n=$.Callbacks();n.add(u);e.data("callbacks",n);var a;var o=true;if(window.ResizeObserver){a=new ResizeObserver(function(){if(!o){r()}o=false});a.observe(this);e.data("observer",a)}else if(e.is("body")){$(window).on("resize.resizer",r)}else{t=$("