All Downloads are FREE. Search and download functionalities are using the official Maven repository.

www.jquery.jqconsole.min.js Maven / Gradle / Ivy

There is a newer version: 3.8.2.9
Show newest version
/*
Copyrights 2011, the repl.it project.
Licensed under the MIT license
*/
(function(){var e,t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N,C,k,L,A,O,M,_,D,P,H,B,j=function(e,t){return function(){return e.apply(t,arguments)}},F=[].slice;e=jQuery,D=0,P=1,H=2,T=13,O=9,E=46,w=8,C=37,A=39,M=38,S=40,N=36,x=35,L=33,k=34,a="jqconsole-",i=""+a+"cursor",s=""+a+"header",f=""+a+"prompt",u=""+a+"old-prompt",o=""+a+"input",r=""+a+"blurred",y="keypress",v="",p="
",d=":empty",_="\n",h=">>> ",c="... ",l=2,n=""+a+"ansi-",m="",g=/\[(\d*)(?:;(\d*))*m/,t=function(){function e(){this.stylize=j(this.stylize,this),this._closeSpan=j(this._closeSpan,this),this._openSpan=j(this._openSpan,this),this.getClasses=j(this.getClasses,this),this._style=j(this._style,this),this._color=j(this._color,this),this._remove=j(this._remove,this),this._append=j(this._append,this),this.klasses=[]}return e.prototype.COLORS=["black","red","green","yellow","blue","magenta","cyan","white"],e.prototype._append=function(e){e=""+n+e;if(this.klasses.indexOf(e)===-1)return this.klasses.push(e)},e.prototype._remove=function(){var e,t,r,i,s,o;r=1<=arguments.length?F.call(arguments,0):[],o=[];for(i=0,s=r.length;i'+e},e.prototype._closeSpan=function(e){return""+e+""},e.prototype.stylize=function(e){var t,n,r,i,s,o;e=this._openSpan(e),r=0;while((r=e.indexOf(m,r))&&r!==-1)if(n=e.slice(r).match(g)){o=n.slice(1);for(i=0,s=o.length;i'+(t||"")+""},b=function(){function n(n,r,i,o){this.container=n,this._HideComposition=j(this._HideComposition,this),this._ShowComposition=j(this._ShowComposition,this),this._UpdateComposition=j(this._UpdateComposition,this),this._EndComposition=j(this._EndComposition,this),this._StartComposition=j(this._StartComposition,this),this._CheckComposition=j(this._CheckComposition,this),this._ProcessMatch=j(this._ProcessMatch,this),this._HandleKey=j(this._HandleKey,this),this._HandleChar=j(this._HandleChar,this),this.isMobile=!!navigator.userAgent.match(/iPhone|iPad|iPod|Android/i),this.isIos=!!navigator.userAgent.match(/iPhone|iPad|iPod/i),this.isAndroid=!!navigator.userAgent.match(/Android/i),this.$window=e(window),this.header=r||"",this.prompt_label_main=typeof i=="string"?i:h,this.prompt_label_continue=" \n"+(o||c),this.indent_width=l,this.state=P,this.input_queue=[],this.input_callback=null,this.multiline_callback=null,this.history=[],this.history_index=0,this.history_new="",this.history_active=!1,this.shortcuts={},this.$console=e('
').appendTo(this.container),this.$console.css({position:"absolute",top:0,bottom:0,right:0,left:0,margin:0,overflow:"auto"}),this.$console_focused=!0,this.$input_container=e(p).appendTo(this.container),this.$input_container.css({position:"relative",width:1,height:0,overflow:"hidden"}),this.$input_source=e("