diff --git a/bower.json b/bower.json index 52ec360..ba87f6b 100644 --- a/bower.json +++ b/bower.json @@ -13,6 +13,7 @@ "dependencies": { "jquery": "2.*", "jquery-mousewheel": "~3.1.13", - "jquery.terminal": "~0.9.3" + "jquery.terminal": "~0.9.3", + "jsvi": "https://github.com/jcubic/jsvi.git" } } diff --git a/gulpfile.js b/gulpfile.js index 63aa708..9d723a5 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -27,6 +27,7 @@ elixir(function(mix) { "jquery.terminal/js/jquery.terminal-src.js", "jquery.terminal/js/unix_formatting.js", "jquery.terminal/js/xml_formatting.js", + "jsvi/vi.js", ], config.get('public.js.outputFolder') + '/plugins.js', 'resources/assets/vendor') .sass([ 'app.scss' diff --git a/public/css/app.css b/public/css/app.css index 3181fdd..a8cdd36 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -1 +1 @@ -.cmd .format,.cmd .prompt,.cmd .prompt div,.terminal .terminal-output .format,.terminal .terminal-output div div{display:inline-block}.cmd .clipboard,.cmd .mask{position:absolute;display:block;bottom:0;height:16px;left:-10px}.cmd,.terminal h1,.terminal h2,.terminal h3,.terminal h4,.terminal h5,.terminal h6,.terminal pre{margin:0}.terminal h1,.terminal h2,.terminal h3,.terminal h4,.terminal h5,.terminal h6{line-height:1.2em}.wrap{word-wrap:break-word;overflow:initial}.cmd .clipboard{left:-99999px;clip:rect(1px,1px,1px,1px);width:10px;height:10px;padding:0;resize:none;border:none;z-index:0;overflow:hidden;outline:none}.terminal .error{color:red}.terminal{padding:10px;overflow:auto}.cmd,.terminal{position:relative}.cmd{padding:0;height:1.3em}.cmd .cursor.blink,.cmd .inverted,.terminal .inverted{background-color:#aaa;color:#000}.cmd .cursor.blink{-webkit-animation:a 1s infinite steps(1,start);animation:a 1s infinite steps(1,start)}@-webkit-keyframes a{0%,to{background-color:#000;color:#aaa}50%{background-color:#bbb;color:#000}}@keyframes a{0%,to{background-color:#000;color:#aaa}50%{background-color:#bbb;color:#000}}.cmd .prompt,.terminal .terminal-output div div{display:block;line-height:14px;height:auto}.cmd .prompt{float:left}.cmd,.terminal{font-family:monospace;color:#aaa;background-color:#000;font-size:12px;line-height:14px}.terminal-output>div{min-height:14px}.terminal .terminal-output div span{display:inline-block}.cmd span{float:left}.cmd div,.cmd span,.terminal-output a,.terminal-output span,.terminal h1,.terminal h2,.terminal h3,.terminal h4,.terminal h5,.terminal h6,.terminal pre,.terminal td{-webkit-touch-callout:initial;-webkit-user-select:initial;-moz-user-select:initial;-ms-user-select:initial;user-select:initial}.terminal,.terminal-output,.terminal-output div{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}@-moz-document url-prefix(){.terminal,.terminal-output,.terminal-output div{-webkit-touch-callout:initial;-webkit-user-select:initial;-moz-user-select:initial;-ms-user-select:initial;user-select:initial}}.terminal table{border-collapse:collapse}.terminal td{border:1px solid #aaa}.cmd .prompt span::-moz-selection,.cmd>span::-moz-selection,.cmd div::-moz-selection,.terminal .terminal-output div div::-moz-selection,.terminal .terminal-output div div a::-moz-selection,.terminal .terminal-output div span::-moz-selection,.terminal h1::-moz-selection,.terminal h2::-moz-selection,.terminal h3::-moz-selection,.terminal h4::-moz-selection,.terminal h5::-moz-selection,.terminal h6::-moz-selection,.terminal pre::-moz-selection,.terminal td::-moz-selection{background-color:#aaa;color:#000}.cmd .prompt span::selection,.cmd>span::selection,.cmd div::selection,.terminal .terminal-output div div::selection,.terminal .terminal-output div div a::selection,.terminal .terminal-output div span::selection,.terminal h1::selection,.terminal h2::selection,.terminal h3::selection,.terminal h4::selection,.terminal h5::selection,.terminal h6::selection,.terminal pre::selection,.terminal td::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:1}.clear{clear:both}.terminal a{color:#0f60ff}.terminal a:hover{color:red}body,html{min-width:480px;background:#000} \ No newline at end of file +.cmd .format,.cmd .prompt,.cmd .prompt div,.terminal .terminal-output .format,.terminal .terminal-output div div{display:inline-block}.cmd .clipboard,.cmd .mask{position:absolute;display:block;bottom:0;height:16px;left:-10px}.cmd,.terminal h1,.terminal h2,.terminal h3,.terminal h4,.terminal h5,.terminal h6,.terminal pre{margin:0}.terminal h1,.terminal h2,.terminal h3,.terminal h4,.terminal h5,.terminal h6{line-height:1.2em}.wrap{word-wrap:break-word;overflow:initial}.cmd .clipboard{left:-99999px;clip:rect(1px,1px,1px,1px);width:10px;height:10px;padding:0;resize:none;border:none;z-index:0;overflow:hidden;outline:none}.terminal .error{color:red}.terminal{padding:10px;overflow:auto}.cmd,.terminal{position:relative}.cmd{padding:0;height:1.3em}.cmd .cursor.blink,.cmd .inverted,.terminal .inverted{background-color:#aaa;color:#000}.cmd .cursor.blink{-webkit-animation:terminal-blink 1s infinite steps(1,start);animation:terminal-blink 1s infinite steps(1,start)}@-webkit-keyframes terminal-blink{0%,to{background-color:#000;color:#aaa}50%{background-color:#bbb;color:#000}}@keyframes terminal-blink{0%,to{background-color:#000;color:#aaa}50%{background-color:#bbb;color:#000}}.cmd .prompt,.terminal .terminal-output div div{display:block;line-height:14px;height:auto}.cmd .prompt{float:left}.cmd,.terminal{font-family:monospace;color:#aaa;background-color:#000;font-size:12px;line-height:14px}.terminal-output>div{min-height:14px}.terminal .terminal-output div span{display:inline-block}.cmd span{float:left}.cmd div,.cmd span,.terminal-output a,.terminal-output span,.terminal h1,.terminal h2,.terminal h3,.terminal h4,.terminal h5,.terminal h6,.terminal pre,.terminal td{-webkit-touch-callout:initial;-webkit-user-select:initial;-moz-user-select:initial;-ms-user-select:initial;user-select:initial}.terminal,.terminal-output,.terminal-output div{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}@-moz-document url-prefix(){.terminal,.terminal-output,.terminal-output div{-webkit-touch-callout:initial;-webkit-user-select:initial;-moz-user-select:initial;-ms-user-select:initial;user-select:initial}}.terminal table{border-collapse:collapse}.terminal td{border:1px solid #aaa}.cmd .prompt span::-moz-selection,.cmd>span::-moz-selection,.cmd div::-moz-selection,.terminal .terminal-output div div::-moz-selection,.terminal .terminal-output div div a::-moz-selection,.terminal .terminal-output div span::-moz-selection,.terminal h1::-moz-selection,.terminal h2::-moz-selection,.terminal h3::-moz-selection,.terminal h4::-moz-selection,.terminal h5::-moz-selection,.terminal h6::-moz-selection,.terminal pre::-moz-selection,.terminal td::-moz-selection{background-color:#aaa;color:#000}.cmd .prompt span::selection,.cmd>span::selection,.cmd div::selection,.terminal .terminal-output div div::selection,.terminal .terminal-output div div a::selection,.terminal .terminal-output div span::selection,.terminal h1::selection,.terminal h2::selection,.terminal h3::selection,.terminal h4::selection,.terminal h5::selection,.terminal h6::selection,.terminal pre::selection,.terminal td::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}.editor{color:#aaa;background-color:#000;position:absolute;top:0;left:0;display:block;overflow:hidden;width:100%;height:100%;cursor:default;font-family:monospace;font-size:100%}.editor,.editorcursor,.print{display:none}@media print{.editor{display:none!important}body,html{overflow:auto!important}.editorcursor{display:none!important}.print{position:absolute;top:0;left:0;display:block!important;font-family:monospace;height:100%}.editortools,input,textarea{display:none!important}}body,html{overflow:hidden;width:100%;height:100%;margin:0;padding:0;background:#000}#shell{min-width:480px}#editor{position:absolute;top:0;left:0;display:none}.editor{z-index:5}.editorcursor{z-index:10} \ No newline at end of file diff --git a/public/js/app.js b/public/js/app.js index 0a69240..3507155 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -1 +1 @@ -(function(){var t=function(t,e){return function(){return t.apply(e,arguments)}};!function(e,r,n){var o,i,s,c;return c=e("meta[name='csrf-token']").attr("content"),e.ajaxSetup({headers:{"X-CSRF-TOKEN":c}}),o=function(){var t,e,r,n;return t=["/","|","\\","-"],n=null,r=50,e=null,{show:function(o){var i;return o.disable(),e=o.get_prompt(),i=0,n=setInterval(function(){return o.set_prompt(t[i++]),i>t.length-1?i=0:void 0},r)},hide:function(t){return clearInterval(n),t.enable(),t.set_prompt(e)}}}(),s=function(){function r(e,r,n){null==e&&(e="white"),null==r&&(r="black"),this.options=null!=n?n:[],this.apply=t(this.apply,this),this.ansi=t(this.ansi,this),this.is=t(this.is,this),this.foreground=this.ansi(e),this.background=this.ansi(r)}return r.prototype.colorList={30:"black",31:"red",32:"green",33:"yellow",34:"blue",35:"magenta",36:"cyan",37:"white",39:"white"},r.prototype.backgroundList={40:"black",41:"red",42:"green",43:"yellow",44:"blue",45:"magenta",46:"cyan",47:"white",49:"black"},r.prototype.colors=e.extend({},e.terminal.ansi_colors.bold,{white:e.terminal.ansi_colors.normal.white,red:e.terminal.ansi_colors.normal.red}),r.prototype.is=function(t,e,r){return null==t&&(t="white"),null==e&&(e="black"),this.options=null!=r?r:[],t===this.foreground&&e===this.background},r.prototype.ansi=function(t){return this.colors[t]?this.colors[t]:t},r.prototype.apply=function(t){return t=e.terminal.escape_brackets(t),"[[;"+this.foreground+";"+this.background+"]"+t+"]"},r}(),i=function(){function r(){this.apply=t(this.apply,this),this.question=t(this.question,this),this.comment=t(this.comment,this),this.info=t(this.info,this),this.error=t(this.error,this)}return r.prototype.formatters={error:new s("white","red"),info:new s("green"),comment:new s("yellow"),question:new s("magenta")},r.prototype.error=function(t){return this.formatters.error.apply(t)},r.prototype.info=function(t){return this.formatters.info.apply(t)},r.prototype.comment=function(t){return this.formatters.comment.apply(t)},r.prototype.question=function(t){return this.formatters.question.apply(t)},r.prototype.apply=function(t,r){var n;return n=new RegExp("(\\033\\[(\\d+)(;\\d+)?m(((?!\\033\\[\\d+).)*)\\033\\[(\\d+)(;\\d+)?m)|(\\[|\\])","g"),t=t.replace(n,function(t){return function(){var r,n;switch(n=arguments,!1){case-1===e.inArray(n[0],["[","]"]):return e.terminal.escape_brackets(n[0]);default:switch(r=e.terminal.escape_brackets(n[4]),!1){case"32"!==n[2]:return t.info(r);case"33"!==n[2]:return t.comment(r);case"37"!==n[2]:return t.error(r);default:return n[0]}}}}(this)),r&&e.each(t.split("\n"),function(t){return function(t,e){return""===e&&(e=" "),r.echo(e)}}(this)),t},r}(),this.Term=function(){function r(r,n){this.options=n,this.serverInfo=t(this.serverInfo,this),this.greetings=t(this.greetings,this),this.execute=t(this.execute,this),this.rpcRequest=t(this.rpcRequest,this),this.commandArtisan=t(this.commandArtisan,this),this.confirmToProceed=t(this.confirmToProceed,this),this.interpreter=t(this.interpreter,this),this.toBoolean=t(this.toBoolean,this),this.confirm=t(this.confirm,this),this.question=t(this.question,this),this.comment=t(this.comment,this),this.info=t(this.info,this),this.error=t(this.error,this),this.color=t(this.color,this),e(r).terminal(function(t){return function(e,r){return t.execute(r,e)}}(this),{onInit:function(t){return function(e){return t.execute(e,"list")}}(this),onBlur:function(t){return function(){return!1}}(this),onClear:function(t){return function(e){return t.serverInfo(e)}}(this),greetings:this.greetings(),prompt:this.defaultPrompt})}var n;return r.prototype.ids={},r.prototype.formatter=new i,r.prototype.colors=e.terminal.ansi_colors,r.prototype.term=null,r.prototype.defaultPrompt="$ ",r.prototype.color=function(t,e,r){return null==r&&(r="bold"),this.colors[r]&&this.colors[r][t]?this.colors[r][t]:t},r.prototype.error=function(t){return this.formatter.error(t)},r.prototype.info=function(t){return this.formatter.info(t)},r.prototype.comment=function(t){return this.formatter.comment(t)},r.prototype.question=function(t){return this.formatter.question(t)},r.prototype.confirm=function(t,r,n){var o,i;return null==n&&(n=""),o=e.Deferred(),n&&t.echo(" "+n),t.echo(r),i=t.history(),i.disable(),t.push(function(e){return function(r){e.toBoolean(r)?o.resolve(!0):(o.resolve(!1),e.serverInfo(t)),t.pop(),i.enable()}}(this),{prompt:" > "}),o.promise()},r.prototype.toBoolean=function(t){switch(t.toLowerCase()){case"y":case"yes":return!0;default:return!1}},r.prototype.interpreter=function(t,e,r){return r||(r=t),e.push(function(r){return function(n){return n=n.trim(),n&&r.execute(e,t.replace(/\s+/g,"-")+" "+n),!1}}(this),{prompt:r+"> "}),!1},n=function(t){return""+t.charAt(0).toUpperCase()+t.slice(1)},r.prototype.confirmToProceed=function(t,e,r){return null==r&&(r="Application In Production!"),t.echo(this.comment("**************************************")),t.echo(this.comment("* "+r+" *")),t.echo(this.comment("**************************************")),t.echo(" "),this.confirm(t,this.info("Do you really wish to run this command? [y/N] (yes/no)")+" "+this.comment("[no]")+": ").done(function(r){return function(n){return n===!0?r.rpcRequest(t,e):(t.echo(" "),t.echo(""+r.comment("Command Cancelled!")),t.echo(" "))}}(this))},r.prototype.commandArtisan=function(t,r){var n;return n=e.terminal.parseCommand(r.rest.trim()),"production"===this.options.environment&&-1===e.inArray("--force",n.args)&&-1!==e.inArray(n.name,this.options.confirmToProceed[r.name])?void this.confirmToProceed(t,r):this.rpcRequest(t,r)},r.prototype.rpcRequest=function(t,r){return this.ids[r.method]=this.ids[r.method]||0,o.show(t),e.ajax({url:this.options.endPoint,dataType:"json",type:"post",data:{jsonrpc:"2.0",id:++this.ids[r.method],cmd:r}}).success(function(e){return function(r){return e.formatter.apply(r.result,t)}}(this)).error(function(e){return function(r,n,o){return e.formatter.error(r.status+": "+o,t)}}(this)).complete(function(e){return function(){return o.hide(t),e.serverInfo(t)}}(this))},r.prototype.execute=function(t,r){var o,i,s,c;switch(r=r.trim()){case"help":case"list":this.formatter.apply(this.options.helpInfo,t),this.serverInfo(t);break;case"":return;default:c=this.options.interpreters;for(i in c)if(s=c[i],r===i)return void this.interpreter(s,t);o=e.terminal.parseCommand(r.trim()),this["command"+n(o.name)]?this["command"+n(o.name)](t,o):this.rpcRequest(t,o)}},r.prototype.greetings=function(){return[" __ _ _____ _ _ ","| | ___ ___ ___ _ _ ___| | |_ ____ ___ _____|_|___ ___| |","| |__| .'| _| .'| | | -_| | | || -_| _| | | | .'| |","|_____|__,|_| |__,|\\_/|___|_| |_||___|_| |_|_|_|_|_|_|__,|_|","","Copyright (c) 2015 Recca Tsai ","","Type a command, or type `"+this.info("help")+"`, for a list of commands.",""].join("\n")},r.prototype.serverInfo=function(t){var e,r,n;if(!(t.level()>1))return e=this.info(this.options.username+"@"+this.options.hostname),r=this.question(""+this.options.os),n=this.comment(""+this.options.basePath),t.echo(e+" "+r+" "+n)},r}()}(jQuery,window,document)}).call(this); \ No newline at end of file +(function(){var t=function(t,e){return function(){return t.apply(e,arguments)}};!function(e,r,n){var o,i,s,h;return h=e("meta[name='csrf-token']").attr("content"),e.ajaxSetup({headers:{"X-CSRF-TOKEN":h}}),o=function(){var t,e,r,n;return t=["/","|","\\","-"],n=null,r=50,e=null,{show:function(o){var i;return o.disable(),e=o.get_prompt(),i=0,n=setInterval(function(){return o.set_prompt(t[i++]),i>t.length-1?i=0:void 0},r)},hide:function(t){return clearInterval(n),t.enable(),t.set_prompt(e)}}}(),s=function(){function r(e,r,n){null==e&&(e="white"),null==r&&(r="black"),this.options=null!=n?n:[],this.apply=t(this.apply,this),this.ansi=t(this.ansi,this),this.is=t(this.is,this),this.foreground=this.ansi(e),this.background=this.ansi(r)}return r.prototype.colorList={30:"black",31:"red",32:"green",33:"yellow",34:"blue",35:"magenta",36:"cyan",37:"white",39:"white"},r.prototype.backgroundList={40:"black",41:"red",42:"green",43:"yellow",44:"blue",45:"magenta",46:"cyan",47:"white",49:"black"},r.prototype.colors=e.extend({},e.terminal.ansi_colors.bold,{white:e.terminal.ansi_colors.normal.white,red:e.terminal.ansi_colors.normal.red}),r.prototype.is=function(t,e,r){return null==t&&(t="white"),null==e&&(e="black"),this.options=null!=r?r:[],t===this.foreground&&e===this.background},r.prototype.ansi=function(t){return this.colors[t]?this.colors[t]:t},r.prototype.apply=function(t){return t=e.terminal.escape_brackets(t),"[[;"+this.foreground+";"+this.background+"]"+t+"]"},r}(),i=function(){function r(){this.apply=t(this.apply,this),this.question=t(this.question,this),this.comment=t(this.comment,this),this.info=t(this.info,this),this.error=t(this.error,this)}return r.prototype.formatters={error:new s("white","red"),info:new s("green"),comment:new s("yellow"),question:new s("magenta")},r.prototype.error=function(t){return this.formatters.error.apply(t)},r.prototype.info=function(t){return this.formatters.info.apply(t)},r.prototype.comment=function(t){return this.formatters.comment.apply(t)},r.prototype.question=function(t){return this.formatters.question.apply(t)},r.prototype.apply=function(t,r){var n;return n=new RegExp("(\\033\\[(\\d+)(;\\d+)?m(((?!\\033\\[\\d+).)*)\\033\\[(\\d+)(;\\d+)?m)|(\\[|\\])","g"),t=t.replace(n,function(t){return function(){var r,n;switch(n=arguments,!1){case-1===e.inArray(n[0],["[","]"]):return e.terminal.escape_brackets(n[0]);default:switch(r=e.terminal.escape_brackets(n[4]),!1){case"32"!==n[2]:return t.info(r);case"33"!==n[2]:return t.comment(r);case"37"!==n[2]:return t.error(r);default:return n[0]}}}}(this)),r&&e.each(t.split("\n"),function(t){return function(t,e){return""===e&&(e=" "),r.echo(e)}}(this)),t},r}(),this.Term=function(){function n(n,o){var i;this.element=n,this.options=o,this.onClear=t(this.onClear,this),this.onInit=t(this.onInit,this),this.serverInfo=t(this.serverInfo,this),this.greetings=t(this.greetings,this),this.execute=t(this.execute,this),this.commandVi=t(this.commandVi,this),this.commandArtisan=t(this.commandArtisan,this),this.confirmToProceed=t(this.confirmToProceed,this),this.interpreter=t(this.interpreter,this),this.request=t(this.request,this),this.toBoolean=t(this.toBoolean,this),this.confirm=t(this.confirm,this),this.question=t(this.question,this),this.comment=t(this.comment,this),this.info=t(this.info,this),this.error=t(this.error,this),this.color=t(this.color,this),this.element=e(this.element),this.element.terminal(this.execute,{onInit:this.onInit,onClear:this.onClear,greetings:this.greetings(),prompt:this.prompt}),i=e(r),i.on("resize",function(t){return function(){return t.element.width(i.width()),t.element.height(i.height())}}(this)),i.trigger("resize")}var s;return n.prototype.ids={},n.prototype.formatter=new i,n.prototype.colors=e.terminal.ansi_colors,n.prototype.term=null,n.prototype.prompt="$ ",n.prototype.color=function(t,e,r){return null==r&&(r="bold"),this.colors[r]&&this.colors[r][t]?this.colors[r][t]:t},n.prototype.error=function(t){return this.formatter.error(t)},n.prototype.info=function(t){return this.formatter.info(t)},n.prototype.comment=function(t){return this.formatter.comment(t)},n.prototype.question=function(t){return this.formatter.question(t)},n.prototype.confirm=function(t,r,n){var o,i;return null==n&&(n=""),o=e.Deferred(),n&&t.echo(" "+n),t.echo(r),i=t.history(),i.disable(),t.push(function(e){return function(r){e.toBoolean(r)?o.resolve(!0):(o.resolve(!1),e.serverInfo()),t.pop(),i.enable()}}(this),{prompt:" > "}),o.promise()},n.prototype.toBoolean=function(t){switch(t.toLowerCase()){case"y":case"yes":return!0;default:return!1}},n.prototype.request=function(t,r){return null==r&&(r=null),this.ids[t.method]=this.ids[t.method]||0,o.show(this.term),e.ajax({url:this.options.endPoint,dataType:"json",type:"post",data:{jsonrpc:"2.0",id:++this.ids[t.method],cmd:t}}).success(function(n){return function(o){return 1===o.error?void n.formatter.apply(o.result,n.term):-1!==e.inArray("-h",t.args)||-1!==e.inArray("--help",t.args)?void n.formatter.apply(o.result,n.term):null!==r?setTimeout(function(){return r(o)},100):n.formatter.apply(o.result,n.term)}}(this)).error(function(t){return function(e,r,n){return t.formatter.error(e.status+": "+n,t.term)}}(this)).complete(function(t){return function(){return o.hide(t.term),t.serverInfo()}}(this))},n.prototype.interpreter=function(t,e){return e||(e=t),this.term.push(function(e){return function(r){return r=r.trim(),r&&e.execute(t.replace(/\s+/g,"-")+" "+r,e.term),!1}}(this),{prompt:e+"> "}),!1},s=function(t){return""+t.charAt(0).toUpperCase()+t.slice(1)},n.prototype.confirmToProceed=function(t,e){return null==e&&(e="Application In Production!"),this.term.echo(this.comment("**************************************")),this.term.echo(this.comment("* "+e+" *")),this.term.echo(this.comment("**************************************")),this.term.echo(" "),this.confirm(this.term,this.info("Do you really wish to run this command? [y/N] (yes/no)")+" "+this.comment("[no]")+": ").done(function(e){return function(r){return r===!0?e.request(t):(e.term.echo(" "),e.term.echo(""+e.comment("Command Cancelled!")),e.term.echo(" "))}}(this))},n.prototype.commandArtisan=function(t){var r;return r=e.terminal.parseCommand(t.rest.trim()),"production"===this.options.environment&&-1===e.inArray("--force",r.args)&&-1!==e.inArray(r.name,this.options.confirmToProceed[t.name])?void this.confirmToProceed(t):this.request(t)},n.prototype.commandVi=function(t){var r;return r=t.rest,this.request(t,function(r){return function(n){var o;return r.term.disable(),o=e(r.options.editor),o.html(n.result),vi(o.get(0),{onSave:function(){var e;return e=JSON.stringify(o.val()),t.command+=" --text="+e,t.rest+=" --text="+e,t.args.push("--text="+e),r.request(t)},onExit:function(){return r.term.enable(),r.term.focus()}})}}(this))},n.prototype.execute=function(t,r){var n,o,i,h;switch(t=t.trim()){case"help":case"list":this.formatter.apply(this.options.helpInfo,this.term),this.serverInfo();break;case"":return;default:h=this.options.interpreters;for(o in h)if(i=h[o],t===o)return void this.interpreter(i);n=e.terminal.parseCommand(t.trim()),this["command"+s(n.name)]?this["command"+s(n.name)](n):this.request(n)}},n.prototype.greetings=function(){return[" __ _ _____ _ _ ","| | ___ ___ ___ _ _ ___| | |_ ____ ___ _____|_|___ ___| |","| |__| .'| _| .'| | | -_| | | || -_| _| | | | .'| |","|_____|__,|_| |__,|\\_/|___|_| |_||___|_| |_|_|_|_|_|_|__,|_|","","Copyright (c) 2015 Recca Tsai ","","Type a command, or type `"+this.info("help")+"`, for a list of commands.",""].join("\n")},n.prototype.serverInfo=function(){var t,e,r;if(!(this.term.level()>1))return t=this.info(this.options.username+"@"+this.options.hostname),e=this.question(""+this.options.os),r=this.comment(""+this.options.basePath),this.term.echo(t+" "+e+" "+r)},n.prototype.onInit=function(t){return this.term=t,this.execute("list",t)},n.prototype.onClear=function(t){return this.serverInfo()},n}()}(jQuery,window,document)}).call(this); \ No newline at end of file diff --git a/public/js/plugins.js b/public/js/plugins.js index e4f8b7d..f4254aa 100644 --- a/public/js/plugins.js +++ b/public/js/plugins.js @@ -1,5 +1,7 @@ -!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(e){var t=!!e&&"length"in e&&e.length,n=oe.type(e);return"function"===n||oe.isWindow(e)?!1:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e}function r(e,t,n){if(oe.isFunction(t))return oe.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return oe.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(ge.test(t))return oe.filter(t,e,n);t=oe.filter(t,e)}return oe.grep(e,function(e){return Z.call(t,e)>-1!==n})}function i(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function o(e){var t={};return oe.each(e.match(xe)||[],function(e,n){t[n]=!0}),t}function a(){Q.removeEventListener("DOMContentLoaded",a),e.removeEventListener("load",a),oe.ready()}function s(){this.expando=oe.expando+s.uid++}function u(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(De,"-$&").toLowerCase(),n=e.getAttribute(r),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:Ce.test(n)?oe.parseJSON(n):n}catch(i){}Te.set(e,t,n)}else n=void 0;return n}function l(e,t,n,r){var i,o=1,a=20,s=r?function(){return r.cur()}:function(){return oe.css(e,t,"")},u=s(),l=n&&n[3]||(oe.cssNumber[t]?"":"px"),c=(oe.cssNumber[t]||"px"!==l&&+u)&&Ee.exec(oe.css(e,t));if(c&&c[3]!==l){l=l||c[3],n=n||[],c=+u||1;do o=o||".5",c/=o,oe.style(e,t,c+l);while(o!==(o=s()/u)&&1!==o&&--a)}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}function c(e,t){var n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&oe.nodeName(e,t)?oe.merge([e],n):n}function f(e,t){for(var n=0,r=e.length;r>n;n++)Ae.set(e[n],"globalEval",!t||Ae.get(t[n],"globalEval"))}function p(e,t,n,r,i){for(var o,a,s,u,l,p,h=t.createDocumentFragment(),d=[],g=0,m=e.length;m>g;g++)if(o=e[g],o||0===o)if("object"===oe.type(o))oe.merge(d,o.nodeType?[o]:o);else if(He.test(o)){for(a=a||h.appendChild(t.createElement("div")),s=(Re.exec(o)||["",""])[1].toLowerCase(),u=Oe[s]||Oe._default,a.innerHTML=u[1]+oe.htmlPrefilter(o)+u[2],p=u[0];p--;)a=a.lastChild;oe.merge(d,a.childNodes),a=h.firstChild,a.textContent=""}else d.push(t.createTextNode(o));for(h.textContent="",g=0;o=d[g++];)if(r&&oe.inArray(o,r)>-1)i&&i.push(o);else if(l=oe.contains(o.ownerDocument,o),a=c(h.appendChild(o),"script"),l&&f(a),n)for(p=0;o=a[p++];)qe.test(o.type||"")&&n.push(o);return h}function h(){return!0}function d(){return!1}function g(){try{return Q.activeElement}catch(e){}}function m(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)m(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),i===!1)i=d;else if(!i)return this;return 1===o&&(a=i,i=function(e){return oe().off(e),a.apply(this,arguments)},i.guid=a.guid||(a.guid=oe.guid++)),e.each(function(){oe.event.add(this,t,i,r,n)})}function v(e,t){return oe.nodeName(e,"table")&&oe.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e:e}function y(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function b(e){var t=We.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function w(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Ae.hasData(e)&&(o=Ae.access(e),a=Ae.set(t,o),l=o.events)){delete a.handle,a.events={};for(i in l)for(n=0,r=l[i].length;r>n;n++)oe.event.add(t,i,l[i][n])}Te.hasData(e)&&(s=Te.access(e),u=oe.extend({},s),Te.set(t,u))}}function x(e,t){var n=t.nodeName.toLowerCase();"input"===n&&Le.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}function F(e,t,n,r){t=V.apply([],t);var i,o,a,s,u,l,f=0,h=e.length,d=h-1,g=t[0],m=oe.isFunction(g);if(m||h>1&&"string"==typeof g&&!re.checkClone&&Be.test(g))return e.each(function(i){var o=e.eq(i);m&&(t[0]=g.call(this,i,o.html())),F(o,t,n,r)});if(h&&(i=p(t,e[0].ownerDocument,!1,e,r),o=i.firstChild,1===i.childNodes.length&&(i=o),o||r)){for(a=oe.map(c(i,"script"),y),s=a.length;h>f;f++)u=i,f!==d&&(u=oe.clone(u,!0,!0),s&&oe.merge(a,c(u,"script"))),n.call(e[f],u,f);if(s)for(l=a[a.length-1].ownerDocument,oe.map(a,b),f=0;s>f;f++)u=a[f],qe.test(u.type||"")&&!Ae.access(u,"globalEval")&&oe.contains(l,u)&&(u.src?oe._evalUrl&&oe._evalUrl(u.src):oe.globalEval(u.textContent.replace(Ke,"")))}return e}function _(e,t,n){for(var r,i=t?oe.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||oe.cleanData(c(r)),r.parentNode&&(n&&oe.contains(r.ownerDocument,r)&&f(c(r,"script")),r.parentNode.removeChild(r));return e}function k(e,t){var n=oe(t.createElement(e)).appendTo(t.body),r=oe.css(n[0],"display");return n.detach(),r}function A(e){var t=Q,n=Ye[e];return n||(n=k(e,t),"none"!==n&&n||(Xe=(Xe||oe("