Skip to content
Snippets Groups Projects
Commit ea616b78 authored by Astor Bizard's avatar Astor Bizard :dog2:
Browse files

Merge branch 'dev' into 'master'

Update vpl_terminal.min.js to correct merge version.

See merge request !4
parents 9822ced1 7c262cbe
No related branches found
No related tags found
1 merge request!4Update vpl_terminal.min.js to correct merge version.
define(["jquery","jqueryui","mod_vpl/vplutil","mod_vpl/vplclipboard"],function(a,b,c,d){if("undefined"!=typeof e)return e;var e=function(b,e,f){function g(a){if(u+=a,u.length>t){var b=u.length-t/2;u=u.substr(b)}}function h(){m&&m.readyState==m.OPEN&&m.send(s.getEntry2())}function i(){s.setEntry1(u)}function j(){i(),s.show()}var k,l=this,m=null,n=function(){},o="",p="",q=a("#"+b),r="",s=null,t=64e3,u="",v=a("#"+e);this.updateTitle=function(){var a=o;""!==p&&(a+=" ("+p+")"),r.text(f("console")+": "+a)},this.setTitle=function(a){o=a,this.updateTitle()},this.setMessage=function(a){p=a,this.updateTitle()},this.write=function(a){return k.write(a),a},this.connect=function(a,b){n=b,"WebSocket"in window?(k.reset(),k.startBlink(),l.show(),m&&m.close(),u="",l.setMessage(""),l.setTitle(f("connecting")),m=new WebSocket(a),m.writeBuffer="",m.writeIt=function(){k.write(m.writeBuffer),g(m.writeBuffer),m.writeBuffer=""},m.onmessage=function(a){m.writeBuffer.length>0?m.writeBuffer+=a.data:(m.writeBuffer=a.data,setTimeout(m.writeIt,0))},m.onopen=function(){l.setMessage(""),l.setTitle(f("connected"))},m.onclose=function(){l.setTitle(f("connection_closed")),k.blur(),k.stopBlink(),b(),m.stopOutput=!0}):k.write("WebSocket not available: Upgrade your browser")},this.writeLocal=function(a){return m.onmessage({data:a}),a},this.setDataCallback=function(a){m.onData=a},this.closeLocal=function(){m&&(m.writeIt(),m.close(),k.stopBlink(),l.setTitle(f("connection_closed")))},this.connectLocal=function(a,b){n=a,k.reset(),k.startBlink(),l.show(),m&&m.close(),u="",l.setMessage(""),l.setTitle(f("running")),m={},m.onData=b,m.writeBuffer="",m.readBuffer="",m.readyState=1,m.OPEN=1,m.close=function(){m=!1},m.onmessage=function(a){m.writeBuffer=a.data,m.writeIt()},m.writeIt=function(){m&&(k.write(m.writeBuffer),g(m.writeBuffer),m.writeBuffer="")},m.send=function(a){""==a?m.readBuffer.length>0&&(l.writeLocal("\b \b"),m.readBuffer=m.readBuffer.substr(0,m.readBuffer.length-1)):(l.writeLocal(a),m.readBuffer+=a);var b=m.readBuffer.indexOf("\r");if(b!=-1){var c=m.readBuffer.substr(0,b);m.readBuffer=m.readBuffer.substr(b+1),m.onData(c)}}},this.isOpen=function(){return q.dialog("isOpen")===!0},this.isConnected=function(){return m&&m.readyState!=m.CLOSED},this.disconnect=function(){m&&m.readyState==m.OPEN&&(n(),m&&m.close(),k.stopBlink())};var w=c.genIcon("copy","sw")+" "+f("copy"),x=c.genIcon("paste","sw")+" "+f("paste");s=new d("vpl_dialog_terminal_clipboard",w,function(){i(),document.execCommand("copy")},x,h),this.closeDialog=function(){s.hide(),l.disconnect()},q.dialog({closeOnEscape:!1,autoOpen:!1,width:"auto",height:"auto",resizable:!0,focus:function(){k.focus()},dialogClass:"vpl_ide vpl_vnc",create:function(){r=c.setTitleBar(q,"console","console",["clipboard","keyboard"],[j,function(){k.focus()}])},close:function(){l.closeDialog()},resizeStart:function(){var a=q.find("pre").width(),b=q.find("pre div").width();a<=b&&q.find("pre").width(b)}}),q.css("padding","1px"),this.show=function(){q.dialog("open"),k.focus()},this.init=function(){return"undefined"==typeof Terminal?void c.loadScript(["../../vpl/editor/xterm/term.js"],function(){l.init()}):(k=new Terminal({cols:132,rows:43,useStyle:!0,screenKeys:!0}),k.on("data",function(a){m&&m.readyState==m.OPEN&&m.send(a)}),k.open(v[0]),k.reset(),void k.stopBlink())},this.init()};return window.VPLTerminal=e,e}); define(["jquery","jqueryui","mod_vpl/vplutil","mod_vpl/vplclipboard"],function(a,b,c,d){if("undefined"!=typeof e)return e;var e=function(b,e,f){var g,h=this,i=null,j=function(){},k="",l="",m=a("#"+b),n="",o=null,p=64e3,q="",r=a("#"+e);function s(a){if((q+=a).length>p){var b=q.length-p/2;q=q.substr(b)}}function t(){o.setEntry1(q)}function u(){t(),o.show()}this.updateTitle=function(){var a=k;""!==l&&(a+=" ("+l+")"),n.text(f("console")+": "+a)},this.setTitle=function(a){k=a,this.updateTitle()},this.setMessage=function(a){l=a,this.updateTitle()},this.write=function(a){return g.write(a),a},this.connect=function(a,b){j=b,"WebSocket"in window?(g.reset(),g.startBlink(),h.show(),i&&i.close(),q="",h.setMessage(""),h.setTitle(f("connecting")),(i=new WebSocket(a)).writeBuffer="",i.writeIt=function(){g.write(i.writeBuffer),s(i.writeBuffer),i.writeBuffer=""},i.onmessage=function(a){i.writeBuffer.length>0?i.writeBuffer+=a.data:(i.writeBuffer=a.data,setTimeout(i.writeIt,0))},i.onopen=function(){h.setMessage(""),h.setTitle(f("connected"))},i.onclose=function(){h.setTitle(f("connection_closed")),g.blur(),g.stopBlink(),b(),i.stopOutput=!0}):g.write("WebSocket not available: Upgrade your browser")},this.writeLocal=function(a){return i.onmessage({data:a}),a},this.setDataCallback=function(a){i.onData=a},this.closeLocal=function(){i&&(i.writeIt(),i.close(),g.stopBlink(),h.setTitle(f("connection_closed")))},this.connectLocal=function(a,b){j=a,g.reset(),g.startBlink(),h.show(),i&&i.close(),q="",h.setMessage(""),h.setTitle(f("running")),(i={}).onData=b,i.writeBuffer="",i.readBuffer="",i.readyState=1,i.OPEN=1,i.close=function(){i=!1},i.onmessage=function(a){i.writeBuffer=a.data,i.writeIt()},i.writeIt=function(){i&&(g.write(i.writeBuffer),s(i.writeBuffer),i.writeBuffer="")},i.send=function(a){""==a?i.readBuffer.length>0&&(h.writeLocal("\b \b"),i.readBuffer=i.readBuffer.substr(0,i.readBuffer.length-1)):(h.writeLocal(a),i.readBuffer+=a);var b=i.readBuffer.indexOf("\r");if(-1!=b){var c=i.readBuffer.substr(0,b);i.readBuffer=i.readBuffer.substr(b+1),i.onData(c)}}},this.isOpen=function(){return!0===m.dialog("isOpen")},this.isConnected=function(){return i&&i.readyState!=i.CLOSED},this.disconnect=function(){i&&i.readyState==i.OPEN&&(j(),i&&i.close(),g.stopBlink())};var v=c.genIcon("copy","sw")+" "+f("copy"),w=c.genIcon("paste","sw")+" "+f("paste");o=new d("vpl_dialog_terminal_clipboard",v,function(){t(),document.execCommand("copy")},w,function(){i&&i.readyState==i.OPEN&&i.send(o.getEntry2())}),this.closeDialog=function(){o.hide(),h.disconnect()},m.dialog({closeOnEscape:!1,autoOpen:!1,width:"auto",height:"auto",resizable:!0,focus:function(){g.focus()},dialogClass:"vpl_ide vpl_vnc "+c.getThemeClass(),create:function(){n=c.setTitleBar(m,"console","console",["clipboard","keyboard"],[u,function(){g.focus()}])},close:function(){h.closeDialog()},resizeStart:function(){var a=m.find("pre").width(),b=m.find("pre div").width();a<=b&&m.find("pre").width(b)}}),m.css("padding","1px"),this.show=function(){m.dialog("open"),g.focus()},this.init=function(){"undefined"!=typeof Terminal?((g=new Terminal({cols:132,rows:43,useStyle:!0,screenKeys:!0})).on("data",function(a){i&&i.readyState==i.OPEN&&i.send(a)}),g.open(r[0]),g.reset(),g.stopBlink()):c.loadScript(["../../vpl/editor/xterm/term.js"],function(){h.init()})},this.init()};return window.VPLTerminal=e,e});
\ No newline at end of file \ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment