picluster/web/assets/jquery.terminal.min.js

36 lines
78 KiB
JavaScript
Raw Permalink Normal View History

2021-08-25 08:44:55 -06:00
/**@license
* __ _____ ________ __
* / // _ /__ __ _____ ___ __ _/__ ___/__ ___ ______ __ __ __ ___ / /
* __ / // // // // // _ // _// // / / // _ // _// // // \/ // _ \/ /
* / / // // // // // ___// / / // / / // ___// / / / / // // /\ // // / /__
* \___//____ \\___//____//_/ _\_ / /_//____//_/ /_/ /_//_//_/ /_/ \__\_\___/
* \/ /____/ version 1.5.0
*
* This file is part of jQuery Terminal. http://terminal.jcubic.pl
*
* Copyright (c) 2010-2017 Jakub Jankiewicz <http://jcubic.pl/me>
* Released under the MIT license
*
* Contains:
*
* Storage plugin Distributed under the MIT License
* Copyright (c) 2010 Dave Schindler
*
* jQuery Timers licenced with the WTFPL
* <http://jquery.offput.ca/timers/>
*
* Cross-Browser Split 1.1.1
* Copyright 2007-2012 Steven Levithan <stevenlevithan.com>
* Available under the MIT License
*
* jQuery Caret
* Copyright (c) 2009, Gideon Sireling
* 3 clause BSD License
*
* sprintf.js
* Copyright (c) 2007-2013 Alexandru Marasteanu <hello at alexei dot ro>
* licensed under 3 clause BSD license
*
* Date: Mon, 10 Jul 2017 09:10:00 +0000
*/
(function(e){var n=function(){if(!n.cache.hasOwnProperty(arguments[0])){n.cache[arguments[0]]=n.parse(arguments[0])}return n.format.call(null,n.cache[arguments[0]],arguments)};n.format=function(e,t){var o=1,a=e.length,s="",l,f=[],c,u,p,m,h,d;for(c=0;c<a;c++){s=r(e[c]);if(s==="string"){f.push(e[c])}else if(s==="array"){p=e[c];if(p[2]){l=t[o];for(u=0;u<p[2].length;u++){if(!l.hasOwnProperty(p[2][u])){throw n('[sprintf] property "%s" does not exist',p[2][u])}l=l[p[2][u]]}}else if(p[1]){l=t[p[1]]}else{l=t[o++]}if(/[^s]/.test(p[8])&&r(l)!=="number"){throw n("[sprintf] expecting number but found %s",r(l))}switch(p[8]){case"b":l=l.toString(2);break;case"c":l=String.fromCharCode(l);break;case"d":l=parseInt(l,10);break;case"e":l=p[7]?l.toExponential(p[7]):l.toExponential();break;case"f":l=p[7]?parseFloat(l).toFixed(p[7]):parseFloat(l);break;case"o":l=l.toString(8);break;case"s":l=(l=String(l))&&p[7]?l.substring(0,p[7]):l;break;case"u":l=l>>>0;break;case"x":l=l.toString(16);break;case"X":l=l.toString(16).toUpperCase();break}l=/[def]/.test(p[8])&&p[3]&&l>=0?" +"+l:l;h=p[4]?p[4]==="0"?"0":p[4].charAt(1):" ";d=p[6]-String(l).length;m=p[6]?i(h,d):"";f.push(p[5]?l+m:m+l)}}return f.join("")};n.cache={};n.parse=function(e){var n=e,t=[],r=[],i=0;while(n){if((t=/^[^\x25]+/.exec(n))!==null){r.push(t[0])}else if((t=/^\x25{2}/.exec(n))!==null){r.push("%")}else if((t=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(n))!==null){if(t[2]){i|=1;var o=[],a=t[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?"}t[2]=o}else{i|=2}if(i===3){throw"[sprintf] mixing positional and named placeholders is not (yet) supported"}r.push(t)}else{throw"[sprintf] huh?"}n=n.substring(t[0].length)}return r};var t=function(e,t,r){r=t.slice(0);r.splice(0,0,e);return n.apply(null,r)};function r(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function i(e,n){for(var t=[];n>0;t[--n]=e){}return t.join("")}e.sprintf=n;e.vsprintf=t})(typeof global!=="undefined"?global:window);(function(e,n){"use strict";function t(){var n=e.Callbacks();var t=false;this.resolve=function(){n.fire();t=true};this.add=function(e){if(t){e()}else{n.add(e)}}}e.omap=function(n,t){var r={};e.each(n,function(e,i){r[e]=t.call(n,e,i)});return r};var r={clone_object:function(n){var t={};if(typeof n==="object"){if(e.isArray(n)){return this.clone_array(n)}else if(n===null){return n}else{for(var r in n){if(e.isArray(n[r])){t[r]=this.clone_array(n[r])}else if(typeof n[r]==="object"){t[r]=this.clone_object(n[r])}else{t[r]=n[r]}}}}return t},clone_array:function(n){if(!e.isFunction(Array.prototype.map)){throw new Error("Your browser don't support ES5 array map "+"use es5-shim")}return n.slice(0).map(function(e){if(typeof e==="object"){return this.clone_object(e)}else{return e}}.bind(this))}};var i=function(e){return r.clone_object(e)};var o=function(){var e="test",n=window.localStorage;try{n.setItem(e,"1");n.removeItem(e);return true}catch(e){return false}};var a=o();function s(e,n){var t;if(typeof e==="string"&&typeof n==="string"){localStorage[e]=n;return true}else if(typeof e==="object"&&typeof n==="undefined"){for(t in e){if(e.hasOwnProperty(t)){localStorage[t]=e[t]}}return true}return false}function l(e,n){var t,r,i;t=new Date;t.setTime(t.getTime()+31536e6);r="; expires="+t.toGMTString();if(typeof e==="string"&&typeof n==="string"){document.cookie=e+"="+n+r+"; path=/";return true}else if(typeof e==="object"&&typeof n==="undefined"){for(i in e){if(e.hasOwnProperty(i)){document.cookie=i+"="+e[i]+r+"; path=/"}}return true}return false}function f(e){return localStorage[e]}function c(e){var n,t,r,i;n=e+"=";t=document.cookie.split(";");for(r=0;r<t.length;r++){i=t[r];while(i.charAt(0)===" "){i=i.substring(1,i.length)}if(i.indexOf(n)===0){return i.substring(n.length,i.length)}}return null}function u(e){return delete localStorage[e]