差分
このページの2つのバージョン間の差分を表示します。
| 次のリビジョン | 前のリビジョン | ||
| javascript:jquery:terminal_emulator_plugin [2019/08/17 16:00] – 作成 ともやん | javascript:jquery:terminal_emulator_plugin [2019/09/05 01:09] (現在) – ともやん | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| + | < | ||
| + | <script src="/ | ||
| + | <link href="/ | ||
| + | < | ||
| + | jQuery(function($, | ||
| + | term = $('# | ||
| + | term.terminal(function(command, | ||
| + | if (command == ' | ||
| + | term.echo(' | ||
| + | } | ||
| + | else if (command !== '' | ||
| + | try { | ||
| + | var result = window.eval(command); | ||
| + | if (result !== undefined) { | ||
| + | this.echo(new String(result)); | ||
| + | } | ||
| + | } catch(e) { | ||
| + | this.error(new String(e)); | ||
| + | } | ||
| + | } else { | ||
| + | | ||
| + | } | ||
| + | }, { | ||
| + | greetings: ' | ||
| + | navigator.userAgent, | ||
| + | name: ' | ||
| + | height: 400, | ||
| + | prompt: 'js > ' | ||
| + | }); | ||
| + | | ||
| + | function dir(object) { | ||
| + | var result = ''; | ||
| + | for (var property in object) { | ||
| + | if (object.hasOwnProperty(property)) { | ||
| + | result += property + ', '; | ||
| + | } | ||
| + | } | ||
| + | return result; | ||
| + | } | ||
| + | self.dir = dir; | ||
| + | }); | ||
| + | </ | ||
| + | </ | ||
| ====== jQuery Terminal Emulator Plugin ====== | ====== jQuery Terminal Emulator Plugin ====== | ||
| 本家: [[https:// | 本家: [[https:// | ||
| ソースコード: | ソースコード: | ||
| + | ===== ターミナルデモ ===== | ||
| + | <WRAP prewrap 100% # | ||
| + | </ | ||
| + | <WRAP prewrap 100%> | ||
| + | < | ||
| + | js > dir(term) | ||
| + | 0, length, id, clear, export_view, | ||
| + | js> term.signature() | ||
| + | __ _____ | ||
| + | / // _ /__ __ _____ ___ __ _/__ ___/__ ___ ______ __ __ __ ___ / / | ||
| + | __ / // // // // // _ // _// // / / // _ // _// // // \/ // _ \/ / | ||
| + | / / // // // // // ___// / / // / / // ___// / / / / // // /\ // // / /__ | ||
| + | \___//____ \\___// | ||
| + | \/ / | ||
| + | Copyright (c) 2011-2019 Jakub T. Jankiewicz < | ||
| + | js > help | ||
| + | load python - Python Interpreter | ||
| + | js > | ||
| + | </ | ||
| + | </ | ||