2013-01-20 18:55:00 -05:00
< html >
< head >
< script >
/*! jQuery v1.7.1 jquery.com | jquery.org/license */
(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("< "+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"<!doctype html> ":"")+"< html > < body > "),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType)); var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g< i ; g + + ) { if ( g = ==1)for(h in a . converters ) typeof h = ="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if ( l ! = = " * " & & l ! = = k ) { m = l+" " + k , n = e[m]||e["* " + k ] ; if ( ! n ) { p = b;for(o in e ) { j = o.split(" " ) ; if ( j [ 0 ] = = = l | | j [ 0 ] = = = " * " ) { p = e[j[1]+" " + k ] ; if ( p ) { o = e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from " + m . replace ( " " , " to " ) ) , n ! = = ! 0 & & ( c = n?n(c):p(o(c)))}}return c } function cb ( a , c , d ) { var e = a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g ) i in d & & ( c [ g [ i ] ] = d [ i ] ) ; while ( f [ 0 ] = = = " * " ) f . shift ( ) , h = ==b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e ) if ( e [ i ] & & e [ i ] . test ( h ) ) { f . unshift ( i ) ; break } if ( f [ 0 ] in d ) j = f[0];else{for(i in d ) { if ( ! f [ 0 ] | | a . converters [ i + " " + f [ 0 ] ] ) { j = i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d [ j ] } } function ca ( a , b , c , d ) { if ( f . isArray ( b ) ) f . each ( b , function ( b , e ) { c | | bE . test ( a ) ? d ( a , e ) :ca ( a + " [ " + ( typeof e = ="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if ( ! c & & b ! = null & & typeof b = ="object")for(var e in b ) ca ( a + " [ " + e + " ] " , b [ e ] , c , d ) ; else d ( a , b ) } function b_ ( a , c ) { var d , e , g = f.ajaxSettings.flatOptions||{};for(d in c ) c [ d ] ! = = b & & ( ( g [ d ] ? a:e | | ( e = {}))[d]=c[d]);e&&f.extend(!0,a,e)}function b $ ( a , c , d , e , f , g ) { f = f||c.dataTypes[0],g=g||{},g[f]=!0;var h = a[f],i=0,j=h?h.length:0,k=a===bT,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l = ="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=b$(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=b$(a,c,d,e,"*",g));return l } function bZ ( a ) { return function ( b , c ) { typeof b ! = " string " & & ( c = b,b="*");if(f.isFunction(c)){var d = b.toLowerCase().split(bP),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bC ( a , b , c ) { var d = b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bx:by,g=0,h=e.length;if(d > 0){if(c!=="border")for(;g< h ; g + + ) c | | ( d- = parseFloat(f.css(a,"padding"+e[g]))||0),c==="margin"?d+=parseFloat(f.css(a,c+e[g]))||0:d-=parseFloat(f.css(a,"border"+e[g]+"Width"))||0;return d + " px " } d = bz(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0;if(c)for(;g<h;g++)d+=parseFloat(f.css(a,"padding"+e[g]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+e[g]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+e[g]))||0);return d + " px " } function bp ( a , b ) { b . src ? f . ajax ( { url:b . src , async: ! 1 , dataType: " script " } ) :f . globalEval ( ( b . text | | b . textContent | | b . innerHTML | | " " ) . replace ( bf , " / * $ 0 * / " ) ) , b . parentNode & & b . parentNode . removeChild ( b ) } function bo ( a ) { var b = c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b . firstChild } function bn ( a ) { var b = (a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a . getElementsByTagName ! = " undefined " & & f . grep ( a . getElementsByTagName ( " input " ) , bm ) } function bm ( a ) { if ( a . type = =="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl ( a ) { return typeof a . getElementsByTagName ! = " undefined " ? a . getElementsByTagName ( " * " ) :typeof a . querySelectorAll ! = " undefined " ? a . querySelectorAll ( " * " ) : [ ] } function bk ( a , b ) { var c ; if ( b . nodeType = ==1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.ou
f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler& & (p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"& & (!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k< c.length ; k + + ) { l = A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g = f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" " ) ; for ( h = 0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o ) f . event . remove ( a , j + b [ h ] , c , d , ! 0 ) ; continue } p = f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp ( " ( ^ | \ \ . ) " + l . split ( " . " ) . sort ( ) . join ( " \ \ . ( ? : . * \ \ . ) ? " ) + " ( \ \ . | $ ) " ) :null ; for ( n = 0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o [ j ] ) } f . isEmptyObject ( o ) & & ( q = g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h = c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!") > =0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort()); if((!e||f.event.customEvent[h])&&!f.event.global[h])return; c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")< 0 ? " on " + h: " " ; if ( ! e ) { j = f.cache;for(l in j ) j [ l ] . events & & j [ l ] . events [ h ] & & f . event . trigger ( c , d , j [ l ] . handle . elem , ! 0 ) ; return } c . result = b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c . result } } , dispatch:function ( c ) { c = f.event.fix(c||a.event);var d = (f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=[],j,k,l,m,n,o,p,q,r,s,t;g[0]=c,c.delegateTarget=this;if(e&&!c.target.disabled&&(!c.button||c.type!=="click")){m=f(this),m.context=this.ownerDocument||this;for(l=c.target;l!=this;l=l.parentNode||this){o={},q=[],m[0]=l;for(j=0;j<e;j++)r=d[j],s=r.selector,o[s]===b&&(o[s]=r.quick?H(l,r.quick):m.is(s)),o[s]&&q.push(r);q.length&&i.push({elem:l,matches:q})}}d.length > e&&i.push({elem:this,matches:d.slice(e)}); for(j=0;j< i.length & & ! c . isPropagationStopped ( ) ; j + + ) { p = i[j],c.currentTarget=p.
{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*")); while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null; if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>"); try{for(var c=0,d=this.length;c< d ; c + + ) this [ c ] . nodeType = ==1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f . isFunction ( a ) ? this . each ( function ( b ) { var c = f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this } , replaceWith:function ( a ) { if ( this [ 0 ] & & this [ 0 ] . parentNode ) { if ( f . isFunction ( a ) ) return this . each ( function ( b ) { var c = f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a ! = " string " & & ( a = f(a).detach());return this . each ( function ( ) { var b = this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this . length ? this . pushStack ( f ( f . isFunction ( a ) ? a ( ) :a ) , " replaceWith " , a ) :this } , detach:function ( a ) { return this . remove ( a , ! 0 ) } , domManip:function ( a , c , d ) { var e , g , h , i , j = a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j = ="string"&&bd.test(j))return this . each ( function ( ) { f ( this ) . domManip ( a , c , d , ! 0 ) } ) ; if ( f . isFunction ( j ) ) return this . each ( function ( e ) { var g = f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l = 0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m > 1& & l< n ? f . clone ( h , ! 0 , ! 0 ) :h ) } k . length & & f . each ( k , bp ) } return this } } ) , f . buildFragment = function(a,b,d){var e , g , h , i , j = a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j = ="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d = [],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this } for ( var h = 0,i=e.length;h<i;h++){var j = (h > 0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("< "+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h); for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h); if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c); var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+=""); if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"< $1>< /$2>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[]; for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")& & !q[i].childNodes.length& & q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace& & X.test(k)& & o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]& & typeof (r=k.leng
< / script >
< script >
(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);
< / script >
< script >
/*
| __ _____ ________ __
| / // _ /__ __ _____ ___ __ _/__ ___/__ ___ ______ __ __ __ ___ / /
| __ / // // // // // _ // _// // / / // _ // _// // // \/ // _ \/ /
| / / // // // // // ___// / / // / / // ___// / / / / // // /\ // // / /__
| \___//____ \\___//____//_/ _\_ / /_//____//_/ /_/ /_//_//_/ /_/ \__\_\___/
| \/ /____/ version 0.4.22
http://terminal.jcubic.pl
Licensed under GNU LGPL Version 3 license
Copyright (c) 2011-2012 Jakub Jankiewicz < http: / / jcubic . pl >
Includes:
Storage plugin Distributed under the MIT License
Copyright (c) 2010 Dave Schindler
jQuery Timers licenced with the WTFPL
< http: / / jquery . offput . ca / every / >
Cross-Browser Split 1.1.1
Copyright 2007-2012 Steven Levithan < stevenlevithan.com >
Available under the MIT License
Date: Thu, 15 Nov 2012 07:12:21 +0000
*/
(function(k,H){function aa(c,g){var e;if(typeof c==="string"& & typeof g==="string"){localStorage[c]=g;return true}else if(typeof c==="object"& & typeof g==="undefined"){for(e in c)if(c.hasOwnProperty(e))localStorage[e]=c[e];return true}return false}function W(c,g){var e,h;e=new Date;e.setTime(e.getTime()+31536E6);e="; expires="+e.toGMTString();if(typeof c==="string"& & typeof g==="string"){document.cookie=c+"="+g+e+"; path=/";return true}else if(typeof c==="object"& & typeof g==="undefined"){for(h in c)if(c.hasOwnProperty(h))document.cookie=
h+"="+c[h]+e+"; path=/";return true}return false}function ba(c){return localStorage[c]}function ca(c){var g,e,h;c+="=";g=document.cookie.split(";");for(e=0;e< g.length ; e + + ) { for ( h = g[e];h.charAt(0)===" " ; ) h = h.substring(1,h.length);if(h.indexOf(c)===0)return h . substring ( c . length , h . length ) } return null } function da ( c ) { return delete localStorage [ c ] } function ea ( c ) { return W ( c , " " , -1 ) } function U ( c , g ) { var e = [],h=c.length;if(h<g)return[c];for(var i = 0;i<h;i+=g)e.push(c.substring(i,i+g));return e } function X ( c ) { return k ( " < div > "+
k.terminal.strip(c)+"< / div > ").text().length}function Y(c){var g=c instanceof Array?c:c?[c]:[],e=0;k.extend(this,{left:function(){if(e===0)e=g.length-1;else--e;return g[e]},right:function(){if(e===g.length-1)e=0;else++e;return g[e]},current:function(){return g[e]},data:function(){return g},length:function(){return g.length},reset:function(){e=0},append:function(h){g.push(h);this.reset()}})}function fa(c){var g=c?[c]:[];k.extend(this,{size:function(){return g.length},pop:function(){if(g.length===0)return null;
else{var e=g[g.length-1];g=g.slice(0,g.length-1);return e}},push:function(e){g=g.concat([e]);return e},top:function(){return g.length>0?g[g.length-1]:null}})}function ga(c){var g=true;if(typeof c==="string"&&c!=="")c+="_"; var e=k.Storage.get(c+"commands"),h=new Y(e?eval("("+e+")"):[""]);k.extend(this,{append:function(i){if(g){h.append(i);k.Storage.set(c+"commands",k.json_stringify(h.data()))}},data:function(){return h.data()},next:function(){return h.right()},last:function(){h.reset()},previous:function(){return h.left()},
clear:function(){h=new Y;k.Storage.remove(c+"commands")},enable:function(){g=true},disable:function(){g=false}})}k.omap=function(c,g){var e={};k.each(c,function(h,i){e[h]=g.call(c,h,i)});return e};var R=typeof window.localStorage!=="undefined";k.extend({Storage:{set:R?aa:W,get:R?ba:ca,remove:R?da:ea}});jQuery.fn.extend({everyTime:function(c,g,e,h,i){return this.each(function(){jQuery.timer.add(this,c,g,e,h,i)})},oneTime:function(c,g,e){return this.each(function(){jQuery.timer.add(this,c,g,e,1)})},
stopTime:function(c,g){return this.each(function(){jQuery.timer.remove(this,c,g)})}});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(c){if(c===H||c===null)return null;var g=this.regex.exec(jQuery.trim(c.toString()));return g[2]?parseInt(g[1],10)*(this.powers[g[2]]||1):c},add:function(c,g,e,h,i,o){var t=0;if(jQuery.isFunction(e)){i||(i=h);h=e;e=g}g=jQuery.timer.timeParse(g);if(!(typeof g!=="number"||isNaN(g)||
g< =0)){if(i&&i.constructor!==Number){o=!!i; i=0}i=i||0;o=o||false;if(!c.$timers)c.$timers={};c.$timers[e]||(c.$timers[e]={});h.$timerID=h.$timerID||this.guid++;var m=function(){if(!(o&&m.inProgress)){m.inProgress=true; if(++t>i&&i!==0||h.call(c,t)===false)jQuery.timer.remove(c,e,h); m.inProgress=false}};m.$timerID=h.$timerID;c.$timers[e][h.$timerID]||(c.$timers[e][h.$timerID]=window.setInterval(m,g));this.global[e]||(this.global[e]=[]);this.global[e].push(c)}},remove:function(c,g,e){var h=c.$timers,
i;if(h){if(g){if(h[g]){if(e){if(e.$timerID){window.clearInterval(h[g][e.$timerID]);delete h[g][e.$timerID]}}else for(var o in h[g])if(h[g].hasOwnProperty(o)){window.clearInterval(h[g][o]);delete h[g][o]}for(i in h[g])if(h[g].hasOwnProperty(i))break;if(!i){i=null;delete h[g]}}}else for(var t in h)h.hasOwnProperty(t)&&this.remove(c,t,e); for(i in h)if(h.hasOwnProperty(i))break;if(!i)c.$timers=null}}}});if(jQuery.browser.msie)jQuery(window).one("unload",function(){var c=jQuery.timer.global,g;for(g in c)if(c.hasOwnProperty(g))for(var e=
c[g],h=e.length;--h;)jQuery.timer.remove(e[h],g)});(function(c){if(String.prototype.split.toString().match(/\[native/)){var g=String.prototype.split,e=/()??/.exec("")[1]===c,h;h=function(i,o,t){if(Object.prototype.toString.call(o)!=="[object RegExp]")return g.call(i,o,t);var m=[],v=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.extended?"x":"")+(o.sticky?"y":""),w=0,A,x,C;o=RegExp(o.source,v+"g");i+="";e||(A=RegExp("^"+o.source+"$(?!\\s)",v));for(t=t===c?4294967295:t>>>0;x=o.exec(i);){v=x.index+x[0].length;
if(v>w){m.push(i.slice(w,x.index));!e& & x.length>1& & x[0].replace(A,function(){for(var E=1;E< arguments.length-2 ; E + + ) if ( arguments [ E ] = = = c ) x [ E ] = c } ) ; x . length > 1&&x.index<i.length&&Array.prototype.push.apply(m,x.slice(1)); C=x[0].length;w=v;if(m.length>=t)break}o.lastIndex===x.index& & o.lastIndex++}if(w===i.length){if(C||!o.test(""))m.push("")}else m.push(i.slice(w));return m.length>t?m.slice(0,t):m};String.prototype.split=function(i,o){return h(this,i,o)};return h}})();k.json_stringify=function(c,g){var e=
"",h;g=g===H?1:g;switch(typeof c){case "function":e+=c;break;case "boolean":e+=c?"true":"false";break;case "object":if(c===null)e+="null";else if(c instanceof Array){e+="[";var i=c.length;for(h=0;h< i-1 ; + + h ) e + = k . json_stringify ( c [ h ] , g + 1 ) ; e + = k . json_stringify ( c [ i-1 ] , g + 1 ) + " ] " } else { e + = " { " ; for ( i in c ) if ( c . hasOwnProperty ( i ) ) e + = ' " ' + i + ' " : ' + k . json_stringify ( c [ i ] , g + 1 ) ; e + = " } " } break ; case " string " :i = c;var o = {"\\\\":"\\\\",'"':'\\"',"/":"\\/","\\n":"\\n","\\r":"\\r","\\t":"\\t"};for(h in o ) if ( o . hasOwnProperty ( h ) ) i =
i.replace(RegExp(h,"g"),o[h]);e+='"'+i+'"';break;case "number":e+=String(c)}e+=g>1?",":"";if(g===1)e=e.replace(/,([\]}])/g,"$1");return e.replace(/([\[{]),/g,"$1")};k.fn.cmd=function(c){function g(){I.toggleClass("inverted")}function e(){y="(reverse-i-search)`"+C+"': ";F()}function h(d){var q=D.data(),M=RegExp("^"+C),K=q.length;if(d&&E>0)K-=E; for(d=K;d--;)if(M.test(q[d])){E=q.length-d;b=0;m.set(q[d],true);l();break}}function i(d){var q=d.substring(0,w-A);d=d.substring(w-A);return[q].concat(U(d,w))}
function o(){v.focus();m.oneTime(1,function(){m.insert(v.val());v.blur().val("")})}function t(d){if(c.keydown& & c.keydown(d)===false)return false;if(J){var q;if(x&&(d.which===35||d.which===36||d.which===37||d.which===38||d.which===39||d.which===40||d.which===66||d.which===13||d.which===27)){y=P; x=false;E=null;C="";F();if(d.which===27)p="";l();t.call(this,d)}else if(d.altKey){if(d.which===68){m.set(p.slice(0,b)+p.slice(b).replace(/[^ ]+ |[^ ]+$/,""),true);return false}return true}else if(d.keyCode===
13){if(D&&p&&(c.historyFilter&&c.historyFilter(p)||!c.historyFilter))D.data().slice(-1)[0]!==p&&D.append(p); D.last();d=p;m.set("");c.commands&&c.commands(d); typeof y==="function"& & F()}else if(d.which===32)if(x){C+=" ";e()}else m.insert(" ");else if(d.which===8)if(x){C=C.slice(0,-1);e()}else{if(p!==""&&b>0){p=p.slice(0,b-1)+p.slice(b,p.length); --b;l()}}else if(d.which===9&&!(d.ctrlKey||d.altKey))m.insert("\t"); else if(d.which===46){if(p!==""&&b<p.length){p=p.slice(0,b)+p.slice(b+1,p.length); l()}return true}else if(D& &
d.which===38||d.which===80&&d.ctrlKey)m.set(D.previous()); else if(D&&d.which===40||d.which===78&&d.ctrlKey)m.set(D.next()); else if(d.which===37||d.which===66&&d.ctrlKey)if(d.ctrlKey&&d.which!==66){q=b-1; d=0;for(p[q]===" "&&--q; q>0;--q)if(p[q]===" "& & p[q+1]!==" "){d=q+1;break}else if(p[q]==="\n"&&p[q+1]!=="\n"){d=q; break}m.position(d)}else{if(b>0){--b;l()}}else if(d.which===82&&d.ctrlKey)if(x)h(true); else{P=y;e();p="";l();x=true}else if(d.which===39||d.which===70& & d.ctrlKey)if(d.ctrlKey& & d.which!==
70){p[b]===" "&&++b; d=p.slice(b).match(/\S[\n\s]{2,}|[\n\s]+\S?/);if(!d||d[0].match(/^\s+$/))b=p.length;else if(d[0][0]!==" ")b+=d.index+1;else{b+=d.index+d[0].length-1;d[0][d[0].length-1]!==" "&&--b}l()}else{if(b<p.length){++b; l()}}else if(d.which===123)return true;else if(d.which===36)m.position(0);else if(d.which===35)m.position(p.length);else if(d.ctrlKey||d.metaKey)if(d.shiftKey){if(d.which===84)return true}else if(d.which===65)m.position(0);else if(d.which===69)m.position(p.length);else if(d.which===
88||d.which===67||d.which===87||d.which===84)return true;else if(d.which===86){o();return true}else if(d.which===75)if(b===0)m.set("");else b!==p.length&&m.set(p.slice(0,b)); else if(d.which===85){m.set(p.slice(b,p.length));m.position(0)}else{if(d.which===17)return true}else return true;return false}}var m=this;m.addClass("cmd");m.append('< span class = "prompt" > < / span > < span > < / span > < span class = "cursor" > < / span > < span > < / span > ');var v=k("< textarea / > ").addClass("clipboard").appendTo(m);c.width&&m.width(c.width);
var w,A,x=false,C="",E=null,P,G=c.mask||false,p="",b=0,y,J=c.enabled,T,D,I=m.find(".cursor"),l=function(d){function q(n,a){if(a===n.length){L.html(k.terminal.encode(n));I.html(" ");B.html("")}else if(a===0){L.html("");I.html(k.terminal.encode(n.slice(0,1)));B.html(k.terminal.encode(n.slice(1)))}else{var f=k.terminal.encode(n.slice(0,a));L.html(f);f=n.slice(a,a+1);I.html(f===" "?" ":k.terminal.encode(f));a===n.length-1?B.html(""):B.html(k.terminal.encode(n.slice(a+1)))}}function M(n){return"< div > "+
k.terminal.encode(n)+"< / div > "}function K(n){var a=B;k.each(n,function(f,j){a=k(M(j)).insertAfter(a).addClass("clear")})}function S(n){k.each(n,function(a,f){L.before(M(f))})}var L=I.prev(),B=I.next();return function(){var n=G?p.replace(/./g,"*"):p,a,f;d.find("div").remove();L.html("");if(n.length>w-A-1||n.match(/\n/)){var j,u=n.match(/\t/g),r=u?u.length*3:0;if(u)n=n.replace(/\t/g,"\u0000\u0000\u0000\u0000");if(n.match(/\n/)){var s=n.split("\n");f=w-A-1;for(a=0;a< s.length-1 ; + + a ) s [ a ] + = " " ; if ( s [ 0 ] . length >
f){j=[s[0].substring(0,f)];j=j.concat(U(s[0].substring(f),w))}else j=[s[0]];for(a=1;a< s.length ; + + a ) if ( s [ a ] . length > w)j=j.concat(U(s[a],w));else j.push(s[a])}else j=i(n);if(u)j=k.map(j,function(N){return N.replace(/\x00\x00\x00\x00/g,"\t")});f=j[0].length;if(b< f ) { q ( j [ 0 ] , b ) ; K ( j . slice ( 1 ) ) } else if ( b = ==f){L.before(M(j[0]));q(j[1],0);K(j.slice(2))}else{a=j.length;if(b<f){q(j[0],b);K(j.slice(1))}else if ( b = ==f){L.before(M(j[0]));q(j[1],0);K(j.slice(2))}else{u=j.slice(-1)[0];s=n.length-b;var z = u.length;n=0;
if(s< =z){S(j.slice(0,-1));q(u,(z===s?0:z-s)+r)}else if(a===3){L.before("< div > "+k.terminal.encode(j[0])+"< / div > ");q(j[1],b-f-1);B.after('< div class = "clear" > '+k.terminal.encode(j[2])+"< / div > ")}else{n=b;for(a=0;a< j.length ; + + a ) { f = j[a].length;if(n > f)n-=f;else break}f=j[a];r=a;if(n===f.length){n=0;f=j[++r]}q(f,n);S(j.slice(0,r));K(j.slice(r+1))}}}}else if(n===""){L.html("");I.html(" ");B.html("")}else q(n,b)}}(m),F=function(){var d=m.find(".prompt");return function(){if(typeof y==="string"){A=X(y);
d.html(k.terminal.format(y))}else y(function(q){A=X(q);d.html(k.terminal.format(q))})}}();k.extend(m,{name:function(d){if(d!==H){T=d;D=new ga(d)}else return T},history:function(){return D},set:function(d,q){if(d!==H){p=d;if(!q)b=p.length;l();if(typeof c.onCommandChange==="function")c.onCommandChange(p)}},insert:function(d,q){if(b===p.length)p+=d;else p=b===0?d+p:p.slice(0,b)+d+p.slice(b);q||(b+=d.length);l();if(typeof c.onCommandChange==="function")c.onCommandChange(p)},get:function(){return p},commands:function(d){if(d)c.commands=
d;else return d},destroy:function(){k(document.documentElement).unbind(".commandline");m.find(".prompt").remove()},prompt:function(d){if(d===H)return y;else{if(typeof d==="string"||typeof d==="function")y=d;else throw"prompt must be a function or string";F();l()}},position:function(d){if(typeof d==="number"){b=d< 0 ? 0:d > p.length?p.length:d;l()}else return b},visible:function(){var d=m.visible;return function(){d.apply(m,[]);l();F()}}(),show:function(){var d=m.show;return function(){d.apply(m,[]);l();
F()}}(),resize:function(d){if(d)w=d;else{d=m.width();var q=I.innerWidth();w=Math.floor(d/q)}l()},enable:function(){if(!J){I.addClass("inverted");m.everyTime(500,"blink",g);J=true}},isenabled:function(){return J},disable:function(){if(J){m.stopTime("blink",g);I.removeClass("inverted");J=false}},mask:function(d){if(typeof d==="boolean"){G=d;l()}else return G}});m.name(c.name||"");y=c.prompt||"> ";F();if(c.enabled===H||c.enabled===true)m.enable();k(k.browser.msie?document.documentElement:window).keypress(function(d){var q;
if(d.ctrlKey& & d.which===99)return true;if(!x&&c.keypress)q=c.keypress(d); if(q===H||q){if(J)if(k.inArray(d.which,[38,32,13,0,8])>-1& & d.keyCode!==123& & !(d.which===38& & d.shiftKey))return false;else if(!d.ctrlKey&&!(d.altKey&&d.which===100)){if(x){C+=String.fromCharCode(d.which); e();h()}else m.insert(String.fromCharCode(d.which));return false}else if(d.altKey)if(x){C+=String.fromCharCode(d.which);e();h()}else m.insert(String.fromCharCode(d.which))}else return q}).keydown(t);return m};var ha=/(\[\[[gbius]*;[^;]*;[^\]]*\](?:[^\]\[]*|\[*(?!\[)[^\]]*\][^\]]*)\])/g,
Z=/\[\[([gbius]*);([^;]*);([^;\]]*;|[^\]]*);?([^\]]*)\]([^\]\[]*|[^\[]*\[(?!\[)*[^\]]*\][^\]]*)\]/g,$=/#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})/,ia=/(https?:((?!&[^; ]+;)[^\s:"'< )])+)/g,ja=/((([^< >()[\]\\.,;:\s@\"]+(\.[^< >()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,})))/g;k.terminal={split_equal:function(c,g){for(var e=c.split(/\n/g),h=/(\[\[[gbius]*;[^;]*;[^\]]*\][^\]\[]*\]?)/g,i=/(\[\[[gbius]*;[^;]*;[^\]]*\])/,o=/\[\[[gbius]*;?[^;]*;?[^\]]*\]?$/,
t=false,m=false,v="",w=[],A=0,x=e.length;A< x ; + + A ) { if ( v ! = = " " ) if ( e [ A ] = = = " " ) { w . push ( v + " ] " ) ; continue } else { e [ A ] = v + e [ A ] ; v = "" } else if ( e [ A ] = = = " " ) { w . push ( " " ) ; continue } for ( var C = e[A],E=0,P=0,G=0,p=C.length;G<p;++G){if(C[G]==="["&&C[G+1]==="[")t=true;else if ( t & & C [ G ] = = = " ] " ) if ( m ) m = t=false;else m = true;else if ( t & & m | | ! t ) + + P ; if ( P = ==g||G===p-1){var b = C.substring(E,G+1);if(v){b=v+b;if(b.match("]"))v=""}E=G+1;P=0;var y = b.match(h);if(y){y=y[y.length-1];if(y[y.length-1]!=="]"){v=y.match(i)[1];b+="]"}else if ( b . match ( o ) ) { b =
b.replace(o,"");v=y.match(i)[1]}}w.push(b)}}}return w},encode:function(c){return c.replace(/&(?!#[0-9]+; |[a-zA-Z]+;)/g,"& ").replace(/< /g,"< ").replace(/>/g,"> ").replace(/\n/g,"< br / > ").replace(/ /g," ").replace(/\t/g," ")},format:function(c){if(typeof c==="string"){c=k.terminal.encode(k.terminal.from_ansi(c));var g=c.split(ha);if(g& & g.length>1)c=k.map(g,function(e){return e===""?e:e.substring(0,1)==="["?e.replace(Z,function(h,i,o,t,m,v){if(v==="")return"< span > < / span > ";
h="";if(i.indexOf("b")!==-1)h+="font-weight:bold;";var w="text-decoration:";if(i.indexOf("u")!==-1)w+="underline ";if(i.indexOf("s")!==-1)w+="line-through";if(i.indexOf("s")!==-1||i.indexOf("u")!==-1)h+=w+";";if(i.indexOf("i")!==-1)h+="font-style:italic;";if(o.match($)){h+="color:"+o+";";if(i.indexOf("g")!==-1)h+="text-shadow: 0 0 5px "+o+";"}if(t.match($))h+="background-color:"+t;return'< span style = "'+h+'" ' + ( m ! = " " ? ' class = "'+m+'" ' : " " ) + " > "+v+"< / span > "}):"< span > "+e+"< / span > "}).join("");return c.replace(ia,
function(e){var h=e.match(/\.$/);e=e.replace(/\.$/,"");return'< a target = "_blank" href = "'+e+'" > '+e+"< / a > "+(h?".":"")}).replace(ja,'< a href = "mailto:$1" > $1< / a > ').replace(/< span > < br \ / ? > < \/span>/g,"< br / > ")}else return""},strip:function(c){return c.replace(Z,"$5")},active:function(){return O.front()},ansi_colors:{normal:{black:"#000",red:"#AA0000",green:"#008400",yellow:"#AA5500",blue:"#0000AA",magenta:"#AA00AA",cyan:"#00AAAA",white:"#fff"},bold:{white:"#fff",red:"#FF5555",green:"#44D544",yellow:"#FFFF55",
blue:"#5555FF",magenta:"#FF55FF",cyan:"#55FFFF",black:"#000"}},from_ansi:function(){function c(h){var i=h.split(";"),o;h=[];var t="",m="",v;for(v in i){o=parseInt(i[v],10);o===1&&h.push("b"); o===4&&h.push("u"); if(e[o])m=e[o];if(g[o])t=g[o]}o=i=k.terminal.ansi_colors.normal;for(v=h.length;v--;)if(h[v]=="b"){if(t=="")t="white";o=k.terminal.ansi_colors.bold;break}return"[["+[h.join(""),o[t],i[m]].join(";")+"]"}var g={30:"black",31:"red",32:"green",33:"yellow",34:"blue",35:"magenta",36:"cyan",37:"white"},
e={40:"black",41:"red",42:"green",43:"yellow",44:"blue",45:"magenta",46:"cyan",47:"white"};return function(h){var i=h.split(/(\[[0-9;]*m)/g);if(i.length==1)return h;h=[];if(i.length>3&&i.slice(0,3).join("")=="[0m")i=i.slice(3); for(var o=false,t=0;t< i.length ; + + t ) { var m = i[t].match(/^\[([0-9;]*)m$/);if(m){if(m[1]!="")if(o){h.push("]");if(m[1]=="0")o=false;else h . push ( c ( m [ 1 ] ) ) } else { o = true;h.push(c(m[1]))}}else h . push ( i [ t ] ) } o & & h . push ( " ] " ) ; return h . join ( " " ) } } ( ) } ; k . fn . visible = function(){return this . css ( " visibility " ,
"visible")};k.fn.hidden=function(){return this.css("visibility","hidden")};k.jrpc=function(c,g,e,h,i,o){g=k.json_stringify({jsonrpc:"2.0",method:e,params:h,id:g});return k.ajax({url:c,data:g,success:i,error:o,contentType:"application/json",dataType:"json",async:true,cache:false,type:"POST"})};R=/ {14}$/;var ka=[["jQuery Terminal","(c) 2011-2012 jcubic"],["jQuery Terminal Emulator v. 0.4.22","Copyright (c) 2011-2012 Jakub Jankiewicz < http: / / jcubic . pl > ".replace(/ *< . * > /,"")],["jQuery Terminal Emulator version version 0.4.22",
"Copyright (c) 2011-2012 Jakub Jankiewicz < http: / / jcubic . pl > "],[" _______ ________ __"," / / _ /_ ____________ _/__ ___/______________ _____ / /"," __ / / // / // / _ / _/ // / / / _ / _/ / / \\/ / _ \\/ /","/ / / // / // / ___/ // // / / / ___/ // / / / / /\\ / // / /__","\\___/____ \\\\__/____/_/ \\__ / /_/____/_//_/ /_/ /_/ \\/\\__\\_\\___/"," \\/ /____/ ".replace(R,"")+"version 0.4.22",
"Copyright (c) 2011-2012 Jakub Jankiewicz < http: / / jcubic . pl > "],[" __ _____ ________ __"," / // _ /__ __ _____ ___ __ _/__ ___/__ ___ ______ __ __ __ ___ / /"," __ / // // // // // _ // _// // / / // _ // _// // // \\/ // _ \\/ /","/ / // // // // // ___// / / // / / // ___// / / / / // // /\\ // // / /__","\\___//____ \\\\___//____//_/ _\\_ / /_//____//_/ /_/ /_//_//_/ /_/ \\__\\_\\___/"," \\/ /____/ ".replace(R,
"")+"version 0.4.22","Copyright (c) 2011-2012 Jakub Jankiewicz < http: / / jcubic . pl > "]],V=[],O=new function(c){var g=c?[c]:[],e=0;k.extend(this,{rotate:function(){if(g.length===1)return g[0];else{if(e===g.length-1)e=0;else++e;return g[e]}},length:function(){return g.length},set:function(h){for(var i=g.length;i--;)if(g[i]===h){e=i;return}this.append(h)},front:function(){return g[e]},append:function(h){g.push(h)}})};k.fn.terminal=function(c,g){function e(){return b.get(0).scrollHeight>b.innerHeight()}
function h(){var a=b.find(".cursor").width(),f=Math.floor(b.width()/a);if(e()){var j=b.innerWidth()-b.width();f-=Math.ceil((20-j/2)/(a-1))}return f}function i(a,f){if(l.displayExceptions){b.error("[ "+f+"] : "+(typeof a==="string"?a:typeof a.fileName==="string"?a.fileName+": "+a.message:a.message));if(typeof a.fileName==="string"){b.pause();k.get(a.fileName,function(j){b.resume();var u=a.lineNumber-1;(j=j.split("\n")[u])&&b.error("[ "+a.lineNumber+"] : "+j)})}a.stack& & b.error(a.stack)}}
function o(a,f){try{if(typeof f==="function")f(function(){});else if(typeof f!=="string")throw a+" must be string or function";}catch(j){i(j,a.toUpperCase());return false}return true}function t(){var a=b.prop?b.prop("scrollHeight"):b.attr("scrollHeight");b.scrollTop(a)}function m(a){a=typeof a==="string"?a:String(a);var f,j;if(a.length>D){var u=k.terminal.split_equal(a,D);a=k("< div > < / div > ");f=0;for(j=u.length;f< j ; + + f ) u [ f ] = = = " " | | u [ f ] = = = " \ r " ? a . append ( " < div > < / div > "):k("< div / > ").html(k.terminal.format(u[f])).appendTo(a)}else a=
k("< div / > ").html(k.terminal.format(a));J.append(a);a.width("100%");t();return a}function v(){if(g.greetings===H)b.echo(b.signature);else g.greetings& & b.echo(g.greetings)}function w(a,f){var j=1,u=function(r,s){f.pause();k.jrpc(a,j++,r,s,function(z){if(z.error)f.error("[ RPC] "+z.error.message);else if(typeof z.result==="string")f.echo(z.result);else if(z.result instanceof Array)f.echo(z.result.join(" "));else if(typeof z.result==="object"){var N="",Q;for(Q in z.result)if(z.result.hasOwnProperty(Q))N+=
Q+": "+z.result[Q]+"\n";f.echo(N)}f.resume()},function(z,N){f.error("[ AJAX] "+N+" - Server reponse is: \n"+z.responseText);f.resume()})};return function(r,s){if(r!==""){var z,N;if(r.match(/[^ ]* /)){r=r.split(/ +/);z=r[0];N=r.slice(1)}else{z=r;N=[]}if(!l.login||z==="help")u(z,N);else{var Q=s.token();Q?u(z,[Q].concat(N)):s.error("[ AUTH] Access denied (no token)")}}}}function A(a){a=a.replace(/\[/g,"[ ").replace(/\]/g,"] ");var f=n.prompt();if(n.mask())a=a.replace(/./g,"*");typeof f===
"function"?f(function(j){b.echo(j+a)}):b.echo(f+a)}function x(a,f){try{var j=B.top();if(a==="exit"&&l.exit)if(B.size()===1)if(l.login)E(); else{f||A(a);b.echo("You can exit from main interpeter")}else b.pop("exit");else{f||A(a);a==="clear"&&l.clear?b.clear():j.eval(a,b)}}catch(u){i(u,"USER"); b.resume();throw u;}}function C(){var a=null;n.prompt("login: ");l.history&&n.history().disable(); n.commands(function(f){try{A(f);if(a){n.mask(false);b.pause();if(typeof l.login!=="function")throw"Value of login property must be a function";
l.login(a,f,function(u){if(u){var r=l.name;r=r?"_"+r:"";k.Storage.set("token"+r,u);k.Storage.set("login"+r,a);n.commands(x);G()}else{b.error("Wrong password try again");n.prompt("login: ");a=null}b.resume();l.history&&n.history().enable()})}else{a=f; n.prompt("password: ");n.mask(true)}}catch(j){i(j,"LOGIN",b);throw j;}})}function E(){if(typeof l.onBeforelogout==="function")try{if(l.onBeforelogout(b)==false)return}catch(a){i(a,"onBeforelogout");throw a;}var f=l.name;f=f?"_"+f:"";k.Storage.remove("token"+
f,null);k.Storage.remove("login"+f,null);l.history&&n.history().disable(); C();if(typeof l.onAfterlogout==="function")try{l.onAfterlogout(b)}catch(j){i(j,"onAfterlogout");throw j;}}function P(){var a=B.top(),f="";if(a.name!==H&&a.name!=="")f+=a.name+"_"; f+=T;n.name(f);typeof a.prompt=="function"?n.prompt(function(j){a.prompt(j,b)}):n.prompt(a.prompt);l.history&&n.history().enable(); n.set("");if(typeof a.onStart==="function")a.onStart(b)}function G(){P();v();if(typeof l.onInit==="function")try{l.onInit(b)}catch(a){i(a,
"OnInit");throw a;}}function p(a){b.oneTime(5,function(){q()});if(l.keydown& & l.keydown(a,b)===false)return false;if(b.paused()){if(a.which===68&&a.ctrlKey){for(a=V.length; a--;){var f=V[a];if(4!==f.readyState)try{f.abort()}catch(j){b.error("error in aborting ajax")}}b.resume();return false}}else{if(a.which!==9)M=0;if(a.which===68&&a.ctrlKey){if(n.get()==="")if(B.size()>1||l.login!==H)b.pop(""); else{b.resume();b.echo("")}else b.set_command("");return false}else if(l.tabcompletion&&a.which===9){++M;
f=n.get();if(!f.match(" ")){var u=RegExp("^"+f),r=B.top().command_list,s=[];for(a=r.length;a--;)u.test(r[a])&&s.push(r[a]); if(s.length===1)b.set_command(s[0]);else if(s.length>1)if(M>=2){A(f);b.echo(s.join("\t"));M=0}}return false}else if(a.which===86&&a.ctrlKey){b.oneTime(1,function(){t()}); return true}else if(a.which===9&&a.ctrlKey){O.length()>1&&b.focus(false); return false}else if(a.which===34)b.scroll(b.height());else a.which===33?b.scroll(-b.height()):b.attr({scrollTop:b.attr("scrollHeight")})}}
var b=this,y=[],J,T=O.length(),D,I=[],l=k.extend({name:"",prompt:"> ",history:true,exit:true,clear:true,enabled:true,displayExceptions:true,cancelableAjax:true,login:null,tabcompletion:null,historyFilter:null,onInit:k.noop,onClear:k.noop,onBlur:k.noop,onFocus:k.noop,onTerminalChange:k.noop,onExit:k.noop,keypress:k.noop,keydown:k.noop},g||{});l.width&&b.width(l.width); l.height&&b.height(l.height); var F=!l.enabled;if(b.length===0)throw'Sorry, but terminal said that "'+b.selector+'" is not valid selector!';
b.ajaxSend(function(a,f){V.push(f)});if(b.data("terminal"))return b.data("terminal");J=k("< div > ").addClass("terminal-output").appendTo(b);b.addClass("terminal").append("< div / > ");b.click(function(){b.find("textarea").focus()});var d=[];k.extend(b,k.omap({clear:function(){J.html("");n.set("");y=[];try{l.onClear(b)}catch(a){i(a,"onClear");throw a;}b.attr({scrollTop:0});return b},exec:function(a,f){F?d.push([a,f]):x(a,f);return b},commands:function(){return B.top().eval},greetings:function(){v();return b},
paused:function(){return F},pause:function(){if(n){F=true;b.disable();n.hidden()}return b},resume:function(){if(n){b.enable();var a=d;for(d=[];a.length;){var f=a.shift();b.exec.apply(b,f)}n.visible();t()}return b},cols:function(){return D},rows:function(){return y.length},history:function(){return n.history()},next:function(){if(O.length()===1)return b;else{var a=b.offset().top;b.height();b.scrollTop();var f=b,j=k(window).scrollTop(),u=j+k(window).height(),r=k(f).offset().top;if(r+k(f).height()>=
j&&r<=u){O.front().disable(); a=O.rotate().enable();f=a.offset().top-50;k("html,body").animate({scrollTop:f},500);try{l.onTerminalChange(a)}catch(s){i(s,"onTerminalChange");throw s;}return a}else{b.enable();k("html,body").animate({scrollTop:a-50},500);return b}}},focus:function(a,f){b.oneTime(1,function(){if(O.length()===1)if(a===false)try{!f&&l.onBlur(b)!==false&&b.disable()}catch(j){i(j,"onBlur"); throw j;}else try{!f&&l.onFocus(b)!==false&&b.enable()}catch(u){i(u,"onFocus"); throw u;}else if(a===
false)b.next();else{var r=O.front();if(r!=b){r.disable();if(!f)try{l.onTerminalChange(b)}catch(s){i(s,"onTerminalChange");throw s;}}O.set(b);b.enable()}});return b},enable:function(){D===H&&b.resize(); if(F)if(n){n.enable();F=false}return b},disable:function(){if(n){F=true;n.disable()}return b},enabled:function(){return F},signature:function(){var a=b.cols();a=a< 15 ? null:a < 35 ? 0:a < 55 ? 1:a < 64 ? 2:a < 75 ? 3:4 ; return a ! = = null ? ka [ a ] . join ( " \ n " ) + " \ n " : " " } , version:function ( ) { return " 0 . 4 . 22 " } , get_command:function ( ) { return n . get ( ) } ,
insert:function(a){if(typeof a==="string"){n.insert(a);return b}else throw"insert function argument is not a string";},set_prompt:function(a){if(o("prompt",a)){typeof a=="function"?n.prompt(function(f){a(f,b)}):n.prompt(a);B.top().prompt=a}return b},get_prompt:function(){return B.top().prompt},set_command:function(a){n.set(a);return b},set_mask:function(a){n.mask(a);return b},get_output:function(a){return a?y:k.map(y,function(f,j){return typeof j=="function"?j():j}).join("\n")},resize:function(a,
f){if(a&&f){b.width(a); b.height(f)}D=h();n.resize(D);var j=J.detach();J.html("");k.each(y,function(u,r){m(r& & typeof r=="function"?r():r)});b.prepend(j);t();return b},echo:function(a){y.push(a);m(typeof a==="function"?a():a);q();return b},error:function(a){return b.echo("[[;#f00;]"+a.replace(/\[/g,"[ ").replace(/\]/g,"] ")+"]")},scroll:function(a){var f;a=Math.round(a);if(b.prop){a>b.prop("scrollTop")&&a>0&&b.prop("scrollTop",0); f=b.prop("scrollTop");b.prop("scrollTop",f+a)}else{a>b.attr("scrollTop")& &
a>0&&b.attr("scrollTop",0); f=b.attr("scrollTop");b.attr("scrollTop",f+a)}return b},logout:l.login?function(){for(;B.size()>1;)B.pop();E();return b}:function(){throw"You don't have login function";},token:l.login?function(){var a=l.name;return k.Storage.get("token"+(a?"_"+a:""))}:k.noop,login_name:l.login?function(){var a=l.name;return k.Storage.get("login"+(a?"_"+a:""))}:k.noop,name:function(){return l.name},push:function(a,f){if(f& & (!f.prompt||o("prompt",f.prompt))||!f){if(typeof a==="string")a=
w(f.eval,b);B.push(k.extend({eval:a},f));P()}return b},reset:function(){for(b.clear();B.size()>1;)B.pop();G()},pop:function(a){a!==H&&A(a); if(B.top().name===l.name){if(l.login){E();if(typeof l.onExit==="function")try{l.onExit(b)}catch(f){i(f,"onExit");throw f;}}}else{a=B.pop();P();if(typeof a.onExit==="function")try{a.onExit(b)}catch(j){i(j,"onExit");throw j;}}return b}},function(a,f){return function(){try{return f.apply(this,Array.prototype.slice.apply(arguments))}catch(j){i(j,"TERMINAL")}}}));var q=
function(){var a=e();return function(){if(a!==e()){b.resize();a=e()}}}(),M=0,K;if(l.login& & typeof l.onBeforeLogin==="function")try{l.onBeforeLogin(b)}catch(S){i(S,"onBeforeLogin");throw S;}if(typeof c=="string"){K=c;c=w(c,b)}else if(typeof c=="object"& & c.constructor===Array)throw"You can't use array as eval";else if(typeof c==="object"){for(var L in c)c.hasOwnProperty(L)&&I.push(L); c=function a(f){return function(j){if(j!==""){j=j.split(/ +/);var u=j[0],r=j.slice(1);j=f[u];var s=typeof j;if(s==="function")j.apply(b,
r);else if(s==="object"||s==="string"){r=[];if(s==="object"){for(var z in j)j.hasOwnProperty(z)&&r.push(z); j=a(j)}b.push(j,{prompt:u+"> ",name:u,command_list:r})}else b.error("Command '"+u+"' Not Found")}}}(c)}else if(typeof c!=="function")throw'Unknow object "'+String(c)+'" passed as eval';if(K& & (typeof l.login==="string"||l.login))l.login=function(a){var f=1;return function(j,u,r){b.pause();k.jrpc(K,f++,a,[j,u],function(s){b.resume();!s.error&&s.result?r(s.result):r(null)},function(s,z){b.resume();
b.error("[ AJAX\ Response: "+z+"\n"+s.responseText)})}}(typeof l.login==="boolean"?"login":l.login);if(o("prompt",l.prompt)){var B=new fa({name:l.name,eval:c,prompt:l.prompt,command_list:I,greetings:l.greetings}),n=b.find(".terminal-output").next().cmd({prompt:l.prompt,history:l.history,historyFilter:l.historyFilter,width:"100%",keydown:p,keypress:l.keypress?function(a){return l.keypress(a,b)}:null,onCommandChange:function(a){if(typeof l.onCommandChange==="function")try{l.onCommandChange(a,
b)}catch(f){i(f,"onCommandChange");throw f;}t()},commands:x});O.append(b);l.enabled===true?b.focus(H,true):b.disable();k(window).resize(b.resize);b.click(function(){F&&O.length()>1&&b===k.terminal.active()||b.focus()}); g.login&&b.token&&!b.token()&&b.login_name&&!b.login_name()?C():G(); typeof k.fn.init.prototype.mousewheel==="function"&&b.mousewheel(function(a,f){f>0?b.scroll(-40):b.scroll(40); return false},true)}b.data("terminal",b);return b}})(jQuery);
< / script >
< style type = "text/css" >
.terminal .clipboard {
position: absolute;
bottom: 0;
left: 0;
opacity: 0.01;
filter: alpha(opacity = 0.01);
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0.01);
width: 2px;
}
.cmd > .clipboard {
position: fixed;
}
.terminal {
padding: 10px;
position: relative;
overflow: hidden;
}
.cmd {
padding: 0;
margin: 0;
height: 1.3em;
}
.terminal .terminal-output div div, .terminal .prompt {
display: block;
line-height: 9px;
height: 14px;
}
.terminal {
font-family: FreeMono, monospace;
color: #aaa;
background-color: #000;
font-size: 12px;
line-height: 14px;
}
.terminal .terminal-output div span {
display: inline-block;
}
.terminal .cmd span {
display: inline-block;
}
.terminal .cmd span.inverted {
background-color: #aaa;
color: #000;
}
.terminal .terminal-output div div::-moz-selection, .terminal .terminal-output div span::-moz-selection {
background-color: #aaa;
color: #000;
}
.terminal .terminal-output div div::selection, .terminal .terminal-output div span::selection,
.terminal .cmd > span::selection, .terminal .prompt span::selection {
background-color: #aaa;
color: #000;
}
.terminal .terminal-output div.error, .terminal .terminal-output div.error div {
color: red;
}
.tilda {
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 1100;
}
.clear {
clear: both;
}
.terminal a {
color: #0F60FF;
}
.terminal a:hover {
color: red;
}
< / style >
< style type = "text/css" >
body,html{
height:100%;
}
div#term{
2013-01-21 01:23:11 -05:00
height:500px;
2013-01-20 18:55:00 -05:00
}
< / style >
< script type = "text/javascript" >
jQuery(function($, undefined) {
$('#term').terminal(function(command, term) {
if (command !== '') {
console.log(command);
try {
2013-01-29 18:30:32 -05:00
var url = "/" + command.split(" ")[0] + "?" + $.param(command.split(" ").slice(1).map(function(e) { return {name: "q", value: e} }))
2013-01-20 18:55:00 -05:00
console.log(url);
$.ajax(url).done(function(data) {
term.echo(new String(data));
term.resume();
}).fail(function(req, status, err) {
term.error("Error: " + new String(err))
term.resume();
})
term.pause()
} catch(e) {
term.error(new String(e));
}
} else {
term.echo('');
}
}, {
greetings: 'Docker: a self-sufficient runtime for linux containers',
name: 'docker',
height: 200,
prompt: 'docker> '});
2013-01-21 01:23:11 -05:00
$('#term').css('height', '90%');
2013-01-20 18:55:00 -05:00
});
< / script >
< / head >
< div id = "term" style = "height: 100%" > < / div >
< / html >