/**@license * __ _____ ________ __ * / // _ /__ __ _____ ___ __ _/__ ___/__ ___ ______ __ __ __ ___ / / * __ / // // // // // _ // _// // / / // _ // _// // // \/ // _ \/ / * / / // // // // // ___// / / // / / // ___// / / / / // // /\ // // / /__ * \___//____ \\___//____//_/ _\_ / /_//____//_/ /_/ /_//_//_/ /_/ \__\_\___/ * \/ /____/ version 0.10.8 * * This file is part of jQuery Terminal. http://terminal.jcubic.pl * * Copyright (c) 2010-2016 Jakub Jankiewicz * Released under the MIT license * * Contains: * * Storage plugin Distributed under the MIT License * Copyright (c) 2010 Dave Schindler * * jQuery Timers licenced with the WTFPL * * * Cross-Browser Split 1.1.1 * Copyright 2007-2012 Steven Levithan * Available under the MIT License * * jQuery Caret * Copyright (c) 2009, Gideon Sireling * 3 clause BSD License * * sprintf.js * Copyright (c) 2007-2013 Alexandru Marasteanu * licensed under 3 clause BSD license * * Date: Tue, 17 May 2016 09:01:51 +0000 */ (function(e){var r=function(){if(!r.cache.hasOwnProperty(arguments[0])){r.cache[arguments[0]]=r.parse(arguments[0])}return r.format.call(null,r.cache[arguments[0]],arguments)};r.format=function(e,n){var o=1,a=e.length,s="",l,f=[],c,u,h,p,m,g;for(c=0;c>>0;break;case"x":l=l.toString(16);break;case"X":l=l.toString(16).toUpperCase();break}l=/[def]/.test(h[8])&&h[3]&&l>=0?"+"+l:l;m=h[4]?h[4]=="0"?"0":h[4].charAt(1):" ";g=h[6]-String(l).length;p=h[6]?i(m,g):"";f.push(h[5]?l+p:p+l)}}return f.join("")};r.cache={};r.parse=function(e){var r=e,n=[],t=[],i=0;while(r){if((n=/^[^\x25]+/.exec(r))!==null){t.push(n[0])}else if((n=/^\x25{2}/.exec(r))!==null){t.push("%")}else if((n=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(r))!==null){if(n[2]){i|=1;var o=[],a=n[2],s=[];if((s=/^([a-z_][a-z_\d]*)/i.exec(a))!==null){o.push(s[1]);while((a=a.substring(s[0].length))!==""){if((s=/^\.([a-z_][a-z_\d]*)/i.exec(a))!==null){o.push(s[1])}else if((s=/^\[(\d+)\]/.exec(a))!==null){o.push(s[1])}else{throw"[sprintf] huh?"}}}else{throw"[sprintf] huh?"}n[2]=o}else{i|=2}if(i===3){throw"[sprintf] mixing positional and named placeholders is not (yet) supported"}t.push(n)}else{throw"[sprintf] huh?"}r=r.substring(n[0].length)}return t};var n=function(e,n,t){t=n.slice(0);t.splice(0,0,e);return r.apply(null,t)};function t(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function i(e,r){for(var n=[];r>0;n[--r]=e){}return n.join("")}e.sprintf=r;e.vsprintf=n})(typeof global!="undefined"?global:window);(function(e,r){"use strict";e.omap=function(r,n){var t={};e.each(r,function(e,i){t[e]=n.call(r,e,i)});return t};var n={clone_object:function(r){var n={};if(typeof r=="object"){if(e.isArray(r)){return this.clone_array(r)}else if(r===null){return r}else{for(var t in r){if(e.isArray(r[t])){n[t]=this.clone_array(r[t])}else if(typeof r[t]=="object"){n[t]=this.clone_object(r[t])}else{n[t]=r[t]}}}}return n},clone_array:function(r){if(!e.isFunction(Array.prototype.map)){throw new Error("You'r browser don't support ES5 array map "+"use es5-shim")}return r.slice(0).map(function(e){if(typeof e=="object"){return this.clone_object(e)}else{return e}}.bind(this))}};var t=function(e){return n.clone_object(e)};var i=function(){var e="test",r=window.localStorage;try{r.setItem(e,"1");r.removeItem(e);return true}catch(n){return false}};var o=i();function a(e,r){var n;if(typeof e==="string"&&typeof r==="string"){localStorage[e]=r;return true}else if(typeof e==="object"&&typeof r==="undefined"){for(n in e){if(e.hasOwnProperty(n)){localStorage[n]=e[n]}}return true}return false}function s(e,r){var n,t,i;n=new Date;n.setTime(n.getTime()+31536e6);t="; expires="+n.toGMTString();if(typeof e==="string"&&typeof r==="string"){document.cookie=e+"="+r+t+"; path=/";return true}else if(typeof e==="object"&&typeof r==="undefined"){for(i in e){if(e.hasOwnProperty(i)){document.cookie=i+"="+e[i]+t+"; path=/"}}return true}return false}function l(e){return localStorage[e]}function f(e){var r,n,t,i;r=e+"=";n=document.cookie.split(";");for(t=0;ti&&i!==0||t.call(e,a)===false){jQuery.timer.remove(e,n,t)}s.inProgress=false};s.$timerID=t.$timerID;if(!e.$timers[n][t.$timerID]){e.$timers[n][t.$timerID]=window.setInterval(s,r)}if(!this.global[n]){this.global[n]=[]}this.global[n].push(e)},remove:function(e,r,n){var t=e.$timers,i;if(t){if(!r){for(var o in t){if(t.hasOwnProperty(o)){this.remove(e,o,n)}}}else if(t[r]){if(n){if(n.$timerID){window.clearInterval(t[r][n.$timerID]);delete t[r][n.$timerID]}}else{for(var a in t[r]){if(t[r].hasOwnProperty(a)){window.clearInterval(t[r][a]);delete t[r][a]}}}for(i in t[r]){if(t[r].hasOwnProperty(i)){break}}if(!i){i=null;delete t[r]}}for(i in t){if(t.hasOwnProperty(i)){break}}if(!i){e.$timers=null}}}}});if(/(msie) ([\w.]+)/.exec(navigator.userAgent.toLowerCase())){jQuery(window).one("unload",function(){var e=jQuery.timer.global;for(var r in e){if(e.hasOwnProperty(r)){var n=e[r],t=n.length;while(--t){jQuery.timer.remove(n[t],r)}}}})}(function(e){if(!String.prototype.split.toString().match(/\[native/)){return}var r=String.prototype.split,n=/()??/.exec("")[1]===e,t;t=function(t,i,o){if(Object.prototype.toString.call(i)!=="[object RegExp]"){return r.call(t,i,o)}var a=[],s=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.extended?"x":"")+(i.sticky?"y":""),l=0,f,c,u,h;i=new RegExp(i.source,s+"g");t+="";if(!n){f=new RegExp("^"+i.source+"$(?!\\s)",s)}o=o===e?-1>>>0:o>>>0;while(c=i.exec(t)){u=c.index+c[0].length;if(u>l){a.push(t.slice(l,c.index));if(!n&&c.length>1){c[0].replace(f,function(){for(var r=1;r1&&c.index=o){break}}if(i.lastIndex===c.index){i.lastIndex++}}if(l===t.length){if(h||!i.test("")){a.push("")}}else{a.push(t.slice(l))}return a.length>o?a.slice(0,o):a};String.prototype.split=function(e,r){return t(this,e,r)};return t})();e.fn.caret=function(e){var r=this[0];var n=r.contentEditable==="true";if(arguments.length==0){if(window.getSelection){if(n){r.focus();var t=window.getSelection().getRangeAt(0),i=t.cloneRange();i.selectNodeContents(r);i.setEnd(t.endContainer,t.endOffset);return i.toString().length}return r.selectionStart}if(document.selection){r.focus();if(n){var t=document.selection.createRange(),i=document.body.createTextRange();i.moveToElementText(r);i.setEndPoint("EndToEnd",t);return i.text.length}var e=0,o=r.createTextRange(),i=document.selection.createRange().duplicate(),a=i.getBookmark();o.moveToBookmark(a);while(o.moveStart("character",-1)!==0)e++;return e}return 0}if(e==-1)e=this[n?"text":"val"]().length;if(window.getSelection){if(n){r.focus();window.getSelection().collapse(r.firstChild,e)}else r.setSelectionRange(e,e)}else if(document.body.createTextRange){var o=document.body.createTextRange();o.moveToElementText(r);o.moveStart("character",e);o.collapse(true);o.select()}if(!n)r.focus();return e};function h(e,r){var n=[];var t=e.length;if(t0?n[n.length-1]:null},clone:function(){return new m(n.slice(0))}})}e.json_stringify=function(n,t){var i="",o;t=t===r?1:t;var a=typeof n;switch(a){case"function":i+=n;break;case"boolean":i+=n?"true":"false";break;case"object":if(n===null){i+="null"}else if(n instanceof Array){i+="[";var s=n.length;for(o=0;o1?",":"";if(t===1){i=i.replace(/,([\]}])/g,"$1")}return i.replace(/([\[{]),/g,"$1")};function g(r,n){var t=true;var i="";if(typeof r==="string"&&r!==""){i=r+"_"}i+="commands";var o=e.Storage.get(i);o=o?e.parseJSON(o):[];var a=o.length-1;e.extend(this,{append:function(r){if(t){if(o[o.length-1]!==r){o.push(r);if(n&&o.length>n){o=o.slice(-n)}a=o.length-1;e.Storage.set(i,e.json_stringify(o))}}},data:function(){return o},reset:function(){a=o.length-1},last:function(){return o[length-1]},end:function(){return a===o.length-1},position:function(){return a},current:function(){return o[a]},next:function(){if(a0){--a}if(e!==-1){return o[a]}},clear:function(){o=[];this.purge()},enabled:function(){return t},enable:function(){t=true},purge:function(){e.Storage.remove(i)},disable:function(){t=false}})}var d=function(){var e=document.createElement("div");e.setAttribute("onpaste","return;");return typeof e.onpaste=="function"}();var v=true;e.fn.cmd=function(n){var t=this;var i=t.data("cmd");if(i){return i}t.addClass("cmd");t.append(''+' ');var o=e("