Scott Baker | 999edc6 | 2014-06-18 15:40:56 -0700 | [diff] [blame] | 1 | // TryMongo |
2 | // | ||||
3 | // Copyright (c) 2009 Kyle Banker | ||||
4 | // Licensed under the MIT Licence. | ||||
5 | // http://www.opensource.org/licenses/mit-license.php | ||||
6 | |||||
7 | var DefaultInputHtml = function(stack) { | ||||
8 | var linePrompt = ""; | ||||
9 | if(stack == 0) { | ||||
10 | linePrompt += "<span class='prompt'> ></span>"; | ||||
11 | } | ||||
12 | else { | ||||
13 | for(var i=0; i <= stack; i++) { | ||||
14 | linePrompt += "<span class='prompt'>.</span>"; | ||||
15 | } | ||||
16 | } | ||||
Scott Baker | c9dcc78 | 2014-06-19 22:42:49 -0700 | [diff] [blame] | 17 | return "<div class='terminal_line'>" + |
Scott Baker | 999edc6 | 2014-06-18 15:40:56 -0700 | [diff] [blame] | 18 | linePrompt + |
19 | "<input type='text' class='readLine active' />" + | ||||
20 | "</div>"; | ||||
21 | } | ||||
22 | |||||
23 | var EnterKeyCode = 13; | ||||
24 | var UpArrowKeyCode = 38; | ||||
25 | var DownArrowKeyCode = 40; | ||||
26 | |||||
27 | var PTAG = function(str) { | ||||
Scott Baker | bf1610d | 2014-06-18 18:22:03 -0700 | [diff] [blame] | 28 | return '<pre class="terminal_help">' + str + '</pre>'; |
Scott Baker | 999edc6 | 2014-06-18 15:40:56 -0700 | [diff] [blame] | 29 | } |
30 | |||||
31 | var BR = function() { | ||||
32 | return "<br/>"; | ||||
33 | } | ||||
34 | |||||
35 | var JavascriptKeywords = ['abstract', 'boolean', 'break', 'byte', 'case', 'catch', 'char', 'class', 'const', 'continue', 'debugger', 'default', 'delete', 'do', 'double', 'else', 'enum', 'export', 'extends', 'false', 'final', 'finally', 'float', 'for', 'function', 'goto', 'if', 'implements', 'import', 'in', 'instanceof', 'int', 'interface', 'long', 'native', 'new', 'null', 'package', 'private', 'protected', 'public', 'return', 'short', 'static', 'super', 'switch', 'synchronized', 'this', 'throw', 'throws', 'transient', 'true', 'try', 'typeof', 'var', 'void', 'volatile', 'while', 'with', 'alert', 'date', 'eval']; | ||||
36 | |||||
37 | var JavascriptClassNames = ['Array', 'String', 'Object'] | ||||
38 | |||||
Scott Baker | 2c3d5a8 | 2014-06-19 16:51:16 -0700 | [diff] [blame] | 39 | var MongoKeywords = ['help','tutorial','next','back','t0','t1','t2','t3','t4']; |