Skip to content
Browse files

Revamped shell

Shell won't work under 'slidy', so I moved it to subpages for now.  I
also chose to bring in jquery-terminal to provide a nice terminal view.
However, since it isn't a pty, you can't actually open up any
interactive programs.  It also doesn't do any real terminal emulation.
This is essentially a total mess right now.
  • Loading branch information...
1 parent bb6cffb commit ce985d2ea9d38e2c16572b43046e86f65b2d6b0b @jadonk committed Apr 28, 2012
Showing with 384 additions and 50 deletions.
  1. +170 −0 LICENSE
  2. +84 −41 bone101/client.js
  3. +12 −9 bone101/index.html
  4. +2 −0 bone101/jquery.mousewheel.js
  5. +78 −0 bone101/jquery.terminal.js
  6. +17 −0 bone101/js_term.html
  7. +17 −0 bone101/shell.html
  8. +4 −0 bonescript/index.js
View
170 LICENSE
@@ -17,3 +17,173 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+
+--------------------
+
+bone101/jquery.terminal.js is covered by the LGPL 3.0 license:
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
View
125 bone101/client.js
@@ -1,9 +1,15 @@
+var cssUrls = [
+ '/schmux.css',
+ '/jquery.terminal.css' // http://terminal.jcubic.pl/js/jquery.terminal.css
+];
+
var scriptUrls = [
'/socket.io/socket.io.js',
'/jquery.js',
'/jquery.svg.js',
+ '/jquery.terminal.js', // http://terminal.jcubic.pl/js/jquery.terminal-0.4.12.min.js
+ '/jquery.mousewheel.js', // http://terminal.jcubic.pl/js/jquery.mousewheel-min.js
'/eeprom-web.js',
- '/slidy.js', // http://www.w3.org/Talks/Tools/Slidy2/scripts/slidy.js
'/autoadvance.js'
];
@@ -14,55 +20,77 @@ bone =
P8_2: { name: "DGND" },
};
-function printPin(pinname) {
+var printPin = function(pinname) {
$("#" + pinname).css("background-color", "#000000");
}
-function clearPin(pinname) {
+var clearPin = function(pinname) {
$("#" + pinname).css("background-color", "#EAF2D3");
}
-// based loosely on https://github.com/itchyny/browsershell/blob/master/main.js
+//var slidyDisable = function() {
+// document.removeEventListener('keydown', w3c_slidy.key_down);
+// document.removeEventListener('keypress', w3c_slidy.key_press);
+//};
+//
+//var slidyEnable = function() {
+// w3c_slidy.add_listener(document, 'keydown', w3c_slidy.key_down);
+// w3c_slidy.add_listener(document, 'keypress', w3c_slidy.key_press);
+//}
+
var init = function() {
- try {
+ //try {
var socket = io.connect('');
- var $textarea = $('#shell').focus();
- var view = function(s, e) {
- if(e) e.preventDefault();
- $textarea.val($textarea.val() + s);
- $textarea.scrollTop(9999999);
- $textarea.selectionStart = $textarea.textLength;
- };
+ var view = false;
+ try {
+ $('#shell').terminal(
+ function(command, term) {
+ socket.emit('shell', command);
+ if(!view) {
+ view = function(s) {
+ term.echo(s);
+ };
+ }
+ },
+ {
+ greetings: "BeagleBone bash shell",
+ name: "bash",
+ height: 400,
+ prompt: 'bash>'
+ }
+ );
+ } catch(ex) {
+ console.log("Unable to open shell terminal window due to " + ex);
+ }
+ try {
+ $('#js_term').terminal(
+ function(command, term) {
+ if (command !== '') {
+ var result = window.eval("(" + command + ")");
+ if (result !== undefined) {
+ term.echo(String(result));
+ }
+ } else {
+ term.echo('');
+ }
+ }, {
+ greetings: 'Javascript Interpreter',
+ name: 'js_demo',
+ height: 400,
+ prompt: 'js>'
+ }
+ );
+ } catch(ex) {
+ console.log("Unable to open javascript terminal window due to " + ex);
+ }
socket.on('connect', function() {
- view('connected\n');
+ if(view) view('Connected\n');
});
socket.on('disconnect', function() {
- view('disconnected\n');
+ if(view) view('Disconnected\n');
});
socket.on('shell', function(m) {
- view(m + '\n');
- });
- $textarea.keydown(function(e) {
- if(e.keyCode === 13) {
- if($textarea.selectionStart != $textarea.textLength) {
- view('\n');
- }
- setTimeout(function () {
- var c = $textarea.val().split('\n').slice(-2)[0];
- if(c.replace(/( |\n)+/g, '') === '') {
- view('\n');
- } else if(c.replace(/( |\n)+/g, '') === 'clear') {
- $textarea.val('');
- view('\n');
- } else if(c.replace(/( |\n)+/g, '') === 'connect') {
- init();
- } else {
- socket.emit('shell', c);
- }
- }, 20);
- } else {
- view('');
- }
+ if(view) view(m);
});
//setup handler for receiving the strict with all the expansion pins from the server
@@ -138,9 +166,9 @@ var init = function() {
}
);
- } catch(ex) {
- setTimeout(init, 100);
- }
+ //} catch(ex) {
+ // setTimeout(init, 100);
+ //}
};
// based loosely on http://stackoverflow.com/questions/950087/include-javascript-file-inside-javascript-file
@@ -158,4 +186,19 @@ var loadScripts = function() {
}
};
-loadScripts();
+var loadCss = function() {
+ var url = cssUrls.shift();
+ if(url) {
+ var head = document.getElementsByTagName('head')[0];
+ var link = document.createElement('link');
+ link.rel = 'stylesheet';
+ link.type = 'text/css';
+ link.href = url;
+ var linkObj = head.appendChild(link);
+ loadCss();
+ } else {
+ loadScripts();
+ }
+};
+
+loadCss();
View
21 bone101/index.html
@@ -7,7 +7,7 @@
<link rel="stylesheet" type="text/css" media="screen, projection, print" href="slidy.css" />
<script src="client.js" charset="utf-8" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" media="screen, projection, print" href="beagle.css" />
- <link rel="stylesheet" type="text/css" href="schmux.css" />
+ <script src="slidy.js" charset="utf-8" type="text/javascript"></script>
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
</head>
@@ -38,23 +38,26 @@
</div>
<div class="slide">
- <h1>Shell</h1>
+ <h1>In-browser shells</h1>
<h2>&nbsp;</h2>
- <textarea id="shell" name="shell" cols="80" rows="25" width="90%" height="80%"></textarea>
+ <!-- <div id="shell"></div> -->
+ <ul>
+ <li><a href="/shell.html">BeagleBone BASH shell</a></li>
+ <li><a href="/js_term.html">JavaScript terminal</a></li>
+ </ul>
</div>
-<div class="slide">
- <h1>Attached capes</h1>
+ <div class="slide">
+ <h1>Attached capes</h1>
+ <h2>Any attached capes with ID EEPROMs would be listed here</h2>
<div id="eeprom"></div>
<div class="capesvg"><div id="cape54"></div></div>
<div class="capesvg"><div id="cape55"></div></div>
<div class="capesvg"><div id="cape56"></div></div>
<div class="capesvg"><div id="cape57"></div></div>
-</div>
-
-<br clear="all"/>
+ </div>
-<div class="slide">
+ <div class="slide">
<h1>Pinmux</h1>
<center><table>
<thead>
View
2 bone101/jquery.mousewheel.js
@@ -0,0 +1,2 @@
+(function(c){function g(a){var b=a||window.event,i=[].slice.call(arguments,1),e=0,h=0,f=0;a=c.event.fix(b);a.type="mousewheel";if(b.wheelDelta)e=b.wheelDelta/120;if(b.detail)e=-b.detail/3;f=e;if(b.axis!==undefined&&b.axis===b.HORIZONTAL_AXIS){f=0;h=-1*e}if(b.wheelDeltaY!==undefined)f=b.wheelDeltaY/120;if(b.wheelDeltaX!==undefined)h=-1*b.wheelDeltaX/120;i.unshift(a,e,h,f);return(c.event.dispatch||c.event.handle).apply(this,i)}var d=["DOMMouseScroll","mousewheel"];if(c.event.fixHooks)for(var j=d.length;j;)c.event.fixHooks[d[--j]]=
+c.event.mouseHooks;c.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=d.length;a;)this.addEventListener(d[--a],g,false);else this.onmousewheel=g},teardown:function(){if(this.removeEventListener)for(var a=d.length;a;)this.removeEventListener(d[--a],g,false);else this.onmousewheel=null}};c.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);
View
78 bone101/jquery.terminal.js
@@ -0,0 +1,78 @@
+/*
+
+ | __ _____ ________ __
+ | / // _ /__ __ _____ ___ __ _/__ ___/__ ___ ______ __ __ __ ___ / /
+ | __ / // // // // // _ // _// // / / // _ // _// // // \/ // _ \/ /
+ | / / // // // // // ___// / / // / / // ___// / / / / // // /\ // // / /__
+ | \___//____ \\___//____//_/ _\_ / /_//____//_/ /_/ /_//_//_/ /_/ \__\_\___/
+ | \/ /____/ version 0.4.12
+ http://terminal.jcubic.pl
+
+ Licensed under GNU LGPL Version 3 license
+ Copyright (c) 2011 Jakub Jankiewicz <http://jcubic.pl>
+
+ Includes:
+
+ Storage plugin Distributed under the MIT License
+ Copyright (c) 2010 Dave Schindler
+
+ LiveQuery plugin Dual MIT and GPL
+ Copyright (c) 2008 Brandon Aaron (http://brandonaaron.net)
+
+ jQuery Timers licenced with the WTFPL
+ <http://jquery.offput.ca/every/>
+
+ Date: Wed, 04 Apr 2012 16:30:49 +0000
+*/
+Array.prototype.has=function(g){for(var z=this.length;z--;)if(this[z]==g)return true;return false};function get_stack(g){return g?[g.toString().match(/.*\n.*\n/)].concat(get_stack(g.caller)):[]}
+(function(g,z){function ea(a,d){var e;if(typeof a==="string"&&typeof d==="string"){localStorage[a]=d;return true}else if(typeof a==="object"&&typeof d==="undefined"){for(e in a)if(a.hasOwnProperty(e))localStorage[e]=a[e];return true}return false}function $(a,d){var e,i;e=new Date;e.setTime(e.getTime()+31536E6);e="; expires="+e.toGMTString();if(typeof a==="string"&&typeof d==="string"){document.cookie=a+"="+d+e+"; path=/";return true}else if(typeof a==="object"&&typeof d==="undefined"){for(i in a)if(a.hasOwnProperty(i))document.cookie=
+i+"="+a[i]+e+"; path=/";return true}return false}function fa(a){return localStorage[a]}function ga(a){var d,e,i;a+="=";d=document.cookie.split(";");for(e=0;e<d.length;e++){for(i=d[e];i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(a)===0)return i.substring(a.length,i.length)}return null}function ha(a){return delete localStorage[a]}function ia(a){return $(a,"",-1)}function X(a,d){var e=[],i=a.length;if(i<d)return[a];for(var h=0;h<i;h+=d)e.push(a.substring(h,h+d));return e}function F(a){if(typeof a==
+"string"){a=a.replace(/&(?!#[0-9]+;|[a-zA-Z]+;)/g,"&amp;");a=a.replace(/</g,"&lt;").replace(/>/g,"&gt;");a=a.replace(/\n/g,"<br/>");a=a.replace(/ /g,"&nbsp;");a=a.replace(/\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;");var d=a.split(ja);if(d.length>1)a=g.map(d,function(e){return e===""?e:e[0]=="["?e.replace(Y,function(i,h,t,v,C){if(C==="")return"<span>&nbsp;</span>";i="";if(h.indexOf("b")!=-1)i+="font-weight:bold;";var L="text-decoration:";if(h.indexOf("u")!=-1)L+="underline ";if(h.indexOf("s")!=-1)L+="line-through";
+if(h.indexOf("s")!=-1||h.indexOf("u")!=-1)i+=L+";";if(h.indexOf("i")!=-1)i+="font-style:italic; ";if(t.match(aa))i+="color:"+t+";";if(v.match(aa))i+="background-color:"+v;return a='<span style="'+i+'">'+C+"</span>"}):"<span>"+e+"</span>"}).join("");return a}else return""}function ba(a){var d=a instanceof Array?a:a?[a]:[],e=0;g.extend(this,{left:function(){if(e===0)e=d.length-1;else--e;return d[e]},right:function(){if(e==d.length-1)e=0;else++e;return d[e]},current:function(){return d[e]},data:function(){return d},
+length:function(){return d.length},reset:function(){e=0},append:function(i){d.push(i);this.reset()}})}function ka(a){var d=a?[a]:[];g.extend(this,{size:function(){return d.length},pop:function(){if(d.length===0)return null;else{var e=d[d.length-1];d=d.slice(0,d.length-1);return e}},push:function(e){d=d.concat([e]);return e},top:function(){return d.length>0?d[d.length-1]:null}})}function la(a){var d=true;if(typeof a==="string"&&a!=="")a+="_";var e=g.Storage.get(a+"commands"),i=new ba(e?eval("("+e+
+")"):[""]);g.extend(this,{append:function(h){if(d&&i.current()!=h){i.append(h);g.Storage.set(a+"commands",g.json_stringify(i.data()))}},data:function(){return i.data()},next:function(){return i.right()},last:function(){i.reset()},previous:function(){return i.left()},clear:function(){i=new ba;g.Storage.remove(a+"commands")},enable:function(){d=true},disable:function(){d=false}})}g.extend(g.fn,{livequery:function(a,d,e){var i=this,h;if(g.isFunction(a)){e=d;d=a;a=z}g.each(g.livequery.queries,function(t,
+v){if(i.selector==v.selector&&i.context==v.context&&a==v.type&&(!d||d.$lqguid==v.fn.$lqguid)&&(!e||e.$lqguid==v.fn2.$lqguid))return(h=v)&&false});h=h||new g.livequery(this.selector,this.context,a,d,e);h.stopped=false;h.run();return this},expire:function(a,d,e){var i=this;if(g.isFunction(a)){e=d;d=a;a=z}g.each(g.livequery.queries,function(h,t){if(i.selector==t.selector&&i.context==t.context&&(!a||a==t.type)&&(!d||d.$lqguid==t.fn.$lqguid)&&(!e||e.$lqguid==t.fn2.$lqguid)&&!this.stopped)g.livequery.stop(t.id)});
+return this}});g.livequery=function(a,d,e,i,h){this.selector=a;this.context=d||document;this.type=e;this.fn=i;this.fn2=h;this.elements=[];this.stopped=false;this.id=g.livequery.queries.push(this)-1;i.$lqguid=i.$lqguid||g.livequery.guid++;if(h)h.$lqguid=h.$lqguid||g.livequery.guid++;return this};g.livequery.prototype={stop:function(){var a=this;if(this.type)this.elements.unbind(this.type,this.fn);else this.fn2&&this.elements.each(function(d,e){a.fn2.apply(e)});this.elements=[];this.stopped=true},run:function(){if(!this.stopped){var a=
+this,d=this.elements,e=g(this.selector,this.context),i=e.not(d);this.elements=e;if(this.type){i.bind(this.type,this.fn);d.length>0&&g.each(d,function(h,t){g.inArray(t,e)<0&&g.event.remove(t,a.type,a.fn)})}else{i.each(function(){a.fn.apply(this)});this.fn2&&d.length>0&&g.each(d,function(h,t){g.inArray(t,e)<0&&a.fn2.apply(t)})}}}};g.extend(g.livequery,{guid:0,queries:[],queue:[],running:false,timeout:null,checkQueue:function(){if(g.livequery.running&&g.livequery.queue.length)for(var a=g.livequery.queue.length;a--;)g.livequery.queries[g.livequery.queue.shift()].run()},
+pause:function(){g.livequery.running=false},play:function(){g.livequery.running=true;g.livequery.run()},registerPlugin:function(){g.each(arguments,function(a,d){if(g.fn[d]){var e=g.fn[d];g.fn[d]=function(){var i=e.apply(this,arguments);g.livequery.run();return i}}})},run:function(a){if(a!=z)g.inArray(a,g.livequery.queue)<0&&g.livequery.queue.push(a);else g.each(g.livequery.queries,function(d){g.inArray(d,g.livequery.queue)<0&&g.livequery.queue.push(d)});g.livequery.timeout&&clearTimeout(g.livequery.timeout);
+g.livequery.timeout=setTimeout(g.livequery.checkQueue,20)},stop:function(a){a!=z?g.livequery.queries[a].stop():g.each(g.livequery.queries,function(d){g.livequery.queries[d].stop()})}});g.livequery.registerPlugin("append","prepend","after","before","wrap","attr","removeAttr","addClass","removeClass","toggleClass","empty","remove");g(function(){g.livequery.play()});var ma=g.prototype.init;g.prototype.init=function(a,d){var e=ma.apply(this,arguments);if(a&&a.selector){e.context=a.context;e.selector=
+a.selector}if(typeof a=="string"){e.context=d||document;e.selector=a}return e};g.prototype.init.prototype=g.prototype;var U=typeof window.localStorage!=="undefined";g.extend({Storage:{set:U?ea:$,get:U?fa:ga,remove:U?ha:ia}});jQuery.fn.extend({everyTime:function(a,d,e,i,h){return this.each(function(){jQuery.timer.add(this,a,d,e,i,h)})},oneTime:function(a,d,e){return this.each(function(){jQuery.timer.add(this,a,d,e,1)})},stopTime:function(a,d){return this.each(function(){jQuery.timer.remove(this,a,
+d)})}});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(a){if(a==z||a===null)return null;var d=this.regex.exec(jQuery.trim(a.toString()));return d[2]?parseInt(d[1],10)*(this.powers[d[2]]||1):a},add:function(a,d,e,i,h,t){var v=0;if(jQuery.isFunction(e)){h||(h=i);i=e;e=d}d=jQuery.timer.timeParse(d);if(!(typeof d!="number"||isNaN(d)||d<=0)){if(h&&h.constructor!=Number){t=!!h;h=0}h=h||0;t=t||false;if(!a.$timers)a.$timers=
+{};a.$timers[e]||(a.$timers[e]={});i.$timerID=i.$timerID||this.guid++;var C=function(){if(!(t&&this.inProgress)){this.inProgress=true;if(++v>h&&h!==0||i.call(a,v)===false)jQuery.timer.remove(a,e,i);this.inProgress=false}};C.$timerID=i.$timerID;a.$timers[e][i.$timerID]||(a.$timers[e][i.$timerID]=window.setInterval(C,d));this.global[e]||(this.global[e]=[]);this.global[e].push(a)}},remove:function(a,d,e){var i=a.$timers,h;if(i){if(d){if(i[d]){if(e){if(e.$timerID){window.clearInterval(i[d][e.$timerID]);
+delete i[d][e.$timerID]}}else for(e in i[d]){window.clearInterval(i[d][e]);delete i[d][e]}for(h in i[d])break;if(!h){h=null;delete i[d]}}}else for(d in i)this.remove(a,d,e);for(h in i)break;if(!h)a.$timers=null}}}});if(jQuery.browser.msie)jQuery(window).one("unload",function(){var a=jQuery.timer.global,d;for(d in a)for(var e=a[d],i=e.length;--i;)jQuery.timer.remove(e[i],d)});var ja=/(\[\[[bius]*;[^;]*;[^\]]*\][^\]\[]*\])/g,Y=/\[\[([bius]*);([^;]*);([^\]]*)\]([^\]\[]*)\]/g,aa=/#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})/;
+g.json_stringify=function(a,d){var e="",i;d=d===z?1:d;switch(typeof a){case "function":e+=a;break;case "boolean":e+=a?"true":"false";break;case "object":if(a===null)e+="null";else if(a instanceof Array){e+="[";var h=a.length;for(i=0;i<h-1;++i)e+=g.json_stringify(a[i],d+1);e+=g.json_stringify(a[h-1],d+1)+"]"}else{e+="{";for(h in a)if(a.hasOwnProperty(h))e+='"'+h+'":'+g.json_stringify(a[h],d+1);e+="}"}break;case "string":h=a;var t={"\\\\":"\\\\",'"':'\\"',"/":"\\/","\\n":"\\n","\\r":"\\r","\\t":"\\t"};
+for(i in t)if(t.hasOwnProperty(i))h=h.replace(RegExp(i,"g"),t[i]);e+='"'+h+'"';break;case "number":e+=String(a)}e+=d>1?",":"";if(d==1)e=e.replace(/,([\]}])/g,"$1");return e.replace(/([\[{]),/g,"$1")};g.fn.cmd=function(a){function d(){M.toggleClass("inverted")}function e(f){var q=f.substring(0,v-C-1);f=f.substring(v-C-1);return[q].concat(X(f,v))}function i(){t.focus();h.oneTime(1,function(){h.insert(t.val());t.blur().val("")})}var h=this;h.addClass("cmd");h.append('<span class="prompt"></span><span></span><span class="cursor">&nbsp;</span><span></span>');
+var t=g("<textarea/>").addClass("clipboard").appendTo(h);a.width&&h.width(a.width);var v,C,L=a.mask||false,m="",n=0,I,J=a.enabled,V,G,M=h.find(".cursor"),c=function(f){function q(r,u){if(u==r.length){D.html(F(r));M.html("&nbsp;");H.html("")}else if(u===0){D.html("");M.html(F(r.slice(0,1)));H.html(F(r.slice(1)))}else{var o=F(r.slice(0,u));D.html(o);o=r.slice(u,u+1);M.html(o==" "?"&nbsp;":F(o));u==r.lenght-1?H.html(""):H.html(F(r.slice(u+1)))}}function K(r){return"<div>"+F(r)+"</div>"}function Q(r){var u=
+H;g.each(r,function(o,y){u=g(K(y)).insertAfter(u).addClass("clear")})}function l(r){g.each(r,function(u,o){D.before(K(o))})}var D=M.prev(),H=M.next();return function(){var r=L?m.replace(/./g,"*"):m,u;f.find("div").remove();D.html("");if(r.length>v-C-1||r.match(/\n/)){var o,y=r.match(/\t/g),p=y?y.length*3:0;if(y)r=r.replace(/\t/g,"\u0000\u0000\u0000\u0000");if(r.match(/\n/)){var b=r.split("\n"),j=v-C-1;for(u=0;u<b.length-1;++u)b[u]+=" ";if(b[0].length>j){o=[b[0].substring(0,j)];o=o.concat(X(b[0].substring(j),
+v))}else o=[b[0]];for(u=1;u<b.length;++u)if(b[u].length>v)o=o.concat(X(b[u],v));else o.push(b[u])}else o=e(r);if(y)o=g.map(o,function(k){return k.replace(/\x00\x00\x00\x00/g,"\t")});j=o[0].length;if(n<j){q(o[0],n);Q(o.slice(1))}else if(n==j){D.before(K(o[0]));q(o[1],0);Q(o.slice(2))}else{u=o.length;if(n<j){q(o[0],n);Q(o.slice(1))}else if(n==j){D.before(K(o[0]));q(o[1],0);Q(o.slice(2))}else{y=o.slice(-1)[0];b=r.length-n;r=0;if(b<=y.length){l(o.slice(0,-1));r=y.length==b?0:y.length-b;q(y,r+p)}else if(u==
+3){D.before("<div>"+F(o[0])+"</div>");q(o[1],n-j-1);H.after('<div class="clear">'+F(o[2])+"</div>")}else{r=n;for(u=0;u<o.length;++u)if(r>o[u].length)r-=o[u].length;else break;p=o[u];j=u;if(r==p.length){r=0;p=o[++j]}q(p,r);l(o.slice(0,j));Q(o.slice(j+1))}}}}else if(r===""){D.html("");M.html("&nbsp;");H.html("")}else q(r,n)}}(h),N=function(){var f=h.find(".prompt");return function(){if(typeof I=="string"){C=I.replace(Y,"$4").length;f.html(F(I)+"&nbsp;")}else I(function(q){C=q.replace(Y,"$4").length;
+f.html(F(q)+"&nbsp;")})}}();g.extend(h,{name:function(f){if(f!==z){V=f;G=new la(f)}else return V},history:function(){return G},set:function(f,q){if(f!==z){m=f;if(!q)n=m.length;c();if(typeof a.onCommandChange=="function")a.onCommandChange(m)}},insert:function(f,q){if(n==m.length)m+=f;else m=n===0?f+m:m.slice(0,n)+f+m.slice(n);q||(n+=f.length);c();if(typeof a.onCommandChange=="function")a.onCommandChange(m)},get:function(){return m},commands:function(f){if(f)a.commands=f;else return f},destroy:function(){g(document.documentElement).unbind(".commandline");
+h.find(".prompt").remove()},prompt:function(f){if(f===z)return I;else{if(typeof f=="string"||typeof f=="function")I=f;else throw"prompt must be a function or string";N();c()}},position:function(f){if(typeof f=="number"){n=f<0?0:f>m.length?m.length:f;c()}else return n},show:function(){var f=h.show;return function(){f.apply(h,[]);c();N()}}(),resize:function(f){if(f)v=f;else{f=h.width();var q=M.innerWidth();v=Math.floor(f/q)}c()},enable:function(){if(!J){h.everyTime(500,"blink",d);J=true}},isenabled:function(){return J},
+disable:function(){if(J){h.stopTime("blink",d);h.find(".cursor").removeClass("inverted");J=false}},mask:function(f){if(typeof f=="boolean"){L=f;c()}else return L}});h.name(a.name||"");I=a.prompt||">";N();if(a.enabled===z||a.enabled===true)h.enable();g(g.browser.msie?document.documentElement:window).keypress(function(f){var q;if(f.ctrlKey&&f.which==99)return true;if(a.keypress)q=a.keypress(f);if(q===z||q){if(J)if([38,32,13,0,8].has(f.which)&&f.keyCode!=123&&!(f.which==38&&f.shiftKey))return false;
+else if(!f.ctrlKey&&!(f.altKey&&f.which==100)){h.insert(String.fromCharCode(f.which));return false}else f.altKey&&h.insert(String.fromCharCode(f.which))}else return q}).keydown(function(f){if(J){if(a.keydown&&a.keydown(f)===false)return false;var q;if(f.altKey){if(f.which==68){h.set(m.slice(0,n)+m.slice(n).replace(/[^ ]+ |[^ ]+$/,""),true);return false}return true}else if(f.keyCode==13){if(G&&m&&(a.historyFilter&&a.historyFilter(m)||!a.historyFilter))G.append(m);G.last();f=m;h.set("");a.commands&&
+a.commands(f);typeof I=="function"&&N()}else if(f.which==32)h.insert(" ");else if(f.which==8){if(m!==""&&n>0){m=m.slice(0,n-1)+m.slice(n,m.length);--n;c()}}else if(f.which==9&&!(f.ctrlKey||f.altKey))h.insert("\t");else if(f.which==46){if(m!==""&&n<m.length){m=m.slice(0,n)+m.slice(n+1,m.length);c()}return true}else if(G&&f.which==38||f.which==80&&f.ctrlKey)h.set(G.previous());else if(G&&f.which==40||f.which==78&&f.ctrlKey)h.set(G.next());else if(f.which==37||f.which==66&&f.ctrlKey)if(f.ctrlKey&&f.which!=
+66){q=n-1;f=0;for(m[q]==" "&&--q;q>0;--q)if(m[q]==" "&&m[q+1]!=" "){f=q+1;break}else if(m[q]=="\n"&&m[q+1]!="\n"){f=q;break}h.position(f)}else{if(n>0){--n;c()}}else if(f.which==39||f.which==70&&f.ctrlKey)if(f.ctrlKey&&f.which!=70){m[n]==" "&&++n;f=m.slice(n).match(/\S[\n\s]{2,}|[\n\s]+\S?/);if(!f||f[0].match(/^\s+$/))n=m.length;else if(f[0][0]!=" ")n+=f.index+1;else{n+=f.index+f[0].length-1;f[0][f[0].length-1]!=" "&&--n}c()}else{if(n<m.length){++n;c()}}else if(f.which==123)return true;else if(f.which==
+36)h.position(0);else if(f.which==35)h.position(m.length);else if(f.ctrlKey||f.metaKey)if(f.shiftKey){if(f.which==84)return true}else if(f.which==65)h.position(0);else if(f.which==69)h.position(m.length);else if(f.which==88||f.which==67||f.which==87||f.which==84)return true;else if(f.which==86){i();return true}else if(f.which==75)if(n===0)h.set("");else n!=m.length&&h.set(m.slice(0,n));else if(f.which==85){h.set(m.slice(n,m.length));h.position(0)}else{if(f.which==17)return true}else return true;return false}});
+return h};g.jrpc=function(a,d,e,i,h,t){d=g.json_stringify({jsonrpc:"2.0",method:e,params:i,id:d});return g.ajax({url:a,data:d,success:h,error:t,contentType:"application/json",dataType:"json",async:true,cache:false,type:"POST"})};U=/ {14}$/;var na=[["jQuery Terminal","(c) 2011 jcubic"],["JQuery Terminal Emulator v. 0.4.12","Copyright (c) 2011 Jakub Jankiewicz <http://jcubic.pl>".replace(/ *<.*>/,"")],["JQuery Terminal Emulator version version 0.4.12","Copyright (c) 2011 Jakub Jankiewicz <http://jcubic.pl>"],
+[" _______ ________ __"," / / _ /_ ____________ _/__ ___/______________ _____ / /"," __ / / // / // / _ / _/ // / / / _ / _/ / / \\/ / _ \\/ /","/ / / // / // / ___/ // // / / / ___/ // / / / / /\\ / // / /__","\\___/____ \\\\__/____/_/ \\__ / /_/____/_//_/ /_/ /_/ \\/\\__\\_\\___/"," \\/ /____/ ".replace(U,"")+"version 0.4.12","Copyright (c) 2011 Jakub Jankiewicz <http://jcubic.pl>"],
+[" __ _____ ________ __"," / // _ /__ __ _____ ___ __ _/__ ___/__ ___ ______ __ __ __ ___ / /"," __ / // // // // // _ // _// // / / // _ // _// // // \\/ // _ \\/ /","/ / // // // // // ___// / / // / / // ___// / / / / // // /\\ // // / /__","\\___//____ \\\\___//____//_/ _\\_ / /_//____//_/ /_/ /_//_//_/ /_/ \\__\\_\\___/"," \\/ /____/ ".replace(U,"")+"version 0.4.12",
+"Copyright (c) 2011 Jakub Jankiewicz <http://jcubic.pl>"]],oa=[],O=new function(a){var d=a?[a]:[],e=0;g.extend(this,{rotate:function(){if(d.length==1)return d[0];else{if(e==d.length-1)e=0;else++e;return d[e]}},length:function(){return d.length},set:function(i){for(var h=d.length;h--;)if(d[h]===i){e=h;return}this.append(i)},front:function(){return d[e]},append:function(i){d.push(i)}})};g.fn.terminal=function(a,d){function e(){return c.get(0).scrollHeight>c.innerHeight()}function i(){var b=c.find(".cursor").width(),
+j=Math.floor(c.width()/b);if(e()){var k=c.innerWidth()-c.width();j-=Math.ceil((20-k/2)/(b-1))}return j}function h(b,j){c.error("&#91;"+j+"&#93;: "+(typeof b=="string"?b:b.fileName+": "+b.message));c.pause();typeof b.fileName=="string"&&g.get(b.fileName,function(k){c.resume();var w=b.lineNumber-1;(k=k.split("\n")[w])&&c.error("&#91;"+b.lineNumber+"&#93;: "+k)})}function t(b,j){try{if(typeof j=="function")j(function(){});else if(typeof j!="string")throw b+" must be string or function";}catch(k){h(k,
+b.toUpperCase());return false}return true}function v(){var b=c.prop?c.prop("scrollHeight"):c.attr("scrollHeight");c.scrollTop(b)}function C(b){b=typeof b=="string"?b:String(b);var j,k,w;if(b.length>K){j=K;k=b.split(/\n/g);w=/(\[\[[bius]*;[^;]*;[^\]]*\][^\]\[]*\]?)/g;var s=/(\[\[[bius]*;[^;]*;[^\]]*\])/,A=/\[\[[bius]*;?[^;]*;?[^\]]*\]?$/,x=false,E=false,B="";b=[];for(var T=0,pa=k.length;T<pa;++T){if(B!=="")if(k[T]===""){b.push(B+"]");continue}else{k[T]=B+k[T];B=""}else if(k[T]===""){b.push("");continue}for(var W=
+k[T],ca=0,Z=0,R=0,da=W.length;R<da;++R){if(W[R]=="["&&W[R+1]=="[")x=true;else if(x&&W[R]=="]")if(E)E=x=false;else E=true;else if(x&&E||!x)++Z;if(Z==j||R==da-1){var P=W.substring(ca,R+1);if(B){P=B+P;if(P.match("]"))B=""}ca=R+1;Z=0;var S=P.match(w);if(S){S=S[S.length-1];if(S[S.length-1]!="]"){B=S.match(s)[1];P+="]"}else if(P.match(A)){P=P.replace(A,"");B=S.match(s)[1]}}b.push(P)}}}j=g("<div></div>");k=0;for(w=b.length;k<w;++k)b[k]===""||b[k]=="\r"?j.append("<div>&nbsp;</div>"):g("<div/>").html(F(b[k])).appendTo(j)}else j=
+g("<div/>").html(F(b));f.append(j);j.width("100%");v();return j}function L(b,j){var k=1,w=function(s,A){j.pause();g.jrpc(b,k++,s,A,function(x){if(x.error)j.error("&#91;RPC&#93; "+x.error.message);else if(typeof x.result=="string")j.echo(x.result);else if(x.result instanceof Array)j.echo(x.result.join(" "));else if(typeof x.result=="object"){var E="",B;for(B in x.result)if(x.result.hasOwnProperty(B))E+=B+": "+x.result[B]+"\n";j.echo(E)}j.resume()},function(x,E){j.error("&#91;AJAX&#93; "+E+" - Server reponse is: \n"+
+x.responseText);j.resume()})};return function(s,A){if(s!==""){var x,E;if(s.match(/[^ ]* /)){s=s.split(/ +/);x=s[0];E=s.slice(1)}else{x=s;E=[]}if(!l.login||x=="help")w(x,E);else{var B=A.token();B?w(x,[B].concat(E)):A.error("&#91;AUTH&#93; Access denied (no token)")}}}}function m(b){var j=p.prompt();if(p.mask())b=b.replace(/./g,"*");typeof j=="function"?j(function(k){c.echo(k+" "+b)}):c.echo(j+" "+b)}function n(b){try{var j=y.top();if(b=="exit"&&l.exit)if(y.size()==1)l.login?J():c.echo("You can exit from main interpeter");
+else c.pop("exit");else{m(b);b=="clear"&&l.clear?c.clear():j.eval(b,c)}}catch(k){h(k,"USER");c.resume();throw k;}}function I(){var b=null;p.prompt("login:");l.history&&p.history().disable();p.commands(function(j){try{m(j);if(b){p.mask(false);c.pause();if(typeof l.login!="function")throw"Value of login property must be a function";l.login(b,j,function(w){if(w){var s=l.name;s=s?"_"+s:"";g.Storage.set("token"+s,w);g.Storage.set("login"+s,b);p.commands(n);G()}else{c.error("Wrong password try again");
+p.prompt("login:");b=null}c.resume();l.history&&p.history().enable()})}else{b=j;p.prompt("password:");p.mask(true)}}catch(k){h(k,"LOGIN",c);throw k;}})}function J(){var b=l.name;b=b?"_"+b:"";g.Storage.remove("token"+b,null);g.Storage.remove("login"+b,null);l.history&&p.history().disable();I()}function V(){var b=y.top(),j="";if(b.name!==z&&b.name!=="")j+=b.name+"_";j+=q;p.name(j);p.prompt(b.prompt);l.history&&p.history().enable();p.set("");if(typeof b.onStart=="function")b.onStart(c)}function G(){V();
+if(d.greetings===z)c.echo(c.signature);else d.greetings&&c.echo(d.greetings);if(typeof l.onInit=="function")l.onInit(c)}function M(b){c.oneTime(5,function(){if(r!=e()){c.resize();r=e()}});if(!c.paused()){if(l.keydown&&l.keydown(b,c)===false)return false;if(b.which!=9)H=0;if(b.which==68&&b.ctrlKey){if(l.exit)if(p.get()==="")if(y.size()>1||l.login!==z)c.pop("");else{c.resume();c.echo("")}else c.set_command("");b.preventDefault()}else if(l.tabcompletion&&b.which==9){++H;b=p.get();if(!b.match(" ")){for(var j=
+RegExp("^"+b),k=y.top().command_list,w=[],s=k.length;s--;)j.test(k[s])&&w.push(k[s]);if(w.length==1)c.set_command(w[0]);else if(w.length>1)if(H>=2){m(b);c.echo(w.join("\t"));H=0}}return false}else if(b.which==86&&b.ctrlKey){c.oneTime(1,function(){v()});return true}else if(b.which==9&&b.ctrlKey){O.length()>1&&c.focus(false);b.preventDefault()}else if(b.which==34)c.scroll(c.height());else b.which==33?c.scroll(-c.height()):c.attr({scrollTop:c.attr("scrollHeight")})}}var c=this,N=[],f,q=O.length(),K,
+Q=[],l={name:"",prompt:">",history:true,exit:true,clear:true,enabled:true,login:null,tabcompletion:false,onInit:null,onExit:null,keypress:null,keydown:null};if(d){d.width&&c.width(d.width);d.height&&c.height(d.height);g.extend(l,d)}var D=!l.enabled;if(c.length===0)throw'Sorry, but terminal said that "'+c.selector+'" is not valid selector!';c.ajaxSend(function(b,j){oa.push(j)});if(c.data("terminal"))return c.data("terminal");f=g("<div>").addClass("terminal-output").appendTo(c);c.addClass("terminal").append("<div/>");
+g.extend(c,{clear:function(){f.html("");p.set("");N=[];c.attr({scrollTop:0});return c},paused:function(){return D},pause:function(){if(p){c.disable();p.hide()}return c},resume:function(){if(p){c.enable();p.show();v()}return c},cols:function(){return K},rows:function(){return N.length},history:function(){return p.history()},next:function(){if(O.length()==1)return c;else{var b=c.offset().top;c.height();c.scrollTop();var j=c,k=g(window).scrollTop(),w=k+g(window).height(),s=g(j).offset().top;if(s+g(j).height()>=
+k&&s<=w){O.front().disable();b=O.rotate().enable();j=b.offset().top-50;g("html,body").animate({scrollTop:j},500);return b}else{c.enable();g("html,body").animate({scrollTop:b-50},500);return c}}},focus:function(b){c.oneTime(1,function(){if(O.length()==1)b===false?c.disable():c.enable();else if(b===false)c.next();else{O.front().disable();O.set(c);c.enable()}});return c},enable:function(){K===z&&c.resize();if(D)if(p){p.enable();D=false}return c},disable:function(){if(p){D=true;p.disable()}return c},
+enabled:function(){return D},signature:function(){var b=c.cols();b=b<15?null:b<35?0:b<55?1:b<64?2:b<75?3:4;return b!==null?na[b].join("\n")+"\n":""},version:function(){return"0.4.12"},get_command:function(){return p.get()},insert:function(b){p.insert(b);return c},set_prompt:function(b){t("prompt",b)&&p.prompt(b);return c},get_prompt:function(){return p.prompt()},set_command:function(b){p.set(b);return c},set_mask:function(b){p.mask(b);return c},get_output:function(){return g.map(N,function(b,j){return typeof j==
+"function"?j():j}).get().join("\n")},resize:function(b,j){if(b&&j){c.width(b);c.height(j)}K=i();p.resize(K);var k=f.detach();f.html("");g.each(N,function(w,s){C(typeof s=="function"?s():s)});c.prepend(k);v();return c},echo:function(b){N.push(b);return C(typeof b=="function"?b():b)},error:function(b){c.echo("[[;#f00;]"+b.replace(/\[/g,"&#91;").replace(/\]/g,"&#93;")+"]")},scroll:function(b){var j;if(c.prop){b>c.prop("scrollTop")&&b>0&&c.prop("scrollTop",0);j=c.prop("scrollTop");c.prop("scrollTop",
+j+b)}else{b>c.attr("scrollTop")&&b>0&&c.attr("scrollTop",0);j=c.attr("scrollTop");c.attr("scrollTop",j+b)}return c},logout:l.login?function(){for(;y.size()>1;)y.pop();J();return c}:function(){throw"You don't have login function";},token:l.login?function(){var b=l.name;return g.Storage.get("token"+(b?"_"+b:""))}:null,login_name:l.login?function(){var b=l.name;return g.Storage.get("login"+(b?"_"+b:""))}:null,name:function(){return l.name},push:function(b,j){if(!j.prompt||t("prompt",j.prompt)){if(typeof b==
+"string")b=L(j.eval,c);y.push(g.extend({eval:b},j));V()}return c},pop:function(b){b!==z&&m(b);if(y.top().name===l.name){if(l.login){J();if(typeof l.onExit=="function")l.onExit(c)}}else{b=y.pop();V();if(typeof b.onExit=="function")b.onExit(c)}return c}});var H=0,r=e(),u;if(l.login&&typeof l.onBeforeLogin=="function")l.onBeforeLogin(c);if(a.constructor==String){u=a;a=L(a,c)}else if(a.constructor==Array)throw"You can't use array as eval";else if(typeof a=="object"){for(var o in a)Q.push(o);a=function b(j){return function(k){if(k!==
+""){k=k.split(/ +/);var w=k[0],s=k.slice(1);k=j[w];var A=typeof k;if(A=="function")k.apply(c,s);else if(A=="object"||A=="string"){s=[];if(A=="object"){for(var x in k)s.push(x);k=b(k)}c.push(k,{prompt:w+">",name:w,command_list:s})}else c.error("Command '"+w+"' Not Found")}}}(a)}else if(typeof a!="function")throw'Unknow object "'+String(a)+'" passed as eval';if(u&&(typeof l.login=="string"||l.login))l.login=function(b){var j=1;return function(k,w,s){c.pause();g.jrpc(u,j++,b,[k,w],function(A){c.resume();
+!A.error&&A.result?s(A.result):s(null)},function(A,x){c.resume();c.error("&#91;AJAX&#92; Response: "+x+"\n"+A.responseText)})}}(typeof l.login=="boolean"?"login":l.login);if(t("prompt",l.prompt)){var y=new ka({name:l.name,eval:a,prompt:l.prompt,command_list:Q,greetings:l.greetings}),p=c.find(".terminal-output").next().cmd({prompt:l.prompt,history:l.history,width:"100%",keydown:M,keypress:l.keypress?function(b){return l.keypress(b,c)}:null,onCommandChange:function(b){if(typeof l.onCommandChange=="function")l.onCommandChange(b,
+c);v()},commands:n});c.livequery(function(){c.resize()});O.append(c);l.enabled===true?c.focus():c.disable();g(window).resize(c.resize);c.click(function(){c.focus()});c.token&&!c.token()&&c.login_name&&!c.login_name()?I():G();typeof g.fn.init.prototype.mousewheel==="function"&&c.mousewheel(function(b,j){j>0?c.scroll(-40):c.scroll(40);return false},true)}c.data("terminal",c);return c}})(jQuery);
View
17 bone101/js_term.html
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
+<head>
+ <title>BeagleBone BASH shell</title>
+ <script src="client.js" charset="utf-8" type="text/javascript"></script>
+ <link rel="icon" href="favicon.ico" type="image/x-icon" />
+ <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
+<body>
+ <div class="slide">
+ <h1>JavaScript terminal</h1>
+ <h2>&nbsp;</h2>
+ <div id="js_term"></div>
+ </div>
+</body>
+</html>
View
17 bone101/shell.html
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
+<head>
+ <title>BeagleBone BASH shell</title>
+ <script src="client.js" charset="utf-8" type="text/javascript"></script>
+ <link rel="icon" href="favicon.ico" type="image/x-icon" />
+ <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
+<body>
+ <div class="slide">
+ <h1>BeagleBone BASH shell</h1>
+ <h2>&nbsp;</h2>
+ <div id="shell"></div>
+ </div>
+</body>
+</html>
View
4 bonescript/index.js
@@ -297,6 +297,10 @@ var spawn = function(socket) {
socket.emit('shell', send('\nexited\n'));
c = undefined;
});
+ socket.on('disconnect', function () {
+ console.log('Killing bash');
+ c.kill('SIGHUP');
+ });
} catch(ex) {
c = undefined;
send('Error invoking bash');

0 comments on commit ce985d2

Please sign in to comment.
Something went wrong with that request. Please try again.